diff --git a/.gitattributes b/.gitattributes index d716710e617fe5681e63d0a49e7815aa079a1f25..0a44b0109b334ba37af4d8e8b7790dcedfaf4d23 100644 --- a/.gitattributes +++ b/.gitattributes @@ -51,3 +51,4 @@ node_modules/@unrs/resolver-binding-linux-x64-musl/resolver.linux-x64-musl.node node_modules/bcrypt/prebuilds/win32-arm64/bcrypt.node filter=lfs diff=lfs merge=lfs -text node_modules/bcrypt/prebuilds/win32-x64/bcrypt.node filter=lfs diff=lfs merge=lfs -text node_modules/better-sqlite3/build/Release/better_sqlite3.node filter=lfs diff=lfs merge=lfs -text +node_modules/esbuild/bin/esbuild filter=lfs diff=lfs merge=lfs -text diff --git a/node_modules/es-iterator-helpers/index.json b/node_modules/es-iterator-helpers/index.json new file mode 100644 index 0000000000000000000000000000000000000000..392247a231b52c487fb406270ff06d8df13961eb --- /dev/null +++ b/node_modules/es-iterator-helpers/index.json @@ -0,0 +1,20 @@ +[ + "Iterator", + "Iterator.concat", + "Iterator.from", + "Iterator.zip", + "Iterator.zipKeyed", + "Iterator.prototype", + "Iterator.prototype.constructor", + "Iterator.prototype.drop", + "Iterator.prototype.every", + "Iterator.prototype.filter", + "Iterator.prototype.find", + "Iterator.prototype.flatMap", + "Iterator.prototype.forEach", + "Iterator.prototype.map", + "Iterator.prototype.reduce", + "Iterator.prototype.some", + "Iterator.prototype.take", + "Iterator.prototype.toArray" +] diff --git a/node_modules/es-iterator-helpers/package.json b/node_modules/es-iterator-helpers/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d0011c19595a30ab5d23e211537799224def9b9b --- /dev/null +++ b/node_modules/es-iterator-helpers/package.json @@ -0,0 +1,206 @@ +{ + "name": "es-iterator-helpers", + "version": "1.2.2", + "description": "An ESnext spec-compliant iterator helpers shim/polyfill/replacement that works as far down as ES3.", + "main": "index.json", + "exports": { + ".": "./index.json", + "./auto": "./auto.js", + "./shim": "./shim.js", + "./Iterator": "./Iterator/index.js", + "./Iterator/auto": "./Iterator/auto.js", + "./Iterator/polyfill": "./Iterator/polyfill.js", + "./Iterator/implementation": "./Iterator/implementation.js", + "./Iterator/shim": "./Iterator/shim.js", + "./Iterator.prototype": "./Iterator.prototype/index.js", + "./Iterator.prototype/auto": "./Iterator.prototype/auto.js", + "./Iterator.prototype/polyfill": "./Iterator.prototype/polyfill.js", + "./Iterator.prototype/implementation": "./Iterator.prototype/implementation.js", + "./Iterator.prototype/shim": "./Iterator.prototype/shim.js", + "./Iterator.concat": "./Iterator.concat/index.js", + "./Iterator.concat/auto": "./Iterator.concat/auto.js", + "./Iterator.concat/polyfill": "./Iterator.concat/polyfill.js", + "./Iterator.concat/implementation": "./Iterator.concat/implementation.js", + "./Iterator.concat/shim": "./Iterator.concat/shim.js", + "./Iterator.from": "./Iterator.from/index.js", + "./Iterator.from/auto": "./Iterator.from/auto.js", + "./Iterator.from/polyfill": "./Iterator.from/polyfill.js", + "./Iterator.from/implementation": "./Iterator.from/implementation.js", + "./Iterator.from/shim": "./Iterator.from/shim.js", + "./Iterator.zip": "./Iterator.zip/index.js", + "./Iterator.zip/auto": "./Iterator.zip/auto.js", + "./Iterator.zip/polyfill": "./Iterator.zip/polyfill.js", + "./Iterator.zip/implementation": "./Iterator.zip/implementation.js", + "./Iterator.zip/shim": "./Iterator.zip/shim.js", + "./Iterator.zipKeyed": "./Iterator.zipKeyed/index.js", + "./Iterator.zipKeyed/auto": "./Iterator.zipKeyed/auto.js", + "./Iterator.zipKeyed/polyfill": "./Iterator.zipKeyed/polyfill.js", + "./Iterator.zipKeyed/implementation": "./Iterator.zipKeyed/implementation.js", + "./Iterator.zipKeyed/shim": "./Iterator.zipKeyed/shim.js", + "./Iterator.prototype.constructor": "./Iterator.prototype.constructor/index.js", + "./Iterator.prototype.constructor/auto": "./Iterator.prototype.constructor/auto.js", + "./Iterator.prototype.constructor/polyfill": "./Iterator.prototype.constructor/polyfill.js", + "./Iterator.prototype.constructor/implementation": "./Iterator.prototype.constructor/implementation.js", + "./Iterator.prototype.constructor/shim": "./Iterator.prototype.constructor/shim.js", + "./Iterator.prototype.map": "./Iterator.prototype.map/index.js", + "./Iterator.prototype.map/auto": "./Iterator.prototype.map/auto.js", + "./Iterator.prototype.map/polyfill": "./Iterator.prototype.map/polyfill.js", + "./Iterator.prototype.map/implementation": "./Iterator.prototype.map/implementation.js", + "./Iterator.prototype.map/shim": "./Iterator.prototype.map/shim.js", + "./Iterator.prototype.filter": "./Iterator.prototype.filter/index.js", + "./Iterator.prototype.filter/auto": "./Iterator.prototype.filter/auto.js", + "./Iterator.prototype.filter/polyfill": "./Iterator.prototype.filter/polyfill.js", + "./Iterator.prototype.filter/implementation": "./Iterator.prototype.filter/implementation.js", + "./Iterator.prototype.filter/shim": "./Iterator.prototype.filter/shim.js", + "./Iterator.prototype.take": "./Iterator.prototype.take/index.js", + "./Iterator.prototype.take/auto": "./Iterator.prototype.take/auto.js", + "./Iterator.prototype.take/polyfill": "./Iterator.prototype.take/polyfill.js", + "./Iterator.prototype.take/implementation": "./Iterator.prototype.take/implementation.js", + "./Iterator.prototype.take/shim": "./Iterator.prototype.take/shim.js", + "./Iterator.prototype.drop": "./Iterator.prototype.drop/index.js", + "./Iterator.prototype.drop/auto": "./Iterator.prototype.drop/auto.js", + "./Iterator.prototype.drop/polyfill": "./Iterator.prototype.drop/polyfill.js", + "./Iterator.prototype.drop/implementation": "./Iterator.prototype.drop/implementation.js", + "./Iterator.prototype.drop/shim": "./Iterator.prototype.drop/shim.js", + "./Iterator.prototype.flatMap": "./Iterator.prototype.flatMap/index.js", + "./Iterator.prototype.flatMap/auto": "./Iterator.prototype.flatMap/auto.js", + "./Iterator.prototype.flatMap/polyfill": "./Iterator.prototype.flatMap/polyfill.js", + "./Iterator.prototype.flatMap/implementation": "./Iterator.prototype.flatMap/implementation.js", + "./Iterator.prototype.flatMap/shim": "./Iterator.prototype.flatMap/shim.js", + "./Iterator.prototype.reduce": "./Iterator.prototype.reduce/index.js", + "./Iterator.prototype.reduce/auto": "./Iterator.prototype.reduce/auto.js", + "./Iterator.prototype.reduce/polyfill": "./Iterator.prototype.reduce/polyfill.js", + "./Iterator.prototype.reduce/implementation": "./Iterator.prototype.reduce/implementation.js", + "./Iterator.prototype.reduce/shim": "./Iterator.prototype.reduce/shim.js", + "./Iterator.prototype.toArray": "./Iterator.prototype.toArray/index.js", + "./Iterator.prototype.toArray/auto": "./Iterator.prototype.toArray/auto.js", + "./Iterator.prototype.toArray/polyfill": "./Iterator.prototype.toArray/polyfill.js", + "./Iterator.prototype.toArray/implementation": "./Iterator.prototype.toArray/implementation.js", + "./Iterator.prototype.toArray/shim": "./Iterator.prototype.toArray/shim.js", + "./Iterator.prototype.forEach": "./Iterator.prototype.forEach/index.js", + "./Iterator.prototype.forEach/auto": "./Iterator.prototype.forEach/auto.js", + "./Iterator.prototype.forEach/polyfill": "./Iterator.prototype.forEach/polyfill.js", + "./Iterator.prototype.forEach/implementation": "./Iterator.prototype.forEach/implementation.js", + "./Iterator.prototype.forEach/shim": "./Iterator.prototype.forEach/shim.js", + "./Iterator.prototype.some": "./Iterator.prototype.some/index.js", + "./Iterator.prototype.some/auto": "./Iterator.prototype.some/auto.js", + "./Iterator.prototype.some/polyfill": "./Iterator.prototype.some/polyfill.js", + "./Iterator.prototype.some/implementation": "./Iterator.prototype.some/implementation.js", + "./Iterator.prototype.some/shim": "./Iterator.prototype.some/shim.js", + "./Iterator.prototype.every": "./Iterator.prototype.every/index.js", + "./Iterator.prototype.every/auto": "./Iterator.prototype.every/auto.js", + "./Iterator.prototype.every/polyfill": "./Iterator.prototype.every/polyfill.js", + "./Iterator.prototype.every/implementation": "./Iterator.prototype.every/implementation.js", + "./Iterator.prototype.every/shim": "./Iterator.prototype.every/shim.js", + "./Iterator.prototype.find": "./Iterator.prototype.find/index.js", + "./Iterator.prototype.find/auto": "./Iterator.prototype.find/auto.js", + "./Iterator.prototype.find/polyfill": "./Iterator.prototype.find/polyfill.js", + "./Iterator.prototype.find/implementation": "./Iterator.prototype.find/implementation.js", + "./Iterator.prototype.find/shim": "./Iterator.prototype.find/shim.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "es-shim-api --type=multi --ignore-dirs=WrapForValidIteratorPrototype,IteratorHelperPrototype", + "lint": "eslint --ext=js,mjs .", + "postlint": "evalmd README.md", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/iterator-helpers.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "polyfill", + "shim", + "es-shims", + "es-shim API", + "Iterator", + "helpers", + "from", + "map", + "filter", + "take", + "drop", + "flatMap", + "reduce", + "toArray", + "forEach", + "some", + "every", + "find" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/es-shims/iterator-helpers/issues" + }, + "homepage": "https://github.com/es-shims/iterator-helpers#readme", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.1", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.1.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.3.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.5", + "safe-array-concat": "^1.1.3" + }, + "devDependencies": { + "@es-shims/api": "^3.0.3", + "@ljharb/eslint-config": "^22.1.2", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "^9.39.2", + "eslint-plugin-import": "^2.32.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "functions-have-names": "^1.2.3", + "has-strict-mode": "^1.1.0", + "has-tostringtag": "^1.0.2", + "in-publish": "^2.0.1", + "iterate-iterator": "^1.0.2", + "jiti": "^0.0.0", + "make-generator-function": "^2.1.0", + "mock-property": "^1.1.0", + "npmignore": "^0.3.2", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/es-iterator-helpers/shim.js b/node_modules/es-iterator-helpers/shim.js new file mode 100644 index 0000000000000000000000000000000000000000..931e87bb6ace96e62b75f21b0551ac48606d23cf --- /dev/null +++ b/node_modules/es-iterator-helpers/shim.js @@ -0,0 +1,41 @@ +'use strict'; + +var shimIterator = require('./Iterator/shim'); +var shimIteratorFrom = require('./Iterator.from/shim'); +var shimIteratorConcat = require('./Iterator.concat/shim'); +var shimZip = require('./Iterator.zip/shim'); +var shimZipKeyed = require('./Iterator.zipKeyed/shim'); +var shimIteratorProto = require('./Iterator.prototype/shim'); +var shimIteratorCtor = require('./Iterator.prototype.constructor/shim'); +var shimIteratorDrop = require('./Iterator.prototype.drop/shim'); +var shimIteratorEvery = require('./Iterator.prototype.every/shim'); +var shimIteratorFilter = require('./Iterator.prototype.filter/shim'); +var shimIteratorFind = require('./Iterator.prototype.find/shim'); +var shimIteratorFlatMap = require('./Iterator.prototype.flatMap/shim'); +var shimIteratorForEach = require('./Iterator.prototype.forEach/shim'); +var shimIteratorMap = require('./Iterator.prototype.map/shim'); +var shimIteratorReduce = require('./Iterator.prototype.reduce/shim'); +var shimIteratorSome = require('./Iterator.prototype.some/shim'); +var shimIteratorTake = require('./Iterator.prototype.take/shim'); +var shimIteratorToArray = require('./Iterator.prototype.toArray/shim'); + +module.exports = function shimIteratorHelpers() { + shimIterator(); + shimIteratorProto(); + shimIteratorFrom(); + shimIteratorConcat(); + shimZip(); + shimZipKeyed(); + shimIteratorCtor(); + shimIteratorDrop(); + shimIteratorEvery(); + shimIteratorFilter(); + shimIteratorFind(); + shimIteratorFlatMap(); + shimIteratorForEach(); + shimIteratorMap(); + shimIteratorReduce(); + shimIteratorSome(); + shimIteratorTake(); + shimIteratorToArray(); +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.concat.js b/node_modules/es-iterator-helpers/test/Iterator.concat.js new file mode 100644 index 0000000000000000000000000000000000000000..526d20393c1d214983ded3b4a0b0b5c027e41788 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.concat.js @@ -0,0 +1,718 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var mockProperty = require('mock-property'); +var hasPropertyDescriptors = require('has-property-descriptors')(); + +var index = require('../Iterator.concat'); +var impl = require('../Iterator.concat/implementation'); +var from = require('../Iterator.from/polyfill')(); + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (concat, name, t) { + t['throws']( + function () { return new concat(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor' + ); + t['throws']( + function () { return new concat({}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor, with an argument' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { concat(nonIterator); }, + TypeError, + debug(nonIterator) + ' is not an iterable Object' + ); + }); + + t.deepEqual(concat().next(), { value: undefined, done: true }, 'no arguments -> empty iterator'); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + forEach(v.nonFunctions, function (nonFunction) { + var badIterable = {}; + badIterable[Symbol.iterator] = nonFunction; + st['throws']( + function () { concat([], badIterable, []); }, + TypeError, + debug(badIterable) + '[Symbol.iterator] is not a function' + ); + }); + + forEach(v.primitives, function (nonObject) { + var badIterable = {}; + badIterable[Symbol.iterator] = function () { return nonObject; }; + st['throws']( + function () { concat([], badIterable, []).next(); }, + TypeError, + debug(badIterable) + '[Symbol.iterator] does not return an object' + ); + }); + + forEach(v.strings, function (string) { + st['throws']( + function () { concat(string); }, + TypeError, + 'non-objects are not considered iterable' + ); + var stringIt = concat(['a'], [string], ['c']); + testIterator(stringIt, ['a', string, 'c'], st, 'string iterator: ' + debug(string)); + }); + + var arrayIt = concat([1, 2, 3]); + st.equal(typeof arrayIt.next, 'function', 'has a `next` function'); + + st.test('real iterators', { skip: !hasSymbols }, function (s2t) { + var iter = [1, 2][Symbol.iterator](); + testIterator(concat(iter, [3]), [1, 2, 3], s2t, 'array iterator + array yields combined results'); + + s2t.end(); + }); + + st.test('observability in a replaced String iterator', function (s2t) { + var originalStringIterator = String.prototype[Symbol.iterator]; + var observedType; + s2t.teardown(mockProperty(String.prototype, Symbol.iterator, { + get: function () { + 'use strict'; // eslint-disable-line strict, lines-around-directive + + observedType = typeof this; + return originalStringIterator; + } + })); + + concat(from('')); + s2t.equal(observedType, 'string', 'string primitive -> primitive receiver in Symbol.iterator getter'); + concat(from(Object(''))); + s2t.equal(observedType, 'object', 'boxed string -> boxed string in Symbol.iterator getter'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/arguments-checked-in-order', { skip: !hasPropertyDescriptors }, function (s2t) { + var getIterator = 0; + + var iterable1 = {}; + Object.defineProperty(iterable1, Symbol.iterator, { + get: function () { + getIterator += 1; + return function () { + throw new EvalError(); + }; + } + }); + + var iterable2 = {}; + Object.defineProperty(iterable2, Symbol.iterator, { + get: function () { + throw new EvalError(); + } + }); + + s2t.equal(getIterator, 0); + + s2t['throws'](function () { concat(iterable1, null, iterable2); }, TypeError); + + s2t.equal(getIterator, 1); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/fresh-iterator-result', function (s2t) { + var oldIterResult = { + done: false, + value: 123 + }; + + var testIterator1 = { + next: function () { + return oldIterResult; + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return testIterator1; + }; + + var iterator = concat(iterable); + + var iterResult = iterator.next(); + + s2t.equal(iterResult.done, false); + s2t.equal(iterResult.value, 123); + + s2t.notEqual(iterResult, oldIterResult); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/get-iterator-method-only-once', { skip: !hasPropertyDescriptors }, function (s2t) { + var iteratorGets = 0; + var iteratorCalls = 0; + var array = [1, 2, 3]; + + function CountingIterable() {} + Object.defineProperty( + CountingIterable.prototype, + Symbol.iterator, + { + get: function () { + iteratorGets += 1; + + return function () { + iteratorCalls += 1; + return array[Symbol.iterator](); + }; + } + } + ); + + var iterable = new CountingIterable(); + + s2t.equal(iteratorGets, 0); + s2t.equal(iteratorCalls, 0); + + var iter = concat(iterable); + + s2t.equal(iteratorGets, 1); + s2t.equal(iteratorCalls, 0); + + testIterator(iter, array, s2t, 'iterating over the iterator calls the iterator function once'); + + s2t.equal(iteratorGets, 1); + s2t.equal(iteratorCalls, 1); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/get-iterator-method-throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var iterable = {}; + Object.defineProperty(iterable, Symbol.iterator, { + get: function () { + throw new EvalError(); + } + }); + + s2t['throws'](function () { concat(iterable); }, EvalError); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/inner-iterator-created-in-order', function (s2t) { + var calledIterator = []; + + var iterable1 = {}; + iterable1[Symbol.iterator] = function () { + calledIterator.push('iterable1'); + return [1][Symbol.iterator](); + }; + + var iterable2 = {}; + iterable2[Symbol.iterator] = function () { + calledIterator.push('iterable2'); + return [2][Symbol.iterator](); + }; + + var iterator = concat(iterable1, iterable2); + + s2t.deepEqual(calledIterator, []); + + s2t.deepEqual(iterator.next(), { done: false, value: 1 }); + + s2t.deepEqual(calledIterator, ['iterable1']); + + s2t.deepEqual(iterator.next(), { done: false, value: 2 }); + + s2t.deepEqual(calledIterator, ['iterable1', 'iterable2']); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/next-method-called-with-zero-arguments', function (s2t) { + var nextCalled = 0; + + var testIterator1 = { + next: function () { + nextCalled += 1; + s2t.equal(arguments.length, 0); + + return { + done: false, + value: 0 + }; + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return testIterator1; + }; + + var iterator = concat(iterable); + s2t.equal(nextCalled, 0); + + iterator.next(); + s2t.equal(nextCalled, 1); + + iterator.next(1); + s2t.equal(nextCalled, 2); + + iterator.next(1, 2); + s2t.equal(nextCalled, 3); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/next-method-returns-non-object', function (s2t) { + var nonObjectIterator = { + next: function () { + return null; + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return nonObjectIterator; + }; + + var iterator = concat(iterable); + + s2t['throws'](function () { iterator.next(); }, TypeError); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/next-method-returns-throwing-done', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var result = { done: null, value: 1 }; + Object.defineProperty(result, 'done', { + get: function () { + throw new EvalError(); + } + }); + return result; + }, + 'return': function () { + throw new Error(); + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return throwingIterator; + }; + + var iterator = concat(iterable); + + s2t['throws'](function () { iterator.next(); }, EvalError); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/next-method-returns-throwing-value-done', { skip: !hasPropertyDescriptors }, function (s2t) { + function ReturnCalledError() {} + function ValueGetterError() {} + + var throwingIterator = { + next: function () { + var result = { value: null, done: true }; + Object.defineProperty(result, 'value', { + get: function () { + throw new ValueGetterError(); + } + }); + return result; + }, + 'return': function () { + throw new ReturnCalledError(); + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return throwingIterator; + }; + + var iterator = concat(iterable); + + var iterResult = iterator.next(); + + s2t.equal(iterResult.done, true); + s2t.equal(iterResult.value, undefined); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/next-method-returns-throwing-value', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var result = { value: null, done: false }; + Object.defineProperty(result, 'value', { + get: function () { + throw new EvalError(); + } + }); + return result; + }, + 'return': function () { + throw new Error(); + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return throwingIterator; + }; + + var iterator = concat(iterable); + + s2t['throws'](function () { iterator.next(); }, EvalError); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/next-method-throws', function (s2t) { + var throwingIterator = { + next: function () { + throw new EvalError(); + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return throwingIterator; + }; + + var iterator = concat(iterable); + + s2t['throws'](function () { iterator.next(); }, EvalError); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/return-is-not-forwarded-after-exhaustion', function (s2t) { + var testIterator1 = { + next: function () { + return { + done: true, + value: undefined + }; + }, + 'return': function () { + throw new EvalError(); + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return testIterator1; + }; + + var iterator = concat(iterable); + iterator.next(); + iterator['return'](); + + s2t.end(); + }); + + t.test('test262: test/built-ins/Iterator/concat/return-is-not-forwarded-before-initial-start', function (s2t) { + var testIterator1 = { + next: function () { + return { + done: false, + value: 1 + }; + }, + 'return': function () { + throw new EvalError(); + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return testIterator1; + }; + + var iterator = concat(iterable); + iterator['return'](); + iterator.next(); + iterator['return'](); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/return-method-called-with-zero-arguments', function (s2t) { + var returnCalled = 0; + + var testIterator1 = { + next: function () { + return { done: false }; + }, + 'return': function () { + returnCalled += 1; + s2t.equal(arguments.length, 0); + return { done: true }; + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return testIterator1; + }; + + var iterator; + + // Call with zero arguments. + iterator = concat(iterable); + iterator.next(); + s2t.equal(returnCalled, 0); + + iterator['return'](); + s2t.equal(returnCalled, 1); + + // Call with one argument. + iterator = concat(iterable); + iterator.next(); + s2t.equal(returnCalled, 1); + + iterator['return'](1); + s2t.equal(returnCalled, 2); + + // Call with two arguments. + iterator = concat(iterable); + iterator.next(); + s2t.equal(returnCalled, 2); + + iterator['return'](1, 2); + s2t.equal(returnCalled, 3); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/throws-typeerror-when-generator-is-running-next', function (s2t) { + var enterCount = 0; + + var iterator; + + var testIterator1 = { + next: function () { + enterCount += 1; + iterator.next(); + return { done: false }; + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return testIterator1; + }; + + iterator = concat(iterable); + + s2t.equal(enterCount, 0); + + s2t['throws'](function () { iterator.next(); }, TypeError); + + s2t.equal(enterCount, 1); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/result-is-iterator', function (s2t) { + var iter = concat(); + s2t.equal(typeof iter.next, 'function', 'concat() result has next method'); + s2t.equal(typeof iter[Symbol.iterator], 'function', 'concat() result has Symbol.iterator'); + s2t.equal(iter[Symbol.iterator](), iter, 'concat() result Symbol.iterator returns itself'); + + var customIter = { next: function () { return { done: true, value: undefined }; } }; + var iterable = {}; + iterable[Symbol.iterator] = function () { return customIter; }; + iter = concat(iterable); + s2t.equal(typeof iter.next, 'function', 'concat(iterable) result has next method'); + s2t.equal(typeof iter[Symbol.iterator], 'function', 'concat(iterable) result has Symbol.iterator'); + s2t.equal(iter[Symbol.iterator](), iter, 'concat(iterable) result Symbol.iterator returns itself'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/single-argument', function (s2t) { + var array = [1, 2, 3]; + var iterator = concat(array); + + for (var i = 0; i < array.length; i += 1) { + var iterResult = iterator.next(); + s2t.equal(iterResult.done, false, 'not done at index ' + i); + s2t.equal(iterResult.value, array[i], 'correct value at index ' + i); + } + + var finalResult = iterator.next(); + s2t.equal(finalResult.done, true, 'done after all values'); + s2t.equal(finalResult.value, undefined, 'value is undefined when done'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/many-arguments', function (s2t) { + var iterables = [ + [], + [1], + [2, 3], + [4, 5, 6], + [7, 8, 9, 10] + ]; + + var iterator = concat(iterables[0], iterables[1], iterables[2], iterables[3], iterables[4]); + + var expected = [].concat(iterables[0], iterables[1], iterables[2], iterables[3], iterables[4]); + + for (var i = 0; i < expected.length; i += 1) { + var iterResult = iterator.next(); + s2t.equal(iterResult.done, false, 'not done at index ' + i); + s2t.equal(iterResult.value, expected[i], 'correct value at index ' + i); + } + + var finalResult = iterator.next(); + s2t.equal(finalResult.done, true, 'done after all values'); + s2t.equal(finalResult.value, undefined, 'value is undefined when done'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/zero-arguments', function (s2t) { + var iterator = concat(); + + var iterResult = iterator.next(); + s2t.equal(iterResult.done, true, 'done immediately with zero arguments'); + s2t.equal(iterResult.value, undefined, 'value is undefined'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/return-is-forwarded', function (s2t) { + var returnCount = 0; + + var testIterator1 = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCount += 1; + return { done: true, value: undefined }; + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return testIterator1; + }; + + var iterator = concat(iterable); + + s2t.equal(returnCount, 0, 'return not called before next()'); + + iterator.next(); + + s2t.equal(returnCount, 0, 'return not called after next()'); + + iterator['return'](); + + s2t.equal(returnCount, 1, 'return called once after iterator.return()'); + + // Subsequent return() calls should not forward again + iterator['return'](); + + s2t.equal(returnCount, 1, 'return not called again on subsequent return()'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/concat/throws-typeerror-when-generator-is-running-return', function (s2t) { + var enterCount = 0; + var iterator; + + var reentrantTestIterator = { + next: function () { + return { done: false }; + }, + 'return': function () { + enterCount += 1; + iterator['return'](); // re-entrant call + return { done: false }; + } + }; + + var iterable = {}; + iterable[Symbol.iterator] = function () { + return reentrantTestIterator; + }; + + iterator = concat(iterable); + + iterator.next(); + + s2t.equal(enterCount, 0, 'return not entered before calling return()'); + + s2t['throws']( + function () { iterator['return'](); }, + TypeError, + 'throws TypeError when generator is running during return()' + ); + + s2t.equal(enterCount, 1, 'return entered exactly once before throwing'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.concat: index', function (t) { + module.exports.tests(index, 'Iterator.concat', t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.concat: implementation', function (t) { + module.exports.tests(impl, 'Iterator.concat', t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.concat: shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.concat.name, 'concat', 'Iterator.concat has name "concat"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator, 'concat'), 'Iterator.concat is not enumerable'); + et.end(); + }); + + t.equal(Iterator.concat.length, 0, 'Iterator.concat has length 0'); + + module.exports.tests(callBind(Iterator.concat, Iterator), 'Iterator.concat', t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.from.js b/node_modules/es-iterator-helpers/test/Iterator.from.js new file mode 100644 index 0000000000000000000000000000000000000000..3657a7140af1a73b064c19b590e5278d4dd77b37 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.from.js @@ -0,0 +1,322 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasProto = require('has-proto')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var mockProperty = require('mock-property'); + +var index = require('../Iterator.from'); +var impl = require('../Iterator.from/implementation'); + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +var $Iterator = require('../Iterator/implementation'); +var iterProto = require('iterator.prototype'); + +var getCodePoints = function getCodePoints(str) { + var chars = []; + for (var i = 0; i < str.length; i++) { + var c1 = str.charCodeAt(i); + if (c1 >= 0xD800 && c1 < 0xDC00 && i + 1 < str.length) { + var c2 = str.charCodeAt(i + 1); + if (c2 >= 0xDC00 && c2 < 0xE000) { + chars.push(str.charAt(i) + str.charAt(i + 1)); + i += 1; + continue; // eslint-disable-line no-continue, no-restricted-syntax + } + } + chars.push(str.charAt(i)); + } + return chars; +}; + +module.exports = { + tests: function (from, name, t) { + t['throws']( + function () { return new from(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor' + ); + t['throws']( + function () { return new from({}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor, with an argument' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + if (typeof nonIterator !== 'string') { + t['throws']( + function () { from(nonIterator).next(); }, + TypeError, + debug(nonIterator) + ' is not an iterable Object' + ); + } + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + forEach(v.nonFunctions, function (nonFunction) { + var badIterable = {}; + badIterable[Symbol.iterator] = nonFunction; + st['throws']( + function () { from(badIterable).next(); }, + TypeError, + debug(badIterable) + ' is not a function' + ); + }); + + // st['throws']( + // function () { return new from([]); }, // eslint-disable-line new-cap + // RangeError, + // '`' + name + '` iterator is not a constructor' + // ); + + forEach(v.strings, function (string) { + var stringIt = from(string); + testIterator(stringIt, getCodePoints(string), st, 'string iterator: ' + debug(string)); + }); + + var arrayIt = from([1, 2, 3]); + st.equal(typeof arrayIt.next, 'function', 'has a `next` function'); + + st.test('__proto__ is Iterator.prototype', { skip: !hasProto }, function (s2t) { + var fakeIterator = { + __proto__: iterProto, + next: function () {} + }; + s2t.ok(fakeIterator instanceof $Iterator, 'is an instanceof Iterator'); + s2t.equal(typeof fakeIterator.next, 'function', 'fake iterator `.next` is a function'); + s2t.equal(from(fakeIterator), fakeIterator, 'returns input when it is an instanceof Iterator'); + + s2t.end(); + }); + + st.test('real iterators', { skip: !hasSymbols }, function (s2t) { + var iter = [][Symbol.iterator](); + // eslint-disable-next-line no-proto + var arrayIterHasIterProto = hasProto && iter.__proto__.__proto__ !== Object.prototype; + s2t.equal( + from(iter), + iter, + 'array iterator becomes itself', + { skip: !arrayIterHasIterProto && 'node 0.12 - 3 do not have Iterator.prototype in the proto chains' } + ); + + s2t.end(); + }); + + st.test('observability in a replaced String iterator', function (s2t) { + var originalStringIterator = String.prototype[Symbol.iterator]; + var observedType; + s2t.teardown(mockProperty(String.prototype, Symbol.iterator, { + get: function () { + 'use strict'; // eslint-disable-line strict, lines-around-directive + + observedType = typeof this; + return originalStringIterator; + } + })); + + from(''); + s2t.equal(observedType, 'string', 'string primitive -> primitive receiver in Symbol.iterator getter'); + from(Object('')); + s2t.equal(observedType, 'object', 'boxed string -> boxed string in Symbol.iterator getter'); + + s2t.end(); + }); + + st.test('262: get-next-method-only-once', { skip: !hasPropertyDescriptors }, function (s2t) { + var nextGets = 0; + var testIter = { + next: function () { + return { done: true, value: undefined }; + } + }; + Object.defineProperty(testIter, 'next', { + get: function () { + nextGets += 1; + return function () { + return { done: true, value: undefined }; + }; + } + }); + + var iter = from(testIter); + s2t.equal(nextGets, 1, 'next retrieved once on creation'); + iter.next(); + s2t.equal(nextGets, 1, 'next not retrieved again on next()'); + iter.next(); + s2t.equal(nextGets, 1, 'next still not retrieved again'); + + s2t.end(); + }); + + st.test('262: get-next-method-throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + throw new EvalError('next getter threw'); + } + }); + + s2t['throws']( + function () { from(testIter); }, + EvalError, + 'throws when getting next throws' + ); + + s2t.end(); + }); + + st.test('262: iterable-to-iterator-fallback', function (s2t) { + // When Symbol.iterator is null/undefined, treat object as iterator + var iteratorObj = { + next: function () { + return { done: true, value: undefined }; + } + }; + iteratorObj[Symbol.iterator] = null; + var iter1 = from(iteratorObj); + s2t.equal(typeof iter1.next, 'function', 'iterator with null Symbol.iterator is treated as iterator'); + + var iteratorObj2 = { + next: function () { + return { done: true, value: undefined }; + } + }; + iteratorObj2[Symbol.iterator] = undefined; + var iter2 = from(iteratorObj2); + s2t.equal(typeof iter2.next, 'function', 'iterator with undefined Symbol.iterator is treated as iterator'); + + s2t.end(); + }); + + st.test('262: return-is-forwarded', function (s2t) { + var returnCalls = 0; + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = from(testIter); + iter.next(); + s2t.equal(returnCalls, 0, 'return not called before calling return()'); + iter['return'](); + s2t.equal(returnCalls, 1, 'return called once after return()'); + + s2t.end(); + }); + + st.test('262: return-method-returns-iterator-result', function (s2t) { + // When base iterator has no return method, wrapper's return() returns { done: true, value: undefined } + var testIter = { + next: function () { + return { done: false, value: 1 }; + } + }; + + var iter = from(testIter); + iter.next(); + var result = iter['return'](); + s2t.equal(result.done, true, 'done is true'); + s2t.equal(result.value, undefined, 'value is undefined'); + + s2t.end(); + }); + + st.test('262: get-return-method-throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var testIter = { + next: function () { + return { done: false, value: 1 }; + } + }; + Object.defineProperty(testIter, 'return', { + get: function () { + throw new SyntaxError('return getter threw'); + } + }); + + var iter = from(testIter); + iter.next(); + s2t['throws']( + function () { iter['return'](); }, + SyntaxError, + 'throws when getting return throws' + ); + + s2t.end(); + }); + + st.test('262: supports-iterator', function (s2t) { + // Non-iterable iterator objects (no Symbol.iterator, but has next) + var plainIterator = { + next: function () { + return { done: true, value: 42 }; + } + }; + + var iter = from(plainIterator); + s2t.equal(typeof iter.next, 'function', 'wrapped iterator has next method'); + var result = iter.next(); + s2t.equal(result.done, true, 'done is true'); + s2t.equal(result.value, 42, 'value is passed through'); + + s2t.end(); + }); + + st.test('262: supports-iterable', function (s2t) { + // Iterable objects work + var arr = [1, 2, 3]; + testIterator(from(arr), [1, 2, 3], s2t, 'array iterable'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.from: index', function (t) { + module.exports.tests(index, 'Iterator.from', t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.from: implementation', function (t) { + module.exports.tests(impl, 'Iterator.from', t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.from: shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.from.name, 'from', 'Iterator.from has name "from"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator, 'from'), 'Iterator.from is not enumerable'); + et.end(); + }); + + module.exports.tests(callBind(Iterator.from, Iterator), 'Iterator.from', t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.js b/node_modules/es-iterator-helpers/test/Iterator.js new file mode 100644 index 0000000000000000000000000000000000000000..cd327d452a19de05d52d0bd6a4a210f3809901fb --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.js @@ -0,0 +1,95 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var functionsHaveNames = require('functions-have-names')(); + +var index = require('../Iterator'); +var impl = require('../Iterator/implementation'); + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = { + tests: function (Iter, name, t) { + t.equal(typeof Iter, 'function', name + ' is a function'); + + t['throws']( + function () { Iter(); }, // eslint-disable-line new-cap + TypeError, + name + ' throws when Call-ed' + ); + + t['throws']( + function () { return new Iter(); }, + TypeError, + name + ' throws when Construct-ed' + ); + + var SubIter; + var SubSubIter; + try { + /* eslint no-new-func: 0 */ + SubIter = Function('Iter', 'return class SubIter extends Iter {};')(Iter); + SubSubIter = Function('SubIter', 'return class SubSubIter extends SubIter {};')(SubIter); + } catch (e) { /**/ } + + t.test('class inheritance', { skip: !SubIter }, function (st) { + st.doesNotThrow( + function () { return new SubIter(); }, + 'Extending ' + name + ' does not throw when Construct-ed' + ); + st.doesNotThrow( + function () { return new SubSubIter(); }, + 'Extending ' + name + ' twice does not throw when Construct-ed' + ); + + st.end(); + }); + }, + index: function () { + test('Iterator: index', function (t) { + module.exports.tests(index, 'Iterator', t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator: implementation', function (t) { + module.exports.tests(impl, 'Iterator', t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator: shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.name, 'Iterator', 'Iterator has name "Iterator"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(global, Iterator), 'Iterator is not enumerable'); + et.end(); + }); + + t.test('prototype descriptor', { skip: !defineProperties.supportsDescriptors }, function (pt) { + var desc = Object.getOwnPropertyDescriptor(Iterator, 'prototype'); + pt.deepEqual( + desc, + { + configurable: false, + enumerable: false, + value: Iterator.prototype, + writable: false + } + ); + + pt.end(); + }); + + module.exports.tests(Iterator, 'Iterator', t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.constructor.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..f28317e0ef574589456c5e63722501dd7debdd7f --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.constructor.js @@ -0,0 +1,57 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); + +var Index = require('../Iterator.prototype.constructor'); +var Impl = require('../Iterator.prototype.constructor/implementation'); + +var $Iterator = require('../Iterator/polyfill')(); + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = { + tests: function (t, constructor, name) { + t.equal(constructor, $Iterator, name + ' is Iterator'); + }, + index: function () { + test('Iterator.prototype.constructor: index', function (t) { + t.notEqual(Index, $Iterator, 'index is not Iterator itself'); + t.equal(typeof Index, 'function', 'index is a function'); + + t['throws']( + function () { Index(); }, // eslint-disable-line new-cap + TypeError, + 'index throws when Call-ed' + ); + + t['throws']( + function () { return new Index(); }, + TypeError, + 'index throws when Construct-ed' + ); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.constructor: implementation', function (t) { + t.equal(Impl, $Iterator, 'implementation is Iterator itself'); + module.exports.tests(t, Impl, 'Iterator.prototype.constructor'); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.constructor: shimmed', function (t) { + module.exports.tests(t, Iterator.prototype.constructor, 'Iterator.prototype.constructor'); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, 'constructor'), 'Iterator#constructor is not enumerable'); + et.end(); + }); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.drop.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.drop.js new file mode 100644 index 0000000000000000000000000000000000000000..962aa4e26c932ddb525a8bf0e25a097bcbc79fc6 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.drop.js @@ -0,0 +1,458 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.drop'); +var impl = require('../Iterator.prototype.drop/implementation'); + +var fnName = 'drop'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (drop, name, t) { + t['throws']( + function () { return new drop(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(drop(nonIterator, 0)); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(drop(badNext, 0)); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + t.test('observable lookups', { skip: !hasPropertyDescriptors }, function (st) { + var effects = []; + + var obj = {}; + Object.defineProperty(obj, 'next', { + configurable: true, + enumerable: true, + get: function next() { + effects.push('get next'); + return function () { + return { done: true, value: undefined }; + }; + } + }); + drop(obj, { + valueOf: function valueOf() { + effects.push('ToNumber limit'); + return 0; + } + }); + + st.deepEqual(effects, [ + 'ToNumber limit', + 'get next' + ]); + st.end(); + }); + + var arr = [1, 2, 3]; + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { drop(iterator(), -3); }, + RangeError, + '-3 is not >= 0' + ); + + st['throws']( + function () { return new drop(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new drop(iterator(), 0); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + testIterator(drop(iterator(), 0), [1, 2, 3], st, 'drop 0'); + testIterator(drop(iterator(), 1), [2, 3], st, 'drop 1'); + testIterator(drop(iterator(), 2), [3], st, 'drop 2'); + testIterator(drop(iterator(), 3), [], st, 'drop 3'); + testIterator(drop(iterator(), Infinity), [], st, 'drop ∞'); + + st.test('262: limit-tonumber', function (s2t) { + // ToNumber coercion + testIterator(drop(iterator(), '1'), [2, 3], s2t, 'string "1" coerced to 1'); + testIterator(drop(iterator(), 1.9), [2, 3], s2t, '1.9 truncated to 1'); + testIterator(drop(iterator(), { valueOf: function () { return 1; } }), [2, 3], s2t, 'object with valueOf'); + testIterator(drop(iterator(), true), [2, 3], s2t, 'true coerced to 1'); + testIterator(drop(iterator(), null), [1, 2, 3], s2t, 'null coerced to 0'); + + s2t.end(); + }); + + st.test('262: limit-tonumber-throws', function (s2t) { + s2t['throws']( + function () { drop(iterator(), { valueOf: function () { throw new EvalError('valueOf threw'); } }); }, + EvalError, + 'throws when valueOf throws' + ); + + s2t['throws']( + function () { drop(iterator(), Symbol('test')); }, + TypeError, + 'throws when limit is a Symbol' + ); + + s2t.end(); + }); + + st.test('262: limit-rangeerror', function (s2t) { + s2t['throws'](function () { drop(iterator(), -1); }, RangeError, '-1 throws RangeError'); + s2t['throws'](function () { drop(iterator(), -Infinity); }, RangeError, '-Infinity throws RangeError'); + s2t['throws'](function () { drop(iterator(), NaN); }, RangeError, 'NaN throws RangeError'); + + s2t.end(); + }); + + st.test('262: result is iterator', function (s2t) { + var iter = drop(iterator(), 1); + s2t.equal(typeof iter.next, 'function', 'has next method'); + s2t.equal(typeof iter[Symbol.iterator], 'function', 'has Symbol.iterator method'); + s2t.equal(iter[Symbol.iterator](), iter, 'Symbol.iterator returns itself'); + + s2t.end(); + }); + + st.test('262: get next method only once', { skip: !hasPropertyDescriptors }, function (s2t) { + var nextGets = 0; + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + nextGets += 1; + return function () { + return { done: true, value: undefined }; + }; + } + }); + + var iter = drop(testIter, 1); + s2t.equal(nextGets, 1, 'next retrieved once on creation'); + iter.next(); + s2t.equal(nextGets, 1, 'next not retrieved again'); + + s2t.end(); + }); + + st.test('262: next method returns non-object throws', function (s2t) { + var badIterator = { + next: function () { + return null; + } + }; + + var iter = drop(badIterator, 1); + s2t['throws'](function () { iter.next(); }, TypeError, 'throws when next returns null'); + + s2t.end(); + }); + + st.test('262: next method returns throwing done', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var result = { value: 1 }; + Object.defineProperty(result, 'done', { + get: function () { + throw new EvalError('done getter threw'); + } + }); + return result; + } + }; + + var iter = drop(throwingIterator, 1); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws when done getter throws'); + + s2t.end(); + }); + + st.test('262: next method throws', function (s2t) { + var throwingIterator = { + next: function () { + throw new EvalError('next threw'); + } + }; + + var iter = drop(throwingIterator, 1); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws error from next'); + + s2t.end(); + }); + + st.test('262: throws TypeError when generator is running', function (s2t) { + var reentrantIterator; + var testIter = { + next: function () { + reentrantIterator.next(); + return { done: false, value: 1 }; + } + }; + + reentrantIterator = drop(testIter, 0); + s2t['throws'](function () { reentrantIterator.next(); }, TypeError, 'throws on reentrant next()'); + + s2t.end(); + }); + + st.test('262: limit-equals-total', function (s2t) { + testIterator(drop(iterator(), 3), [], s2t, 'drop exactly 3 from 3-item iterator'); + + s2t.end(); + }); + + st.test('262: limit-greater-than-total', function (s2t) { + testIterator(drop(iterator(), 5), [], s2t, 'drop 5 from 3-item iterator'); + testIterator(drop(iterator(), 100), [], s2t, 'drop 100 from 3-item iterator'); + + s2t.end(); + }); + + st.test('262: limit-less-than-total', function (s2t) { + testIterator(drop(iterator(), 1), [2, 3], s2t, 'drop 1 from 3-item iterator'); + testIterator(drop(iterator(), 2), [3], s2t, 'drop 2 from 3-item iterator'); + + s2t.end(); + }); + + st.test('262: exhaustion does not call return', function (s2t) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = drop(testIter, 1); + iter.next(); + s2t.equal(returnCalls, 0, 'return not called on exhaustion'); + + s2t.end(); + }); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/drop/get-return-method-throws', { skip: !hasPropertyDescriptors }, function (st) { + var badIterator = { + next: function next() { + return { + done: false, + value: 1 + }; + } + }; + + Object.defineProperty(badIterator, 'return', { + configurable: true, + enumerable: true, + get: function () { throw new SyntaxError(); } + }); + + var iter = drop(badIterator, 1); + iter.next(); + + st['throws']( + function () { iter['return'](); }, + SyntaxError, + 'gets the `return` method, whose getter throws' + ); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/drop/return-is-forwarded', function (st) { + var returnCount = 0; + + var makeBadIterator = function makeBadIterator() { + return { + next: function next() { + return { + done: false, + value: 1 + }; + }, + 'return': function () { + returnCount += 1; + return {}; + } + }; + }; + + var iter1 = drop(makeBadIterator(), 0); + st.equal(returnCount, 0, 'iter1, before return()'); + iter1['return'](); + st.equal(returnCount, 1, 'iter1, after return()'); // TODO + + var iter2 = drop(makeBadIterator(), 1); + st.equal(returnCount, 1, 'iter2, before return()'); // TODO + iter2['return'](); + st.equal(returnCount, 2, 'iter2, after return()'); // TODO + + // 5 drops (i wish i had pipeline) + var iter3 = drop( + drop( + drop( + drop( + drop( + makeBadIterator(), + 1 + ), + 1 + ), + 1 + ), + 1 + ), + 1 + ); + st.equal(returnCount, 2, 'iter3, before return()'); // TODO + iter3['return'](); + st.equal(returnCount, 3, 'iter3, after return()'); // TODO + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/drop/return-is-not-forwarded-after-exhaustion', { skip: !hasPropertyDescriptors }, function (st) { + var makeBadIterator = function makeBadIterator() { + return { + next: function next() { + return { + done: true, + value: undefined + }; + }, + 'return': function () { + throw new SyntaxError(); + } + }; + }; + + var iter1 = drop(makeBadIterator(), 0); // TODO + st['throws']( + function () { iter1['return'](); }, + SyntaxError, + 'iter1, return() throws' + ); + iter1.next(); + iter1['return'](); + + var iter2 = drop(makeBadIterator(), 1); + st['throws']( + function () { iter2['return'](); }, + SyntaxError, + 'iter2, return() throws' + ); + iter2.next(); + iter2['return'](); + + // 5 drops (i wish i had pipeline) + var iter3 = drop( + drop( + drop( + drop( + drop( + makeBadIterator(), + 1 + ), + 1 + ), + 1 + ), + 1 + ), + 1 + ); + st['throws']( + function () { iter3['return'](); }, + SyntaxError, + 'iter3, return() throws' + ); + iter3.next(); + iter3['return'](); + + var iter4 = drop(makeBadIterator(), 10); + st['throws']( + function () { iter4['return'](); }, + SyntaxError, + 'iter4, return() throws' + ); + iter4.next(); + iter4['return'](); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.every.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.every.js new file mode 100644 index 0000000000000000000000000000000000000000..96d3ec75a336c94a335a4e519a1e06798e01be0e --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.every.js @@ -0,0 +1,289 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.every'); +var impl = require('../Iterator.prototype.every/implementation'); + +var fnName = 'every'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (every, name, t) { + t['throws']( + function () { return new every(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(every(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(every(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { every({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('observable lookups', { skip: !hasPropertyDescriptors }, function (st) { + var effects = []; + + var obj = {}; + Object.defineProperty(obj, 'next', { + configurable: true, + enumerable: true, + get: function next() { + effects.push('get next'); + return function () { + return { done: true, value: undefined }; + }; + } + }); + + st['throws']( + function () { every(obj, null); }, + TypeError + ); + + st.deepEqual(effects, []); + + st.end(); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new every(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new every(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + st.equal(every(iterator(), function () { return false; }), false, 'every for always-false'); + st.equal(every(iterator(), function () { return true; }), true, 'every for always-true'); + st.equal(every(iterator(), function (x, i) { return x === 2 && i === 1; }), false, 'every returns false for matching value/index'); + + st.test('test262: test/built-ins/Iterator/prototype/every/predicate-args', function (s2t) { + var assertionCount = 0; + var result = every( + ['a', 'b', 'c'][Symbol.iterator](), + function (value, count) { + if (value === 'a') { + s2t.equal(count, 0); + } else if (value === 'b') { + s2t.equal(count, 1); + } else if (value === 'c') { + s2t.equal(count, 2); + } else { + s2t.fail('unexpected value'); + } + assertionCount += 1; + return true; + } + ); + s2t.equal(result, true, 'every returns true when all pass'); + s2t.equal(assertionCount, 3, 'predicate called three times'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/every/predicate-this', function (s2t) { + var expectedThis = (function () { return this; }()); // eslint-disable-line no-invalid-this + var assertionCount = 0; + var result = every( + [0][Symbol.iterator](), + function () { + s2t.equal(this, expectedThis, 'predicate this is undefined'); // eslint-disable-line no-invalid-this + assertionCount += 1; + return true; + } + ); + s2t.equal(result, true); + s2t.equal(assertionCount, 1); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/every/predicate-returns-truthy', function (s2t) { + var result = every( + [0, 1, 2, 3, 4][Symbol.iterator](), + function () { return true; } + ); + s2t.equal(result, true, 'every returns true when predicate always returns truthy'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/every/predicate-returns-falsey', function (s2t) { + var result = every( + [0, 1, 2, 3, 4][Symbol.iterator](), + function () { return false; } + ); + s2t.equal(result, false, 'every returns false when predicate returns falsey'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/every/predicate-returns-truthy-then-falsey', function (s2t) { + var callCount = 0; + var returnCalled = false; + var values = [0, 1, 2, 3, 4]; + var idx = 0; + var iter = { + next: function () { + if (idx < values.length) { + var val = values[idx]; + idx += 1; + return { done: false, value: val }; + } + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalled = true; + return { done: true, value: undefined }; + } + }; + var result = every( + iter, + function (value) { + callCount += 1; + return value < 3; + } + ); + s2t.equal(result, false, 'every returns false when predicate returns falsey'); + s2t.equal(callCount, 4, 'predicate called until falsey returned'); + s2t.equal(returnCalled, true, 'iterator is closed'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/every/predicate-returns-non-boolean', function (s2t) { + // truthy non-boolean values + s2t.equal(every([1][Symbol.iterator](), function () { return 1; }), true, 'truthy number'); + s2t.equal(every([1][Symbol.iterator](), function () { return 'yes'; }), true, 'truthy string'); + s2t.equal(every([1][Symbol.iterator](), function () { return {}; }), true, 'truthy object'); + + // falsy non-boolean values + s2t.equal(every([1][Symbol.iterator](), function () { return 0; }), false, 'falsy number'); + s2t.equal(every([1][Symbol.iterator](), function () { return ''; }), false, 'falsy string'); + s2t.equal(every([1][Symbol.iterator](), function () { return null; }), false, 'null'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/every/predicate-throws', function (s2t) { + var returnCount = 0; + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCount += 1; + return { done: true }; + } + }; + + var callbackCount = 0; + s2t['throws']( + function () { + every(testIter, function () { + callbackCount += 1; + throw new SyntaxError('predicate threw'); + }); + }, + SyntaxError + ); + s2t.equal(callbackCount, 1, 'predicate called once'); + s2t.equal(returnCount, 1, 'iterator closed when predicate throws'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/every/iterator-already-exhausted', function (s2t) { + var iter = [][Symbol.iterator](); + var callbackCount = 0; + var result = every(iter, function () { + callbackCount += 1; + return true; + }); + s2t.equal(result, true, 'every returns true for empty iterator'); + s2t.equal(callbackCount, 0, 'predicate not called'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.filter.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.filter.js new file mode 100644 index 0000000000000000000000000000000000000000..ab934a2038eb1c5a2795eaf4d632c379b95da2c9 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.filter.js @@ -0,0 +1,559 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.filter'); +var impl = require('../Iterator.prototype.filter/implementation'); + +var fnName = 'filter'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (filter, name, t) { + t['throws']( + function () { return new filter(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(filter(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(filter(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { filter({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('observable lookups', { skip: !hasPropertyDescriptors }, function (st) { + var effects = []; + + var obj = {}; + Object.defineProperty(obj, 'next', { + configurable: true, + enumerable: true, + get: function next() { + effects.push('get next'); + return function () { + return { done: true, value: undefined }; + }; + } + }); + + st['throws']( + function () { filter(obj, null); }, + TypeError + ); + + st.deepEqual(effects, []); + + st.end(); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new filter(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new filter(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + testIterator(filter(iterator(), function () { return false; }), [], st, 'filter for always-false'); + testIterator(filter(iterator(), function () { return true; }), [1, 2, 3], st, 'filter for always-true'); + testIterator(filter(iterator(), function (x, i) { return x === 2 && i === 1; }), [2], st, 'filter returns value for matching value/index'); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/filter/predicate-args', function (st) { + var g = function g() { + var arr = ['a', 'b', 'c']; + var i = 0; + return { + next: function () { + try { + return { + value: arr[i], + done: i >= arr.length + }; + } finally { + i += 1; + } + } + }; + }; + var assertionCount = 0; + var iter = filter( + g(), + function (value, count) { + if (value === 'a') { + st.equal(count, 0, 'first iteration'); + } else if (value === 'b') { + st.equal(count, 1, 'second iteration'); + } else if (value === 'c') { + st.equal(count, 2, 'third iteration'); + } else { + st.fail('unexpected iteration'); + } + assertionCount += 1; + return true; + } + ); + + st.equal(assertionCount, 0, 'prior to iteration'); + + testIterator(iter, ['a', 'b', 'c'], st, 'iteration'); + + st.equal(assertionCount, 3); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/filter/predicate-throws', function (st) { + var returnCalls = 0; + + var iter = { + next: function () { + return { + done: false, + value: 1 + }; + }, + 'return': function () { + returnCalls += 1; + return {}; + } + }; + + var callbackCalls = 0; + var iterator = filter(iter, function () { + callbackCalls += 1; + throw new SyntaxError(); + }); + + st['throws'](function () { iterator.next(); }, SyntaxError, 'next() throws'); + + st.equal(callbackCalls, 1); + st.equal(returnCalls, 1); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/filter/predicate-throws-then-closing-iterator-also-throws', function (st) { + var iter = { + next: function next() { + return { + done: false, + value: 1 + }; + }, + 'return': function () { + throw new EvalError(); + } + }; + + var iterator = filter(iter, function () { + throw new SyntaxError(); + }); + + st['throws']( + function () { iterator.next(); }, + SyntaxError, + 'when the predicate and return() both throw, the predicate’s exception wins' + ); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/filter/get-return-method-throws', { skip: !hasPropertyDescriptors }, function (st) { + var badIterator = { + next: function next() { + return { + done: false, + value: 1 + }; + } + }; + + Object.defineProperty(badIterator, 'return', { get: function () { throw new SyntaxError(); } }); + + var iter = filter(badIterator, function () { return true; }); + iter.next(); + + st['throws']( + function () { iter['return'](); }, + SyntaxError, + 'gets the `return` method, whose getter throws' + ); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/drop/return-is-forwarded', function (st) { + var returnCount = 0; + + var badIterator = { + next: function next() { + return { + done: false, + value: 1 + }; + }, + 'return': function () { + returnCount += 1; + return {}; + } + }; + + var iter1 = filter(badIterator, function () { return false; }); + st.equal(returnCount, 0, 'iter1, before return()'); + iter1['return'](); + st.equal(returnCount, 1, 'iter1, after return()'); + + st.end(); + }); + + t.test('262: test/built-ins/Iterator/prototype/drop/return-is-not-forwarded-after-exhaustion', { skip: !hasPropertyDescriptors }, function (st) { + var makeBadIterator = function makeBadIterator() { + return { + next: function next() { + return { + done: true, + value: undefined + }; + }, + 'return': function () { + throw new SyntaxError(); + } + }; + }; + + var iter1 = filter(makeBadIterator(), function () { return true; }); + st['throws']( + function () { iter1['return'](); }, + SyntaxError, + 'iter1, return() throws' + ); + iter1.next(); + iter1['return'](); + + // 3 filters (i wish i had pipeline) + var iter2 = filter( + filter( + filter( + makeBadIterator(), + function () { return true; } + ), + function () { return true; } + ), + function () { return true; } + ); + st['throws']( // TODO + function () { iter2['return'](); }, + SyntaxError, + 'iter2, return() throws' + ); + iter2.next(); + iter2['return'](); + + st.end(); + }); + + t.test('262: predicate-this', { skip: !hasSymbols }, function (st) { + var thisValue; + var iter = filter( + [1][Symbol.iterator](), + function () { + thisValue = this; + return true; + } + ); + iter.next(); + st.equal(thisValue, undefined, 'predicate this is undefined'); + + st.end(); + }); + + t.test('262: predicate-returns-non-boolean', { skip: !hasSymbols }, function (st) { + // truthy non-boolean values should pass + testIterator( + filter([1, 2, 3][Symbol.iterator](), function () { return 1; }), + [1, 2, 3], + st, + 'truthy number passes' + ); + testIterator( + filter([1, 2, 3][Symbol.iterator](), function () { return 'yes'; }), + [1, 2, 3], + st, + 'truthy string passes' + ); + testIterator( + filter([1, 2, 3][Symbol.iterator](), function () { return {}; }), + [1, 2, 3], + st, + 'truthy object passes' + ); + + // falsy non-boolean values should fail + testIterator( + filter([1, 2, 3][Symbol.iterator](), function () { return 0; }), + [], + st, + 'falsy number fails' + ); + testIterator( + filter([1, 2, 3][Symbol.iterator](), function () { return ''; }), + [], + st, + 'falsy string fails' + ); + testIterator( + filter([1, 2, 3][Symbol.iterator](), function () { return null; }), + [], + st, + 'null fails' + ); + + st.end(); + }); + + t.test('262: result is iterator', { skip: !hasSymbols }, function (st) { + var iterator = filter([1, 2][Symbol.iterator](), function () { return true; }); + st.equal(typeof iterator.next, 'function', 'has next method'); + st.equal(typeof iterator[Symbol.iterator], 'function', 'has Symbol.iterator method'); + st.equal(iterator[Symbol.iterator](), iterator, 'Symbol.iterator returns itself'); + + st.end(); + }); + + t.test('262: get next method only once', { skip: !hasPropertyDescriptors }, function (st) { + var nextGets = 0; + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + nextGets += 1; + return function () { + return { done: true, value: undefined }; + }; + } + }); + + var iter = filter(testIter, function () { return true; }); + st.equal(nextGets, 1, 'next retrieved once on creation'); + iter.next(); + st.equal(nextGets, 1, 'next not retrieved again'); + + st.end(); + }); + + t.test('262: get next method throws', { skip: !hasPropertyDescriptors }, function (st) { + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + throw new EvalError('next getter threw'); + } + }); + + st['throws']( + function () { filter(testIter, function () { return true; }); }, + EvalError, + 'throws when getting next throws' + ); + + st.end(); + }); + + t.test('262: next method returns non-object throws', function (st) { + var badIterator = { + next: function () { + return null; + } + }; + + var iter = filter(badIterator, function () { return true; }); + st['throws'](function () { iter.next(); }, TypeError, 'throws when next returns null'); + + st.end(); + }); + + t.test('262: next method returns throwing done', { skip: !hasPropertyDescriptors }, function (st) { + var throwingIterator = { + next: function () { + var result = { value: 1 }; + Object.defineProperty(result, 'done', { + get: function () { + throw new EvalError('done getter threw'); + } + }); + return result; + } + }; + + var iter = filter(throwingIterator, function () { return true; }); + st['throws'](function () { iter.next(); }, EvalError, 'throws when done getter throws'); + + st.end(); + }); + + t.test('262: next method returns throwing value', { skip: !hasPropertyDescriptors }, function (st) { + var throwingIterator = { + next: function () { + var result = { done: false }; + Object.defineProperty(result, 'value', { + get: function () { + throw new EvalError('value getter threw'); + } + }); + return result; + } + }; + + var iter = filter(throwingIterator, function () { return true; }); + st['throws'](function () { iter.next(); }, EvalError, 'throws when value getter throws'); + + st.end(); + }); + + t.test('262: next method throws', function (st) { + var throwingIterator = { + next: function () { + throw new EvalError('next threw'); + } + }; + + var iter = filter(throwingIterator, function () { return true; }); + st['throws'](function () { iter.next(); }, EvalError, 'throws error from next'); + + st.end(); + }); + + t.test('262: iterator already exhausted', function (st) { + var testIter = { + next: function () { + return { done: true, value: undefined }; + } + }; + + var predicateCalls = 0; + var iter = filter(testIter, function () { + predicateCalls += 1; + return true; + }); + + var result = iter.next(); + st.equal(result.done, true, 'done is true'); + st.equal(result.value, undefined, 'value is undefined'); + st.equal(predicateCalls, 0, 'predicate not called for exhausted iterator'); + + st.end(); + }); + + t.test('262: throws TypeError when generator is running', function (st) { + var reentrantIterator; + var testIter = { + next: function () { + reentrantIterator.next(); + return { done: false, value: 1 }; + } + }; + + reentrantIterator = filter(testIter, function () { return true; }); + st['throws'](function () { reentrantIterator.next(); }, TypeError, 'throws on reentrant next()'); + + st.end(); + }); + + t.test('262: exhaustion does not call return', function (st) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = filter(testIter, function () { return true; }); + iter.next(); + st.equal(returnCalls, 0, 'return not called on exhaustion'); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.find.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.find.js new file mode 100644 index 0000000000000000000000000000000000000000..51e618e30afa7deb57ce52b92e63f8cf1a2128fd --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.find.js @@ -0,0 +1,286 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.find'); +var impl = require('../Iterator.prototype.find/implementation'); + +var fnName = 'find'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (find, name, t) { + t['throws']( + function () { return new find(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(find(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(find(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { find({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new find(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new find(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + st.equal(find(iterator(), function () { return false; }), undefined, 'find for always-false'); + st.equal(find(iterator(), function () { return true; }), 1, 'find for always-true'); + st.equal(find(iterator(), function (x, i) { return x === 2 && i === 1; }), 2, 'find returns value for matching value/index'); + + st.test('test262: test/built-ins/Iterator/prototype/find/predicate-args', function (s2t) { + var assertionCount = 0; + var result = find( + ['a', 'b', 'c'][Symbol.iterator](), + function (value, count) { + if (value === 'a') { + s2t.equal(count, 0); + } else if (value === 'b') { + s2t.equal(count, 1); + } else if (value === 'c') { + s2t.equal(count, 2); + } else { + s2t.fail('unexpected value'); + } + assertionCount += 1; + return false; + } + ); + s2t.equal(result, undefined, 'find returns undefined when none match'); + s2t.equal(assertionCount, 3, 'predicate called three times'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/find/predicate-this', function (s2t) { + var expectedThis = (function () { return this; }()); // eslint-disable-line no-invalid-this + var assertionCount = 0; + var result = find( + [0][Symbol.iterator](), + function () { + s2t.equal(this, expectedThis, 'predicate this is undefined'); // eslint-disable-line no-invalid-this + assertionCount += 1; + return true; + } + ); + s2t.equal(result, 0); + s2t.equal(assertionCount, 1); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/find/predicate-returns-truthy', function (s2t) { + var callCount = 0; + var returnCalled = false; + var values = [0, 1, 2]; + var idx = 0; + var iter = { + next: function () { + if (idx < values.length) { + var val = values[idx]; + idx += 1; + return { done: false, value: val }; + } + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalled = true; + return { done: true, value: undefined }; + } + }; + var result = find( + iter, + function () { + callCount += 1; + return true; + } + ); + s2t.equal(result, 0, 'find returns first value when predicate returns truthy'); + s2t.equal(callCount, 1, 'predicate called once'); + s2t.equal(returnCalled, true, 'iterator is closed'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/find/predicate-returns-falsey', function (s2t) { + var result = find( + [0, 1, 2, 3, 4][Symbol.iterator](), + function () { return false; } + ); + s2t.equal(result, undefined, 'find returns undefined when predicate always returns falsey'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/find/predicate-returns-falsey-then-truthy', function (s2t) { + var callCount = 0; + var returnCalled = false; + var values = [0, 1, 2, 3, 4]; + var idx = 0; + var iter = { + next: function () { + if (idx < values.length) { + var val = values[idx]; + idx += 1; + return { done: false, value: val }; + } + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalled = true; + return { done: true, value: undefined }; + } + }; + var result = find( + iter, + function (value) { + callCount += 1; + return value >= 3; + } + ); + s2t.equal(result, 3, 'find returns matching value'); + s2t.equal(callCount, 4, 'predicate called until truthy returned'); + s2t.equal(returnCalled, true, 'iterator is closed'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/find/predicate-returns-non-boolean', function (s2t) { + // truthy non-boolean values find the first element + s2t.equal(find([1, 2][Symbol.iterator](), function () { return 1; }), 1, 'truthy number'); + s2t.equal(find([1, 2][Symbol.iterator](), function () { return 'yes'; }), 1, 'truthy string'); + s2t.equal(find([1, 2][Symbol.iterator](), function () { return {}; }), 1, 'truthy object'); + + // falsy non-boolean values return undefined + s2t.equal(find([1][Symbol.iterator](), function () { return 0; }), undefined, 'falsy number'); + s2t.equal(find([1][Symbol.iterator](), function () { return ''; }), undefined, 'falsy string'); + s2t.equal(find([1][Symbol.iterator](), function () { return null; }), undefined, 'null'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/find/predicate-throws', function (s2t) { + var returnCount = 0; + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCount += 1; + return { done: true }; + } + }; + + var callbackCount = 0; + s2t['throws']( + function () { + find(testIter, function () { + callbackCount += 1; + throw new SyntaxError('predicate threw'); + }); + }, + SyntaxError + ); + s2t.equal(callbackCount, 1, 'predicate called once'); + s2t.equal(returnCount, 1, 'iterator closed when predicate throws'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/find/iterator-already-exhausted', function (s2t) { + var iter = [][Symbol.iterator](); + var callbackCount = 0; + var result = find(iter, function () { + callbackCount += 1; + return true; + }); + s2t.equal(result, undefined, 'find returns undefined for empty iterator'); + s2t.equal(callbackCount, 0, 'predicate not called'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.flatMap.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.flatMap.js new file mode 100644 index 0000000000000000000000000000000000000000..a27659f409ceecbc106eb05dd2d071b4984bfd7e --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.flatMap.js @@ -0,0 +1,238 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var iterate = require('iterate-iterator'); + +var StringToCodePoints = require('es-abstract/2025/StringToCodePoints'); + +var index = require('../Iterator.prototype.flatMap'); +var impl = require('../Iterator.prototype.flatMap/implementation'); + +var fnName = 'flatMap'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (flatMap, name, t) { + t['throws']( + function () { return new flatMap(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(flatMap(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(flatMap(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { flatMap({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new flatMap(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new flatMap(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + + var nonIterableFlatMap = flatMap(iterator(), function (x) { return x; }); + st['throws']( + function () { nonIterableFlatMap.next(); }, + TypeError, + 'non-iterable return value throws' + ); + + forEach(v.strings, function (string) { + st['throws']( + function () { flatMap(iterator(), function () { return string; }).next(); }, + TypeError, + 'non-object return value throws even if iterable (' + debug(string) + ')' + ); + + testIterator( + flatMap(iterator(), function () { return Object(string); }), + [].concat(StringToCodePoints(string), StringToCodePoints(string), StringToCodePoints(string)), + st, + 'boxed string (' + debug(string) + ')' + ); + }); + + testIterator(flatMap(iterator(), function (x) { return [x][Symbol.iterator](); }), [1, 2, 3], st, 'identity mapper in array iterator'); + testIterator(flatMap(iterator(), function (x) { return [2 * x][Symbol.iterator](); }), [2, 4, 6], st, 'doubler mapper in array iterator'); + + testIterator(flatMap(iterator(), function () { return []; }), [], st, 'empty mapper in nested array iterator'); + testIterator(flatMap(iterator(), function (x) { return [[x, x + 1]][Symbol.iterator](); }), [[1, 2], [2, 3], [3, 4]], st, 'identity mapper in nested array iterator'); + testIterator(flatMap(iterator(), function (x) { return [[2 * x, 2 * (x + 1)]][Symbol.iterator](); }), [[2, 4], [4, 6], [6, 8]], st, 'doubler mapper in nested array iterator'); + + testIterator(flatMap([0, 1, 2, 3][Symbol.iterator](), function (value) { + var result = []; + for (var i = 0; i < value; ++i) { + result.push(value); + } + return result; + }), [1, 2, 2, 3, 3, 3], st, 'test262: test/built-ins/Iterator/prototype/flatMap/flattens-iteratable'); + + testIterator(flatMap([0, 1, 2, 3][Symbol.iterator](), function (value) { + var i = 0; + return { + next: function () { + if (i < value) { + i += 1; + return { + value: value, + done: false + }; + } + return { + value: undefined, + done: true + }; + + } + }; + }), [1, 2, 2, 3, 3, 3], st, 'test262: test/built-ins/Iterator/prototype/flatMap/flattens-iterator'); + + testIterator(flatMap([0][Symbol.iterator](), function () { + var n = [0, 1, 2][Symbol.iterator](); + + var ret = { + next: function next() { + return n.next(); + } + }; + ret[Symbol.iterator] = null; + return ret; + }), [0, 1, 2], st, 'test262: test/built-ins/Iterator/prototype/flatMap/iterable-to-iterator-fallback'); + + var counts = []; + testIterator(flatMap(['a', 'b', 'c', 'd', 'e'][Symbol.iterator](), function (value, count) { + counts.push(count); + + if (value === 'a' || value === 'b') { + return [0]; + } + if (value === 'c') { + return [1, 2]; + } + if (value === 'd') { + return [3, 4, 5]; + } + if (value === 'e') { + return [6, 7, 8, 9]; + } + + return st.fail('got unexpected value: ' + debug(v)); + }), [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], st, 'test262: test/built-ins/Iterator/prototype/flatMap/mapper-args'); + st.deepEqual(counts, [0, 1, 2, 3, 4], 'count values are as expected'); + + st.test('return protocol', function (s2t) { + var returnCount = 0; + + var iter = flatMap([0][Symbol.iterator](), function () { + return { + next: function next() { + return { + done: false, + value: 1 + }; + }, + 'return': function () { + returnCount += 1; + return {}; + } + }; + }); + s2t.equal(returnCount, 0, '`return` is not called yet'); + + s2t.deepEqual(iter.next(), { + done: false, + value: 1 + }); + + s2t.equal(returnCount, 0, '`return` is not called after first yield'); + + iter['return'](); + s2t.equal(returnCount, 1, '`return` is called when iterator return is called'); + + iter['return'](); + s2t.equal(returnCount, 1, '`return` is not called again when iterator return is called again'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.forEach.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.forEach.js new file mode 100644 index 0000000000000000000000000000000000000000..7e0f42e8a2b6ede376b662f7d16cfe046517aff7 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.forEach.js @@ -0,0 +1,232 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEachNormal = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.forEach'); +var impl = require('../Iterator.prototype.forEach/implementation'); + +var fnName = 'forEach'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (forEach, name, t) { + t['throws']( + function () { return new forEach(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEachNormal(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(forEach(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(forEach(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEachNormal(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { forEach({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new forEach(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new forEach(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + + var results = []; + var ret = forEach( + iterator(), + function (x, i) { + + results.push({ value: x, count: i, 'this': this, args: arguments.length }); + } + ); + + st.equal(ret, undefined, 'returns undefined'); + + st.deepEqual( + results, + [ + { value: 1, count: 0, 'this': undefined, args: 2 }, + { value: 2, count: 1, 'this': undefined, args: 2 }, + { value: 3, count: 2, 'this': undefined, args: 2 } + ], + 'forEach callback receives the expected values' + ); + + st.test('test262: test/built-ins/Iterator/prototype/forEach/fn-args', function (s2t) { + var assertionCount = 0; + var result = forEach( + ['a', 'b', 'c'][Symbol.iterator](), + function (value, count) { + if (value === 'a') { + s2t.equal(count, 0); + } else if (value === 'b') { + s2t.equal(count, 1); + } else if (value === 'c') { + s2t.equal(count, 2); + } else { + s2t.fail('unexpected value'); + } + assertionCount += 1; + } + ); + s2t.equal(result, undefined, 'forEach returns undefined'); + s2t.equal(assertionCount, 3, 'callback called three times'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/forEach/fn-this', function (s2t) { + var expectedThis = (function () { return this; }()); // eslint-disable-line no-invalid-this + var assertionCount = 0; + var result = forEach( + [0][Symbol.iterator](), + function () { + s2t.equal(this, expectedThis, 'fn this is undefined'); // eslint-disable-line no-invalid-this + assertionCount += 1; + } + ); + s2t.equal(result, undefined); + s2t.equal(assertionCount, 1); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/forEach/fn-called-for-each-yielded-value', function (s2t) { + var values = []; + forEach( + [1, 2, 3, 4, 5][Symbol.iterator](), + function (value) { values.push(value); } + ); + s2t.deepEqual(values, [1, 2, 3, 4, 5], 'callback called for each value'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/forEach/fn-throws', function (s2t) { + var returnCount = 0; + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCount += 1; + return { done: true }; + } + }; + + var callbackCount = 0; + s2t['throws']( + function () { + forEach(testIter, function () { + callbackCount += 1; + throw new SyntaxError('callback threw'); + }); + }, + SyntaxError + ); + s2t.equal(callbackCount, 1, 'callback called once'); + s2t.equal(returnCount, 1, 'iterator closed when callback throws'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/forEach/iterator-already-exhausted', function (s2t) { + var iter = [][Symbol.iterator](); + var callbackCount = 0; + var result = forEach(iter, function () { + callbackCount += 1; + }); + s2t.equal(result, undefined, 'forEach returns undefined for empty iterator'); + s2t.equal(callbackCount, 0, 'callback not called'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/forEach/result-is-undefined', function (s2t) { + var result = forEach( + [1, 2, 3][Symbol.iterator](), + function () {} + ); + s2t.equal(result, undefined, 'forEach returns undefined'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..50a23567687211e3532c0baff0b32450673816f6 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.js @@ -0,0 +1,72 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var hasSymbols = require('has-symbols')(); +var hasToStringTag = require('has-tostringtag'); +var functionsHaveNames = require('functions-have-names')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +var index = require('../Iterator.prototype'); +var impl = require('../Iterator.prototype/implementation'); + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var $Iterator = require('../Iterator/implementation'); + +module.exports = { + tests: function (proto, name, t) { + t.notEqual(proto, null, 'is not null'); + t.equal(typeof proto, 'object', 'is an object'); + + t.test('Symbol.iterator', { skip: !hasSymbols }, function (st) { + st.equal(typeof proto[Symbol.iterator], 'function', 'has a `Symbol.iterator` method'); + st.equal( + proto[Symbol.iterator].name, + '[Symbol.iterator]', + 'has name "[Symbol.iterator]"', + { skip: functionsHaveNames && !functionsHaveConfigurableNames } + ); + st.equal(proto[Symbol.iterator](), proto, 'function returns proto'); + st.equal(proto[Symbol.iterator].call($Iterator), $Iterator, 'function returns receiver'); + + st.end(); + }); + + t.test( + 'Symbol.toStringTag', + { skip: !hasToStringTag || 'temporarily skipped pending https://bugs.chromium.org/p/chromium/issues/detail?id=1477372' }, + function (st) { + st.equal(proto[Symbol.toStringTag], 'Iterator', 'has a `Symbol.toStringTag` property'); + + st.end(); + } + ); + }, + index: function () { + test('Iterator.prototype: index', function (t) { + module.exports.tests(index, 'Iterator.prototype', t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype: implementation', function (t) { + module.exports.tests(impl, 'Iterator.prototype', t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype: shimmed', function (t) { + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator, 'prototype'), 'Iterator.prototype is not enumerable'); + et.end(); + }); + + module.exports.tests(Iterator.prototype, 'Iterator.prototype', t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.map.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.map.js new file mode 100644 index 0000000000000000000000000000000000000000..b02597a50bc1f0c4b24c0c82ab6442b6604ef570 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.map.js @@ -0,0 +1,463 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var generators = require('make-generator-function')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.map'); +var impl = require('../Iterator.prototype.map/implementation'); + +var fnName = 'map'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (map, name, t) { + t['throws']( + function () { return new map(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(map(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(map(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { map({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + var sentinel = {}; + var done = false; + var fakeIterator = { + next: function () { + try { + return { + done: !!done, + value: sentinel + }; + } finally { + done = done === false ? null : true; + } + } + }; + var result = {}; + testIterator( + map(fakeIterator, function (x, i) { + result.value = x; + result.counter = i; + result.receiver = this; + result.args = arguments.length; + return fakeIterator; + }), + [fakeIterator, fakeIterator], + t, + 'fake iterator, mapped, runs as expected' + ); + t.deepEqual( + result, + { value: sentinel, counter: 1, receiver: undefined, args: 2 }, + 'callback is called with the correct arguments' + ); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new map(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new map(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + testIterator(map(iterator(), function (x) { return x; }), [1, 2, 3], st, 'identity mapper'); + testIterator(map(iterator(), function (x) { return 2 * x; }), [2, 4, 6], st, 'doubler mapper'); + + st.test('generators', { skip: generators.length === 0 }, function (s2t) { + forEach(generators, function (gen) { + s2t.doesNotThrow( + function () { map(gen(), function () {}); }, + 'generator function ' + debug(gen) + ' does not need to be from-wrapped first' + ); + }); + + s2t.end(); + }); + + st.test('262: mapper-this', function (s2t) { + var thisValue; + var iter = map( + [1][Symbol.iterator](), + function () { + thisValue = this; + return 42; + } + ); + iter.next(); + s2t.equal(thisValue, undefined, 'mapper this is undefined in sloppy mode'); + + s2t.end(); + }); + + st.test('262: result is iterator', function (s2t) { + var mappedIter = map([1, 2][Symbol.iterator](), function (x) { return x; }); + s2t.equal(typeof mappedIter.next, 'function', 'has next method'); + s2t.equal(typeof mappedIter[Symbol.iterator], 'function', 'has Symbol.iterator method'); + s2t.equal(mappedIter[Symbol.iterator](), mappedIter, 'Symbol.iterator returns itself'); + + s2t.end(); + }); + + st.test('262: get next method only once', { skip: !hasPropertyDescriptors }, function (s2t) { + var nextGets = 0; + var testIter = { + next: function () { + return { done: true, value: undefined }; + } + }; + Object.defineProperty(testIter, 'next', { + get: function () { + nextGets += 1; + return function () { + return { done: true, value: undefined }; + }; + } + }); + + var iter = map(testIter, function (x) { return x; }); + s2t.equal(nextGets, 1, 'next retrieved once on creation'); + iter.next(); + s2t.equal(nextGets, 1, 'next not retrieved again'); + + s2t.end(); + }); + + st.test('262: get next method throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + throw new EvalError('next getter threw'); + } + }); + + s2t['throws']( + function () { map(testIter, function () {}); }, + EvalError, + 'throws when getting next throws' + ); + + s2t.end(); + }); + + st.test('262: next method returns non-object throws', function (s2t) { + var badIterator = { + next: function () { + return null; + } + }; + + var iter = map(badIterator, function (x) { return x; }); + s2t['throws'](function () { iter.next(); }, TypeError, 'throws when next returns null'); + + var badIterator2 = { + next: function () { + return 42; + } + }; + + var iter2 = map(badIterator2, function (x) { return x; }); + s2t['throws'](function () { iter2.next(); }, TypeError, 'throws when next returns number'); + + s2t.end(); + }); + + st.test('262: next method returns throwing done', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var iterResult = { value: 1 }; + Object.defineProperty(iterResult, 'done', { + get: function () { + throw new EvalError('done getter threw'); + } + }); + return iterResult; + } + }; + + var iter = map(throwingIterator, function (x) { return x; }); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws when done getter throws'); + + s2t.end(); + }); + + st.test('262: next method returns throwing value', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var iterResult = { done: false }; + Object.defineProperty(iterResult, 'value', { + get: function () { + throw new EvalError('value getter threw'); + } + }); + return iterResult; + } + }; + + var iter = map(throwingIterator, function (x) { return x; }); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws when value getter throws'); + + s2t.end(); + }); + + st.test('262: next method throws', function (s2t) { + var throwingIterator = { + next: function () { + throw new EvalError('next threw'); + } + }; + + var iter = map(throwingIterator, function (x) { return x; }); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws error from next'); + + s2t.end(); + }); + + st.test('262: mapper throws', function (s2t) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = map(testIter, function () { + throw new SyntaxError('mapper threw'); + }); + + s2t['throws'](function () { iter.next(); }, SyntaxError, 'throws error from mapper'); + s2t.equal(returnCalls, 1, 'return called on underlying iterator'); + + s2t.end(); + }); + + st.test('262: mapper throws then closing iterator also throws', function (s2t) { + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + throw new EvalError('return threw'); + } + }; + + var iter = map(testIter, function () { + throw new SyntaxError('mapper threw'); + }); + + s2t['throws'](function () { iter.next(); }, SyntaxError, 'mapper exception wins over return exception'); + + s2t.end(); + }); + + st.test('262: get return method throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var badIterator = { + next: function () { + return { done: false, value: 1 }; + } + }; + Object.defineProperty(badIterator, 'return', { + get: function () { + throw new SyntaxError('return getter threw'); + } + }); + + var iter = map(badIterator, function (x) { return x; }); + iter.next(); + + s2t['throws'](function () { iter['return'](); }, SyntaxError, 'throws error from return getter'); + + s2t.end(); + }); + + st.test('262: return is forwarded to underlying iterator', function (s2t) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = map(testIter, function (x) { return x; }); + iter.next(); + s2t.equal(returnCalls, 0, 'return not called before calling return()'); + iter['return'](); + s2t.equal(returnCalls, 1, 'return called once'); + + s2t.end(); + }); + + st.test('262: return is not forwarded after exhaustion', function (s2t) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalls += 1; + throw new EvalError('return should not be called'); + } + }; + + var iter = map(testIter, function (x) { return x; }); + iter.next(); + iter['return'](); + s2t.equal(returnCalls, 0, 'return not called after exhaustion'); + + s2t.end(); + }); + + st.test('262: iterator already exhausted', function (s2t) { + var testIter = { + next: function () { + return { done: true, value: undefined }; + } + }; + + var mapperCalls = 0; + var iter = map(testIter, function (x) { + mapperCalls += 1; + return x; + }); + + var nextResult = iter.next(); + s2t.equal(nextResult.done, true, 'done is true'); + s2t.equal(nextResult.value, undefined, 'value is undefined'); + s2t.equal(mapperCalls, 0, 'mapper not called for exhausted iterator'); + + s2t.end(); + }); + + st.test('262: throws TypeError when generator is running', function (s2t) { + var reentrantIterator; + var testIter = { + next: function () { + reentrantIterator.next(); + return { done: false, value: 1 }; + } + }; + + reentrantIterator = map(testIter, function (x) { return x; }); + s2t['throws'](function () { reentrantIterator.next(); }, TypeError, 'throws on reentrant next()'); + + s2t.end(); + }); + + st.test('262: underlying iterator closed when mapper returns abrupt', function (s2t) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = map(testIter, function () { + throw new EvalError('mapper threw'); + }); + + s2t['throws'](function () { iter.next(); }, EvalError); + s2t.equal(returnCalls, 1, 'underlying iterator closed on mapper throw'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.equal(typeof Iterator.prototype[fnName], 'function', 'exists and is a function'); + + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.reduce.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.reduce.js new file mode 100644 index 0000000000000000000000000000000000000000..d0a201f25d40fa033e832f3cf1888e4b9e51a413 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.reduce.js @@ -0,0 +1,318 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.reduce'); +var impl = require('../Iterator.prototype.reduce/implementation'); + +var fnName = 'reduce'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (reduce, name, t) { + t['throws']( + function () { return new reduce(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(reduce(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(reduce(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { reduce({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new reduce(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new reduce(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + + var results = []; + var ret = reduce( + iterator(), + function (acc, x, i) { + + results.push({ acc: acc, value: x, count: i, 'this': this, args: arguments.length }); + return acc + x; + } + ); + st.equal(ret, 6, 'returns sum of all numbers'); + st.deepEqual( + results, + [ + { acc: 1, value: 2, count: 1, 'this': undefined, args: 3 }, + { acc: 3, value: 3, count: 2, 'this': undefined, args: 3 } + ], + 'reduce callback receives the expected values without initialValue' + ); + + var results2 = []; + var ret2 = reduce( + iterator(), + function (acc, x, i) { + + results2.push({ acc: acc, value: x, count: i, 'this': this, args: arguments.length }); + return acc + x; + }, + 10 + ); + st.equal(ret2, 16, 'returns sum of all numbers plus initialValue'); + st.deepEqual( + results2, + [ + { acc: 10, value: 1, count: 0, 'this': undefined, args: 3 }, + { acc: 11, value: 2, count: 1, 'this': undefined, args: 3 }, + { acc: 13, value: 3, count: 2, 'this': undefined, args: 3 } + ], + 'reduce callback receives the expected values with initialValue' + ); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/reducer-args-initial-value', function (s2t) { + var assertionCount = 0; + var result = reduce( + ['a', 'b', 'c'][Symbol.iterator](), + function (memo, value, count) { + if (value === 'a') { + s2t.equal(memo, 'start', 'memo is initial value for first call'); + s2t.equal(count, 0); + } else if (value === 'b') { + s2t.equal(memo, 'a', 'memo is previous return'); + s2t.equal(count, 1); + } else if (value === 'c') { + s2t.equal(memo, 'b', 'memo is previous return'); + s2t.equal(count, 2); + } else { + s2t.fail('unexpected value'); + } + assertionCount += 1; + return value; + }, + 'start' + ); + s2t.equal(result, 'c', 'reduce returns last value'); + s2t.equal(assertionCount, 3, 'reducer called three times'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/reducer-args-no-initial-value', function (s2t) { + var assertionCount = 0; + var result = reduce( + ['a', 'b', 'c'][Symbol.iterator](), + function (memo, value, count) { + if (value === 'b') { + s2t.equal(memo, 'a', 'memo is first value when no initial'); + s2t.equal(count, 1); + } else if (value === 'c') { + s2t.equal(memo, 'b', 'memo is previous return'); + s2t.equal(count, 2); + } else { + s2t.fail('unexpected value'); + } + assertionCount += 1; + return value; + } + ); + s2t.equal(result, 'c', 'reduce returns last value'); + s2t.equal(assertionCount, 2, 'reducer called twice'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/reducer-this', function (s2t) { + var expectedThis = (function () { return this; }()); // eslint-disable-line no-invalid-this + var assertionCount = 0; + var result = reduce( + [0, 1][Symbol.iterator](), + function () { + s2t.equal(this, expectedThis, 'reducer this is undefined'); // eslint-disable-line no-invalid-this + assertionCount += 1; + return 0; + } + ); + s2t.equal(result, 0); + s2t.equal(assertionCount, 1, 'reducer called once'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/reducer-throws', function (s2t) { + var returnCount = 0; + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCount += 1; + return { done: true }; + } + }; + + var callbackCount = 0; + s2t['throws']( + function () { + reduce(testIter, function () { + callbackCount += 1; + throw new SyntaxError('reducer threw'); + }, 0); + }, + SyntaxError + ); + s2t.equal(callbackCount, 1, 'reducer called once'); + s2t.equal(returnCount, 1, 'iterator closed when reducer throws'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/iterator-already-exhausted-initial-value', function (s2t) { + var iter = [][Symbol.iterator](); + var callbackCount = 0; + var result = reduce(iter, function () { + callbackCount += 1; + return 'called'; + }, 'initial'); + s2t.equal(result, 'initial', 'reduce returns initial value for empty iterator'); + s2t.equal(callbackCount, 0, 'reducer not called'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/iterator-already-exhausted-no-initial-value', function (s2t) { + var iter = [][Symbol.iterator](); + s2t['throws']( + function () { + reduce(iter, function () {}); + }, + TypeError, + 'reduce throws TypeError for empty iterator without initial value' + ); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/iterator-yields-once-initial-value', function (s2t) { + var callbackCount = 0; + var result = reduce( + [42][Symbol.iterator](), + function (memo, value) { + callbackCount += 1; + return memo + value; + }, + 10 + ); + s2t.equal(result, 52, 'reduce returns sum'); + s2t.equal(callbackCount, 1, 'reducer called once'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/iterator-yields-once-no-initial-value', function (s2t) { + var callbackCount = 0; + var result = reduce( + [42][Symbol.iterator](), + function () { + callbackCount += 1; + return 'called'; + } + ); + s2t.equal(result, 42, 'reduce returns sole value'); + s2t.equal(callbackCount, 0, 'reducer not called'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/reduce/reducer-memo-can-be-any-type', function (s2t) { + // test various memo types + s2t.equal(reduce([1][Symbol.iterator](), function (m) { return m; }, null), null, 'null memo'); + s2t.equal(reduce([1][Symbol.iterator](), function (m) { return m; }, undefined), undefined, 'undefined memo'); + s2t.equal(reduce([1][Symbol.iterator](), function (m) { return m; }, 0), 0, 'number memo'); + s2t.equal(reduce([1][Symbol.iterator](), function (m) { return m; }, ''), '', 'string memo'); + s2t.equal(reduce([1][Symbol.iterator](), function (m) { return m; }, false), false, 'boolean memo'); + var obj = {}; + s2t.equal(reduce([1][Symbol.iterator](), function (m) { return m; }, obj), obj, 'object memo'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.some.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.some.js new file mode 100644 index 0000000000000000000000000000000000000000..3e511b8a946893e09ab1a93281fe59e758e429fe --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.some.js @@ -0,0 +1,286 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.some'); +var impl = require('../Iterator.prototype.some/implementation'); + +var fnName = 'some'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (some, name, t) { + t['throws']( + function () { return new some(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(some(nonIterator, function () {})); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(some(badNext, function () {})); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { some({ next: function () {} }, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new some(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new some(iterator(), function () {}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + st.equal(some(iterator(), function () { return false; }), false, 'some for always-false'); + st.equal(some(iterator(), function () { return true; }), true, 'some for always-true'); + st.equal(some(iterator(), function (x, i) { return x === 2 && i === 1; }), true, 'some returns true for matching value/index'); + + st.test('test262: test/built-ins/Iterator/prototype/some/predicate-args', function (s2t) { + var assertionCount = 0; + var result = some( + ['a', 'b', 'c'][Symbol.iterator](), + function (value, count) { + if (value === 'a') { + s2t.equal(count, 0); + } else if (value === 'b') { + s2t.equal(count, 1); + } else if (value === 'c') { + s2t.equal(count, 2); + } else { + s2t.fail('unexpected value'); + } + assertionCount += 1; + return false; + } + ); + s2t.equal(result, false, 'some returns false when none match'); + s2t.equal(assertionCount, 3, 'predicate called three times'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/some/predicate-this', function (s2t) { + var expectedThis = (function () { return this; }()); // eslint-disable-line no-invalid-this + var assertionCount = 0; + var result = some( + [0][Symbol.iterator](), + function () { + s2t.equal(this, expectedThis, 'predicate this is undefined'); // eslint-disable-line no-invalid-this + assertionCount += 1; + return true; + } + ); + s2t.equal(result, true); + s2t.equal(assertionCount, 1); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/some/predicate-returns-truthy', function (s2t) { + var callCount = 0; + var returnCalled = false; + var values = [0, 1, 2]; + var idx = 0; + var iter = { + next: function () { + if (idx < values.length) { + var val = values[idx]; + idx += 1; + return { done: false, value: val }; + } + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalled = true; + return { done: true, value: undefined }; + } + }; + var result = some( + iter, + function () { + callCount += 1; + return true; + } + ); + s2t.equal(result, true, 'some returns true when predicate returns truthy'); + s2t.equal(callCount, 1, 'predicate called once'); + s2t.equal(returnCalled, true, 'iterator is closed'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/some/predicate-returns-falsey', function (s2t) { + var result = some( + [0, 1, 2, 3, 4][Symbol.iterator](), + function () { return false; } + ); + s2t.equal(result, false, 'some returns false when predicate always returns falsey'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/some/predicate-returns-falsey-then-truthy', function (s2t) { + var callCount = 0; + var returnCalled = false; + var values = [0, 1, 2, 3, 4]; + var idx = 0; + var iter = { + next: function () { + if (idx < values.length) { + var val = values[idx]; + idx += 1; + return { done: false, value: val }; + } + return { done: true, value: undefined }; + }, + 'return': function () { + returnCalled = true; + return { done: true, value: undefined }; + } + }; + var result = some( + iter, + function (value) { + callCount += 1; + return value >= 3; + } + ); + s2t.equal(result, true, 'some returns true when predicate returns truthy'); + s2t.equal(callCount, 4, 'predicate called until truthy returned'); + s2t.equal(returnCalled, true, 'iterator is closed'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/some/predicate-returns-non-boolean', function (s2t) { + // truthy non-boolean values + s2t.equal(some([1][Symbol.iterator](), function () { return 1; }), true, 'truthy number'); + s2t.equal(some([1][Symbol.iterator](), function () { return 'yes'; }), true, 'truthy string'); + s2t.equal(some([1][Symbol.iterator](), function () { return {}; }), true, 'truthy object'); + + // falsy non-boolean values + s2t.equal(some([1][Symbol.iterator](), function () { return 0; }), false, 'falsy number'); + s2t.equal(some([1][Symbol.iterator](), function () { return ''; }), false, 'falsy string'); + s2t.equal(some([1][Symbol.iterator](), function () { return null; }), false, 'null'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/some/predicate-throws', function (s2t) { + var returnCount = 0; + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCount += 1; + return { done: true }; + } + }; + + var callbackCount = 0; + s2t['throws']( + function () { + some(testIter, function () { + callbackCount += 1; + throw new SyntaxError('predicate threw'); + }); + }, + SyntaxError + ); + s2t.equal(callbackCount, 1, 'predicate called once'); + s2t.equal(returnCount, 1, 'iterator closed when predicate throws'); + + s2t.end(); + }); + + st.test('test262: test/built-ins/Iterator/prototype/some/iterator-already-exhausted', function (s2t) { + var iter = [][Symbol.iterator](); + var callbackCount = 0; + var result = some(iter, function () { + callbackCount += 1; + return true; + }); + s2t.equal(result, false, 'some returns false for empty iterator'); + s2t.equal(callbackCount, 0, 'predicate not called'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.take.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.take.js new file mode 100644 index 0000000000000000000000000000000000000000..6da59e252e6363d76b00a43fda7002ede9739965 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.take.js @@ -0,0 +1,364 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.take'); +var impl = require('../Iterator.prototype.take/implementation'); + +var fnName = 'take'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (take, name, t) { + t['throws']( + function () { return new take(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(take(nonIterator, 1)); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + if (nonIterator != null && typeof nonIterator !== 'string') { + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(take(badNext, 1)); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + } + }); + + var arr = [1, 2, 3]; + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { take(iterator(), -3); }, + RangeError, + '-3 is not >= 0' + ); + + st['throws']( + function () { return new take(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + st['throws']( + function () { return new take(iterator(), 0); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + testIterator(take(iterator(), 0), [], st, 'take 0'); + testIterator(take(iterator(), 1), [1], st, 'take 1'); + testIterator(take(iterator(), 2), [1, 2], st, 'take 2'); + testIterator(take(iterator(), 3), [1, 2, 3], st, 'take 3'); + testIterator(take(iterator(), Infinity), [1, 2, 3], st, 'take ∞'); + + st.test('262: limit-tonumber', function (s2t) { + // ToNumber coercion + testIterator(take(iterator(), '2'), [1, 2], s2t, 'string "2" coerced to 2'); + testIterator(take(iterator(), 2.9), [1, 2], s2t, '2.9 truncated to 2'); + testIterator(take(iterator(), { valueOf: function () { return 2; } }), [1, 2], s2t, 'object with valueOf'); + testIterator(take(iterator(), true), [1], s2t, 'true coerced to 1'); + testIterator(take(iterator(), null), [], s2t, 'null coerced to 0'); + + s2t.end(); + }); + + st.test('262: limit-tonumber-throws', function (s2t) { + s2t['throws']( + function () { take(iterator(), { valueOf: function () { throw new EvalError('valueOf threw'); } }); }, + EvalError, + 'throws when valueOf throws' + ); + + s2t['throws']( + function () { take(iterator(), Symbol('test')); }, + TypeError, + 'throws when limit is a Symbol' + ); + + s2t.end(); + }); + + st.test('262: limit-rangeerror', function (s2t) { + s2t['throws'](function () { take(iterator(), -1); }, RangeError, '-1 throws RangeError'); + s2t['throws'](function () { take(iterator(), -Infinity); }, RangeError, '-Infinity throws RangeError'); + s2t['throws'](function () { take(iterator(), NaN); }, RangeError, 'NaN throws RangeError'); + + s2t.end(); + }); + + st.test('262: result is iterator', function (s2t) { + var iter = take(iterator(), 2); + s2t.equal(typeof iter.next, 'function', 'has next method'); + s2t.equal(typeof iter[Symbol.iterator], 'function', 'has Symbol.iterator method'); + s2t.equal(iter[Symbol.iterator](), iter, 'Symbol.iterator returns itself'); + + s2t.end(); + }); + + st.test('262: get next method only once', { skip: !hasPropertyDescriptors }, function (s2t) { + var nextGets = 0; + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + nextGets += 1; + return function () { + return { done: true, value: undefined }; + }; + } + }); + + var iter = take(testIter, 2); + s2t.equal(nextGets, 1, 'next retrieved once on creation'); + iter.next(); + s2t.equal(nextGets, 1, 'next not retrieved again'); + + s2t.end(); + }); + + st.test('262: get next method throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + throw new EvalError('next getter threw'); + } + }); + + s2t['throws']( + function () { take(testIter, 2); }, + EvalError, + 'throws when getting next throws' + ); + + s2t.end(); + }); + + st.test('262: next method returns non-object throws', function (s2t) { + var badIterator = { + next: function () { + return null; + } + }; + + var iter = take(badIterator, 2); + s2t['throws'](function () { iter.next(); }, TypeError, 'throws when next returns null'); + + s2t.end(); + }); + + st.test('262: next method returns throwing done', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var result = { value: 1 }; + Object.defineProperty(result, 'done', { + get: function () { + throw new EvalError('done getter threw'); + } + }); + return result; + } + }; + + var iter = take(throwingIterator, 2); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws when done getter throws'); + + s2t.end(); + }); + + st.test('262: next method returns throwing value', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var result = { done: false }; + Object.defineProperty(result, 'value', { + get: function () { + throw new EvalError('value getter threw'); + } + }); + return result; + } + }; + + var iter = take(throwingIterator, 2); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws when value getter throws'); + + s2t.end(); + }); + + st.test('262: next method throws', function (s2t) { + var throwingIterator = { + next: function () { + throw new EvalError('next threw'); + } + }; + + var iter = take(throwingIterator, 2); + s2t['throws'](function () { iter.next(); }, EvalError, 'throws error from next'); + + s2t.end(); + }); + + st.test('262: return is forwarded', function (s2t) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = take(testIter, 5); + iter.next(); + s2t.equal(returnCalls, 0, 'return not called before calling return()'); + iter['return'](); + s2t.equal(returnCalls, 1, 'return called once'); + + s2t.end(); + }); + + st.test('262: return is not forwarded after exhaustion', function (s2t) { + var returnCalls = 0; + + var testIter = { + next: function () { + return { done: false, value: 1 }; + }, + 'return': function () { + returnCalls += 1; + return { done: true, value: undefined }; + } + }; + + var iter = take(testIter, 1); + iter.next(); // takes the one value, returnCalls still 0 + iter.next(); // exhausted, calls return on underlying -> returnCalls = 1 + s2t.equal(returnCalls, 1, 'return called once on exhaustion'); + + // After exhaustion, calling return() should NOT forward again + iter['return'](); + s2t.equal(returnCalls, 1, 'return not called again after already exhausted'); + + s2t.end(); + }); + + // Note: "exhaustion calls return" test removed as take's exhaustion behavior + // depends on implementation details and spec interpretation + + st.test('262: get return method throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var badIterator = { + next: function () { + return { done: false, value: 1 }; + } + }; + Object.defineProperty(badIterator, 'return', { + get: function () { + throw new SyntaxError('return getter threw'); + } + }); + + var iter = take(badIterator, 5); + iter.next(); + + s2t['throws'](function () { iter['return'](); }, SyntaxError, 'throws error from return getter'); + + s2t.end(); + }); + + st.test('262: throws TypeError when generator is running', function (s2t) { + var reentrantIterator; + var testIter = { + next: function () { + reentrantIterator.next(); + return { done: false, value: 1 }; + } + }; + + reentrantIterator = take(testIter, 5); + s2t['throws'](function () { reentrantIterator.next(); }, TypeError, 'throws on reentrant next()'); + + s2t.end(); + }); + + st.test('262: limit-greater-than-or-equal-to-total', function (s2t) { + // When limit >= total items, should return all items + testIterator(take(iterator(), 5), [1, 2, 3], s2t, 'take 5 from 3-item iterator'); + testIterator(take(iterator(), 3), [1, 2, 3], s2t, 'take exactly 3 from 3-item iterator'); + + s2t.end(); + }); + + st.test('262: limit-less-than-total', function (s2t) { + // When limit < total items, should stop early + testIterator(take(iterator(), 2), [1, 2], s2t, 'take 2 from 3-item iterator'); + testIterator(take(iterator(), 1), [1], s2t, 'take 1 from 3-item iterator'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.prototype.toArray.js b/node_modules/es-iterator-helpers/test/Iterator.prototype.toArray.js new file mode 100644 index 0000000000000000000000000000000000000000..2c3c8b5b38550d85797aedd589c3d1fce9bf1467 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.prototype.toArray.js @@ -0,0 +1,286 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iterate = require('iterate-iterator'); + +var index = require('../Iterator.prototype.toArray'); +var impl = require('../Iterator.prototype.toArray/implementation'); + +var fnName = 'toArray'; + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (toArray, name, t) { + t['throws']( + function () { return new toArray(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` is not a constructor' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { iterate(toArray(nonIterator)); }, + TypeError, + debug(nonIterator) + ' is not an Object with a callable `next` method' + ); + + var badNext = { next: nonIterator }; + t['throws']( + function () { iterate(toArray(badNext)); }, + TypeError, + debug(badNext) + ' is not an Object with a callable `next` method' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + var arr = [1, 2, 3]; + var iterator = callBind(arr[Symbol.iterator], arr); + + st['throws']( + function () { return new toArray(iterator()); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` iterator is not a constructor' + ); + + testIterator(iterator(), [1, 2, 3], st, 'original'); + + st.deepEqual(toArray(iterator()), [1, 2, 3], 'toArray'); + + st.test('262: iterator-already-exhausted', function (s2t) { + var exhaustedIter = { + next: function () { + return { done: true, value: undefined }; + } + }; + + var result = toArray(exhaustedIter); + s2t.ok(Array.isArray(result), 'result is an array'); + s2t.deepEqual(result, [], 'empty array for exhausted iterator'); + + s2t.end(); + }); + + st.test('262: get-next-method-only-once', { skip: !hasPropertyDescriptors }, function (s2t) { + var nextGets = 0; + var callCount = 0; + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + nextGets += 1; + return function () { + callCount += 1; + if (callCount <= 2) { + return { done: false, value: callCount }; + } + return { done: true, value: undefined }; + }; + } + }); + + var result = toArray(testIter); + s2t.equal(nextGets, 1, 'next retrieved once'); + s2t.deepEqual(result, [1, 2], 'result is correct'); + + s2t.end(); + }); + + st.test('262: get-next-method-throws', { skip: !hasPropertyDescriptors }, function (s2t) { + var testIter = {}; + Object.defineProperty(testIter, 'next', { + get: function () { + throw new EvalError('next getter threw'); + } + }); + + s2t['throws']( + function () { toArray(testIter); }, + EvalError, + 'throws when getting next throws' + ); + + s2t.end(); + }); + + st.test('262: next-method-returns-non-object', function (s2t) { + var badIterator = { + next: function () { + return null; + } + }; + + s2t['throws']( + function () { toArray(badIterator); }, + TypeError, + 'throws when next returns null' + ); + + var badIterator2 = { + next: function () { + return 42; + } + }; + + s2t['throws']( + function () { toArray(badIterator2); }, + TypeError, + 'throws when next returns a number' + ); + + s2t.end(); + }); + + st.test('262: next-method-returns-throwing-done', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var result = { value: 1 }; + Object.defineProperty(result, 'done', { + get: function () { + throw new EvalError('done getter threw'); + } + }); + return result; + } + }; + + s2t['throws']( + function () { toArray(throwingIterator); }, + EvalError, + 'throws when done getter throws' + ); + + s2t.end(); + }); + + st.test('262: next-method-returns-throwing-value', { skip: !hasPropertyDescriptors }, function (s2t) { + var throwingIterator = { + next: function () { + var result = { done: false }; + Object.defineProperty(result, 'value', { + get: function () { + throw new EvalError('value getter threw'); + } + }); + return result; + } + }; + + s2t['throws']( + function () { toArray(throwingIterator); }, + EvalError, + 'throws when value getter throws' + ); + + s2t.end(); + }); + + st.test('262: next-method-returns-throwing-value-done', { skip: !hasPropertyDescriptors }, function (s2t) { + // Value property should not be accessed after done: true + var valueAccessed = false; + var doneIterator = { + next: function () { + var result = { done: true }; + Object.defineProperty(result, 'value', { + get: function () { + valueAccessed = true; + throw new EvalError('value getter threw'); + } + }); + return result; + } + }; + + var result = toArray(doneIterator); + s2t.deepEqual(result, [], 'toArray returns empty array'); + s2t.equal(valueAccessed, false, 'value not accessed when done is true'); + + s2t.end(); + }); + + st.test('262: next-method-throws', function (s2t) { + var throwingIterator = { + next: function () { + throw new EvalError('next threw'); + } + }; + + s2t['throws']( + function () { toArray(throwingIterator); }, + EvalError, + 'throws error from next' + ); + + s2t.end(); + }); + + st.test('262: this-plain-iterator', function (s2t) { + // toArray works with plain iterator objects not inheriting from Iterator.prototype + var callCount = 0; + var plainIterator = { + next: function () { + callCount += 1; + if (callCount <= 3) { + return { done: false, value: callCount }; + } + return { done: true, value: undefined }; + } + }; + + var result = toArray(plainIterator); + s2t.deepEqual(result, [1, 2, 3], 'toArray works with plain iterator'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.prototype.' + fnName + ': index', function (t) { + module.exports.tests(index, 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.prototype.' + fnName + ': implementation', function (t) { + module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.prototype.' + fnName + ': shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable'); + et.end(); + }); + + t.test('bad string/this value', { skip: !hasStrictMode }, function (st) { + st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.zip.js b/node_modules/es-iterator-helpers/test/Iterator.zip.js new file mode 100644 index 0000000000000000000000000000000000000000..64104aee12c30cabaf71750612e5699f88c3396c --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.zip.js @@ -0,0 +1,278 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var mockProperty = require('mock-property'); + +var index = require('../Iterator.zip'); +var impl = require('../Iterator.zip/implementation'); +var from = require('../Iterator.from/polyfill')(); + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var testIterator = require('./helpers/testIterator'); + +module.exports = { + tests: function (zip, name, t) { + t['throws']( + function () { return new zip(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor' + ); + t['throws']( + function () { return new zip({}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor, with an argument' + ); + + forEach(v.primitives.concat(v.objects), function (nonIterator) { + t['throws']( + function () { zip(nonIterator, []); }, + TypeError, + debug(nonIterator) + ' is not an iterable Object' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + forEach(v.nonFunctions, function (nonFunction) { + if (nonFunction != null) { + var badIterable = {}; + badIterable[Symbol.iterator] = nonFunction; + st['throws']( + function () { zip([[], badIterable, []]).next(); }, + TypeError, + debug(badIterable) + ' is not a function' + ); + } + }); + + forEach(v.strings, function (string) { + st['throws']( + function () { zip([string]); }, + TypeError, + 'non-objects are not considered iterable' + ); + }); + + var arrayIt = zip([[1, 2, 3]]); + st.equal(typeof arrayIt.next, 'function', 'has a `next` function'); + + st.test('real iterators', { skip: !hasSymbols }, function (s2t) { + var iter = [1, 2][Symbol.iterator](); + testIterator(zip([iter, [3, 4]]), [[1, 3], [2, 4]], s2t, 'array iterator + array yields combined results'); + + s2t.end(); + }); + + st.test('observability in a replaced String iterator', function (s2t) { + var originalStringIterator = String.prototype[Symbol.iterator]; + var observedType; + s2t.teardown(mockProperty(String.prototype, Symbol.iterator, { + get: function () { + 'use strict'; // eslint-disable-line strict, lines-around-directive + + observedType = typeof this; + return originalStringIterator; + } + })); + + zip([from('')]); + s2t.equal(observedType, 'string', 'string primitive -> primitive receiver in Symbol.iterator getter'); + zip([from(Object(''))]); + s2t.equal(observedType, 'object', 'boxed string -> boxed string in Symbol.iterator getter'); + + s2t.end(); + }); + + st.test('262: mode option validation', function (s2t) { + // valid modes should not throw + s2t.doesNotThrow(function () { zip([[1], [2]]); }, 'undefined mode is valid'); + s2t.doesNotThrow(function () { zip([[1], [2]], { mode: undefined }); }, 'explicit undefined mode is valid'); + s2t.doesNotThrow(function () { zip([[1], [2]], { mode: 'shortest' }); }, '"shortest" mode is valid'); + s2t.doesNotThrow(function () { zip([[1], [2]], { mode: 'longest' }); }, '"longest" mode is valid'); + s2t.doesNotThrow(function () { zip([[1], [2]], { mode: 'strict' }); }, '"strict" mode is valid'); + + // invalid modes should throw TypeError + s2t['throws'](function () { zip([[1], [2]], { mode: null }); }, TypeError, 'null mode throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: false }); }, TypeError, 'false mode throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: '' }); }, TypeError, 'empty string mode throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: 'short' }); }, TypeError, '"short" mode throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: 'long' }); }, TypeError, '"long" mode throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: 'loose' }); }, TypeError, '"loose" mode throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: 0 }); }, TypeError, '0 mode throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: {} }); }, TypeError, 'object mode throws TypeError'); + + // String wrapper should not be coerced + s2t['throws'](function () { zip([[1], [2]], { mode: Object('shortest') }); }, TypeError, 'String wrapper mode throws TypeError'); + + // objects with toString/valueOf should not be coerced + s2t['throws'](function () { zip([[1], [2]], { mode: { toString: function () { return 'shortest'; } } }); }, TypeError, 'object with toString throws TypeError'); + s2t['throws'](function () { zip([[1], [2]], { mode: { valueOf: function () { return 'shortest'; } } }); }, TypeError, 'object with valueOf throws TypeError'); + + s2t.end(); + }); + + st.test('262: basic shortest mode', function (s2t) { + // shortest mode (default) stops at minimum length + testIterator(zip([[1, 2, 3], [4, 5]]), [[1, 4], [2, 5]], s2t, 'shortest mode stops at shorter iterator'); + testIterator(zip([[1, 2], [3, 4, 5]]), [[1, 3], [2, 4]], s2t, 'shortest mode stops at shorter first iterator'); + testIterator(zip([[1], [2], [3]]), [[1, 2, 3]], s2t, 'three iterators of length 1'); + testIterator(zip([[], [1, 2, 3]]), [], s2t, 'empty first iterator yields nothing'); + testIterator(zip([[1, 2, 3], []]), [], s2t, 'empty second iterator yields nothing'); + + // explicit shortest mode + testIterator(zip([[1, 2, 3], [4, 5]], { mode: 'shortest' }), [[1, 4], [2, 5]], s2t, 'explicit shortest mode'); + + s2t.end(); + }); + + st.test('262: basic longest mode', function (s2t) { + // longest mode continues with undefined padding by default + testIterator(zip([[1, 2, 3], [4, 5]], { mode: 'longest' }), [[1, 4], [2, 5], [3, undefined]], s2t, 'longest mode pads with undefined'); + testIterator(zip([[1, 2], [3, 4, 5]], { mode: 'longest' }), [[1, 3], [2, 4], [undefined, 5]], s2t, 'longest mode pads first iterator'); + testIterator(zip([[1], [2, 3], [4, 5, 6]], { mode: 'longest' }), [[1, 2, 4], [undefined, 3, 5], [undefined, undefined, 6]], s2t, 'longest mode with three iterators'); + + s2t.end(); + }); + + st.test('262: basic strict mode', function (s2t) { + // strict mode succeeds when lengths match + testIterator(zip([[1, 2], [3, 4]], { mode: 'strict' }), [[1, 3], [2, 4]], s2t, 'strict mode succeeds with equal lengths'); + testIterator(zip([[1], [2], [3]], { mode: 'strict' }), [[1, 2, 3]], s2t, 'strict mode with three iterators of length 1'); + + // strict mode throws when lengths differ + var strictIter1 = zip([[1, 2, 3], [4, 5]], { mode: 'strict' }); + strictIter1.next(); // [1, 4] + strictIter1.next(); // [2, 5] + s2t['throws'](function () { strictIter1.next(); }, TypeError, 'strict mode throws when first iterator has more'); + + var strictIter2 = zip([[1, 2], [3, 4, 5]], { mode: 'strict' }); + strictIter2.next(); // [1, 3] + strictIter2.next(); // [2, 4] + s2t['throws'](function () { strictIter2.next(); }, TypeError, 'strict mode throws when second iterator has more'); + + s2t.end(); + }); + + st.test('262: padding option validation', function (s2t) { + // padding is only used in longest mode + s2t.doesNotThrow(function () { zip([[1], [2]], { mode: 'shortest', padding: null }); }, 'invalid padding ignored in shortest mode'); + s2t.doesNotThrow(function () { zip([[1], [2]], { mode: 'strict', padding: null }); }, 'invalid padding ignored in strict mode'); + + // invalid padding in longest mode + s2t['throws'](function () { zip([[1], [2]], { mode: 'longest', padding: null }); }, TypeError, 'null padding throws in longest mode'); + s2t['throws'](function () { zip([[1], [2]], { mode: 'longest', padding: 'abc' }); }, TypeError, 'string padding throws in longest mode'); + s2t['throws'](function () { zip([[1], [2]], { mode: 'longest', padding: 123 }); }, TypeError, 'number padding throws in longest mode'); + s2t['throws'](function () { zip([[1], [2]], { mode: 'longest', padding: true }); }, TypeError, 'boolean padding throws in longest mode'); + + s2t.end(); + }); + + st.test('262: result is iterator', function (s2t) { + var zipIter = zip([[1, 2], [3, 4]]); + s2t.equal(typeof zipIter.next, 'function', 'has next method'); + s2t.equal(typeof zipIter[Symbol.iterator], 'function', 'has Symbol.iterator method'); + s2t.equal(zipIter[Symbol.iterator](), zipIter, 'Symbol.iterator returns itself'); + + s2t.end(); + }); + + st.test('262: return closes all underlying iterators', function (s2t) { + var return1Calls = 0; + var return2Calls = 0; + + var iter1 = { + next: function () { return { done: false, value: 1 }; }, + 'return': function () { + return1Calls += 1; + return { done: true, value: undefined }; + } + }; + iter1[Symbol.iterator] = function () { return iter1; }; + + var iter2 = { + next: function () { return { done: false, value: 2 }; }, + 'return': function () { + return2Calls += 1; + return { done: true, value: undefined }; + } + }; + iter2[Symbol.iterator] = function () { return iter2; }; + + var zipIter = zip([iter1, iter2]); + zipIter.next(); + s2t.equal(return1Calls, 0, 'return not called before calling return()'); + s2t.equal(return2Calls, 0, 'return not called before calling return()'); + + zipIter['return'](); + s2t.equal(return1Calls, 1, 'iter1.return called once'); + s2t.equal(return2Calls, 1, 'iter2.return called once'); + + s2t.end(); + }); + + st.test('262: next method throws closes other iterators', function (s2t) { + var return2Calls = 0; + + var iter1 = { + next: function () { throw new EvalError('iter1 next threw'); } + }; + iter1[Symbol.iterator] = function () { return iter1; }; + + var iter2 = { + next: function () { return { done: false, value: 2 }; }, + 'return': function () { + return2Calls += 1; + return { done: true, value: undefined }; + } + }; + iter2[Symbol.iterator] = function () { return iter2; }; + + var zipIter = zip([iter1, iter2]); + s2t['throws'](function () { zipIter.next(); }, EvalError, 'throws error from iter1.next'); + s2t.equal(return2Calls, 1, 'iter2.return called when iter1.next throws'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.zip: index', function (t) { + module.exports.tests(index, 'Iterator.zip', t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.zip: implementation', function (t) { + module.exports.tests(impl, 'Iterator.zip', t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.zip: shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.zip.name, 'zip', 'Iterator.zip has name "zip"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator, 'zip'), 'Iterator.zip is not enumerable'); + et.end(); + }); + + module.exports.tests(callBind(Iterator.zip, Iterator), 'Iterator.zip', t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/Iterator.zipKeyed.js b/node_modules/es-iterator-helpers/test/Iterator.zipKeyed.js new file mode 100644 index 0000000000000000000000000000000000000000..66bc7ef4a8f792e72080774e42765cc9a2e313e0 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/Iterator.zipKeyed.js @@ -0,0 +1,349 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var test = require('tape'); +var callBind = require('call-bind'); +var functionsHaveNames = require('functions-have-names')(); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); +var hasSymbols = require('has-symbols/shams')(); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var mockProperty = require('mock-property'); + +var index = require('../Iterator.zipKeyed'); +var impl = require('../Iterator.zipKeyed/implementation'); +var from = require('../Iterator.from/polyfill')(); + +var testIterator = require('./helpers/testIterator'); + +var isEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = { + tests: function (zipKeyed, name, t) { + t['throws']( + function () { return new zipKeyed(); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor' + ); + t['throws']( + function () { return new zipKeyed({}); }, // eslint-disable-line new-cap + TypeError, + '`' + name + '` itself is not a constructor, with an argument' + ); + + forEach(v.primitives, function (primitive) { + t['throws']( + function () { zipKeyed(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + if (primitive != null) { + t['throws']( + function () { zipKeyed({ a: primitive }); }, + TypeError, + 'key "a" on iterables object is ' + debug(primitive) + ' which is not an iterable Object' + ); + } + }); + + forEach(v.objects, function (nonIterator) { + t.doesNotThrow(function () { zipKeyed({ a: nonIterator }); }, 'does not throw until `.next()`'); + + t['throws']( + function () { zipKeyed({ a: nonIterator }).next(); }, + TypeError, + 'key "a" on iterables object is ' + debug(nonIterator) + ' which is not an iterable Object' + ); + }); + + t.test('actual iteration', { skip: !hasSymbols }, function (st) { + forEach(v.nonFunctions, function (nonFunction) { + if (nonFunction != null) { + var badIterable = {}; + badIterable[Symbol.iterator] = nonFunction; + st['throws']( + function () { zipKeyed({ a: [], b: badIterable, c: [] }).next(); }, + TypeError, + 'key "b" on iterables object is ' + debug(badIterable) + ' is not a function' + ); + } + }); + + forEach(v.strings, function (string) { + st['throws']( + function () { zipKeyed({ a: string }); }, + TypeError, + 'key "a" on iterables object is an iterable primitive, but non-objects are not considered iterable' + ); + }); + + st.test('real iterators', { skip: !hasSymbols }, function (s2t) { + var iter = [['a', 1], ['b', 2]][Symbol.iterator](); + var iterator = zipKeyed({ a: iter, b: ['a', 3], c: ['b', 4] }); + + testIterator( + iterator, + [ + { __proto__: null, a: ['a', 1], b: 'a', c: 'b' }, + { __proto__: null, a: ['b', 2], b: 3, c: 4 } + ], + s2t, + 'array iterator + array yields combined results' + ); + + s2t.end(); + }); + + st.test('observability in a replaced String iterator', function (s2t) { + var originalStringIterator = String.prototype[Symbol.iterator]; + var observedType; + s2t.teardown(mockProperty(String.prototype, Symbol.iterator, { + get: function () { + 'use strict'; // eslint-disable-line strict, lines-around-directive + + observedType = typeof this; + return originalStringIterator; + } + })); + + zipKeyed([from('')]); + s2t.equal(observedType, 'string', 'string primitive -> primitive receiver in Symbol.iterator getter'); + zipKeyed([from(Object(''))]); + s2t.equal(observedType, 'object', 'boxed string -> boxed string in Symbol.iterator getter'); + + s2t.end(); + }); + + st.test('262: mode option validation', function (s2t) { + // valid modes should not throw + s2t.doesNotThrow(function () { zipKeyed({ a: [1], b: [2] }); }, 'undefined mode is valid'); + s2t.doesNotThrow(function () { zipKeyed({ a: [1], b: [2] }, { mode: undefined }); }, 'explicit undefined mode is valid'); + s2t.doesNotThrow(function () { zipKeyed({ a: [1], b: [2] }, { mode: 'shortest' }); }, '"shortest" mode is valid'); + s2t.doesNotThrow(function () { zipKeyed({ a: [1], b: [2] }, { mode: 'longest' }); }, '"longest" mode is valid'); + s2t.doesNotThrow(function () { zipKeyed({ a: [1], b: [2] }, { mode: 'strict' }); }, '"strict" mode is valid'); + + // invalid modes should throw TypeError + s2t['throws'](function () { zipKeyed({ a: [1], b: [2] }, { mode: null }); }, TypeError, 'null mode throws TypeError'); + s2t['throws'](function () { zipKeyed({ a: [1], b: [2] }, { mode: false }); }, TypeError, 'false mode throws TypeError'); + s2t['throws'](function () { zipKeyed({ a: [1], b: [2] }, { mode: '' }); }, TypeError, 'empty string mode throws TypeError'); + s2t['throws'](function () { zipKeyed({ a: [1], b: [2] }, { mode: 'short' }); }, TypeError, '"short" mode throws TypeError'); + s2t['throws'](function () { zipKeyed({ a: [1], b: [2] }, { mode: 'long' }); }, TypeError, '"long" mode throws TypeError'); + s2t['throws'](function () { zipKeyed({ a: [1], b: [2] }, { mode: {} }); }, TypeError, 'object mode throws TypeError'); + + s2t.end(); + }); + + st.test('262: basic shortest mode', function (s2t) { + // shortest mode (default) stops at minimum length + var iter1 = zipKeyed({ a: [1, 2, 3], b: [4, 5] }); + var results1 = []; + var r; + while (!(r = iter1.next()).done) { + results1.push(r.value); + } + s2t.equal(results1.length, 2, 'shortest mode stops at shorter iterator'); + s2t.deepEqual(results1[0], { __proto__: null, a: 1, b: 4 }, 'first result'); + s2t.deepEqual(results1[1], { __proto__: null, a: 2, b: 5 }, 'second result'); + + s2t.end(); + }); + + st.test('262: basic longest mode', function (s2t) { + // longest mode continues with padding for exhausted iterators + var iter1 = zipKeyed({ a: [1, 2, 3], b: [4, 5] }, { mode: 'longest' }); + var result1 = iter1.next().value; + s2t.deepEqual(result1, { __proto__: null, a: 1, b: 4 }, 'first result has both keys'); + + var result2 = iter1.next().value; + s2t.deepEqual(result2, { __proto__: null, a: 2, b: 5 }, 'second result has both keys'); + + var result3 = iter1.next().value; + s2t.deepEqual(result3, { __proto__: null, a: 3, b: undefined }, 'third result has a with value and b with undefined'); + + var done = iter1.next(); + s2t.equal(done.done, true, 'iterator is done after third result'); + + s2t.end(); + }); + + st.test('262: basic strict mode', function (s2t) { + // strict mode throws when lengths differ + var strictIter = zipKeyed({ a: [1, 2, 3], b: [4, 5] }, { mode: 'strict' }); + strictIter.next(); // { a: 1, b: 4 } + strictIter.next(); // { a: 2, b: 5 } + s2t['throws'](function () { strictIter.next(); }, TypeError, 'strict mode throws when lengths differ'); + + s2t.end(); + }); + + st.test('262: symbol keys are used', function (s2t) { + var symbolA = Symbol('a'); + var iterables = {}; + iterables[symbolA] = ['value for symbol']; + iterables.b = ['value for b']; + + var iter = zipKeyed(iterables); + var result = iter.next().value; + + s2t.equal(Object.getPrototypeOf(result), null, 'result has null prototype'); + s2t.ok(Object.prototype.hasOwnProperty.call(result, symbolA), 'result has symbol key'); + s2t.ok(Object.prototype.hasOwnProperty.call(result, 'b'), 'result has string key'); + s2t.equal(result[symbolA], 'value for symbol', 'symbol key has correct value'); + s2t.equal(result.b, 'value for b', 'string key has correct value'); + + s2t.end(); + }); + + st.test('262: inherited properties are skipped', { skip: !hasPropertyDescriptors }, function (s2t) { + var parentAccessed = false; + var parent = {}; + Object.defineProperty(parent, 'inherited', { + get: function () { + parentAccessed = true; + throw new Error('inherited property should not be accessed'); + }, + enumerable: true, + configurable: true + }); + + var iterables = Object.create(parent); + iterables.own = ['own value']; + + var iter = zipKeyed(iterables); + var result = iter.next().value; + + s2t.equal(parentAccessed, false, 'inherited property getter not called'); + s2t.ok(Object.prototype.hasOwnProperty.call(result, 'own'), 'result has own key'); + s2t.notOk(Object.prototype.hasOwnProperty.call(result, 'inherited'), 'result does not have inherited key'); + s2t.equal(result.own, 'own value', 'own key has correct value'); + + s2t.end(); + }); + + st.test('262: non-enumerable properties are skipped', { skip: !hasPropertyDescriptors }, function (s2t) { + var iterables = {}; + Object.defineProperty(iterables, 'nonEnum', { + value: ['non-enum value'], + enumerable: false, + configurable: true + }); + iterables.enumerable = ['enum value']; + + var iter = zipKeyed(iterables); + var result = iter.next().value; + + s2t.notOk(Object.prototype.hasOwnProperty.call(result, 'nonEnum'), 'result does not have non-enumerable key'); + s2t.ok(Object.prototype.hasOwnProperty.call(result, 'enumerable'), 'result has enumerable key'); + + s2t.end(); + }); + + // Note: The "deleted properties" test is skipped as the current implementation + // doesn't handle dynamic property deletion during iteration correctly + + st.test('262: result object has null prototype', function (s2t) { + var iter = zipKeyed({ a: [1], b: [2] }); + var result = iter.next().value; + + s2t.equal(Object.getPrototypeOf(result), null, 'result has null prototype'); + + s2t.end(); + }); + + st.test('262: result object has default attributes', { skip: !hasPropertyDescriptors }, function (s2t) { + var iter = zipKeyed({ a: [1], b: [2] }); + var result = iter.next().value; + + var descA = Object.getOwnPropertyDescriptor(result, 'a'); + var descB = Object.getOwnPropertyDescriptor(result, 'b'); + + s2t.equal(descA.writable, true, 'property a is writable'); + s2t.equal(descA.enumerable, true, 'property a is enumerable'); + s2t.equal(descA.configurable, true, 'property a is configurable'); + + s2t.equal(descB.writable, true, 'property b is writable'); + s2t.equal(descB.enumerable, true, 'property b is enumerable'); + s2t.equal(descB.configurable, true, 'property b is configurable'); + + s2t.end(); + }); + + st.test('262: result is iterator', function (s2t) { + var zipKeyedIter = zipKeyed({ a: [1, 2], b: [3, 4] }); + s2t.equal(typeof zipKeyedIter.next, 'function', 'has next method'); + s2t.equal(typeof zipKeyedIter[Symbol.iterator], 'function', 'has Symbol.iterator method'); + s2t.equal(zipKeyedIter[Symbol.iterator](), zipKeyedIter, 'Symbol.iterator returns itself'); + + s2t.end(); + }); + + st.test('262: return closes all underlying iterators', function (s2t) { + var returnACalls = 0; + var returnBCalls = 0; + + var iterA = { + next: function () { return { done: false, value: 1 }; }, + 'return': function () { + returnACalls += 1; + return { done: true, value: undefined }; + } + }; + iterA[Symbol.iterator] = function () { return iterA; }; + + var iterB = { + next: function () { return { done: false, value: 2 }; }, + 'return': function () { + returnBCalls += 1; + return { done: true, value: undefined }; + } + }; + iterB[Symbol.iterator] = function () { return iterB; }; + + var zkIter = zipKeyed({ a: iterA, b: iterB }); + zkIter.next(); + s2t.equal(returnACalls, 0, 'return not called on iterA before calling return()'); + s2t.equal(returnBCalls, 0, 'return not called on iterB before calling return()'); + + zkIter['return'](); + s2t.equal(returnACalls, 1, 'iterA.return called once'); + s2t.equal(returnBCalls, 1, 'iterB.return called once'); + + s2t.end(); + }); + + st.end(); + }); + }, + index: function () { + test('Iterator.zipKeyed: index', function (t) { + module.exports.tests(index, 'Iterator.zipKeyed', t); + + t.end(); + }); + }, + implementation: function () { + test('Iterator.zipKeyed: implementation', function (t) { + module.exports.tests(impl, 'Iterator.zipKeyed', t); + + t.end(); + }); + }, + shimmed: function () { + test('Iterator.zipKeyed: shimmed', function (t) { + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Iterator.zipKeyed.name, 'zipKeyed', 'Iterator.zipKeyed has name "zipKeyed"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Iterator, 'zipKeyed'), 'Iterator.zipKeyed is not enumerable'); + et.end(); + }); + + module.exports.tests(callBind(Iterator.zipKeyed, Iterator), 'Iterator.zipKeyed', t); + + t.end(); + }); + } +}; diff --git a/node_modules/es-iterator-helpers/test/helpers/testIterator.js b/node_modules/es-iterator-helpers/test/helpers/testIterator.js new file mode 100644 index 0000000000000000000000000000000000000000..65051b40b9c95582d4b48c913a09edab281fee02 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/helpers/testIterator.js @@ -0,0 +1,7 @@ +'use strict'; + +var iterate = require('iterate-iterator'); + +module.exports = function testIterator(iterator, expected, t, msg) { + t.deepEqual(iterate(iterator), expected, 'iterator yields expected values: ' + msg); +}; diff --git a/node_modules/es-iterator-helpers/test/implementation.js b/node_modules/es-iterator-helpers/test/implementation.js new file mode 100644 index 0000000000000000000000000000000000000000..d036435ac6c8498eb0e1a417a0d5d1160369f04e --- /dev/null +++ b/node_modules/es-iterator-helpers/test/implementation.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); +var forEach = require('for-each'); + +var shims = require('..'); + +forEach(shims, function (shim) { + var shimTests; + try { + shimTests = require('./' + shim); // eslint-disable-line global-require, import/no-dynamic-require + } catch (e) { + test(shim + ': implementation', { todo: true }); + } + if (shimTests) { + shimTests.implementation(); + } +}); diff --git a/node_modules/es-iterator-helpers/test/index.js b/node_modules/es-iterator-helpers/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3cfefe649d63e598215d5223f5187f517bd063f4 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/index.js @@ -0,0 +1,20 @@ +'use strict'; + +var test = require('tape'); +var forEach = require('for-each'); + +var shims = require('..'); + +forEach(shims, function (shim) { + var shimTests; + try { + shimTests = require('./' + shim); // eslint-disable-line global-require, import/no-dynamic-require + } catch (e) { + console.error(e); + test(shim + ': index', { todo: true }); + } + if (shimTests) { + shimTests.index(); + } +}); + diff --git a/node_modules/es-iterator-helpers/test/shimmed.js b/node_modules/es-iterator-helpers/test/shimmed.js new file mode 100644 index 0000000000000000000000000000000000000000..4c6e06776f12de225a6a85d9c2cb96b9a6d37ce3 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/shimmed.js @@ -0,0 +1,70 @@ +'use strict'; + +require('../auto'); + +var test = require('tape'); +var forEach = require('for-each'); + +var shims = require('..'); + +forEach(shims, function (shim) { + var shimTests; + try { + shimTests = require('./' + shim); // eslint-disable-line global-require, import/no-dynamic-require + } catch (e) { + test(shim + ': shimmed', { todo: true }); + } + if (shimTests) { + shimTests.shimmed(); + } +}); + +test('integration', function (t) { + var seenMapEveryMap = []; + var seenMapEveryEvery = []; + var mapEveryResult = Iterator.from([1, 2, 3, 4, 5]).map(function (x) { + seenMapEveryMap.push(x); + return x * x; + }).every(function (x) { + seenMapEveryEvery.push(x); + return x < 10; + }); + t.equal(mapEveryResult, false, 'map + every: every predicate returned false nonzero times'); + t.deepEqual(seenMapEveryMap, [1, 2, 3, 4], 'map + every, map: all values are seen until after the first one that is > 10 when squared'); + t.deepEqual(seenMapEveryEvery, [1, 4, 9, 16], 'map + every, every: all values are seen until after the first one that is > 10 when squared'); + + var seenMapSomeMap = []; + var seenMapSomeSome = []; + var mapSomeResult = Iterator.from([1, 2, 3, 4, 5]).map(function (x) { + seenMapSomeMap.push(x); + return x * x; + }).some(function (x) { + seenMapSomeSome.push(x); + return x > 10; + }); + t.equal(mapSomeResult, true, 'map + some: some predicate returned true nonzero times'); + t.deepEqual(seenMapSomeMap, [1, 2, 3, 4], 'map + some, map: all values are seen until after the first one that is > 10 when squared'); + t.deepEqual(seenMapSomeSome, [1, 4, 9, 16], 'map + some, some: all values are seen until after the first one that is > 10 when squared'); + + var seenMapFind = []; + var mapFindResult = Iterator.from([1, 2, 3, 4, 5]).map(function (x) { + seenMapFind.push(x); + return x * x; + }).find(function (x) { + return x > 10; + }); + t.equal(mapFindResult, 16, 'map + find: find found the first mapped value over 10'); + t.deepEqual(seenMapFind, [1, 2, 3, 4], 'map + find: all values are seen until after the first one that is > 10 when squared'); + + var seenFilterEvery = []; + var filterEveryResult = Iterator.from([1, 2, 3, 4, 5]).filter(function (x) { + seenFilterEvery.push(x); + return x; + }).every(function (x) { + return x <= 3; + }); + t.equal(filterEveryResult, false, 'filter + every: every predicate returned false nonzero times'); + t.deepEqual(seenMapFind, [1, 2, 3, 4], 'filter + every: all values are seen until after the first one that is > 10 when squared'); + + t.end(); +}); diff --git a/node_modules/es-iterator-helpers/test/tests.js b/node_modules/es-iterator-helpers/test/tests.js new file mode 100644 index 0000000000000000000000000000000000000000..7949f54d1dedd7e9e04582b4cc6b4abc7bb608a2 --- /dev/null +++ b/node_modules/es-iterator-helpers/test/tests.js @@ -0,0 +1,25 @@ +'use strict'; + +var data = { + anchor: { arg: 'bar"baz"', expected: 'foo' }, + big: 'foo', + blink: 'foo', + bold: 'foo', + fixed: 'foo', + fontcolor: { arg: 'blue"red"green', expected: 'foo' }, + fontsize: { arg: '10"large"small', expected: 'foo' }, + italics: 'foo', + link: { arg: 'url"http://"', expected: 'foo' }, + small: 'foo', + strike: 'foo', + sub: 'foo', + sup: 'foo' +}; + +module.exports = function (method, name, t) { + var result = data[name] || {}; + var expected = typeof result === 'string' ? result : result.expected; + var actual = typeof result === 'string' ? method('foo') : method('foo', result.arg); + + t.equal(actual, expected, name + ': got expected result'); +}; diff --git a/node_modules/es-module-lexer/LICENSE b/node_modules/es-module-lexer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c795a2775f8af8064b6b7554460f1b5ebeb41fc7 --- /dev/null +++ b/node_modules/es-module-lexer/LICENSE @@ -0,0 +1,10 @@ +MIT License +----------- + +Copyright (C) 2018-2022 Guy Bedford + +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/node_modules/es-module-lexer/README.md b/node_modules/es-module-lexer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..310f4ee6602af9e33fea008eed99b71dbb368b63 --- /dev/null +++ b/node_modules/es-module-lexer/README.md @@ -0,0 +1,338 @@ +# ES Module Lexer + +[![Build Status][actions-image]][actions-url] + +A JS module syntax lexer used in [es-module-shims](https://github.com/guybedford/es-module-shims). + +Outputs the list of exports and locations of import specifiers, including dynamic import and import meta handling. + +Supports new syntax features including import attributes and source phase imports. + +A very small single JS file (4KiB gzipped) that includes inlined Web Assembly for very fast source analysis of ECMAScript module syntax only. + +For an example of the performance, Angular 1 (720KiB) is fully parsed in 5ms, in comparison to the fastest JS parser, Acorn which takes over 100ms. + +_Comprehensively handles the JS language grammar while remaining small and fast. - ~10ms per MB of JS cold and ~5ms per MB of JS warm, [see benchmarks](#benchmarks) for more info._ + +> [Built with](https://github.com/guybedford/es-module-lexer/blob/main/chompfile.toml) [Chomp](https://chompbuild.com/) + +### Usage + +``` +npm install es-module-lexer +``` + +See [src/lexer.ts](src/lexer.ts) for the type definitions. + +For use in CommonJS: + +```js +const { init, parse } = require('es-module-lexer'); + +(async () => { + // either await init, or call parse asynchronously + // this is necessary for the Web Assembly boot + await init; + + const source = 'export var p = 5'; + const [imports, exports] = parse(source); + + // Returns "p" + source.slice(exports[0].s, exports[0].e); + // Returns "p" + source.slice(exports[0].ls, exports[0].le); +})(); +``` + +An ES module version is also available: + +```js +import { init, parse } from 'es-module-lexer'; + +(async () => { + await init; + + const source = ` + import { name } from 'mod\\u1011'; + import json from './json.json' assert { type: 'json' } + export var p = 5; + export function q () { + + }; + export { x as 'external name' } from 'external'; + + // Comments provided to demonstrate edge cases + import /*comment!*/ ( 'asdf', { assert: { type: 'json' }}); + import /*comment!*/.meta.asdf; + + // Source phase imports: + import source mod from './mod.wasm'; + import.source('./mod.wasm'); + `; + + const [imports, exports] = parse(source, 'optional-sourcename'); + + // Returns "modထ" + imports[0].n + // Returns "mod\u1011" + source.slice(imports[0].s, imports[0].e); + // "s" = start + // "e" = end + + // Returns "import { name } from 'mod'" + source.slice(imports[0].ss, imports[0].se); + // "ss" = statement start + // "se" = statement end + + // Returns "{ type: 'json' }" + source.slice(imports[1].a, imports[1].se); + // "a" = assert, -1 for no assertion + + // Returns "external" + source.slice(imports[2].s, imports[2].e); + + // Returns "p" + source.slice(exports[0].s, exports[0].e); + // Returns "p" + source.slice(exports[0].ls, exports[0].le); + // Returns "q" + source.slice(exports[1].s, exports[1].e); + // Returns "q" + source.slice(exports[1].ls, exports[1].le); + // Returns "'external name'" + source.slice(exports[2].s, exports[2].e); + // Returns -1 + exports[2].ls; + // Returns -1 + exports[2].le; + + // Import type is provided by `t` value + // (1 for static, 2, for dynamic) + // Returns true + imports[2].t == 2; + + // Returns "asdf" (only for string literal dynamic imports) + imports[2].n + // Returns "import /*comment!*/ ( 'asdf', { assert: { type: 'json' } })" + source.slice(imports[3].ss, imports[3].se); + // Returns "'asdf'" + source.slice(imports[3].s, imports[3].e); + // Returns "( 'asdf', { assert: { type: 'json' } })" + source.slice(imports[3].d, imports[3].se); + // Returns "{ assert: { type: 'json' } }" + source.slice(imports[3].a, imports[3].se - 1); + + // For non-string dynamic import expressions: + // - n will be undefined + // - a is currently -1 even if there is an assertion + // - e is currently the character before the closing ) + + // For nested dynamic imports, the se value of the outer import is -1 as end tracking does not + // currently support nested dynamic immports + + // import.meta is indicated by imports[3].d === -2 + // Returns true + imports[4].d === -2; + // Returns "import /*comment!*/.meta" + source.slice(imports[4].s, imports[4].e); + // ss and se are the same for import meta + + // Returns "'./mod.wasm'" + source.slice(imports[5].s, imports[5].e); + + // Import type 4 and 5 for static and dynamic source phase + imports[5].t === 4; + imports[6].t === 5; +})(); +``` + +### CSP asm.js Build + +The default version of the library uses Wasm and (safe) eval usage for performance and a minimal footprint. + +Neither of these represent security escalation possibilities since there are no execution string injection vectors, but that can still violate existing CSP policies for applications. + +For a version that works with CSP eval disabled, use the `es-module-lexer/js` build: + +```js +import { parse } from 'es-module-lexer/js'; +``` + +Instead of Web Assembly, this uses an asm.js build which is almost as fast as the Wasm version ([see benchmarks below](#benchmarks)). + +### Escape Sequences + +To handle escape sequences in specifier strings, the `.n` field of imported specifiers will be provided where possible. + +For dynamic import expressions, this field will be empty if not a valid JS string. + +### Facade Detection + +Facade modules that only use import / export syntax can be detected via the third return value: + +```js +const [,, facade] = parse(` + export * from 'external'; + import * as ns from 'external2'; + export { a as b } from 'external3'; + export { ns }; +`); +facade === true; +``` + +### ESM Detection + +Modules that uses ESM syntaxes can be detected via the fourth return value: + +```js +const [,,, hasModuleSyntax] = parse(` + export {} +`); +hasModuleSyntax === true; +``` + +Dynamic imports are ignored since they can be used in Non-ESM files. + +```js +const [,,, hasModuleSyntax] = parse(` + import('./foo.js') +`); +hasModuleSyntax === false; +``` + +### Environment Support + +Node.js 10+, and [all browsers with Web Assembly support](https://caniuse.com/#feat=wasm). + +### Grammar Support + +* Token state parses all line comments, block comments, strings, template strings, blocks, parens and punctuators. +* Division operator / regex token ambiguity is handled via backtracking checks against punctuator prefixes, including closing brace or paren backtracking. +* Always correctly parses valid JS source, but may parse invalid JS source without errors. + +### Limitations + +The lexing approach is designed to deal with the full language grammar including RegEx / division operator ambiguity through backtracking and paren / brace tracking. + +The only limitation to the reduced parser is that the "exports" list may not correctly gather all export identifiers in the following edge cases: + +```js +// Only "a" is detected as an export, "q" isn't +export var a = 'asdf', q = z; + +// "b" is not detected as an export +export var { a: b } = asdf; +``` + +The above cases are handled gracefully in that the lexer will keep going fine, it will just not properly detect the export names above. + +### Benchmarks + +Benchmarks can be run with `npm run bench`. + +Current results for a high spec machine: + +#### Wasm Build + +``` +Module load time +> 5ms +Cold Run, All Samples +test/samples/*.js (3123 KiB) +> 18ms + +Warm Runs (average of 25 runs) +test/samples/angular.js (739 KiB) +> 3ms +test/samples/angular.min.js (188 KiB) +> 1ms +test/samples/d3.js (508 KiB) +> 3ms +test/samples/d3.min.js (274 KiB) +> 2ms +test/samples/magic-string.js (35 KiB) +> 0ms +test/samples/magic-string.min.js (20 KiB) +> 0ms +test/samples/rollup.js (929 KiB) +> 4.32ms +test/samples/rollup.min.js (429 KiB) +> 2.16ms + +Warm Runs, All Samples (average of 25 runs) +test/samples/*.js (3123 KiB) +> 14.16ms +``` + +#### JS Build (asm.js) + +``` +Module load time +> 2ms +Cold Run, All Samples +test/samples/*.js (3123 KiB) +> 34ms + +Warm Runs (average of 25 runs) +test/samples/angular.js (739 KiB) +> 3ms +test/samples/angular.min.js (188 KiB) +> 1ms +test/samples/d3.js (508 KiB) +> 3ms +test/samples/d3.min.js (274 KiB) +> 2ms +test/samples/magic-string.js (35 KiB) +> 0ms +test/samples/magic-string.min.js (20 KiB) +> 0ms +test/samples/rollup.js (929 KiB) +> 5ms +test/samples/rollup.min.js (429 KiB) +> 3.04ms + +Warm Runs, All Samples (average of 25 runs) +test/samples/*.js (3123 KiB) +> 17.12ms +``` + +### Building + +This project uses [Chomp](https://chompbuild.com) for building. + +With Chomp installed, download the WASI SDK 12.0 from https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-12. + +- [Linux](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz) +- [Windows (MinGW)](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-mingw.tar.gz) +- [macOS](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz) + +Locate the WASI-SDK as a sibling folder, or customize the path via the `WASI_PATH` environment variable. + +Emscripten emsdk is also assumed to be a sibling folder or via the `EMSDK_PATH` environment variable. + +Example setup: + +``` +git clone https://github.com:guybedford/es-module-lexer +git clone https://github.com/emscripten-core/emsdk +cd emsdk +git checkout 1.40.1-fastcomp +./emsdk install 1.40.1-fastcomp +cd .. +wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz +gunzip wasi-sdk-12.0-linux.tar.gz +tar -xf wasi-sdk-12.0-linux.tar +mv wasi-sdk-12.0-linux.tar wasi-sdk-12.0 +cargo install chompbuild +cd es-module-lexer +chomp test +``` + +For the `asm.js` build, git clone `emsdk` from is assumed to be a sibling folder as well. + +### License + +MIT + +[actions-image]: https://github.com/guybedford/es-module-lexer/actions/workflows/build.yml/badge.svg +[actions-url]: https://github.com/guybedford/es-module-lexer/actions/workflows/build.yml diff --git a/node_modules/es-module-lexer/dist/lexer.asm.js b/node_modules/es-module-lexer/dist/lexer.asm.js new file mode 100644 index 0000000000000000000000000000000000000000..d64300da749eb90e3308ba88951dc6ad69b32d5e --- /dev/null +++ b/node_modules/es-module-lexer/dist/lexer.asm.js @@ -0,0 +1,2 @@ +/* es-module-lexer 1.7.0 */ +let e,a,r,i=2<<19;const s=1===new Uint8Array(new Uint16Array([1]).buffer)[0]?function(e,a){const r=e.length;let i=0;for(;i>>8}},f="xportmportlassforetaourceeferromsyncunctionssertvoyiedelecontininstantybreareturdebuggeawaithrwhileifcatcfinallels";let t,c,n;export function parse(k,l="@"){t=k,c=l;const u=2*t.length+(2<<18);if(u>i||!e){for(;u>i;)i*=2;a=new ArrayBuffer(i),s(f,new Uint16Array(a,16,114)),e=function(e,a,r){"use asm";var i=new e.Int8Array(r),s=new e.Int16Array(r),f=new e.Int32Array(r),t=new e.Uint8Array(r),c=new e.Uint16Array(r),n=1040;function b(){var e=0,a=0,r=0,t=0,c=0,b=0,u=0;u=n;n=n+10240|0;i[812]=1;i[811]=0;s[403]=0;s[404]=0;f[71]=f[2];i[813]=0;f[70]=0;i[810]=0;f[72]=u+2048;f[73]=u;i[814]=0;e=(f[3]|0)+-2|0;f[74]=e;a=e+(f[68]<<1)|0;f[75]=a;e:while(1){r=e+2|0;f[74]=r;if(e>>>0>=a>>>0){t=18;break}a:do{switch(s[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((s[404]|0)==0?H(r)|0:0)?(m(e+4|0,16,10)|0)==0:0)?(k(),(i[812]|0)==0):0){t=9;break e}else t=17;break}case 105:{if(H(r)|0?(m(e+4|0,26,10)|0)==0:0){l();t=17}else t=17;break}case 59:{t=17;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{t=16;break e}}default:{t=16;break e}}}while(0);if((t|0)==17){t=0;f[71]=f[74]}e=f[74]|0;a=f[75]|0}if((t|0)==9){e=f[74]|0;f[71]=e;t=19}else if((t|0)==16){i[812]=0;f[74]=e;t=19}else if((t|0)==18)if(!(i[810]|0)){e=r;t=19}else e=0;do{if((t|0)==19){e:while(1){a=e+2|0;f[74]=a;if(e>>>0>=(f[75]|0)>>>0){t=92;break}a:do{switch(s[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[404]|0)==0?H(a)|0:0)?(m(e+4|0,16,10)|0)==0:0){k();t=91}else t=91;break}case 105:{if(H(a)|0?(m(e+4|0,26,10)|0)==0:0){l();t=91}else t=91;break}case 99:{if((H(a)|0?(m(e+4|0,36,8)|0)==0:0)?V(s[e+12>>1]|0)|0:0){i[814]=1;t=91}else t=91;break}case 40:{r=f[72]|0;e=s[404]|0;t=e&65535;f[r+(t<<3)>>2]=1;a=f[71]|0;s[404]=e+1<<16>>16;f[r+(t<<3)+4>>2]=a;t=91;break}case 41:{a=s[404]|0;if(!(a<<16>>16)){t=36;break e}r=a+-1<<16>>16;s[404]=r;t=s[403]|0;a=t&65535;if(t<<16>>16!=0?(f[(f[72]|0)+((r&65535)<<3)>>2]|0)==5:0){a=f[(f[73]|0)+(a+-1<<2)>>2]|0;r=a+4|0;if(!(f[r>>2]|0))f[r>>2]=(f[71]|0)+2;f[a+12>>2]=e+4;s[403]=t+-1<<16>>16;t=91}else t=91;break}case 123:{t=f[71]|0;r=f[65]|0;e=t;do{if((s[t>>1]|0)==41&(r|0)!=0?(f[r+4>>2]|0)==(t|0):0){a=f[66]|0;f[65]=a;if(!a){f[61]=0;break}else{f[a+32>>2]=0;break}}}while(0);r=f[72]|0;a=s[404]|0;t=a&65535;f[r+(t<<3)>>2]=(i[814]|0)==0?2:6;s[404]=a+1<<16>>16;f[r+(t<<3)+4>>2]=e;i[814]=0;t=91;break}case 125:{e=s[404]|0;if(!(e<<16>>16)){t=49;break e}r=f[72]|0;t=e+-1<<16>>16;s[404]=t;if((f[r+((t&65535)<<3)>>2]|0)==4){h();t=91}else t=91;break}case 39:{v(39);t=91;break}case 34:{v(34);t=91;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{e=f[71]|0;a=s[e>>1]|0;r:do{if(!(U(a)|0))if(a<<16>>16==41){r=s[404]|0;if(!(D(f[(f[72]|0)+((r&65535)<<3)+4>>2]|0)|0))t=65}else t=64;else switch(a<<16>>16){case 46:if(((s[e+-2>>1]|0)+-48&65535)<10){t=64;break r}else break r;case 43:if((s[e+-2>>1]|0)==43){t=64;break r}else break r;case 45:if((s[e+-2>>1]|0)==45){t=64;break r}else break r;default:break r}}while(0);if((t|0)==64){r=s[404]|0;t=65}r:do{if((t|0)==65){t=0;if(r<<16>>16!=0?(c=f[72]|0,b=(r&65535)+-1|0,a<<16>>16==102?(f[c+(b<<3)>>2]|0)==1:0):0){if((s[e+-2>>1]|0)==111?$(f[c+(b<<3)+4>>2]|0,44,3)|0:0)break}else t=69;if((t|0)==69?(0,a<<16>>16==125):0){t=f[72]|0;r=r&65535;if(p(f[t+(r<<3)+4>>2]|0)|0)break;if((f[t+(r<<3)>>2]|0)==6)break}if(!(o(e)|0)){switch(a<<16>>16){case 0:break r;case 47:{if(i[813]|0)break r;break}default:{}}t=f[67]|0;if((t|0?e>>>0>=(f[t>>2]|0)>>>0:0)?e>>>0<=(f[t+4>>2]|0)>>>0:0){g();i[813]=0;t=91;break a}r=f[3]|0;do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[71]=e;a=s[e>>1]|0}while(!(E(a)|0));if(F(a)|0){do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[71]=e}while(F(s[e>>1]|0)|0);if(j(e)|0){g();i[813]=0;t=91;break a}}i[813]=1;t=91;break a}}}while(0);g();i[813]=0;t=91;break a}}case 96:{r=f[72]|0;a=s[404]|0;t=a&65535;f[r+(t<<3)+4>>2]=f[71];s[404]=a+1<<16>>16;f[r+(t<<3)>>2]=3;h();t=91;break}default:t=91}}while(0);if((t|0)==91){t=0;f[71]=f[74]}e=f[74]|0}if((t|0)==36){T();e=0;break}else if((t|0)==49){T();e=0;break}else if((t|0)==92){e=(i[810]|0)==0?(s[403]|s[404])<<16>>16==0:0;break}}}while(0);n=u;return e|0}function k(){var e=0,a=0,r=0,t=0,c=0,n=0,b=0,k=0,l=0,o=0,h=0,d=0,C=0,g=0;k=f[74]|0;l=f[67]|0;g=k+12|0;f[74]=g;r=w(1)|0;e=f[74]|0;if(!((e|0)==(g|0)?!(I(r)|0):0))C=3;e:do{if((C|0)==3){a:do{switch(r<<16>>16){case 123:{f[74]=e+2;e=w(1)|0;a=f[74]|0;while(1){if(W(e)|0){v(e);e=(f[74]|0)+2|0;f[74]=e}else{q(e)|0;e=f[74]|0}w(1)|0;e=A(a,e)|0;if(e<<16>>16==44){f[74]=(f[74]|0)+2;e=w(1)|0}if(e<<16>>16==125){C=15;break}g=a;a=f[74]|0;if((a|0)==(g|0)){C=12;break}if(a>>>0>(f[75]|0)>>>0){C=14;break}}if((C|0)==12){T();break e}else if((C|0)==14){T();break e}else if((C|0)==15){i[811]=1;f[74]=(f[74]|0)+2;break a}break}case 42:{f[74]=e+2;w(1)|0;g=f[74]|0;A(g,g)|0;break}default:{i[812]=0;switch(r<<16>>16){case 100:{k=e+14|0;f[74]=k;switch((w(1)|0)<<16>>16){case 97:{a=f[74]|0;if((m(a+2|0,80,8)|0)==0?(c=a+10|0,F(s[c>>1]|0)|0):0){f[74]=c;w(0)|0;C=22}break}case 102:{C=22;break}case 99:{a=f[74]|0;if(((m(a+2|0,36,8)|0)==0?(t=a+10|0,g=s[t>>1]|0,V(g)|0|g<<16>>16==123):0)?(f[74]=t,n=w(1)|0,n<<16>>16!=123):0){d=n;C=31}break}default:{}}r:do{if((C|0)==22?(b=f[74]|0,(m(b+2|0,88,14)|0)==0):0){r=b+16|0;a=s[r>>1]|0;if(!(V(a)|0))switch(a<<16>>16){case 40:case 42:break;default:break r}f[74]=r;a=w(1)|0;if(a<<16>>16==42){f[74]=(f[74]|0)+2;a=w(1)|0}if(a<<16>>16!=40){d=a;C=31}}}while(0);if((C|0)==31?(o=f[74]|0,q(d)|0,h=f[74]|0,h>>>0>o>>>0):0){O(e,k,o,h);f[74]=(f[74]|0)+-2;break e}O(e,k,0,0);f[74]=e+12;break e}case 97:{f[74]=e+10;w(0)|0;e=f[74]|0;C=35;break}case 102:{C=35;break}case 99:{if((m(e+2|0,36,8)|0)==0?(a=e+10|0,E(s[a>>1]|0)|0):0){f[74]=a;g=w(1)|0;C=f[74]|0;q(g)|0;g=f[74]|0;O(C,g,C,g);f[74]=(f[74]|0)+-2;break e}e=e+4|0;f[74]=e;break}case 108:case 118:break;default:break e}if((C|0)==35){f[74]=e+16;e=w(1)|0;if(e<<16>>16==42){f[74]=(f[74]|0)+2;e=w(1)|0}C=f[74]|0;q(e)|0;g=f[74]|0;O(C,g,C,g);f[74]=(f[74]|0)+-2;break e}f[74]=e+6;i[812]=0;r=w(1)|0;e=f[74]|0;r=(q(r)|0|32)<<16>>16==123;t=f[74]|0;if(r){f[74]=t+2;g=w(1)|0;e=f[74]|0;q(g)|0}r:while(1){a=f[74]|0;if((a|0)==(e|0))break;O(e,a,e,a);a=w(1)|0;if(r)switch(a<<16>>16){case 93:case 125:break e;default:{}}e=f[74]|0;if(a<<16>>16!=44){C=51;break}f[74]=e+2;a=w(1)|0;e=f[74]|0;switch(a<<16>>16){case 91:case 123:{C=51;break r}default:{}}q(a)|0}if((C|0)==51)f[74]=e+-2;if(!r)break e;f[74]=t+-2;break e}}}while(0);g=(w(1)|0)<<16>>16==102;e=f[74]|0;if(g?(m(e+2|0,74,6)|0)==0:0){f[74]=e+8;u(k,w(1)|0,0);e=(l|0)==0?248:l+16|0;while(1){e=f[e>>2]|0;if(!e)break e;f[e+12>>2]=0;f[e+8>>2]=0;e=e+16|0}}f[74]=e+-2}}while(0);return}function l(){var e=0,a=0,r=0,t=0,c=0,n=0,b=0;b=f[74]|0;c=b+12|0;f[74]=c;e=w(1)|0;t=f[74]|0;e:do{if(e<<16>>16!=46){if(!(e<<16>>16==115&t>>>0>c>>>0)){if(!(e<<16>>16==100&t>>>0>(b+10|0)>>>0)){t=0;n=28;break}if(m(t+2|0,66,8)|0){a=t;e=100;t=0;n=59;break}e=t+10|0;if(!(V(s[e>>1]|0)|0)){a=t;e=100;t=0;n=59;break}f[74]=e;e=w(1)|0;if(e<<16>>16==42){e=42;t=2;n=61;break}f[74]=t;t=0;n=28;break}if((m(t+2|0,56,10)|0)==0?(r=t+12|0,V(s[r>>1]|0)|0):0){f[74]=r;e=w(1)|0;a=f[74]|0;if((a|0)!=(r|0)){if(e<<16>>16!=102){t=1;n=28;break}if(m(a+2|0,74,6)|0){e=102;t=1;n=59;break}if(!(E(s[a+8>>1]|0)|0)){e=102;t=1;n=59;break}}f[74]=t;t=0;n=28}else{a=t;e=115;t=0;n=59}}else{f[74]=t+2;switch((w(1)|0)<<16>>16){case 109:{e=f[74]|0;if(m(e+2|0,50,6)|0)break e;a=f[71]|0;if(!(G(a)|0)?(s[a>>1]|0)==46:0)break e;d(b,b,e+8|0,2);break e}case 115:{e=f[74]|0;if(m(e+2|0,56,10)|0)break e;a=f[71]|0;if(!(G(a)|0)?(s[a>>1]|0)==46:0)break e;f[74]=e+12;e=w(1)|0;t=1;n=28;break e}case 100:{e=f[74]|0;if(m(e+2|0,66,8)|0)break e;a=f[71]|0;if(!(G(a)|0)?(s[a>>1]|0)==46:0)break e;f[74]=e+10;e=w(1)|0;t=2;n=28;break e}default:break e}}}while(0);e:do{if((n|0)==28){if(e<<16>>16==40){r=f[72]|0;a=s[404]|0;c=a&65535;f[r+(c<<3)>>2]=5;e=f[74]|0;s[404]=a+1<<16>>16;f[r+(c<<3)+4>>2]=e;if((s[f[71]>>1]|0)==46)break;f[74]=e+2;a=w(1)|0;d(b,f[74]|0,0,e);if(!t)e=f[65]|0;else{e=f[65]|0;f[e+28>>2]=(t|0)==1?5:7}c=f[73]|0;b=s[403]|0;s[403]=b+1<<16>>16;f[c+((b&65535)<<2)>>2]=e;switch(a<<16>>16){case 39:{v(39);break}case 34:{v(34);break}default:{f[74]=(f[74]|0)+-2;break e}}e=(f[74]|0)+2|0;f[74]=e;switch((w(1)|0)<<16>>16){case 44:{f[74]=(f[74]|0)+2;w(1)|0;c=f[65]|0;f[c+4>>2]=e;b=f[74]|0;f[c+16>>2]=b;i[c+24>>0]=1;f[74]=b+-2;break e}case 41:{s[404]=(s[404]|0)+-1<<16>>16;b=f[65]|0;f[b+4>>2]=e;f[b+12>>2]=(f[74]|0)+2;i[b+24>>0]=1;s[403]=(s[403]|0)+-1<<16>>16;break e}default:{f[74]=(f[74]|0)+-2;break e}}}if(!((t|0)==0&e<<16>>16==123)){switch(e<<16>>16){case 42:case 39:case 34:{n=61;break e}default:{}}a=f[74]|0;n=59;break}e=f[74]|0;if(s[404]|0){f[74]=e+-2;break}while(1){if(e>>>0>=(f[75]|0)>>>0)break;e=w(1)|0;if(!(W(e)|0)){if(e<<16>>16==125){n=49;break}}else v(e);e=(f[74]|0)+2|0;f[74]=e}if((n|0)==49)f[74]=(f[74]|0)+2;c=(w(1)|0)<<16>>16==102;e=f[74]|0;if(c?m(e+2|0,74,6)|0:0){T();break}f[74]=e+8;e=w(1)|0;if(W(e)|0){u(b,e,0);break}else{T();break}}}while(0);if((n|0)==59)if((a|0)==(c|0))f[74]=b+10;else n=61;do{if((n|0)==61){if(!((e<<16>>16==42|(t|0)!=2)&(s[404]|0)==0)){f[74]=(f[74]|0)+-2;break}e=f[75]|0;a=f[74]|0;while(1){if(a>>>0>=e>>>0){n=68;break}r=s[a>>1]|0;if(W(r)|0){n=66;break}n=a+2|0;f[74]=n;a=n}if((n|0)==66){u(b,r,t);break}else if((n|0)==68){T();break}}}while(0);return}function u(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,t=0;i=(f[74]|0)+2|0;switch(a<<16>>16){case 39:{v(39);t=5;break}case 34:{v(34);t=5;break}default:T()}do{if((t|0)==5){d(e,i,f[74]|0,1);if((r|0)>0)f[(f[65]|0)+28>>2]=(r|0)==1?4:6;f[74]=(f[74]|0)+2;a=w(0)|0;r=a<<16>>16==97;if(r){i=f[74]|0;if(m(i+2|0,102,10)|0)t=13}else{i=f[74]|0;if(!(((a<<16>>16==119?(s[i+2>>1]|0)==105:0)?(s[i+4>>1]|0)==116:0)?(s[i+6>>1]|0)==104:0))t=13}if((t|0)==13){f[74]=i+-2;break}f[74]=i+((r?6:4)<<1);if((w(1)|0)<<16>>16!=123){f[74]=i;break}r=f[74]|0;a=r;e:while(1){f[74]=a+2;a=w(1)|0;switch(a<<16>>16){case 39:{v(39);f[74]=(f[74]|0)+2;a=w(1)|0;break}case 34:{v(34);f[74]=(f[74]|0)+2;a=w(1)|0;break}default:a=q(a)|0}if(a<<16>>16!=58){t=22;break}f[74]=(f[74]|0)+2;switch((w(1)|0)<<16>>16){case 39:{v(39);break}case 34:{v(34);break}default:{t=26;break e}}f[74]=(f[74]|0)+2;switch((w(1)|0)<<16>>16){case 125:{t=31;break e}case 44:break;default:{t=30;break e}}f[74]=(f[74]|0)+2;if((w(1)|0)<<16>>16==125){t=31;break}a=f[74]|0}if((t|0)==22){f[74]=i;break}else if((t|0)==26){f[74]=i;break}else if((t|0)==30){f[74]=i;break}else if((t|0)==31){t=f[65]|0;f[t+16>>2]=r;f[t+12>>2]=(f[74]|0)+2;break}}}while(0);return}function o(e){e=e|0;e:do{switch(s[e>>1]|0){case 100:switch(s[e+-2>>1]|0){case 105:{e=$(e+-4|0,112,2)|0;break e}case 108:{e=$(e+-4|0,116,3)|0;break e}default:{e=0;break e}}case 101:switch(s[e+-2>>1]|0){case 115:switch(s[e+-4>>1]|0){case 108:{e=B(e+-6|0,101)|0;break e}case 97:{e=B(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=$(e+-4|0,122,4)|0;break e}case 117:{e=$(e+-4|0,130,6)|0;break e}default:{e=0;break e}}case 102:{if((s[e+-2>>1]|0)==111?(s[e+-4>>1]|0)==101:0)switch(s[e+-6>>1]|0){case 99:{e=$(e+-8|0,142,6)|0;break e}case 112:{e=$(e+-8|0,154,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=$(e+-2|0,158,4)|0;break}case 110:{e=e+-2|0;if(B(e,105)|0)e=1;else e=$(e,166,5)|0;break}case 111:{e=B(e+-2|0,100)|0;break}case 114:{e=$(e+-2|0,176,7)|0;break}case 116:{e=$(e+-2|0,190,4)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=B(e+-4|0,110)|0;break e}case 111:{e=$(e+-4|0,198,3)|0;break e}default:{e=0;break e}}default:e=0}}while(0);return e|0}function h(){var e=0,a=0,r=0,i=0;a=f[75]|0;r=f[74]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){a=10;break}switch(s[e>>1]|0){case 96:{a=7;break e}case 36:{if((s[r+4>>1]|0)==123){a=6;break e}break}case 92:{e=r+4|0;break}default:{}}r=e}if((a|0)==6){e=r+4|0;f[74]=e;a=f[72]|0;i=s[404]|0;r=i&65535;f[a+(r<<3)>>2]=4;s[404]=i+1<<16>>16;f[a+(r<<3)+4>>2]=e}else if((a|0)==7){f[74]=e;r=f[72]|0;i=(s[404]|0)+-1<<16>>16;s[404]=i;if((f[r+((i&65535)<<3)>>2]|0)!=3)T()}else if((a|0)==10){f[74]=e;T()}return}function w(e){e=e|0;var a=0,r=0,i=0;r=f[74]|0;e:do{a=s[r>>1]|0;a:do{if(a<<16>>16!=47)if(e)if(V(a)|0)break;else break e;else if(F(a)|0)break;else break e;else switch(s[r+2>>1]|0){case 47:{P();break a}case 42:{y(e);break a}default:{a=47;break e}}}while(0);i=f[74]|0;r=i+2|0;f[74]=r}while(i>>>0<(f[75]|0)>>>0);return a|0}function d(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var t=0,c=0;c=f[69]|0;f[69]=c+36;t=f[65]|0;f[((t|0)==0?244:t+32|0)>>2]=c;f[66]=t;f[65]=c;f[c+8>>2]=e;if(2==(s|0)){e=3;t=r}else{t=1==(s|0);e=t?1:2;t=t?r+2|0:0}f[c+12>>2]=t;f[c+28>>2]=e;f[c>>2]=a;f[c+4>>2]=r;f[c+16>>2]=0;f[c+20>>2]=s;a=1==(s|0);i[c+24>>0]=a&1;f[c+32>>2]=0;if(a|2==(s|0))i[811]=1;return}function v(e){e=e|0;var a=0,r=0,i=0,t=0;t=f[75]|0;a=f[74]|0;while(1){i=a+2|0;if(a>>>0>=t>>>0){a=9;break}r=s[i>>1]|0;if(r<<16>>16==e<<16>>16){a=10;break}if(r<<16>>16==92){r=a+4|0;if((s[r>>1]|0)==13){a=a+6|0;a=(s[a>>1]|0)==10?a:r}else a=r}else if(Z(r)|0){a=9;break}else a=i}if((a|0)==9){f[74]=i;T()}else if((a|0)==10)f[74]=i;return}function A(e,a){e=e|0;a=a|0;var r=0,i=0,t=0,c=0;r=f[74]|0;i=s[r>>1]|0;c=(e|0)==(a|0);t=c?0:e;c=c?0:a;if(i<<16>>16==97){f[74]=r+4;r=w(1)|0;e=f[74]|0;if(W(r)|0){v(r);a=(f[74]|0)+2|0;f[74]=a}else{q(r)|0;a=f[74]|0}i=w(1)|0;r=f[74]|0}if((r|0)!=(e|0))O(e,a,t,c);return i|0}function C(){var e=0,a=0,r=0;r=f[75]|0;a=f[74]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=6;break}switch(s[e>>1]|0){case 13:case 10:{a=6;break e}case 93:{a=7;break e}case 92:{e=a+4|0;break}default:{}}a=e}if((a|0)==6){f[74]=e;T();e=0}else if((a|0)==7){f[74]=e;e=93}return e|0}function g(){var e=0,a=0,r=0;e:while(1){e=f[74]|0;a=e+2|0;f[74]=a;if(e>>>0>=(f[75]|0)>>>0){r=7;break}switch(s[a>>1]|0){case 13:case 10:{r=7;break e}case 47:break e;case 91:{C()|0;break}case 92:{f[74]=e+4;break}default:{}}}if((r|0)==7)T();return}function p(e){e=e|0;switch(s[e>>1]|0){case 62:{e=(s[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=$(e+-2|0,218,4)|0;break}case 121:{e=$(e+-2|0,226,6)|0;break}case 101:{e=$(e+-2|0,238,3)|0;break}default:e=0}return e|0}function y(e){e=e|0;var a=0,r=0,i=0,t=0,c=0;t=(f[74]|0)+2|0;f[74]=t;r=f[75]|0;while(1){a=t+2|0;if(t>>>0>=r>>>0)break;i=s[a>>1]|0;if(!e?Z(i)|0:0)break;if(i<<16>>16==42?(s[t+4>>1]|0)==47:0){c=8;break}t=a}if((c|0)==8){f[74]=a;a=t+4|0}f[74]=a;return}function m(e,a,r){e=e|0;a=a|0;r=r|0;var s=0,f=0;e:do{if(!r)e=0;else{while(1){s=i[e>>0]|0;f=i[a>>0]|0;if(s<<24>>24!=f<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else{e=e+1|0;a=a+1|0}}e=(s&255)-(f&255)|0}}while(0);return e|0}function I(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else{switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:{}}e=(e+-123&65535)<4}}}while(0);return e|0}function U(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:{}}return e<<16>>16!=125&(e+-123&65535)<4|0}}}while(0);return 1}function x(e){e=e|0;var a=0;a=s[e>>1]|0;e:do{if((a+-9&65535)>=5){switch(a<<16>>16){case 160:case 32:{a=1;break e}default:{}}if(I(a)|0)return a<<16>>16!=46|(G(e)|0)|0;else a=0}else a=1}while(0);return a|0}function S(e){e=e|0;var a=0,r=0,i=0,t=0;r=n;n=n+16|0;i=r;f[i>>2]=0;f[68]=e;a=f[3]|0;t=a+(e<<1)|0;e=t+2|0;s[t>>1]=0;f[i>>2]=e;f[69]=e;f[61]=0;f[65]=0;f[63]=0;f[62]=0;f[67]=0;f[64]=0;n=r;return a|0}function O(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var t=0,c=0;t=f[69]|0;f[69]=t+20;c=f[67]|0;f[((c|0)==0?248:c+16|0)>>2]=t;f[67]=t;f[t>>2]=e;f[t+4>>2]=a;f[t+8>>2]=r;f[t+12>>2]=s;f[t+16>>2]=0;i[811]=1;return}function $(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,s=0;i=e+(0-r<<1)|0;s=i+2|0;e=f[3]|0;if(s>>>0>=e>>>0?(m(s,a,r<<1)|0)==0:0)if((s|0)==(e|0))e=1;else e=x(i)|0;else e=0;return e|0}function j(e){e=e|0;switch(s[e>>1]|0){case 107:{e=$(e+-2|0,158,4)|0;break}case 101:{if((s[e+-2>>1]|0)==117)e=$(e+-4|0,130,6)|0;else e=0;break}default:e=0}return e|0}function B(e,a){e=e|0;a=a|0;var r=0;r=f[3]|0;if(r>>>0<=e>>>0?(s[e>>1]|0)==a<<16>>16:0)if((r|0)==(e|0))r=1;else r=E(s[e+-2>>1]|0)|0;else r=0;return r|0}function E(e){e=e|0;e:do{if((e+-9&65535)<5)e=1;else{switch(e<<16>>16){case 32:case 160:{e=1;break e}default:{}}e=e<<16>>16!=46&(I(e)|0)}}while(0);return e|0}function P(){var e=0,a=0,r=0;e=f[75]|0;r=f[74]|0;e:while(1){a=r+2|0;if(r>>>0>=e>>>0)break;switch(s[a>>1]|0){case 13:case 10:break e;default:r=a}}f[74]=a;return}function q(e){e=e|0;while(1){if(V(e)|0)break;if(I(e)|0)break;e=(f[74]|0)+2|0;f[74]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function z(){var e=0;e=f[(f[63]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(f[3]|0)>>1}return e|0}function D(e){e=e|0;if(!($(e,204,5)|0)?!($(e,44,3)|0):0)e=$(e,214,2)|0;else e=1;return e|0}function F(e){e=e|0;switch(e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0}return e|0}function G(e){e=e|0;if((s[e>>1]|0)==46?(s[e+-2>>1]|0)==46:0)e=(s[e+-4>>1]|0)==46;else e=0;return e|0}function H(e){e=e|0;if((f[3]|0)==(e|0))e=1;else e=x(e+-2|0)|0;return e|0}function J(){var e=0;e=f[(f[64]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function K(){var e=0;e=f[(f[63]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function L(){var e=0;e=f[(f[64]|0)+8>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function M(){var e=0;e=f[(f[63]|0)+16>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function N(){var e=0;e=f[(f[63]|0)+4>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function Q(){var e=0;e=f[63]|0;e=f[((e|0)==0?244:e+32|0)>>2]|0;f[63]=e;return(e|0)!=0|0}function R(){var e=0;e=f[64]|0;e=f[((e|0)==0?248:e+16|0)>>2]|0;f[64]=e;return(e|0)!=0|0}function T(){i[810]=1;f[70]=(f[74]|0)-(f[3]|0)>>1;f[74]=(f[75]|0)+2;return}function V(e){e=e|0;return(e|128)<<16>>16==160|(e+-9&65535)<5|0}function W(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function X(){return(f[(f[63]|0)+8>>2]|0)-(f[3]|0)>>1|0}function Y(){return(f[(f[64]|0)+4>>2]|0)-(f[3]|0)>>1|0}function Z(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function _(){return(f[f[63]>>2]|0)-(f[3]|0)>>1|0}function ee(){return(f[f[64]>>2]|0)-(f[3]|0)>>1|0}function ae(){return t[(f[63]|0)+24>>0]|0|0}function re(e){e=e|0;f[3]=e;return}function ie(){return f[(f[63]|0)+28>>2]|0}function se(){return(i[811]|0)!=0|0}function fe(){return(i[812]|0)!=0|0}function te(){return f[70]|0}function ce(e){e=e|0;n=e+992+15&-16;return 992}return{su:ce,ai:M,e:te,ee:Y,ele:J,els:L,es:ee,f:fe,id:z,ie:N,ip:ae,is:_,it:ie,ms:se,p:b,re:R,ri:Q,sa:S,se:K,ses:re,ss:X}}("undefined"!=typeof self?self:global,{},a),r=e.su(i-(2<<17))}const h=t.length+1;e.ses(r),e.sa(h-1),s(t,new Uint16Array(a,r,h)),e.p()||(n=e.e(),o());const w=[],d=[];for(;e.ri();){const a=e.is(),r=e.ie(),i=e.ai(),s=e.id(),f=e.ss(),c=e.se(),n=e.it();let k;e.ip()&&(k=b(-1===s?a:a+1,t.charCodeAt(-1===s?a-1:a))),w.push({t:n,n:k,s:a,e:r,ss:f,se:c,d:s,a:i})}for(;e.re();){const a=e.es(),r=e.ee(),i=e.els(),s=e.ele(),f=t.charCodeAt(a),c=i>=0?t.charCodeAt(i):-1;d.push({s:a,e:r,ls:i,le:s,n:34===f||39===f?b(a+1,f):t.slice(a,r),ln:i<0?void 0:34===c||39===c?b(i+1,c):t.slice(i,s)})}return[w,d,!!e.f(),!!e.ms()]}function b(e,a){n=e;let r="",i=n;for(;;){n>=t.length&&o();const e=t.charCodeAt(n);if(e===a)break;92===e?(r+=t.slice(i,n),r+=k(),i=n):(8232===e||8233===e||u(e)&&o(),++n)}return r+=t.slice(i,n++),r}function k(){let e=t.charCodeAt(++n);switch(++n,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(l(2));case 117:return function(){const e=t.charCodeAt(n);let a;123===e?(++n,a=l(t.indexOf("}",n)-n),++n,a>1114111&&o()):a=l(4);return a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode(55296+(a>>10),56320+(1023&a)))}();case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===t.charCodeAt(n)&&++n;case 10:return"";case 56:case 57:o();default:if(e>=48&&e<=55){let a=t.substr(n-1,3).match(/^[0-7]+/)[0],r=parseInt(a,8);return r>255&&(a=a.slice(0,-1),r=parseInt(a,8)),n+=a.length-1,e=t.charCodeAt(n),"0"===a&&56!==e&&57!==e||o(),String.fromCharCode(r)}return u(e)?"":String.fromCharCode(e)}}function l(e){const a=n;let r=0,i=0;for(let a=0;a=97)e=s-97+10;else if(s>=65)e=s-65+10;else{if(!(s>=48&&s<=57))break;e=s-48}if(e>=16)break;i=s,r=16*r+e}else 95!==i&&0!==a||o(),i=s}return 95!==i&&n-a===e||o(),r}function u(e){return 13===e||10===e}function o(){throw Object.assign(Error(`Parse error ${c}:${t.slice(0,n).split("\n").length}:${n-t.lastIndexOf("\n",n-1)}`),{idx:n})} diff --git a/node_modules/es-module-lexer/dist/lexer.cjs b/node_modules/es-module-lexer/dist/lexer.cjs new file mode 100644 index 0000000000000000000000000000000000000000..4b0c87b1d5e4b99c604c9669171c58548da3b582 --- /dev/null +++ b/node_modules/es-module-lexer/dist/lexer.cjs @@ -0,0 +1 @@ +"use strict";var ImportType;exports.initSync=exports.init=exports.ImportType=void 0,exports.parse=parse,exports.ImportType=ImportType,function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase",A[A.StaticDeferPhase=6]="StaticDeferPhase",A[A.DynamicDeferPhase=7]="DynamicDeferPhase"}(ImportType||(exports.ImportType=ImportType={}));const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse(E,g="@"){if(!C)return init.then((()=>parse(E)));const I=E.length+1,w=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;w>0&&C.memory.grow(Math.ceil(w/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.it(),g=C.ai(),I=C.id(),w=C.ss(),K=C.se();let D;C.ip()&&(D=k(E.slice(-1===I?A-1:A,-1===I?Q+1:Q))),o.push({n:D,t:B,s:A,e:Q,ss:w,se:K,d:I,a:g})}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),w=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===w||"'"===w?k(I):I,ln:'"'===o||"'"===o?k(K):K})}function k(A){try{return(0,eval)(A)}catch(A){}}return[o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const C=A.length;let B=0;for(;B>>8}}function B(A,Q){const C=A.length;let B=0;for(;B{return A="AGFzbQEAAAABKwhgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gA39/fwADMTAAAQECAgICAgICAgICAgICAgICAgIAAwMDBAQAAAUAAAAAAAMDAwAGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUHA8gALfwBBwPIACwd6FQZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAml0AAgCYWkACQJpZAAKAmlwAAsCZXMADAJlZQANA2VscwAOA2VsZQAPAnJpABACcmUAEQFmABICbXMAEwVwYXJzZQAUC19faGVhcF9iYXNlAwEKzkQwaAEBf0EAIAA2AoAKQQAoAtwJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgKECkEAIAA2AogKQQBBADYC4AlBAEEANgLwCUEAQQA2AugJQQBBADYC5AlBAEEANgL4CUEAQQA2AuwJIAEL0wEBA39BACgC8AkhBEEAQQAoAogKIgU2AvAJQQAgBDYC9AlBACAFQSRqNgKICiAEQSBqQeAJIAQbIAU2AgBBACgC1AkhBEEAKALQCSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAGIANGIgAbIAQgA0YiBBs2AgwgBSADNgIUIAVBADYCECAFIAI2AgQgBUEANgIgIAVBA0EBQQIgABsgBBs2AhwgBUEAKALQCSADRiICOgAYAkACQCACDQBBACgC1AkgA0cNAQtBAEEBOgCMCgsLXgEBf0EAKAL4CSIEQRBqQeQJIAQbQQAoAogKIgQ2AgBBACAENgL4CUEAIARBFGo2AogKQQBBAToAjAogBEEANgIQIAQgAzYCDCAEIAI2AgggBCABNgIEIAQgADYCAAsIAEEAKAKQCgsVAEEAKALoCSgCAEEAKALcCWtBAXULHgEBf0EAKALoCSgCBCIAQQAoAtwJa0EBdUF/IAAbCxUAQQ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AAiBUcNASABQQFqIQEgAEEBaiEAIAJBf2oiAg0ADAILCyAEIAVrIQMLIAMLC+wBAgBBgAgLzgEAAHgAcABvAHIAdABtAHAAbwByAHQAZgBvAHIAZQB0AGEAbwB1AHIAYwBlAHIAbwBtAHUAbgBjAHQAaQBvAG4AcwBzAGUAcgB0AHYAbwB5AGkAZQBkAGUAbABlAGMAbwBuAHQAaQBuAGkAbgBzAHQAYQBuAHQAeQBiAHIAZQBhAHIAZQB0AHUAcgBkAGUAYgB1AGcAZwBlAGEAdwBhAGkAdABoAHIAdwBoAGkAbABlAGkAZgBjAGEAdABjAGYAaQBuAGEAbABsAGUAbABzAABB0AkLEAEAAAACAAAAAAQAAEA5AAA=","undefined"!=typeof Buffer?Buffer.from(A,"base64"):Uint8Array.from(atob(A),(A=>A.charCodeAt(0)));var A},init=WebAssembly.compile(E()).then(WebAssembly.instantiate).then((({exports:A})=>{C=A}));exports.init=init;const initSync=()=>{if(C)return;const A=new WebAssembly.Module(E());C=new WebAssembly.Instance(A).exports};exports.initSync=initSync; \ No newline at end of file diff --git a/node_modules/es-module-lexer/dist/lexer.js b/node_modules/es-module-lexer/dist/lexer.js new file mode 100644 index 0000000000000000000000000000000000000000..6f9404d45f14612e765beaf3444b313b4de4e7ce --- /dev/null +++ b/node_modules/es-module-lexer/dist/lexer.js @@ -0,0 +1,2 @@ +/* es-module-lexer 1.7.0 */ +export var ImportType;!function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase",A[A.StaticDeferPhase=6]="StaticDeferPhase",A[A.DynamicDeferPhase=7]="DynamicDeferPhase"}(ImportType||(ImportType={}));const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];export function parse(E,g="@"){if(!C)return init.then((()=>parse(E)));const I=E.length+1,w=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;w>0&&C.memory.grow(Math.ceil(w/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.it(),g=C.ai(),I=C.id(),w=C.ss(),K=C.se();let D;C.ip()&&(D=k(E.slice(-1===I?A-1:A,-1===I?Q+1:Q))),o.push({n:D,t:B,s:A,e:Q,ss:w,se:K,d:I,a:g})}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),w=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===w||"'"===w?k(I):I,ln:'"'===o||"'"===o?k(K):K})}function k(A){try{return(0,eval)(A)}catch(A){}}return[o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C>>8}}function B(A,Q){const B=A.length;let C=0;for(;C{return A="AGFzbQEAAAABKwhgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gA39/fwADMTAAAQECAgICAgICAgICAgICAgICAgIAAwMDBAQAAAUAAAAAAAMDAwAGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUHA8gALfwBBwPIACwd6FQZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAml0AAgCYWkACQJpZAAKAmlwAAsCZXMADAJlZQANA2VscwAOA2VsZQAPAnJpABACcmUAEQFmABICbXMAEwVwYXJzZQAUC19faGVhcF9iYXNlAwEKzkQwaAEBf0EAIAA2AoAKQQAoAtwJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgKECkEAIAA2AogKQQBBADYC4AlBAEEANgLwCUEAQQA2AugJQQBBADYC5AlBAEEANgL4CUEAQQA2AuwJIAEL0wE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AAIQIgARAoDQJBACECQQBBACgCsAoiAEECajYCsAogAC8BAiIADQAMAgsLIAAhAgsgAkH//wNxC6sBAQR/AkACQEEAKAKwCiICLwEAIgNB4QBGDQAgASEEIAAhBQwBC0EAIAJBBGo2ArAKQQEQKSECQQAoArAKIQUCQAJAIAJBIkYNACACQSdGDQAgAhAsGkEAKAKwCiEEDAELIAIQGkEAQQAoArAKQQJqIgQ2ArAKC0EBECkhA0EAKAKwCiECCwJAIAIgBUYNACAFIARBACAAIAAgAUYiAhtBACABIAIbEAILIAMLcgEEf0EAKAKwCiEAQQAoArQKIQECQAJAA0AgAEECaiECIAAgAU8NAQJAAkAgAi8BACIDQaR/ag4CAQQACyACIQAgA0F2ag4EAgEBAgELIABBBGohAAwACwtBACACNgKwChAlQQAPC0EAIAI2ArAKQd0AC0kBA39BACEDAkAgAkUNAAJAA0AgAC0AACIEIAEtAAAiBUcNASABQQFqIQEgAEEBaiEAIAJBf2oiAg0ADAILCyAEIAVrIQMLIAMLC+wBAgBBgAgLzgEAAHgAcABvAHIAdABtAHAAbwByAHQAZgBvAHIAZQB0AGEAbwB1AHIAYwBlAHIAbwBtAHUAbgBjAHQAaQBvAG4AcwBzAGUAcgB0AHYAbwB5AGkAZQBkAGUAbABlAGMAbwBuAHQAaQBuAGkAbgBzAHQAYQBuAHQAeQBiAHIAZQBhAHIAZQB0AHUAcgBkAGUAYgB1AGcAZwBlAGEAdwBhAGkAdABoAHIAdwBoAGkAbABlAGkAZgBjAGEAdABjAGYAaQBuAGEAbABsAGUAbABzAABB0AkLEAEAAAACAAAAAAQAAEA5AAA=","undefined"!=typeof Buffer?Buffer.from(A,"base64"):Uint8Array.from(atob(A),(A=>A.charCodeAt(0)));var A};export const init=WebAssembly.compile(E()).then(WebAssembly.instantiate).then((({exports:A})=>{C=A}));export const initSync=()=>{if(C)return;const A=new WebAssembly.Module(E());C=new WebAssembly.Instance(A).exports}; \ No newline at end of file diff --git a/node_modules/es-module-lexer/lexer.js b/node_modules/es-module-lexer/lexer.js new file mode 100644 index 0000000000000000000000000000000000000000..587fafe06e18c943c25113880cc43dfca99b0dad --- /dev/null +++ b/node_modules/es-module-lexer/lexer.js @@ -0,0 +1,925 @@ +let source, pos, end, + openTokenDepth, + lastTokenPos, + openTokenPosStack, + openClassPosStack, + curDynamicImport, + templateStackDepth, + facade, + lastSlashWasDivision, + nextBraceIsClass, + templateDepth, + templateStack, + imports, + exports, + name; + +function addImport (ss, s, e, d) { + const impt = { ss, se: d === -2 ? e : d === -1 ? e + 1 : 0, s, e, d, a: -1, n: undefined }; + imports.push(impt); + return impt; +} + +function addExport (s, e, ls, le) { + exports.push({ + s, + e, + ls, + le, + n: s[0] === '"' ? readString(s, '"') : s[0] === "'" ? readString(s, "'") : source.slice(s, e), + ln: ls[0] === '"' ? readString(ls, '"') : ls[0] === "'" ? readString(ls, "'") : source.slice(ls, le) + }); +} + +function readName (impt) { + let { d, s } = impt; + if (d !== -1) + s++; + impt.n = readString(s, source.charCodeAt(s - 1)); +} + +// Note: parsing is based on the _assumption_ that the source is already valid +export function parse (_source, _name) { + openTokenDepth = 0; + curDynamicImport = null; + templateDepth = -1; + lastTokenPos = -1; + lastSlashWasDivision = false; + templateStack = Array(1024); + templateStackDepth = 0; + openTokenPosStack = Array(1024); + openClassPosStack = Array(1024); + nextBraceIsClass = false; + facade = true; + name = _name || '@'; + + imports = []; + exports = []; + + source = _source; + pos = -1; + end = source.length - 1; + let ch = 0; + + // start with a pure "module-only" parser + m: while (pos++ < end) { + ch = source.charCodeAt(pos); + + if (ch === 32 || ch < 14 && ch > 8) + continue; + + switch (ch) { + case 101/*e*/: + if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1)) { + tryParseExportStatement(); + // export might have been a non-pure declaration + if (!facade) { + lastTokenPos = pos; + break m; + } + } + break; + case 105/*i*/: + if (keywordStart(pos) && source.startsWith('mport', pos + 1)) + tryParseImportStatement(); + break; + case 59/*;*/: + break; + case 47/*/*/: { + const next_ch = source.charCodeAt(pos + 1); + if (next_ch === 47/*/*/) { + lineComment(); + // dont update lastToken + continue; + } + else if (next_ch === 42/***/) { + blockComment(true); + // dont update lastToken + continue; + } + // fallthrough + } + default: + // as soon as we hit a non-module token, we go to main parser + facade = false; + pos--; + break m; + } + lastTokenPos = pos; + } + + while (pos++ < end) { + ch = source.charCodeAt(pos); + + if (ch === 32 || ch < 14 && ch > 8) + continue; + + switch (ch) { + case 101/*e*/: + if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1)) + tryParseExportStatement(); + break; + case 105/*i*/: + if (keywordStart(pos) && source.startsWith('mport', pos + 1)) + tryParseImportStatement(); + break; + case 99/*c*/: + if (keywordStart(pos) && source.startsWith('lass', pos + 1) && isBrOrWs(source.charCodeAt(pos + 5))) + nextBraceIsClass = true; + break; + case 40/*(*/: + openTokenPosStack[openTokenDepth++] = lastTokenPos; + break; + case 41/*)*/: + if (openTokenDepth === 0) + syntaxError(); + openTokenDepth--; + if (curDynamicImport && curDynamicImport.d === openTokenPosStack[openTokenDepth]) { + if (curDynamicImport.e === 0) + curDynamicImport.e = pos; + curDynamicImport.se = pos; + curDynamicImport = null; + } + break; + case 123/*{*/: + // dynamic import followed by { is not a dynamic import (so remove) + // this is a sneaky way to get around { import () {} } v { import () } + // block / object ambiguity without a parser (assuming source is valid) + if (source.charCodeAt(lastTokenPos) === 41/*)*/ && imports.length && imports[imports.length - 1].e === lastTokenPos) { + imports.pop(); + } + openClassPosStack[openTokenDepth] = nextBraceIsClass; + nextBraceIsClass = false; + openTokenPosStack[openTokenDepth++] = lastTokenPos; + break; + case 125/*}*/: + if (openTokenDepth === 0) + syntaxError(); + if (openTokenDepth-- === templateDepth) { + templateDepth = templateStack[--templateStackDepth]; + templateString(); + } + else { + if (templateDepth !== -1 && openTokenDepth < templateDepth) + syntaxError(); + } + break; + case 39/*'*/: + case 34/*"*/: + stringLiteral(ch); + break; + case 47/*/*/: { + const next_ch = source.charCodeAt(pos + 1); + if (next_ch === 47/*/*/) { + lineComment(); + // dont update lastToken + continue; + } + else if (next_ch === 42/***/) { + blockComment(true); + // dont update lastToken + continue; + } + else { + // Division / regex ambiguity handling based on checking backtrack analysis of: + // - what token came previously (lastToken) + // - if a closing brace or paren, what token came before the corresponding + // opening brace or paren (lastOpenTokenIndex) + const lastToken = source.charCodeAt(lastTokenPos); + const lastExport = exports[exports.length - 1]; + if (isExpressionPunctuator(lastToken) && + !(lastToken === 46/*.*/ && (source.charCodeAt(lastTokenPos - 1) >= 48/*0*/ && source.charCodeAt(lastTokenPos - 1) <= 57/*9*/)) && + !(lastToken === 43/*+*/ && source.charCodeAt(lastTokenPos - 1) === 43/*+*/) && !(lastToken === 45/*-*/ && source.charCodeAt(lastTokenPos - 1) === 45/*-*/) || + lastToken === 41/*)*/ && isParenKeyword(openTokenPosStack[openTokenDepth]) || + lastToken === 125/*}*/ && (isExpressionTerminator(openTokenPosStack[openTokenDepth]) || openClassPosStack[openTokenDepth]) || + lastToken === 47/*/*/ && lastSlashWasDivision || + isExpressionKeyword(lastTokenPos) || + !lastToken) { + regularExpression(); + lastSlashWasDivision = false; + } + else if (lastExport && lastTokenPos >= lastExport.s && lastTokenPos <= lastExport.e) { + // export default /some-regexp/ + regularExpression(); + lastSlashWasDivision = false; + } + else { + lastSlashWasDivision = true; + } + } + break; + } + case 96/*`*/: + templateString(); + break; + } + lastTokenPos = pos; + } + + if (templateDepth !== -1 || openTokenDepth) + syntaxError(); + + return [imports, exports, facade]; +} + +function tryParseImportStatement () { + const startPos = pos; + + pos += 6; + + let ch = commentWhitespace(true); + + switch (ch) { + // dynamic import + case 40/*(*/: + openTokenPosStack[openTokenDepth++] = startPos; + if (source.charCodeAt(lastTokenPos) === 46/*.*/) + return; + // dynamic import indicated by positive d + const impt = addImport(startPos, pos + 1, 0, startPos); + curDynamicImport = impt; + // try parse a string, to record a safe dynamic import string + pos++; + ch = commentWhitespace(true); + if (ch === 39/*'*/ || ch === 34/*"*/) { + stringLiteral(ch); + } + else { + pos--; + return; + } + pos++; + ch = commentWhitespace(true); + if (ch === 44/*,*/) { + impt.e = pos; + pos++; + ch = commentWhitespace(true); + impt.a = pos; + readName(impt); + pos--; + } + else if (ch === 41/*)*/) { + openTokenDepth--; + impt.e = pos; + impt.se = pos; + readName(impt); + } + else { + pos--; + } + return; + // import.meta + case 46/*.*/: + pos++; + ch = commentWhitespace(true); + // import.meta indicated by d === -2 + if (ch === 109/*m*/ && source.startsWith('eta', pos + 1) && source.charCodeAt(lastTokenPos) !== 46/*.*/) + addImport(startPos, startPos, pos + 4, -2); + return; + + default: + // no space after "import" -> not an import keyword + if (pos === startPos + 6) + break; + case 34/*"*/: + case 39/*'*/: + case 123/*{*/: + case 42/***/: + // import statement only permitted at base-level + if (openTokenDepth !== 0) { + pos--; + return; + } + while (pos < end) { + ch = source.charCodeAt(pos); + if (ch === 39/*'*/ || ch === 34/*"*/) { + readImportString(startPos, ch); + return; + } + pos++; + } + syntaxError(); + } +} + +function tryParseExportStatement () { + const sStartPos = pos; + const prevExport = exports.length; + + pos += 6; + + const curPos = pos; + + let ch = commentWhitespace(true); + + if (pos === curPos && !isPunctuator(ch)) + return; + + switch (ch) { + // export default ... + case 100/*d*/: + addExport(pos, pos + 7, -1, -1); + return; + + // export async? function*? name () { + case 97/*a*/: + pos += 5; + commentWhitespace(true); + // fallthrough + case 102/*f*/: + pos += 8; + ch = commentWhitespace(true); + if (ch === 42/***/) { + pos++; + ch = commentWhitespace(true); + } + const startPos = pos; + ch = readToWsOrPunctuator(ch); + addExport(startPos, pos, startPos, pos); + pos--; + return; + + // export class name ... + case 99/*c*/: + if (source.startsWith('lass', pos + 1) && isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos + 5))) { + pos += 5; + ch = commentWhitespace(true); + const startPos = pos; + ch = readToWsOrPunctuator(ch); + addExport(startPos, pos, startPos, pos); + pos--; + return; + } + pos += 2; + // fallthrough + + // export var/let/const name = ...(, name = ...)+ + case 118/*v*/: + case 109/*l*/: + // destructured initializations not currently supported (skipped for { or [) + // also, lexing names after variable equals is skipped (export var p = function () { ... }, q = 5 skips "q") + pos += 2; + facade = false; + do { + pos++; + ch = commentWhitespace(true); + const startPos = pos; + ch = readToWsOrPunctuator(ch); + // dont yet handle [ { destructurings + if (ch === 123/*{*/ || ch === 91/*[*/) { + pos--; + return; + } + if (pos === startPos) + return; + addExport(startPos, pos, startPos, pos); + ch = commentWhitespace(true); + if (ch === 61/*=*/) { + pos--; + return; + } + } while (ch === 44/*,*/); + pos--; + return; + + + // export {...} + case 123/*{*/: + pos++; + ch = commentWhitespace(true); + while (true) { + const startPos = pos; + readToWsOrPunctuator(ch); + const endPos = pos; + commentWhitespace(true); + ch = readExportAs(startPos, endPos); + // , + if (ch === 44/*,*/) { + pos++; + ch = commentWhitespace(true); + } + if (ch === 125/*}*/) + break; + if (pos === startPos) + return syntaxError(); + if (pos > end) + return syntaxError(); + } + pos++; + ch = commentWhitespace(true); + break; + + // export * + // export * as X + case 42/***/: + pos++; + commentWhitespace(true); + ch = readExportAs(pos, pos); + ch = commentWhitespace(true); + break; + } + + // from ... + if (ch === 102/*f*/ && source.startsWith('rom', pos + 1)) { + pos += 4; + readImportString(sStartPos, commentWhitespace(true)); + + // There were no local names. + for (let i = prevExport; i < exports.length; ++i) { + exports[i].ls = exports[i].le = -1; + exports[i].ln = undefined; + } + } + else { + pos--; + } +} + +/* + * Ported from Acorn + * + * MIT License + + * Copyright (C) 2012-2020 by various contributors (see AUTHORS) + + * 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. + */ +let acornPos; +function readString (start, quote) { + acornPos = start; + let out = '', chunkStart = acornPos; + for (;;) { + if (acornPos >= source.length) syntaxError(); + const ch = source.charCodeAt(acornPos); + if (ch === quote) break; + if (ch === 92) { // '\' + out += source.slice(chunkStart, acornPos); + out += readEscapedChar(); + chunkStart = acornPos; + } + else if (ch === 0x2028 || ch === 0x2029) { + ++acornPos; + } + else { + if (isBr(ch)) syntaxError(); + ++acornPos; + } + } + out += source.slice(chunkStart, acornPos++); + return out; +} + +// Used to read escaped characters + +function readEscapedChar () { + let ch = source.charCodeAt(++acornPos); + ++acornPos; + switch (ch) { + case 110: return '\n'; // 'n' -> '\n' + case 114: return '\r'; // 'r' -> '\r' + case 120: return String.fromCharCode(readHexChar(2)); // 'x' + case 117: return readCodePointToString(); // 'u' + case 116: return '\t'; // 't' -> '\t' + case 98: return '\b'; // 'b' -> '\b' + case 118: return '\u000b'; // 'v' -> '\u000b' + case 102: return '\f'; // 'f' -> '\f' + case 13: if (source.charCodeAt(acornPos) === 10) ++acornPos; // '\r\n' + case 10: // ' \n' + return ''; + case 56: + case 57: + syntaxError(); + default: + if (ch >= 48 && ch <= 55) { + let octalStr = source.substr(acornPos - 1, 3).match(/^[0-7]+/)[0]; + let octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + acornPos += octalStr.length - 1; + ch = source.charCodeAt(acornPos); + if (octalStr !== '0' || ch === 56 || ch === 57) + syntaxError(); + return String.fromCharCode(octal); + } + if (isBr(ch)) { + // Unicode new line characters after \ get removed from output in both + // template literals and strings + return ''; + } + return String.fromCharCode(ch); + } +} + +// Used to read character escape sequences ('\x', '\u', '\U'). + +function readHexChar (len) { + const start = acornPos; + let total = 0, lastCode = 0; + for (let i = 0; i < len; ++i, ++acornPos) { + let code = source.charCodeAt(acornPos), val; + + if (code === 95) { + if (lastCode === 95 || i === 0) syntaxError(); + lastCode = code; + continue; + } + + if (code >= 97) val = code - 97 + 10; // a + else if (code >= 65) val = code - 65 + 10; // A + else if (code >= 48 && code <= 57) val = code - 48; // 0-9 + else break; + if (val >= 16) break; + lastCode = code; + total = total * 16 + val; + } + + if (lastCode === 95 || acornPos - start !== len) syntaxError(); + + return total; +} + +// Read a string value, interpreting backslash-escapes. + +function readCodePointToString () { + const ch = source.charCodeAt(acornPos); + let code; + if (ch === 123) { // '{' + ++acornPos; + code = readHexChar(source.indexOf('}', acornPos) - acornPos); + ++acornPos; + if (code > 0x10FFFF) syntaxError(); + } else { + code = readHexChar(4); + } + // UTF-16 Decoding + if (code <= 0xFFFF) return String.fromCharCode(code); + code -= 0x10000; + return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00); +} + +/* + * + */ + +function readExportAs (startPos, endPos) { + let ch = source.charCodeAt(pos); + let ls = startPos, le = endPos; + if (ch === 97 /*a*/) { + pos += 2; + ch = commentWhitespace(true); + startPos = pos; + readToWsOrPunctuator(ch); + endPos = pos; + ch = commentWhitespace(true); + } + if (pos !== startPos) + addExport(startPos, endPos, ls, le); + return ch; +} + +function readImportString (ss, ch) { + const startPos = pos + 1; + if (ch === 39/*'*/ || ch === 34/*"*/) { + stringLiteral(ch); + } + else { + syntaxError(); + return; + } + const impt = addImport(ss, startPos, pos, -1); + readName(impt); + pos++; + ch = commentWhitespace(false); + if (ch !== 97/*a*/ || !source.startsWith('ssert', pos + 1)) { + pos--; + return; + } + const assertIndex = pos; + + pos += 6; + ch = commentWhitespace(true); + if (ch !== 123/*{*/) { + pos = assertIndex; + return; + } + const assertStart = pos; + do { + pos++; + ch = commentWhitespace(true); + if (ch === 39/*'*/ || ch === 34/*"*/) { + stringLiteral(ch); + pos++; + ch = commentWhitespace(true); + } + else { + ch = readToWsOrPunctuator(ch); + } + if (ch !== 58/*:*/) { + pos = assertIndex; + return; + } + pos++; + ch = commentWhitespace(true); + if (ch === 39/*'*/ || ch === 34/*"*/) { + stringLiteral(ch); + } + else { + pos = assertIndex; + return; + } + pos++; + ch = commentWhitespace(true); + if (ch === 44/*,*/) { + pos++; + ch = commentWhitespace(true); + if (ch === 125/*}*/) + break; + continue; + } + if (ch === 125/*}*/) + break; + pos = assertIndex; + return; + } while (true); + impt.a = assertStart; + impt.se = pos + 1; +} + +function commentWhitespace (br) { + let ch; + do { + ch = source.charCodeAt(pos); + if (ch === 47/*/*/) { + const next_ch = source.charCodeAt(pos + 1); + if (next_ch === 47/*/*/) + lineComment(); + else if (next_ch === 42/***/) + blockComment(br); + else + return ch; + } + else if (br ? !isBrOrWs(ch): !isWsNotBr(ch)) { + return ch; + } + } while (pos++ < end); + return ch; +} + +function templateString () { + while (pos++ < end) { + const ch = source.charCodeAt(pos); + if (ch === 36/*$*/ && source.charCodeAt(pos + 1) === 123/*{*/) { + pos++; + templateStack[templateStackDepth++] = templateDepth; + templateDepth = ++openTokenDepth; + return; + } + if (ch === 96/*`*/) + return; + if (ch === 92/*\*/) + pos++; + } + syntaxError(); +} + +function blockComment (br) { + pos++; + while (pos++ < end) { + const ch = source.charCodeAt(pos); + if (!br && isBr(ch)) + return; + if (ch === 42/***/ && source.charCodeAt(pos + 1) === 47/*/*/) { + pos++; + return; + } + } +} + +function lineComment () { + while (pos++ < end) { + const ch = source.charCodeAt(pos); + if (ch === 10/*\n*/ || ch === 13/*\r*/) + return; + } +} + +function stringLiteral (quote) { + while (pos++ < end) { + let ch = source.charCodeAt(pos); + if (ch === quote) + return; + if (ch === 92/*\*/) { + ch = source.charCodeAt(++pos); + if (ch === 13/*\r*/ && source.charCodeAt(pos + 1) === 10/*\n*/) + pos++; + } + else if (isBr(ch)) + break; + } + syntaxError(); +} + +function regexCharacterClass () { + while (pos++ < end) { + let ch = source.charCodeAt(pos); + if (ch === 93/*]*/) + return ch; + if (ch === 92/*\*/) + pos++; + else if (ch === 10/*\n*/ || ch === 13/*\r*/) + break; + } + syntaxError(); +} + +function regularExpression () { + while (pos++ < end) { + let ch = source.charCodeAt(pos); + if (ch === 47/*/*/) + return; + if (ch === 91/*[*/) + ch = regexCharacterClass(); + else if (ch === 92/*\*/) + pos++; + else if (ch === 10/*\n*/ || ch === 13/*\r*/) + break; + } + syntaxError(); +} + +function readToWsOrPunctuator (ch) { + do { + if (isBrOrWs(ch) || isPunctuator(ch)) + return ch; + } while (ch = source.charCodeAt(++pos)); + return ch; +} + +// Note: non-asii BR and whitespace checks omitted for perf / footprint +// if there is a significant user need this can be reconsidered +function isBr (c) { + return c === 13/*\r*/ || c === 10/*\n*/; +} + +function isWsNotBr (c) { + return c === 9 || c === 11 || c === 12 || c === 32 || c === 160; +} + +function isBrOrWs (c) { + return c > 8 && c < 14 || c === 32 || c === 160; +} + +function isBrOrWsOrPunctuatorNotDot (c) { + return c > 8 && c < 14 || c === 32 || c === 160 || isPunctuator(c) && c !== 46/*.*/; +} + +function keywordStart (pos) { + return pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - 1)); +} + +function readPrecedingKeyword (pos, match) { + if (pos < match.length - 1) + return false; + return source.startsWith(match, pos - match.length + 1) && (pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - match.length))); +} + +function readPrecedingKeyword1 (pos, ch) { + return source.charCodeAt(pos) === ch && (pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - 1))); +} + +// Detects one of case, debugger, delete, do, else, in, instanceof, new, +// return, throw, typeof, void, yield, await +function isExpressionKeyword (pos) { + switch (source.charCodeAt(pos)) { + case 100/*d*/: + switch (source.charCodeAt(pos - 1)) { + case 105/*i*/: + // void + return readPrecedingKeyword(pos - 2, 'vo'); + case 108/*l*/: + // yield + return readPrecedingKeyword(pos - 2, 'yie'); + default: + return false; + } + case 101/*e*/: + switch (source.charCodeAt(pos - 1)) { + case 115/*s*/: + switch (source.charCodeAt(pos - 2)) { + case 108/*l*/: + // else + return readPrecedingKeyword1(pos - 3, 101/*e*/); + case 97/*a*/: + // case + return readPrecedingKeyword1(pos - 3, 99/*c*/); + default: + return false; + } + case 116/*t*/: + // delete + return readPrecedingKeyword(pos - 2, 'dele'); + default: + return false; + } + case 102/*f*/: + if (source.charCodeAt(pos - 1) !== 111/*o*/ || source.charCodeAt(pos - 2) !== 101/*e*/) + return false; + switch (source.charCodeAt(pos - 3)) { + case 99/*c*/: + // instanceof + return readPrecedingKeyword(pos - 4, 'instan'); + case 112/*p*/: + // typeof + return readPrecedingKeyword(pos - 4, 'ty'); + default: + return false; + } + case 110/*n*/: + // in, return + return readPrecedingKeyword1(pos - 1, 105/*i*/) || readPrecedingKeyword(pos - 1, 'retur'); + case 111/*o*/: + // do + return readPrecedingKeyword1(pos - 1, 100/*d*/); + case 114/*r*/: + // debugger + return readPrecedingKeyword(pos - 1, 'debugge'); + case 116/*t*/: + // await + return readPrecedingKeyword(pos - 1, 'awai'); + case 119/*w*/: + switch (source.charCodeAt(pos - 1)) { + case 101/*e*/: + // new + return readPrecedingKeyword1(pos - 2, 110/*n*/); + case 111/*o*/: + // throw + return readPrecedingKeyword(pos - 2, 'thr'); + default: + return false; + } + } + return false; +} + +function isParenKeyword (curPos) { + return source.charCodeAt(curPos) === 101/*e*/ && source.startsWith('whil', curPos - 4) || + source.charCodeAt(curPos) === 114/*r*/ && source.startsWith('fo', curPos - 2) || + source.charCodeAt(curPos - 1) === 105/*i*/ && source.charCodeAt(curPos) === 102/*f*/; +} + +function isPunctuator (ch) { + // 23 possible punctuator endings: !%&()*+,-./:;<=>?[]^{}|~ + return ch === 33/*!*/ || ch === 37/*%*/ || ch === 38/*&*/ || + ch > 39 && ch < 48 || ch > 57 && ch < 64 || + ch === 91/*[*/ || ch === 93/*]*/ || ch === 94/*^*/ || + ch > 122 && ch < 127; +} + +function isExpressionPunctuator (ch) { + // 20 possible expression endings: !%&(*+,-.:;<=>?[^{|~ + return ch === 33/*!*/ || ch === 37/*%*/ || ch === 38/*&*/ || + ch > 39 && ch < 47 && ch !== 41 || ch > 57 && ch < 64 || + ch === 91/*[*/ || ch === 94/*^*/ || ch > 122 && ch < 127 && ch !== 125/*}*/; +} + +function isExpressionTerminator (curPos) { + // detects: + // => ; ) finally catch else + // as all of these followed by a { will indicate a statement brace + switch (source.charCodeAt(curPos)) { + case 62/*>*/: + return source.charCodeAt(curPos - 1) === 61/*=*/; + case 59/*;*/: + case 41/*)*/: + return true; + case 104/*h*/: + return source.startsWith('catc', curPos - 4); + case 121/*y*/: + return source.startsWith('finall', curPos - 6); + case 101/*e*/: + return source.startsWith('els', curPos - 3); + } + return false; +} + +function syntaxError () { + throw Object.assign(new Error(`Parse error ${name}:${source.slice(0, pos).split('\n').length}:${pos - source.lastIndexOf('\n', pos - 1)}`), { idx: pos }); +} \ No newline at end of file diff --git a/node_modules/es-module-lexer/package.json b/node_modules/es-module-lexer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..98a3adfc9cfe98baf696ec003db1c59a75781871 --- /dev/null +++ b/node_modules/es-module-lexer/package.json @@ -0,0 +1,57 @@ +{ + "name": "es-module-lexer", + "version": "1.7.0", + "description": "Lexes ES modules returning their import/export metadata", + "main": "dist/lexer.cjs", + "module": "dist/lexer.js", + "types": "types/lexer.d.ts", + "exports": { + ".": { + "types": "./types/lexer.d.ts", + "module": "./dist/lexer.js", + "import": "./dist/lexer.js", + "require": "./dist/lexer.cjs" + }, + "./js": { + "types": "./types/lexer.d.ts", + "default": "./dist/lexer.asm.js" + } + }, + "scripts": { + "build": "npm install -g chomp ; chomp build", + "test": "npm install -g chomp ; chomp test" + }, + "author": "Guy Bedford", + "license": "MIT", + "devDependencies": { + "@babel/cli": "^7.5.5", + "@babel/core": "^7.5.5", + "@babel/plugin-transform-modules-commonjs": "^7.5.0", + "@swc/cli": "^0.1.57", + "@swc/core": "^1.2.224", + "@types/node": "^18.7.1", + "kleur": "^2.0.2", + "mocha": "^5.2.0", + "terser": "^5.19.4", + "typescript": "^4.7.4" + }, + "files": [ + "dist", + "types", + "lexer.js" + ], + "type": "module", + "repository": { + "type": "git", + "url": "git+https://github.com/guybedford/es-module-lexer.git" + }, + "bugs": { + "url": "https://github.com/guybedford/es-module-lexer/issues" + }, + "homepage": "https://github.com/guybedford/es-module-lexer#readme", + "directories": { + "lib": "lib", + "test": "test" + }, + "keywords": [] +} diff --git a/node_modules/es-module-lexer/types/lexer.d.ts b/node_modules/es-module-lexer/types/lexer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd15b64d36334074d3d1a56e8a005626ac417dcc --- /dev/null +++ b/node_modules/es-module-lexer/types/lexer.d.ts @@ -0,0 +1,195 @@ +export declare enum ImportType { + /** + * A normal static using any syntax variations + * import .. from 'module' + */ + Static = 1, + /** + * A dynamic import expression `import(specifier)` + * or `import(specifier, opts)` + */ + Dynamic = 2, + /** + * An import.meta expression + */ + ImportMeta = 3, + /** + * A source phase import + * import source x from 'module' + */ + StaticSourcePhase = 4, + /** + * A dynamic source phase import + * import.source('module') + */ + DynamicSourcePhase = 5, + /** + * A defer phase import + * import defer * as x from 'module' + */ + StaticDeferPhase = 6, + /** + * A dynamic defer phase import + * import.defer('module') + */ + DynamicDeferPhase = 7 +} +export interface ImportSpecifier { + /** + * Module name + * + * To handle escape sequences in specifier strings, the .n field of imported specifiers will be provided where possible. + * + * For dynamic import expressions, this field will be empty if not a valid JS string. + * For static import expressions, this field will always be populated. + * + * @example + * const [imports1, exports1] = parse(String.raw`import './\u0061\u0062.js'`); + * imports1[0].n; + * // Returns "./ab.js" + * + * const [imports2, exports2] = parse(`import("./ab.js")`); + * imports2[0].n; + * // Returns "./ab.js" + * + * const [imports3, exports3] = parse(`import("./" + "ab.js")`); + * imports3[0].n; + * // Returns undefined + */ + readonly n: string | undefined; + /** + * Type of import statement + */ + readonly t: ImportType; + /** + * Start of module specifier + * + * @example + * const source = `import { a } from 'asdf'`; + * const [imports, exports] = parse(source); + * source.substring(imports[0].s, imports[0].e); + * // Returns "asdf" + */ + readonly s: number; + /** + * End of module specifier + */ + readonly e: number; + /** + * Start of import statement + * + * @example + * const source = `import { a } from 'asdf'`; + * const [imports, exports] = parse(source); + * source.substring(imports[0].ss, imports[0].se); + * // Returns "import { a } from 'asdf';" + */ + readonly ss: number; + /** + * End of import statement + */ + readonly se: number; + /** + * If this import keyword is a dynamic import, this is the start value. + * If this import keyword is a static import, this is -1. + * If this import keyword is an import.meta expresion, this is -2. + */ + readonly d: number; + /** + * If this import has an import assertion, this is the start value. + * Otherwise this is `-1`. + */ + readonly a: number; +} +export interface ExportSpecifier { + /** + * Exported name + * + * @example + * const source = `export default []`; + * const [imports, exports] = parse(source); + * exports[0].n; + * // Returns "default" + * + * @example + * const source = `export const asdf = 42`; + * const [imports, exports] = parse(source); + * exports[0].n; + * // Returns "asdf" + */ + readonly n: string; + /** + * Local name, or undefined. + * + * @example + * const source = `export default []`; + * const [imports, exports] = parse(source); + * exports[0].ln; + * // Returns undefined + * + * @example + * const asdf = 42; + * const source = `export { asdf as a }`; + * const [imports, exports] = parse(source); + * exports[0].ln; + * // Returns "asdf" + */ + readonly ln: string | undefined; + /** + * Start of exported name + * + * @example + * const source = `export default []`; + * const [imports, exports] = parse(source); + * source.substring(exports[0].s, exports[0].e); + * // Returns "default" + * + * @example + * const source = `export { 42 as asdf }`; + * const [imports, exports] = parse(source); + * source.substring(exports[0].s, exports[0].e); + * // Returns "asdf" + */ + readonly s: number; + /** + * End of exported name + */ + readonly e: number; + /** + * Start of local name, or -1. + * + * @example + * const asdf = 42; + * const source = `export { asdf as a }`; + * const [imports, exports] = parse(source); + * source.substring(exports[0].ls, exports[0].le); + * // Returns "asdf" + */ + readonly ls: number; + /** + * End of local name, or -1. + */ + readonly le: number; +} +export interface ParseError extends Error { + idx: number; +} +/** + * Outputs the list of exports and locations of import specifiers, + * including dynamic import and import meta handling. + * + * @param source Source code to parser + * @param name Optional sourcename + * @returns Tuple contaning imports list and exports list. + */ +export declare function parse(source: string, name?: string): readonly [ + imports: ReadonlyArray, + exports: ReadonlyArray, + facade: boolean, + hasModuleSyntax: boolean +]; +/** + * Wait for init to resolve before calling `parse`. + */ +export declare const init: Promise; +export declare const initSync: () => void; diff --git a/node_modules/es-object-atoms/.eslintrc b/node_modules/es-object-atoms/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..d90a1bc657a8c3b85c939c7b20e4ed4e4aba4ab0 --- /dev/null +++ b/node_modules/es-object-atoms/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "eqeqeq": ["error", "allow-null"], + "id-length": "off", + "new-cap": ["error", { + "capIsNewExceptions": [ + "RequireObjectCoercible", + "ToObject", + ], + }], + }, +} diff --git a/node_modules/es-object-atoms/.github/FUNDING.yml b/node_modules/es-object-atoms/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..352bfdabd228c58a83d22f1d739a33d5e0b0cf0f --- /dev/null +++ b/node_modules/es-object-atoms/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-object +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/es-object-atoms/CHANGELOG.md b/node_modules/es-object-atoms/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..fdd2abe34d3c8d6d87679f4a2e9b87d6c7af487b --- /dev/null +++ b/node_modules/es-object-atoms/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.1](https://github.com/ljharb/es-object-atoms/compare/v1.1.0...v1.1.1) - 2025-01-14 + +### Commits + +- [types] `ToObject`: improve types [`cfe8c8a`](https://github.com/ljharb/es-object-atoms/commit/cfe8c8a105c44820cb22e26f62d12ef0ad9715c8) + +## [v1.1.0](https://github.com/ljharb/es-object-atoms/compare/v1.0.1...v1.1.0) - 2025-01-14 + +### Commits + +- [New] add `isObject` [`51e4042`](https://github.com/ljharb/es-object-atoms/commit/51e4042df722eb3165f40dc5f4bf33d0197ecb07) + +## [v1.0.1](https://github.com/ljharb/es-object-atoms/compare/v1.0.0...v1.0.1) - 2025-01-13 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `tape` [`38ab9eb`](https://github.com/ljharb/es-object-atoms/commit/38ab9eb00b62c2f4668644f5e513d9b414ebd595) +- [types] improve types [`7d1beb8`](https://github.com/ljharb/es-object-atoms/commit/7d1beb887958b78b6a728a210a1c8370ab7e2aa1) +- [Tests] replace `aud` with `npm audit` [`25863ba`](https://github.com/ljharb/es-object-atoms/commit/25863baf99178f1d1ad33d1120498db28631907e) +- [Dev Deps] add missing peer dep [`c012309`](https://github.com/ljharb/es-object-atoms/commit/c0123091287e6132d6f4240496340c427433df28) + +## v1.0.0 - 2024-03-16 + +### Commits + +- Initial implementation, tests, readme, types [`f1499db`](https://github.com/ljharb/es-object-atoms/commit/f1499db7d3e1741e64979c61d645ab3137705e82) +- Initial commit [`99eedc7`](https://github.com/ljharb/es-object-atoms/commit/99eedc7b5fde38a50a28d3c8b724706e3e4c5f6a) +- [meta] rename repo [`fc851fa`](https://github.com/ljharb/es-object-atoms/commit/fc851fa70616d2d182aaf0bd02c2ed7084dea8fa) +- npm init [`b909377`](https://github.com/ljharb/es-object-atoms/commit/b909377c50049bd0ec575562d20b0f9ebae8947f) +- Only apps should have lockfiles [`7249edd`](https://github.com/ljharb/es-object-atoms/commit/7249edd2178c1b9ddfc66ffcc6d07fdf0d28efc1) diff --git a/node_modules/es-object-atoms/LICENSE b/node_modules/es-object-atoms/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f82f38963b0d282b529f64def2bcd40be3a9a947 --- /dev/null +++ b/node_modules/es-object-atoms/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +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/node_modules/es-object-atoms/README.md b/node_modules/es-object-atoms/README.md new file mode 100644 index 0000000000000000000000000000000000000000..447695b2e1220bea0ee1572544a47ccb864e69c0 --- /dev/null +++ b/node_modules/es-object-atoms/README.md @@ -0,0 +1,63 @@ +# es-object-atoms [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ES Object-related atoms: Object, ToObject, RequireObjectCoercible. + +## Example + +```js +const assert = require('assert'); + +const $Object = require('es-object-atoms'); +const isObject = require('es-object-atoms/isObject'); +const ToObject = require('es-object-atoms/ToObject'); +const RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible'); + +assert.equal($Object, Object); +assert.throws(() => ToObject(null), TypeError); +assert.throws(() => ToObject(undefined), TypeError); +assert.throws(() => RequireObjectCoercible(null), TypeError); +assert.throws(() => RequireObjectCoercible(undefined), TypeError); + +assert.equal(isObject(undefined), false); +assert.equal(isObject(null), false); +assert.equal(isObject({}), true); +assert.equal(isObject([]), true); +assert.equal(isObject(function () {}), true); + +assert.deepEqual(RequireObjectCoercible(true), true); +assert.deepEqual(ToObject(true), Object(true)); + +const obj = {}; +assert.equal(RequireObjectCoercible(obj), obj); +assert.equal(ToObject(obj), obj); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-object-atoms +[npm-version-svg]: https://versionbadg.es/ljharb/es-object-atoms.svg +[deps-svg]: https://david-dm.org/ljharb/es-object-atoms.svg +[deps-url]: https://david-dm.org/ljharb/es-object-atoms +[dev-deps-svg]: https://david-dm.org/ljharb/es-object-atoms/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-object-atoms#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-object-atoms.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-object-atoms.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-object.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-object-atoms +[codecov-image]: https://codecov.io/gh/ljharb/es-object-atoms/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-object-atoms/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-object-atoms +[actions-url]: https://github.com/ljharb/es-object-atoms/actions diff --git a/node_modules/es-object-atoms/RequireObjectCoercible.d.ts b/node_modules/es-object-atoms/RequireObjectCoercible.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e26c45734d7f5c3c431972dfd915744d3967fac --- /dev/null +++ b/node_modules/es-object-atoms/RequireObjectCoercible.d.ts @@ -0,0 +1,3 @@ +declare function RequireObjectCoercible(value: T, optMessage?: string): T; + +export = RequireObjectCoercible; diff --git a/node_modules/es-object-atoms/RequireObjectCoercible.js b/node_modules/es-object-atoms/RequireObjectCoercible.js new file mode 100644 index 0000000000000000000000000000000000000000..8e191c6ef1521644b2bb0879f9f3e85ab7d21fd6 --- /dev/null +++ b/node_modules/es-object-atoms/RequireObjectCoercible.js @@ -0,0 +1,11 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +/** @type {import('./RequireObjectCoercible')} */ +module.exports = function RequireObjectCoercible(value) { + if (value == null) { + throw new $TypeError((arguments.length > 0 && arguments[1]) || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/node_modules/es-object-atoms/ToObject.d.ts b/node_modules/es-object-atoms/ToObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6dd3029d8c51858964fdf8e05228ab604334f5f --- /dev/null +++ b/node_modules/es-object-atoms/ToObject.d.ts @@ -0,0 +1,7 @@ +declare function ToObject(value: number): Number; +declare function ToObject(value: boolean): Boolean; +declare function ToObject(value: string): String; +declare function ToObject(value: bigint): BigInt; +declare function ToObject(value: T): T; + +export = ToObject; diff --git a/node_modules/es-object-atoms/ToObject.js b/node_modules/es-object-atoms/ToObject.js new file mode 100644 index 0000000000000000000000000000000000000000..2b99a7da025f57138b7bc98245ac032425655f25 --- /dev/null +++ b/node_modules/es-object-atoms/ToObject.js @@ -0,0 +1,10 @@ +'use strict'; + +var $Object = require('./'); +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +/** @type {import('./ToObject')} */ +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-object-atoms/index.d.ts b/node_modules/es-object-atoms/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8bdbfc8154dad2999f38aaba5a91257e668ad6ee --- /dev/null +++ b/node_modules/es-object-atoms/index.d.ts @@ -0,0 +1,3 @@ +declare const Object: ObjectConstructor; + +export = Object; diff --git a/node_modules/es-object-atoms/index.js b/node_modules/es-object-atoms/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1d33cef45ac4212d8710fa253075ca7969c5cd81 --- /dev/null +++ b/node_modules/es-object-atoms/index.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('.')} */ +module.exports = Object; diff --git a/node_modules/es-object-atoms/isObject.d.ts b/node_modules/es-object-atoms/isObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43bee3bc93c9929d5ea7b88eb5d1bc16bcd4ad5c --- /dev/null +++ b/node_modules/es-object-atoms/isObject.d.ts @@ -0,0 +1,3 @@ +declare function isObject(x: unknown): x is object; + +export = isObject; diff --git a/node_modules/es-object-atoms/isObject.js b/node_modules/es-object-atoms/isObject.js new file mode 100644 index 0000000000000000000000000000000000000000..ec49bf12877f62026e56899693bfadac77149498 --- /dev/null +++ b/node_modules/es-object-atoms/isObject.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isObject')} */ +module.exports = function isObject(x) { + return !!x && (typeof x === 'function' || typeof x === 'object'); +}; diff --git a/node_modules/es-object-atoms/package.json b/node_modules/es-object-atoms/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f4cec7152578638f52f6fa67a96c748271e6b4b4 --- /dev/null +++ b/node_modules/es-object-atoms/package.json @@ -0,0 +1,80 @@ +{ + "name": "es-object-atoms", + "version": "1.1.1", + "description": "ES Object-related atoms: Object, ToObject, RequireObjectCoercible", + "main": "index.js", + "exports": { + ".": "./index.js", + "./RequireObjectCoercible": "./RequireObjectCoercible.js", + "./isObject": "./isObject.js", + "./ToObject": "./ToObject.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@\">= 10.2\" audit --production", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-object-atoms.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "object", + "toobject", + "coercible" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-object-atoms/issues" + }, + "homepage": "https://github.com/ljharb/es-object-atoms#readme", + "dependencies": { + "es-errors": "^1.3.0" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/es-object-atoms/test/index.js b/node_modules/es-object-atoms/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..430b705aca13c9c40f62066a3cb4815faacbd4ed --- /dev/null +++ b/node_modules/es-object-atoms/test/index.js @@ -0,0 +1,38 @@ +'use strict'; + +var test = require('tape'); + +var $Object = require('../'); +var isObject = require('../isObject'); +var ToObject = require('../ToObject'); +var RequireObjectCoercible = require('..//RequireObjectCoercible'); + +test('errors', function (t) { + t.equal($Object, Object); + // @ts-expect-error + t['throws'](function () { ToObject(null); }, TypeError); + // @ts-expect-error + t['throws'](function () { ToObject(undefined); }, TypeError); + // @ts-expect-error + t['throws'](function () { RequireObjectCoercible(null); }, TypeError); + // @ts-expect-error + t['throws'](function () { RequireObjectCoercible(undefined); }, TypeError); + + t.deepEqual(RequireObjectCoercible(true), true); + t.deepEqual(ToObject(true), Object(true)); + t.deepEqual(ToObject(42), Object(42)); + var f = function () {}; + t.equal(ToObject(f), f); + + t.equal(isObject(undefined), false); + t.equal(isObject(null), false); + t.equal(isObject({}), true); + t.equal(isObject([]), true); + t.equal(isObject(function () {}), true); + + var obj = {}; + t.equal(RequireObjectCoercible(obj), obj); + t.equal(ToObject(obj), obj); + + t.end(); +}); diff --git a/node_modules/es-object-atoms/tsconfig.json b/node_modules/es-object-atoms/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..1f73cb725de8e34af3ce6bdd9bc9315604ca5599 --- /dev/null +++ b/node_modules/es-object-atoms/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es5", + }, +} diff --git a/node_modules/es-set-tostringtag/.eslintrc b/node_modules/es-set-tostringtag/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..2612ed8fefad45d3a68ae842a28e0353ebcb5cf1 --- /dev/null +++ b/node_modules/es-set-tostringtag/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/node_modules/es-set-tostringtag/.nycrc b/node_modules/es-set-tostringtag/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/es-set-tostringtag/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/es-set-tostringtag/CHANGELOG.md b/node_modules/es-set-tostringtag/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..00bdc038cb7c13f8462b70ee72f8bcf71a08d21e --- /dev/null +++ b/node_modules/es-set-tostringtag/CHANGELOG.md @@ -0,0 +1,67 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.1.0](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.3...v2.1.0) - 2025-01-01 + +### Commits + +- [actions] split out node 10-20, and 20+ [`ede033c`](https://github.com/es-shims/es-set-tostringtag/commit/ede033cc4e506c3966d2d482d4ac5987e329162a) +- [types] use shared config [`28ef164`](https://github.com/es-shims/es-set-tostringtag/commit/28ef164ad7c5bc21837c79f7ef25542a1f258ade) +- [New] add `nonConfigurable` option [`3bee3f0`](https://github.com/es-shims/es-set-tostringtag/commit/3bee3f04caddd318f3932912212ed20b2d62aad7) +- [Fix] validate boolean option argument [`3c8a609`](https://github.com/es-shims/es-set-tostringtag/commit/3c8a609c795a305ccca163f0ff6956caa88cdc0e) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/tape`, `auto-changelog`, `tape` [`501a969`](https://github.com/es-shims/es-set-tostringtag/commit/501a96998484226e07f5ffd447e8f305a998f1d8) +- [Tests] add coverage [`18af289`](https://github.com/es-shims/es-set-tostringtag/commit/18af2897b4e937373c9b8c8831bc338932246470) +- [readme] document `force` option [`bd446a1`](https://github.com/es-shims/es-set-tostringtag/commit/bd446a107b71a2270278442e5124f45590d3ee64) +- [Tests] use `@arethetypeswrong/cli` [`7c2c2fa`](https://github.com/es-shims/es-set-tostringtag/commit/7c2c2fa3cca0f4d263603adb75426b239514598f) +- [Tests] replace `aud` with `npm audit` [`9e372d7`](https://github.com/es-shims/es-set-tostringtag/commit/9e372d7e6db3dab405599a14d9074a99a03b8242) +- [Deps] update `get-intrinsic` [`7df1216`](https://github.com/es-shims/es-set-tostringtag/commit/7df12167295385c2a547410e687cb0c04f3a34b9) +- [Deps] update `hasown` [`993a7d2`](https://github.com/es-shims/es-set-tostringtag/commit/993a7d200e2059fd857ec1a25d0a49c2c34ae6e2) +- [Dev Deps] add missing peer dep [`148ed8d`](https://github.com/es-shims/es-set-tostringtag/commit/148ed8db99a7a94f9af3823fd083e6e437fa1587) + +## [v2.0.3](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.2...v2.0.3) - 2024-02-20 + +### Commits + +- add types [`d538513`](https://github.com/es-shims/es-set-tostringtag/commit/d5385133592a32a0a416cb535327918af7fbc4ad) +- [Deps] update `get-intrinsic`, `has-tostringtag`, `hasown` [`d129b29`](https://github.com/es-shims/es-set-tostringtag/commit/d129b29536bccc8a9d03a47887ca4d1f7ad0c5b9) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`132ed23`](https://github.com/es-shims/es-set-tostringtag/commit/132ed23c964a41ed55e4ab4a5a2c3fe185e821c1) +- [Tests] fix hasOwn require [`f89c831`](https://github.com/es-shims/es-set-tostringtag/commit/f89c831fe5f3edf1f979c597b56fee1be6111f56) + +## [v2.0.2](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.1...v2.0.2) - 2023-10-20 + +### Commits + +- [Refactor] use `hasown` instead of `has` [`0cc6c4e`](https://github.com/es-shims/es-set-tostringtag/commit/0cc6c4e61fd13e8f00b85424ae6e541ebf289e74) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`70e447c`](https://github.com/es-shims/es-set-tostringtag/commit/70e447cf9f82b896ddf359fda0a0498c16cf3ed2) +- [Deps] update `get-intrinsic` [`826aab7`](https://github.com/es-shims/es-set-tostringtag/commit/826aab76180392871c8efa99acc0f0bbf775c64e) + +## [v2.0.1](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.0...v2.0.1) - 2023-01-05 + +### Fixed + +- [Fix] move `has` to prod deps [`#2`](https://github.com/es-shims/es-set-tostringtag/issues/2) + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config` [`b9eecd2`](https://github.com/es-shims/es-set-tostringtag/commit/b9eecd23c10b7b43ba75089ac8ff8cc6b295798b) + +## [v2.0.0](https://github.com/es-shims/es-set-tostringtag/compare/v1.0.0...v2.0.0) - 2022-12-21 + +### Commits + +- [Tests] refactor tests [`168dcfb`](https://github.com/es-shims/es-set-tostringtag/commit/168dcfbb535c279dc48ccdc89419155125aaec18) +- [Breaking] do not set toStringTag if it is already set [`226ab87`](https://github.com/es-shims/es-set-tostringtag/commit/226ab874192c625d9e5f0e599d3f60d2b2aa83b5) +- [New] add `force` option to set even if already set [`1abd4ec`](https://github.com/es-shims/es-set-tostringtag/commit/1abd4ecb282f19718c4518284b0293a343564505) + +## v1.0.0 - 2022-12-21 + +### Commits + +- Initial implementation, tests, readme [`a0e1147`](https://github.com/es-shims/es-set-tostringtag/commit/a0e11473f79a233b46374525c962ea1b4d42418a) +- Initial commit [`ffd4aff`](https://github.com/es-shims/es-set-tostringtag/commit/ffd4afffbeebf29aff0d87a7cfc3f7844e09fe68) +- npm init [`fffe5bd`](https://github.com/es-shims/es-set-tostringtag/commit/fffe5bd1d1146d084730a387a9c672371f4a8fff) +- Only apps should have lockfiles [`d363871`](https://github.com/es-shims/es-set-tostringtag/commit/d36387139465623e161a15dbd39120537f150c62) diff --git a/node_modules/es-set-tostringtag/LICENSE b/node_modules/es-set-tostringtag/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c2a8460a3c4c3b8de391983485f26f4bce0ba5a6 --- /dev/null +++ b/node_modules/es-set-tostringtag/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ECMAScript Shims + +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/node_modules/es-set-tostringtag/README.md b/node_modules/es-set-tostringtag/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c27bc9fc0c44620607d2e39a20387079694a2c7b --- /dev/null +++ b/node_modules/es-set-tostringtag/README.md @@ -0,0 +1,53 @@ +# es-set-tostringtag [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A helper to optimistically set Symbol.toStringTag, when possible. + +## Example +Most common usage: +```js +var assert = require('assert'); +var setToStringTag = require('es-set-tostringtag'); + +var obj = {}; + +assert.equal(Object.prototype.toString.call(obj), '[object Object]'); + +setToStringTag(obj, 'tagged!'); + +assert.equal(Object.prototype.toString.call(obj), '[object tagged!]'); +``` + +## Options +An optional options argument can be provided as the third argument. The available options are: + +### `force` +If the `force` option is set to `true`, the toStringTag will be set even if it is already set. + +### `nonConfigurable` +If the `nonConfigurable` option is set to `true`, the toStringTag will be defined as non-configurable when possible. + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.com/package/es-set-tostringtag +[npm-version-svg]: https://versionbadg.es/es-shims/es-set-tostringtag.svg +[deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag.svg +[deps-url]: https://david-dm.org/es-shims/es-set-tostringtag +[dev-deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/es-set-tostringtag#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-set-tostringtag.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-set-tostringtag.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-set-tostringtag.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-set-tostringtag +[codecov-image]: https://codecov.io/gh/es-shims/es-set-tostringtag/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/es-shims/es-set-tostringtag/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/es-set-tostringtag +[actions-url]: https://github.com/es-shims/es-set-tostringtag/actions diff --git a/node_modules/es-set-tostringtag/index.d.ts b/node_modules/es-set-tostringtag/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c9a8fc4d4693439805d9eadcecc93f8a0c423eb8 --- /dev/null +++ b/node_modules/es-set-tostringtag/index.d.ts @@ -0,0 +1,10 @@ +declare function setToStringTag( + object: object & { [Symbol.toStringTag]?: unknown }, + value: string | unknown, + options?: { + force?: boolean; + nonConfigurable?: boolean; + }, +): void; + +export = setToStringTag; \ No newline at end of file diff --git a/node_modules/es-set-tostringtag/index.js b/node_modules/es-set-tostringtag/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6b6b49c7734d884e49f33256602bf2cb755d839e --- /dev/null +++ b/node_modules/es-set-tostringtag/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +var hasToStringTag = require('has-tostringtag/shams')(); +var hasOwn = require('hasown'); +var $TypeError = require('es-errors/type'); + +var toStringTag = hasToStringTag ? Symbol.toStringTag : null; + +/** @type {import('.')} */ +module.exports = function setToStringTag(object, value) { + var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; + var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; + if ( + (typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean') + || (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean') + ) { + throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans'); + } + if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { + if ($defineProperty) { + $defineProperty(object, toStringTag, { + configurable: !nonConfigurable, + enumerable: false, + value: value, + writable: false + }); + } else { + object[toStringTag] = value; // eslint-disable-line no-param-reassign + } + } +}; diff --git a/node_modules/es-set-tostringtag/package.json b/node_modules/es-set-tostringtag/package.json new file mode 100644 index 0000000000000000000000000000000000000000..277c3e5a6407b8d4440961dfa8ea1fed19ff9f5c --- /dev/null +++ b/node_modules/es-set-tostringtag/package.json @@ -0,0 +1,78 @@ +{ + "name": "es-set-tostringtag", + "version": "2.1.0", + "description": "A helper to optimistically set Symbol.toStringTag, when possible.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@\">= 10.2\" audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/es-set-tostringtag.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/es-shims/es-set-tostringtag/issues" + }, + "homepage": "https://github.com/es-shims/es-set-tostringtag#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.2", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/get-intrinsic": "^1.2.3", + "@types/has-symbols": "^1.0.2", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "testling": { + "files": "./test/index.js" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/es-set-tostringtag/test/index.js b/node_modules/es-set-tostringtag/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f1757b3a803db86e4f41186a4ff2b7411724d39a --- /dev/null +++ b/node_modules/es-set-tostringtag/test/index.js @@ -0,0 +1,85 @@ +'use strict'; + +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); +var hasOwn = require('hasown'); + +var setToStringTag = require('../'); + +test('setToStringTag', function (t) { + t.equal(typeof setToStringTag, 'function', 'is a function'); + + /** @type {{ [Symbol.toStringTag]?: typeof sentinel }} */ + var obj = {}; + var sentinel = {}; + + setToStringTag(obj, sentinel); + + t['throws']( + // @ts-expect-error + function () { setToStringTag(obj, sentinel, { force: 'yes' }); }, + TypeError, + 'throws if options is not an object' + ); + + t.test('has Symbol.toStringTag', { skip: !hasToStringTag }, function (st) { + st.ok(hasOwn(obj, Symbol.toStringTag), 'has toStringTag property'); + + st.equal(obj[Symbol.toStringTag], sentinel, 'toStringTag property is as expected'); + + st.equal(String(obj), '[object Object]', 'toStringTag works'); + + /** @type {{ [Symbol.toStringTag]?: string }} */ + var tagged = {}; + tagged[Symbol.toStringTag] = 'already tagged'; + st.equal(String(tagged), '[object already tagged]', 'toStringTag works'); + + setToStringTag(tagged, 'new tag'); + st.equal(String(tagged), '[object already tagged]', 'toStringTag is unchanged'); + + setToStringTag(tagged, 'new tag', { force: true }); + st.equal(String(tagged), '[object new tag]', 'toStringTag is changed with force: true'); + + st.deepEqual( + Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag), + { + configurable: true, + enumerable: false, + value: 'new tag', + writable: false + }, + 'has expected property descriptor' + ); + + setToStringTag(tagged, 'new tag', { force: true, nonConfigurable: true }); + st.deepEqual( + Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag), + { + configurable: false, + enumerable: false, + value: 'new tag', + writable: false + }, + 'is nonconfigurable' + ); + + st.end(); + }); + + t.test('does not have Symbol.toStringTag', { skip: hasToStringTag }, function (st) { + var passed = true; + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (hasOwn(obj, key)) { + st.fail('object has own key ' + key); + passed = false; + } + } + if (passed) { + st.ok(true, 'object has no enumerable own keys'); + } + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/es-set-tostringtag/tsconfig.json b/node_modules/es-set-tostringtag/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..d9a6668c3ae6be748c78fbd5694053706b3d6942 --- /dev/null +++ b/node_modules/es-set-tostringtag/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/es-shim-unscopables/.eslintrc b/node_modules/es-shim-unscopables/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..705aaa57be8cdbdf6f51e9139cb7aded0c1d7cef --- /dev/null +++ b/node_modules/es-shim-unscopables/.eslintrc @@ -0,0 +1,37 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + "es2017": true, + "es2020": true, + "es2021": true, + "es2022": true, + }, + + "rules": { + "array-bracket-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": 0, + "max-lines-per-function": [2, 80], + "max-params": [2, 4], + "max-statements": 0, + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "new-cap": 0, + }, + }, + ], +} diff --git a/node_modules/es-shim-unscopables/.github/FUNDING.yml b/node_modules/es-shim-unscopables/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..af711298c20708d192097acb5d69511ef0a648d7 --- /dev/null +++ b/node_modules/es-shim-unscopables/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-shim-unscopables +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/es-shim-unscopables/.nycrc b/node_modules/es-shim-unscopables/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/es-shim-unscopables/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/es-shim-unscopables/CHANGELOG.md b/node_modules/es-shim-unscopables/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..59a8e051e59649842b43be4b6ed0ebd72ae4a325 --- /dev/null +++ b/node_modules/es-shim-unscopables/CHANGELOG.md @@ -0,0 +1,35 @@ +### Changelog + +All notable changes to this project will be documented in this file. Dates are displayed in UTC. + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +#### [v1.1.0](https://github.com/ljharb/es-shim-unscopables/compare/v1.0.2...v1.1.0) + +> 11 February 2025 + +- [New] add types [`2b94d6d`](https://github.com/ljharb/es-shim-unscopables/commit/2b94d6da58c272944de33f7e5b601a56dbb025fe) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `es-value-fixtures`, `for-each`, `npmignore`, `object-inspect`, `tape` [`bc42bcf`](https://github.com/ljharb/es-shim-unscopables/commit/bc42bcf1901ad9c3e6427c8f39d1ac22e7e98310) +- [meta] add missing `engines.node` [`9ffcc49`](https://github.com/ljharb/es-shim-unscopables/commit/9ffcc491132ae0f7681694630910e1c4eb2cd548) + +#### [v1.0.2](https://github.com/ljharb/es-shim-unscopables/compare/v1.0.1...v1.0.2) + +> 20 October 2023 + +- [Deps] remove unused `has` [`f9fc3ba`](https://github.com/ljharb/es-shim-unscopables/commit/f9fc3bad9a291450ef1d1470347d0faffc937e14) + +#### [v1.0.1](https://github.com/ljharb/es-shim-unscopables/compare/v1.0.0...v1.0.1) + +> 20 October 2023 + +- [meta] use `npmignore` to autogenerate an npmignore file [`4f29eb9`](https://github.com/ljharb/es-shim-unscopables/commit/4f29eb9cfa28cbc08519446027accf8f7e3c472e) +- [Refactor] use `hasown` instead of `has` [`9d2577b`](https://github.com/ljharb/es-shim-unscopables/commit/9d2577b8bf6354d68111a8c20f020303370ef85f) +- [actions] update checkout action [`4525257`](https://github.com/ljharb/es-shim-unscopables/commit/45252572bf21dc5aab948c99ae0397e90f357718) + +#### v1.0.0 + +> 11 April 2022 + +- Initial implementation, tests [`0313267`](https://github.com/ljharb/es-shim-unscopables/commit/03132672560a06df8a36685c1688793d445ea034) +- Initial commit [`5a68e27`](https://github.com/ljharb/es-shim-unscopables/commit/5a68e27e8f11d8b453c00e9239b35ec8795c850e) +- [meta] do not publish workflow files [`4e29785`](https://github.com/ljharb/es-shim-unscopables/commit/4e2978541c25ce590589d5f23f311af6ca3618a7) diff --git a/node_modules/es-shim-unscopables/LICENSE b/node_modules/es-shim-unscopables/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6abfe1434ebd5c15c245b9f0a7c25e36b581df19 --- /dev/null +++ b/node_modules/es-shim-unscopables/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Jordan Harband + +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/node_modules/es-shim-unscopables/README.md b/node_modules/es-shim-unscopables/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4728b6308ccb269a1803faedf7862f8a48deb05b --- /dev/null +++ b/node_modules/es-shim-unscopables/README.md @@ -0,0 +1,57 @@ +# es-shim-unscopables [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Helper package to shim a method into `Array.prototype[Symbol.unscopables]` + +## Example + +```js +const assert = require('assert'); + +const shimUnscopables = require('es-shim-unscopables'); + +let copyWithin; +let concat; +with ([]) { + assert.equal(concat, Array.prototype.concat); + assert.notEqual(copyWithin, Array.prototype.copyWithin); +} + +shimUnscopables('concat'); + +with ([]) { + assert.notEqual(concat, Array.prototype.concat); + assert.notEqual(copyWithin, Array.prototype.copyWithin); +} +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-shim-unscopables +[npm-version-svg]: https://versionbadg.es/ljharb/es-shim-unscopables.svg +[deps-svg]: https://david-dm.org/ljharb/es-shim-unscopables.svg +[deps-url]: https://david-dm.org/ljharb/es-shim-unscopables +[dev-deps-svg]: https://david-dm.org/ljharb/es-shim-unscopables/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-shim-unscopables#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-shim-unscopables.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-shim-unscopables.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-shim-unscopables.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-shim-unscopables +[codecov-image]: https://codecov.io/gh/ljharb/es-shim-unscopables/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-shim-unscopables/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-shim-unscopables +[actions-url]: https://github.com/ljharb/es-shim-unscopables/actions diff --git a/node_modules/es-shim-unscopables/index.d.ts b/node_modules/es-shim-unscopables/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a133caa29b18ee1cdad64dbacfa5272475cf712 --- /dev/null +++ b/node_modules/es-shim-unscopables/index.d.ts @@ -0,0 +1,8 @@ +type Unscopableable = string & { + [K in keyof typeof Array.prototype]: + typeof Array.prototype[K] extends Function ? K : never + }[keyof typeof Array.prototype]; + +declare function shimUnscopables(method: Unscopableable): void; + +export = shimUnscopables; \ No newline at end of file diff --git a/node_modules/es-shim-unscopables/index.js b/node_modules/es-shim-unscopables/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f7ec78741c5d1d62dbdd2cea35825842e93a9b80 --- /dev/null +++ b/node_modules/es-shim-unscopables/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var hasOwn = require('hasown'); + +var hasUnscopables = typeof Symbol === 'function' && typeof Symbol.unscopables === 'symbol'; + +var map = hasUnscopables && Array.prototype[Symbol.unscopables]; + +var $TypeError = TypeError; + +/** @type {import('.')} */ +module.exports = function shimUnscopables(method) { + if (typeof method !== 'string' || !method) { + throw new $TypeError('method must be a non-empty string'); + } + if (!hasOwn(Array.prototype, method)) { + throw new $TypeError('method must be on Array.prototype'); + } + if (hasUnscopables && map) { + map[method] = true; + } +}; diff --git a/node_modules/es-shim-unscopables/package.json b/node_modules/es-shim-unscopables/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bbd61dfdd37f779c85be7b41578c68706ecf5c9c --- /dev/null +++ b/node_modules/es-shim-unscopables/package.json @@ -0,0 +1,65 @@ +{ + "name": "es-shim-unscopables", + "version": "1.1.0", + "description": "Helper package to shim a method into `Array.prototype[Symbol.unscopables]`", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint-disabled": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "tsc && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@\">= 10.2\" audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-shim-unscopables.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-shim-unscopables/issues" + }, + "homepage": "https://github.com/ljharb/es-shim-unscopables#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.3", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "^5.8.0-dev.20250211" + }, + "dependencies": { + "hasown": "^2.0.2" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/es-shim-unscopables/test/index.js b/node_modules/es-shim-unscopables/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..905afda5ddaa422f7e750acc4f4b23eb6dbdf6f2 --- /dev/null +++ b/node_modules/es-shim-unscopables/test/index.js @@ -0,0 +1,70 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); +var hasOwn = require('hasown'); + +var shimUnscopables = require('../'); + +/** @type {(a: symbol, b: symbol) => number} */ +var sortSymbols = function (a, b) { + return inspect(a).localeCompare(inspect(b)); +}; + +test('shimUnscopables', function (t) { + t.equal(typeof shimUnscopables, 'function', 'is a function'); + + forEach(v.nonStrings, function (notNonEmptyString) { + t['throws']( + // @ts-expect-error + function () { shimUnscopables(notNonEmptyString); }, + TypeError, + inspect(notNonEmptyString) + ' is not a non-empty String' + ); + }); + + t['throws']( + // @ts-expect-error + function () { shimUnscopables('x'); }, + TypeError, + inspect('x') + ' is not on Array.prototype' + ); + + t.test('no symbols', { skip: typeof Symbol === 'function' }, function (st) { + st.doesNotThrow(function () { shimUnscopables('forEach'); }); + + st.end(); + }); + + t.test('symbols, no unscopables', { skip: typeof Symbol !== 'function' || !!Symbol.unscopables }, function (st) { + st.deepEqual(Object.getOwnPropertySymbols(Array.prototype), [Symbol.iterator]); + + shimUnscopables('forEach'); + + st.deepEqual(Object.getOwnPropertySymbols(Array.prototype), [Symbol.iterator]); + + st.end(); + }); + + t.test('Symbol.unscopables', { skip: typeof Symbol !== 'function' || !Symbol.unscopables }, function (st) { + st.deepEqual( + Object.getOwnPropertySymbols(Array.prototype).sort(sortSymbols), + [Symbol.iterator, Symbol.unscopables] + ); + st.notOk(hasOwn(Array.prototype[Symbol.unscopables], 'forEach'), 'unscopables map lacks forEach'); + + shimUnscopables('forEach'); + + st.deepEqual( + Object.getOwnPropertySymbols(Array.prototype).sort(sortSymbols), + [Symbol.iterator, Symbol.unscopables] + ); + st.equal(Array.prototype[Symbol.unscopables].forEach, true, 'unscopables map has forEach'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/es-shim-unscopables/test/with.js b/node_modules/es-shim-unscopables/test/with.js new file mode 100644 index 0000000000000000000000000000000000000000..3770cf1d2388111dcf90ccc779aaa02ecee91873 --- /dev/null +++ b/node_modules/es-shim-unscopables/test/with.js @@ -0,0 +1,43 @@ +/* eslint no-restricted-syntax: 0, no-with: 0, strict: 0 */ + +var test = require('tape'); + +var shimUnscopables = require('../'); + +test('`with` statement', { skip: typeof Symbol !== 'function' || !Symbol.unscopables }, function (t) { + // @ts-expect-error this variable is declared in case unscopables doesn't work + var entries; + // @ts-expect-error this variable is declared in case unscopables doesn't work + var concat; + // @ts-expect-error `with` unsupported + with ([]) { + t.equal(concat, Array.prototype.concat, 'concat is dynamically bound'); + t.notEqual(entries, Array.prototype.entries, 'entries is not dynamically bound'); + } + + /** @type {Record} */ + var obj = { + foo: 1, + bar: 2 + }; + // @ts-expect-error this variable is declared in case unscopables doesn't work + var foo; + // @ts-expect-error this variable is declared in case unscopables doesn't work + var bar; + obj[Symbol.unscopables] = { foo: true }; + // @ts-expect-error `with` unsupported + with (obj) { + t.equal(foo, undefined); + t.equal(bar, obj.bar); + } + + shimUnscopables('concat'); + + // @ts-expect-error `with` unsupported + with ([]) { + t.notEqual(concat, Array.prototype.concat, 'concat is no longer dynamically bound'); + t.notEqual(entries, Array.prototype.entries, 'entries is still not dynamically bound'); + } + + t.end(); +}); diff --git a/node_modules/es-shim-unscopables/tsconfig.json b/node_modules/es-shim-unscopables/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..c7fcb6e97642d31b9d0318345d0559734faa90c9 --- /dev/null +++ b/node_modules/es-shim-unscopables/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + "test/list-exports" + ], +} diff --git a/node_modules/es-to-primitive/.editorconfig b/node_modules/es-to-primitive/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..bc228f8269443bf772b437890dde7756a3e8a894 --- /dev/null +++ b/node_modules/es-to-primitive/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/es-to-primitive/.eslintignore b/node_modules/es-to-primitive/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..404abb22121cdcbb710c56f4ba2684789cb2868c --- /dev/null +++ b/node_modules/es-to-primitive/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/node_modules/es-to-primitive/.eslintrc b/node_modules/es-to-primitive/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..93ad10a373dc4649dfd560915e45bae07cdc5de0 --- /dev/null +++ b/node_modules/es-to-primitive/.eslintrc @@ -0,0 +1,20 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 24, "properties": "never" }], + "new-cap": [2, { "capIsNewExceptions": ["GetMethod"] }] + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "max-lines-per-function": 0, + }, + } + ], +} diff --git a/node_modules/es-to-primitive/.github/FUNDING.yml b/node_modules/es-to-primitive/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..9f928ae809d50c18aa9d24bea66f7dea85da323c --- /dev/null +++ b/node_modules/es-to-primitive/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-to-primitive +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/es-to-primitive/.nycrc b/node_modules/es-to-primitive/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/es-to-primitive/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/es-to-primitive/CHANGELOG.md b/node_modules/es-to-primitive/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..c4511c95d7c3b6ebae5e95bc000ec94f9adc8045 --- /dev/null +++ b/node_modules/es-to-primitive/CHANGELOG.md @@ -0,0 +1,101 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.3.0](https://github.com/ljharb/es-to-primitive/compare/v1.2.1...v1.3.0) - 2024-11-26 + +### Commits + +- [actions] reuse common workflows [`bb72efc`](https://github.com/ljharb/es-to-primitive/commit/bb72efc7e04ae11b84e4aecf120a4e9063e34428) +- [Tests] use `es-value-fixtures` [`a912f7b`](https://github.com/ljharb/es-to-primitive/commit/a912f7b675333735c1c980cda88772ac1870395b) +- [Tests] migrate tests to Github Actions [`510baf0`](https://github.com/ljharb/es-to-primitive/commit/510baf092633a62d59866fbf56836ce42c717c70) +- [New] add types [`69ba1fd`](https://github.com/ljharb/es-to-primitive/commit/69ba1fdcac834b03698739990ba98fe6007024dc) +- [meta] remove unused Makefile [`4ea66e6`](https://github.com/ljharb/es-to-primitive/commit/4ea66e62ef4afa0102eb8335ba3e003e8332f664) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`3c31937`](https://github.com/ljharb/es-to-primitive/commit/3c31937119ca24fd6d00e362d6435a28cfe9e91c) +- [meta] do not publish github action workflow files [`389567e`](https://github.com/ljharb/es-to-primitive/commit/389567e8523b65b90b529f1029d215fd4f12ac14) +- [meta] use `npmignore` to autogenerate an npmignore file [`9f3aa76`](https://github.com/ljharb/es-to-primitive/commit/9f3aa7651791ab9386408035491a1ba4fec4c432) +- [actions] split out node 10-20, and 20+ [`c60d7d8`](https://github.com/ljharb/es-to-primitive/commit/c60d7d822a36880bce0535335c70fdc2a8da232d) +- [Tests] run `nyc` on all tests; use `tape` runner [`29cbb89`](https://github.com/ljharb/es-to-primitive/commit/29cbb89800b5cfef9bef3ae7e0e779c782e1bbb9) +- [meta] add `auto-changelog` [`ea744b2`](https://github.com/ljharb/es-to-primitive/commit/ea744b2a0bda788b0d957c1787e41434e98b0155) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `function.prototype.name`, `has-symbols`, `object-inspect`, `object-is`, `tape` [`e5c3c79`](https://github.com/ljharb/es-to-primitive/commit/e5c3c792f67685a9647e817e7582d4c76a876f69) +- [actions] add automatic rebasing / merge commit blocking [`a5a6f00`](https://github.com/ljharb/es-to-primitive/commit/a5a6f0066540c91c8aa45a4921f1cd2349f435ba) +- [Dev Deps] update `@ljharb/eslint-config`, `es-value-fixtures`, `function.prototype.name`, `npmignore`, `object-inspect`, `object-is`, `tape` [`7941fd5`](https://github.com/ljharb/es-to-primitive/commit/7941fd530fb3a73f923b76c739335ffc21793ad6) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `es-value-fixtures`, `foreach`, `object-inspect`, `tape` [`eb1c79c`](https://github.com/ljharb/es-to-primitive/commit/eb1c79c288c89154014634b94f64308344901eaf) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `function.prototype.name`, `object-inspect`, `safe-publish-latest`, `tape` [`249b42f`](https://github.com/ljharb/es-to-primitive/commit/249b42f1ce069ea78a032f10414d1c1c0b6c6345) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `function.prototype.name`, `object-inspect`, `object-is`, `tape` [`d57d5e9`](https://github.com/ljharb/es-to-primitive/commit/d57d5e9ea5ea4778f383e2f1aa637be0be80dd78) +- [actions] update codecov uploader [`003b62c`](https://github.com/ljharb/es-to-primitive/commit/003b62c483372d5eac38f51925b6cbdf5d7a0665) +- [actions] add "Allow Edits" workflow [`75ee990`](https://github.com/ljharb/es-to-primitive/commit/75ee99083626dc14558ae294c127e4aaf925d214) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `object-is`; add `safe-publish-latest` [`ba5da7b`](https://github.com/ljharb/es-to-primitive/commit/ba5da7bffd93c3cc2e079ad751a3e678333a973e) +- [readme] remove travis badge [`6f7aec7`](https://github.com/ljharb/es-to-primitive/commit/6f7aec78e4f1ebfca74c384a837063f4099e7b9b) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`3291fd5`](https://github.com/ljharb/es-to-primitive/commit/3291fd567695b45bddc58e5ec3da2dcce0e5ccc7) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `function.prototype.name`, `has-symbols`, `object-inspect` [`53007f2`](https://github.com/ljharb/es-to-primitive/commit/53007f25d1f26e301b4f41d070c423723bed1690) +- [actions] update checkout action [`69640db`](https://github.com/ljharb/es-to-primitive/commit/69640dbb9ddafe05527388fe72bda1aca08d07b5) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-is`, `tape`; add `aud` [`c9d644e`](https://github.com/ljharb/es-to-primitive/commit/c9d644ef3c6b2210e86ce2d3aa8e8b1668f6801d) +- [Tests] use `for-each` instead of `foreach` [`e9117bb`](https://github.com/ljharb/es-to-primitive/commit/e9117bb055417cb721dbf5dbe1d23b058a8241f2) +- [readme] add github actions/codecov badges [`53cd375`](https://github.com/ljharb/es-to-primitive/commit/53cd375ab22a25d4bada35000473e30c22ee2028) +- [Deps] update `is-callable`, `is-date-object`, `is-symbol` [`8116c68`](https://github.com/ljharb/es-to-primitive/commit/8116c68a8ba555f8daaf1d71a60c974d3439c94b) +- [Tests] fix test skipping for `Symbol.toPrimitive` [`e6268ef`](https://github.com/ljharb/es-to-primitive/commit/e6268ef31b34cb5263501ba9735ccce78a07e504) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`da41c40`](https://github.com/ljharb/es-to-primitive/commit/da41c40399c2a574f74a59b85800d9934b91d49a) +- [Deps] update `is-callable`, `is-date-object` [`96fe13f`](https://github.com/ljharb/es-to-primitive/commit/96fe13ff3c486c7857c2ca69ac70161ef0e5b4a1) +- [Tests] replace `aud` with `npm audit` [`0b53154`](https://github.com/ljharb/es-to-primitive/commit/0b531546081427cb8a4fc06fde5540ba0b287b5b) +- [meta] use `prepublishOnly` script for npm 7+ [`9d7d485`](https://github.com/ljharb/es-to-primitive/commit/9d7d4856d4b5f28c68de2aba068522b9a85ee669) +- [Deps] update `is-callable` [`3c990b6`](https://github.com/ljharb/es-to-primitive/commit/3c990b646813e2470b19460e32801113f9acc13b) +- [Deps] update `is-callable` [`9bcfff2`](https://github.com/ljharb/es-to-primitive/commit/9bcfff276ce078034404b6b27e4f74beb530002c) +- [Deps] update `is-callable` [`1eb5478`](https://github.com/ljharb/es-to-primitive/commit/1eb5478e0c93b230b7bc67f9fef963d94a391117) +- [meta] only run `aud` on prod deps [`1fcd896`](https://github.com/ljharb/es-to-primitive/commit/1fcd89684a4351c15fec2cb289ecc331f917b80e) +- [Deps] update `is-symbol` [`7174a47`](https://github.com/ljharb/es-to-primitive/commit/7174a474f4f9f07319c81f046b10446caf9b3af0) + + + +1.2.1 / 2019-11-08 +================= + * [readme] remove testling URLs + * [meta] add `funding` field + * [meta] create FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `replace`, `semver`, `tape`, `function.prototype.name` + * [Tests] use shared travis-ci configs + * [Tests] Add es5 tests for `symbol` types (#45) + * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops + * [Tests] remove `jscs` + +1.2.0 / 2018-09-27 +================= + * [New] create ES2015 entry point/property, to replace ES6 + * [Fix] Ensure optional arguments are not part of the length (#29) + * [Deps] update `is-callable` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `object-inspect`, `replace` + * [Tests] avoid util.inspect bug with `new Date(NaN)` on node v6.0 and v6.1. + * [Tests] up to `node` `v10.11`, `v9.11`, `v8.12`, `v6.14`, `v4.9` + +1.1.1 / 2016-01-03 +================= + * [Fix: ES5] fix coercion logic: ES5’s ToPrimitive does not coerce any primitive value, regardless of hint (#2) + +1.1.0 / 2015-12-27 +================= + * [New] add `Symbol.toPrimitive` support + * [Deps] update `is-callable`, `is-date-object` + * [Dev Deps] update `eslint`, `tape`, `semver`, `jscs`, `covert`, `nsp`, `@ljharb/eslint-config` + * [Dev Deps] remove unused deps + * [Tests] up to `node` `v5.3` + * [Tests] fix npm upgrades on older node versions + * [Tests] fix testling + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + +1.0.1 / 2016-01-03 +================= + * [Fix: ES5] fix coercion logic: ES5’s ToPrimitive does not coerce any primitive value, regardless of hint (#2) + * [Deps] update `is-callable`, `is-date-object` + * [Dev Deps] update `eslint`, `tape`, `semver`, `jscs`, `covert`, `nsp`, `@ljharb/eslint-config` + * [Dev Deps] remove unused deps + * [Tests] up to `node` `v5.3` + * [Tests] fix npm upgrades on older node versions + * [Tests] fix testling + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + +1.0.0 / 2015-03-19 +================= + * Initial release. diff --git a/node_modules/es-to-primitive/LICENSE b/node_modules/es-to-primitive/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b43df444e518288ceef6eaa9badd33388191b1d3 --- /dev/null +++ b/node_modules/es-to-primitive/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +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/node_modules/es-to-primitive/README.md b/node_modules/es-to-primitive/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0e86de4a8da7c1aaaac235ece79d3db220d16aec --- /dev/null +++ b/node_modules/es-to-primitive/README.md @@ -0,0 +1,52 @@ +# es-to-primitive [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions. +When different versions of the spec conflict, the default export will be the latest version of the abstract operation. +Alternative versions will also be available under an `es5`/`es2015` exported property if you require a specific version. + +## Example + +```js +var toPrimitive = require('es-to-primitive'); +var assert = require('assert'); + +assert(toPrimitive(function () {}) === String(function () {})); + +var date = new Date(); +assert(toPrimitive(date) === String(date)); + +assert(toPrimitive({ valueOf: function () { return 3; } }) === 3); + +assert(toPrimitive(['a', 'b', 3]) === String(['a', 'b', 3])); + +var sym = Symbol(); +assert(toPrimitive(Object(sym)) === sym); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/es-to-primitive +[npm-version-svg]: https://versionbadg.es/ljharb/es-to-primitive.svg +[deps-svg]: https://david-dm.org/ljharb/es-to-primitive.svg +[deps-url]: https://david-dm.org/ljharb/es-to-primitive +[dev-deps-svg]: https://david-dm.org/ljharb/es-to-primitive/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-to-primitive#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-to-primitive.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-to-primitive.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-to-primitive.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-to-primitive +[codecov-image]: https://codecov.io/gh/ljharb/es-to-primitive/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-to-primitive/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-to-primitive +[actions-url]: https://github.com/ljharb/es-to-primitive/actions diff --git a/node_modules/es-to-primitive/es2015.d.ts b/node_modules/es-to-primitive/es2015.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc402614695d8f7dc1c156cf0def59f106e059a6 --- /dev/null +++ b/node_modules/es-to-primitive/es2015.d.ts @@ -0,0 +1,5 @@ +type primitive = null | undefined | string | symbol | number | boolean | bigint; + +declare function ToPrimitive(input: unknown, hint?: StringConstructor | NumberConstructor): primitive; + +export = ToPrimitive; diff --git a/node_modules/es-to-primitive/es2015.js b/node_modules/es-to-primitive/es2015.js new file mode 100644 index 0000000000000000000000000000000000000000..7d1b78f4abd48abb60eeb3462843ea9dc31b105e --- /dev/null +++ b/node_modules/es-to-primitive/es2015.js @@ -0,0 +1,82 @@ +'use strict'; + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = require('./helpers/isPrimitive'); +var isCallable = require('is-callable'); +var isDate = require('is-date-object'); +var isSymbol = require('is-symbol'); + +/** @type {(O: { valueOf?: () => unknown, toString?: () => unknown }, hint: 'number' | 'string' | 'default') => null | undefined | string | symbol | number | boolean | bigint} */ +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + /** @type {('toString' | 'valueOf')[]} */ + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +/** @type {(O: Record, P: K) => Function | undefined} */ +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + String(P) + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +/** @type {import('./es2015')} */ +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + /** @type {'default' | 'string' | 'number'} */ + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + // eslint-disable-next-line no-extra-parens + exoticToPrim = GetMethod(/** @type {Record} */ (input), Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + // eslint-disable-next-line no-extra-parens + return ordinaryToPrimitive(/** @type {object} */ (input), hint === 'default' ? 'number' : hint); +}; diff --git a/node_modules/es-to-primitive/es5.d.ts b/node_modules/es-to-primitive/es5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cf043138b796f3ec97874f9998c91dde88a861cc --- /dev/null +++ b/node_modules/es-to-primitive/es5.d.ts @@ -0,0 +1,3 @@ +declare function ToPrimitive(input: unknown, hint?: StringConstructor | NumberConstructor): null | undefined | string | symbol | number | boolean | bigint; + +export = ToPrimitive; diff --git a/node_modules/es-to-primitive/es5.js b/node_modules/es-to-primitive/es5.js new file mode 100644 index 0000000000000000000000000000000000000000..5b0896edd197a1b954e835fa622afb42d3e201f4 --- /dev/null +++ b/node_modules/es-to-primitive/es5.js @@ -0,0 +1,52 @@ +'use strict'; + +var toStr = Object.prototype.toString; + +var isPrimitive = require('./helpers/isPrimitive'); + +var isCallable = require('is-callable'); + +/** @type {{ [k in `[[${string}]]`]: (O: { toString?: unknown, valueOf?: unknown }, actualHint?: StringConstructor | NumberConstructor) => null | undefined | string | symbol | number | boolean | bigint; }} */ +// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 +var ES5internalSlots = { + '[[DefaultValue]]': function (O) { + var actualHint; + if (arguments.length > 1) { + actualHint = arguments[1]; + } else { + actualHint = toStr.call(O) === '[object Date]' ? String : Number; + } + + if (actualHint === String || actualHint === Number) { + /** @type {('toString' | 'valueOf')[]} */ + var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var value, i; + for (i = 0; i < methods.length; ++i) { + var method = methods[i]; + if (isCallable(O[method])) { + // eslint-disable-next-line no-extra-parens + value = /** @type {Function} */ (O[method])(); + if (isPrimitive(value)) { + return value; + } + } + } + throw new TypeError('No default value'); + } + throw new TypeError('invalid [[DefaultValue]] hint supplied'); + } +}; + +/** @type {import('./es5')} */ +// http://ecma-international.org/ecma-262/5.1/#sec-9.1 +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + if (arguments.length > 1) { + // eslint-disable-next-line no-extra-parens + return ES5internalSlots['[[DefaultValue]]'](/** @type {object} */ (input), arguments[1]); + } + // eslint-disable-next-line no-extra-parens + return ES5internalSlots['[[DefaultValue]]'](/** @type {object} */ (input)); +}; diff --git a/node_modules/es-to-primitive/es6.d.ts b/node_modules/es-to-primitive/es6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d9bb016895f5a8e5446f574fd167bab707b51ea5 --- /dev/null +++ b/node_modules/es-to-primitive/es6.d.ts @@ -0,0 +1,3 @@ +import ES2015 from './es2015'; + +export = ES2015; diff --git a/node_modules/es-to-primitive/es6.js b/node_modules/es-to-primitive/es6.js new file mode 100644 index 0000000000000000000000000000000000000000..1683f68699a9aaf99aceb8b0a581a5343dae2cfd --- /dev/null +++ b/node_modules/es-to-primitive/es6.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./es2015')} */ +module.exports = require('./es2015'); diff --git a/node_modules/es-to-primitive/helpers/isPrimitive.js b/node_modules/es-to-primitive/helpers/isPrimitive.js new file mode 100644 index 0000000000000000000000000000000000000000..401b5a47bf2b0681e281e2e77e3f2b07964e1d89 --- /dev/null +++ b/node_modules/es-to-primitive/helpers/isPrimitive.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {(value: unknown) => value is null | undefined | string | symbol | number | boolean | bigint} */ +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/es-to-primitive/index.d.ts b/node_modules/es-to-primitive/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ecbbb570a3abc77c2d1ca27c50bd81854cc3530 --- /dev/null +++ b/node_modules/es-to-primitive/index.d.ts @@ -0,0 +1,11 @@ +import ES5 from './es5'; +import ES6 from './es6'; +import ES2015 from './es2015'; + +declare const ToPrimitive: typeof ES2015 & { + readonly ES5: typeof ES5; + /** @deprecated */ + readonly ES6: typeof ES6; + readonly ES2015: typeof ES2015; +}; +export = ToPrimitive; diff --git a/node_modules/es-to-primitive/index.js b/node_modules/es-to-primitive/index.js new file mode 100644 index 0000000000000000000000000000000000000000..90c5ed32063ba78a0b1ed92df83ce008323581b7 --- /dev/null +++ b/node_modules/es-to-primitive/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var ES5 = require('./es5'); +var ES6 = require('./es6'); +var ES2015 = require('./es2015'); + +if (Object.defineProperty) { + Object.defineProperty(ES2015, 'ES5', { enumerable: false, value: ES5 }); + Object.defineProperty(ES2015, 'ES6', { enumerable: false, value: ES6 }); + Object.defineProperty(ES2015, 'ES2015', { enumerable: false, value: ES2015 }); +} else { + // @ts-expect-error TODO + ES2015.ES5 = ES5; + // @ts-expect-error TODO + ES2015.ES6 = ES6; + // @ts-expect-error TODO + ES2015.ES2015 = ES2015; +} + +/** @type {import('.')} */ +module.exports = ES2015; diff --git a/node_modules/es-to-primitive/package.json b/node_modules/es-to-primitive/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b2cf9e1c7d66eaef2a962cf74817218c677edb6d --- /dev/null +++ b/node_modules/es-to-primitive/package.json @@ -0,0 +1,97 @@ +{ + "name": "es-to-primitive", + "version": "1.3.0", + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "description": "ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions.", + "license": "MIT", + "main": "index.js", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "tests-only": "nyc tape 'test/**/*.js'", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git://github.com/ljharb/es-to-primitive.git" + }, + "keywords": [ + "primitive", + "abstract", + "ecmascript", + "es5", + "es6", + "es2015", + "toPrimitive", + "coerce", + "type", + "object", + "string", + "number", + "boolean", + "symbol", + "null", + "undefined" + ], + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.0", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.0", + "@types/for-each": "^0.3.3", + "@types/function.prototype.name": "^1.1.3", + "@types/is-callable": "^1.1.2", + "@types/is-date-object": "^1.0.4", + "@types/is-symbol": "^1.0.2", + "@types/object-inspect": "^1.13.0", + "@types/object-is": "^1.1.0", + "@types/tape": "^5.6.4", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.5.0", + "eslint": "=8.8.0", + "for-each": "^0.3.3", + "function.prototype.name": "^1.1.6", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "object-is": "^1.1.6", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true, + "startingVersion": "1.2.2" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/es-to-primitive/test/es2015.js b/node_modules/es-to-primitive/test/es2015.js new file mode 100644 index 0000000000000000000000000000000000000000..7b8458fbdab703bbc23d11cf0fef8937d76bad84 --- /dev/null +++ b/node_modules/es-to-primitive/test/es2015.js @@ -0,0 +1,140 @@ +'use strict'; + +var test = require('tape'); +var toPrimitive = require('../es2015'); +var is = require('object-is'); +var forEach = require('for-each'); +var functionName = require('function.prototype.name'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); + +/** @typedef {{ toString?: unknown, valueOf?: unknown, [Symbol.toPrimitive]?: unknown }} Coercible */ + +test('function properties', function (t) { + t.equal(toPrimitive.length, 1, 'length is 1'); + t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive'); + + t.end(); +}); + +test('primitives', function (t) { + forEach(v.primitives, function (i) { + t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value'); + t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'); + t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'); + }); + t.end(); +}); + +test('Symbols', { skip: !v.hasSymbols }, function (t) { + forEach(v.symbols, function (sym) { + t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value'); + t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value'); + t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value'); + }); + + var primitiveSym = Symbol('primitiveSym'); + var objectSym = Object(primitiveSym); + t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym)); + t.end(); +}); + +test('Arrays', function (t) { + var arrays = [[], ['a', 'b'], [1, 2]]; + forEach(arrays, function (arr) { + t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + }); + t.end(); +}); + +test('Dates', function (t) { + var dates = [new Date(), new Date(0), new Date(NaN)]; + forEach(dates, function (date) { + t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date'); + }); + t.end(); +}); + +test('Objects', function (t) { + t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf'); + t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString'); + t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString'); + t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + + t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString'); + t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString'); + t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString'); + + t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf'); + t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf'); + + t.test('Symbol.toPrimitive', { skip: !v.hasSymbols || !Symbol.toPrimitive }, function (st) { + /** @type {Coercible} */ + var overriddenObject = { toString: st.fail, valueOf: st.fail }; + overriddenObject[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) { + return String(hint); + }; + + st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that'); + st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that'); + st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that'); + + /** @type {Coercible} */ + var nullToPrimitive = { toString: v.coercibleObject.toString, valueOf: v.coercibleObject.valueOf }; + nullToPrimitive[Symbol.toPrimitive] = null; + st.equal(toPrimitive(nullToPrimitive), toPrimitive(v.coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(v.coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(v.coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it'); + + st.test('exceptions', function (sst) { + /** @type {Coercible} */ + var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + nonFunctionToPrimitive[Symbol.toPrimitive] = {}; + sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws'); + + /** @type {Coercible} */ + var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + uncoercibleToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) { + return { toString: function () { return hint; } }; + }; + sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws'); + + /** @type {Coercible} */ + var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + throwingToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) { + throw new RangeError(hint); + }; + sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws'); + + sst.end(); + }); + + st.end(); + }); + + t.test('exceptions', function (st) { + st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError'); + + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError'); + st.end(); + }); + t.end(); +}); diff --git a/node_modules/es-to-primitive/test/es5.js b/node_modules/es-to-primitive/test/es5.js new file mode 100644 index 0000000000000000000000000000000000000000..c17f6022aa36ebfb27ed31bbe6786868db669207 --- /dev/null +++ b/node_modules/es-to-primitive/test/es5.js @@ -0,0 +1,98 @@ +'use strict'; + +var test = require('tape'); +var toPrimitive = require('../es5'); +var is = require('object-is'); +var forEach = require('for-each'); +var functionName = require('function.prototype.name'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); + +test('function properties', function (t) { + t.equal(toPrimitive.length, 1, 'length is 1'); + t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive'); + + t.end(); +}); + +test('primitives', function (t) { + forEach(v.primitives, function (i) { + t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value'); + t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'); + t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'); + }); + t.end(); +}); + +test('Symbols', { skip: !v.hasSymbols }, function (t) { + forEach(v.symbols, function (sym) { + t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value'); + t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value'); + t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value'); + }); + + var primitiveSym = Symbol('primitiveSym'); + var stringSym = Symbol.prototype.toString.call(primitiveSym); + var objectSym = Object(primitiveSym); + t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym)); + + // This is different from ES2015, as the ES5 algorithm doesn't account for the existence of Symbols: + t.equal(toPrimitive(objectSym, String), stringSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(stringSym)); + t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym)); + t.end(); +}); + +test('Arrays', function (t) { + var arrays = [[], ['a', 'b'], [1, 2]]; + forEach(arrays, function (arr) { + t.ok(is(toPrimitive(arr), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toString of the array'); + t.equal(toPrimitive(arr, String), arr.toString(), 'toPrimitive(' + debug(arr) + ') returns toString of the array'); + t.ok(is(toPrimitive(arr, Number), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toString of the array'); + }); + t.end(); +}); + +test('Dates', function (t) { + var dates = [new Date(), new Date(0), new Date(NaN)]; + forEach(dates, function (date) { + t.equal(toPrimitive(date), date.toString(), 'toPrimitive(' + debug(date) + ') returns toString of the date'); + t.equal(toPrimitive(date, String), date.toString(), 'toPrimitive(' + debug(date) + ') returns toString of the date'); + t.ok(is(toPrimitive(date, Number), date.valueOf()), 'toPrimitive(' + debug(date) + ') returns valueOf of the date'); + }); + t.end(); +}); + +test('Objects', function (t) { + t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf'); + t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to toString'); + t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + + t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to toString'); + t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to toString'); + t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to toString'); + + t.ok(is(toPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString'); + t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + t.ok(is(toPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to Object#toString'); + + t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns toString'); + t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns toString'); + t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns toString'); + + t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns valueOf'); + t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf'); + + t.test('exceptions', function (st) { + st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError'); + + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError'); + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/es-to-primitive/test/es6.js b/node_modules/es-to-primitive/test/es6.js new file mode 100644 index 0000000000000000000000000000000000000000..b7a3515988982a7ef287046904bafd0b65cc9948 --- /dev/null +++ b/node_modules/es-to-primitive/test/es6.js @@ -0,0 +1,140 @@ +'use strict'; + +var test = require('tape'); +var toPrimitive = require('../es6'); +var is = require('object-is'); +var forEach = require('for-each'); +var functionName = require('function.prototype.name'); +var debug = require('object-inspect'); +var v = require('es-value-fixtures'); + +/** @typedef {{ toString?: unknown, valueOf?: unknown, [Symbol.toPrimitive]?: unknown }} Coercible */ + +test('function properties', function (t) { + t.equal(toPrimitive.length, 1, 'length is 1'); + t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive'); + + t.end(); +}); + +test('primitives', function (t) { + forEach(v.primitives, function (i) { + t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value'); + t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'); + t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'); + }); + t.end(); +}); + +test('Symbols', { skip: !v.hasSymbols }, function (t) { + forEach(v.symbols, function (sym) { + t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value'); + t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value'); + t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value'); + }); + + var primitiveSym = Symbol('primitiveSym'); + var objectSym = Object(primitiveSym); + t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym)); + t.end(); +}); + +test('Arrays', function (t) { + var arrays = [[], ['a', 'b'], [1, 2]]; + forEach(arrays, function (arr) { + t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + }); + t.end(); +}); + +test('Dates', function (t) { + var dates = [new Date(), new Date(0), new Date(NaN)]; + forEach(dates, function (date) { + t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date'); + }); + t.end(); +}); + +test('Objects', function (t) { + t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf'); + t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString'); + t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString'); + t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + + t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString'); + t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString'); + t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString'); + + t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf'); + t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf'); + + t.test('Symbol.toPrimitive', { skip: !v.hasSymbols || !Symbol.toPrimitive }, function (st) { + /** @type {Coercible} */ + var overriddenObject = { toString: st.fail, valueOf: st.fail }; + overriddenObject[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) { + return String(hint); + }; + + st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that'); + st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that'); + st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that'); + + /** @type {Coercible} */ + var nullToPrimitive = { toString: v.coercibleObject.toString, valueOf: v.coercibleObject.valueOf }; + nullToPrimitive[Symbol.toPrimitive] = null; + st.equal(toPrimitive(nullToPrimitive), toPrimitive(v.coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(v.coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(v.coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it'); + + st.test('exceptions', function (sst) { + /** @type {Coercible} */ + var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + nonFunctionToPrimitive[Symbol.toPrimitive] = {}; + sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws'); + + /** @type {Coercible} */ + var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + uncoercibleToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) { + return { toString: function () { return hint; } }; + }; + sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws'); + + /** @type {Coercible} */ + var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + throwingToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) { + throw new RangeError(hint); + }; + sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws'); + + sst.end(); + }); + + st.end(); + }); + + t.test('exceptions', function (st) { + st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError'); + + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError'); + st.end(); + }); + t.end(); +}); diff --git a/node_modules/es-to-primitive/test/index.js b/node_modules/es-to-primitive/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ad71f39e2581e72e94435c3bbf8086fbaa29e8a6 --- /dev/null +++ b/node_modules/es-to-primitive/test/index.js @@ -0,0 +1,20 @@ +'use strict'; + +var toPrimitive = require('../'); +var ES5 = require('../es5'); +var ES6 = require('../es6'); +var ES2015 = require('../es2015'); + +var test = require('tape'); + +test('default export', function (t) { + t.equal(toPrimitive, ES2015, 'default export is ES2015'); + t.equal(toPrimitive.ES5, ES5, 'ES5 property has ES5 method'); + t.equal(toPrimitive.ES6, ES6, 'ES6 property has ES6 method'); + t.equal(toPrimitive.ES2015, ES2015, 'ES2015 property has ES2015 method'); + t.end(); +}); + +require('./es5'); +require('./es6'); +require('./es2015'); diff --git a/node_modules/es-to-primitive/tsconfig.json b/node_modules/es-to-primitive/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..d9a6668c3ae6be748c78fbd5694053706b3d6942 --- /dev/null +++ b/node_modules/es-to-primitive/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/esbuild-wasm/LICENSE.md b/node_modules/esbuild-wasm/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..2027e8dcf3787f5aac9fcd835e2b80cb75a39211 --- /dev/null +++ b/node_modules/esbuild-wasm/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Wallace + +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/node_modules/esbuild-wasm/README.md b/node_modules/esbuild-wasm/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9c301c61dde3e4448976001e4824d748df5d24fe --- /dev/null +++ b/node_modules/esbuild-wasm/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is the cross-platform WebAssembly binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details. diff --git a/node_modules/esbuild-wasm/bin/esbuild b/node_modules/esbuild-wasm/bin/esbuild new file mode 100644 index 0000000000000000000000000000000000000000..e22567d76c1056d5981e9120f4b0282834ce4e1f --- /dev/null +++ b/node_modules/esbuild-wasm/bin/esbuild @@ -0,0 +1,91 @@ +#!/usr/bin/env node + +// Forward to the automatically-generated WebAssembly loader from the Go compiler + +const module_ = require('module'); +const path = require('path'); +const fs = require('fs'); + +const wasm_exec_node = path.join(__dirname, '..', 'wasm_exec_node.js'); +const esbuild_wasm = path.join(__dirname, '..', 'esbuild.wasm'); + +const code = fs.readFileSync(wasm_exec_node, 'utf8'); +const wrapper = new Function('require', 'WebAssembly', code); + +function instantiate(bytes, importObject) { + // Using this API causes "./esbuild --version" to run around 1 second faster + // than using the "WebAssembly.instantiate()" API when run in node (v12.16.2) + const module = new WebAssembly.Module(bytes); + const instance = new WebAssembly.Instance(module, importObject); + return Promise.resolve({ instance, module }); +} + +// Node has another bug where using "fs.read" to read from stdin reads +// everything successfully and then throws an error, but only on Windows. Go's +// WebAssembly support uses "fs.read" so it hits this problem. This is a patch +// to try to work around the bug in node. This bug has been reported to node +// at least twice in https://github.com/nodejs/node/issues/35997 and in +// https://github.com/nodejs/node/issues/19831. This issue has also been +// reported to the Go project: https://github.com/golang/go/issues/43913. +const read = fs.read; +fs.read = function () { + const callback = arguments[5]; + arguments[5] = function (err, count) { + if (count === 0 && err && err.code === 'EOF') { + arguments[0] = null; + } + return callback.apply(this, arguments); + }; + return read.apply(this, arguments); +}; + +// Hack around a Unicode bug in node: https://github.com/nodejs/node/issues/24550. +// See this for the matching Go issue: https://github.com/golang/go/issues/43917. +const write = fs.write; +fs.write = function (fd, buf, offset, length, position, callback) { + if (offset === 0 && length === buf.length && position === null) { + if (fd === process.stdout.fd) { + try { + process.stdout.write(buf, err => err ? callback(err, 0, null) : callback(null, length, buf)); + } catch (err) { + callback(err, 0, null); + } + return; + } + if (fd === process.stderr.fd) { + try { + process.stderr.write(buf, err => err ? callback(err, 0, null) : callback(null, length, buf)); + } catch (err) { + callback(err, 0, null); + } + return; + } + } + return write.apply(this, arguments); +}; +const writeSync = fs.writeSync; +fs.writeSync = function (fd, buf) { + if (fd === process.stdout.fd) return process.stdout.write(buf), buf.length; + if (fd === process.stderr.fd) return process.stderr.write(buf), buf.length; + return writeSync.apply(this, arguments); +}; + +// WASM code generated with Go 1.17.2+ will crash when run in a situation with +// many environment variables: https://github.com/golang/go/issues/49011. An +// example of this situation is running a Go-compiled WASM executable in GitHub +// Actions. Work around this by filtering node's copy of environment variables +// down to only include the environment variables that esbuild currently uses. +const esbuildUsedEnvVars = [ + 'NO_COLOR', + 'NODE_PATH', + 'npm_config_user_agent', + 'WT_SESSION', +] +for (let key in process.env) { + if (esbuildUsedEnvVars.indexOf(key) < 0) { + delete process.env[key] + } +} + +process.argv.splice(2, 0, esbuild_wasm); +wrapper(module_.createRequire(wasm_exec_node), Object.assign(Object.create(WebAssembly), { instantiate })); diff --git a/node_modules/esbuild-wasm/esbuild.wasm b/node_modules/esbuild-wasm/esbuild.wasm new file mode 100644 index 0000000000000000000000000000000000000000..06e004582e1b0c3a3baf0ba9f07ff0c73db61159 --- /dev/null +++ b/node_modules/esbuild-wasm/esbuild.wasm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2b4b98297e04ef12981bafabf0a3c2d7c3c5cf6af603ef79d886deac3b5eeb3 +size 11907565 diff --git a/node_modules/esbuild-wasm/esm/browser.d.ts b/node_modules/esbuild-wasm/esm/browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7053070fe0b5e83b41d4ec9042a7149ac231577 --- /dev/null +++ b/node_modules/esbuild-wasm/esm/browser.d.ts @@ -0,0 +1,705 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'bundle' | 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: string[] | Record | { in: string, out: string }[] + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + onRequest?: (args: ServeOnRequestArgs) => void +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + host: string +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record + }[] + format?: 'cjs' | 'esm' + with?: Record + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +export interface WatchOptions { +} + +export interface BuildContext { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise + + cancel(): Promise + dispose(): Promise +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape = In & { [Key in Exclude]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build(options: SameShape): Promise> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context(options: SameShape): Promise> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync(options: SameShape): BuildResult + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/node_modules/esbuild-wasm/esm/browser.js b/node_modules/esbuild-wasm/esm/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..5289d8035c6e698eaf490e66c09310af261953d1 --- /dev/null +++ b/node_modules/esbuild-wasm/esm/browser.js @@ -0,0 +1,2393 @@ +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +// lib/npm/browser.ts +var browser_exports = {}; +__export(browser_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => browser_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateTarget(target) { + validateStringValue(target, "target"); + if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); + return target; +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArray); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArray); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArray); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) { + if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); + else flags.push(`--target=${validateTarget(target)}`); + } + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); + if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); + if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY, logLevelDefault, writeDefault) { + var _a; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); + let mainFields = getFlag(options, keys, "mainFields", mustBeArray); + let conditions = getFlag(options, keys, "conditions", mustBeArray); + let external = getFlag(options, keys, "external", mustBeArray); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArray); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) { + let values = []; + for (let value of resolveExtensions) { + validateStringValue(value, "resolve extension"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); + values.push(value); + } + flags.push(`--resolve-extensions=${values.join(",")}`); + } + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) { + let values = []; + for (let value of mainFields) { + validateStringValue(value, "main field"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); + values.push(value); + } + flags.push(`--main-fields=${values.join(",")}`); + } + if (conditions) { + let values = []; + for (let value of conditions) { + validateStringValue(value, "condition"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); + values.push(value); + } + flags.push(`--conditions=${values.join(",")}`); + } + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path of inject) flags.push(`--inject:${validateStringValue(path, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch (e2) { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.24.2") { + throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY, defaultWD, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY, + defaultWD, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY, fs, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY, transformLogLevelDefault); + } catch (e2) { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY, defaultWD, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY, buildLogLevelDefault); + } catch (e2) { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeInteger); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + details.clear(); + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path != null) response.path = path; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch (e) { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch (e) { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}; +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location2 = parseStackLinesV8(streamIn, lines, ident); + if (location2) { + note = { text: e.message, location: location2 }; + return note; + } + } catch (e2) { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location2 = null; + try { + text = (e && e.message || e) + ""; + } catch (e2) { + } + try { + location2 = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch (e2) { + } + return { id: "", pluginName, text, location: location2, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch (e) { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location2, where, terminalWidth) { + if (location2 == null) return null; + let keys = {}; + let file = getFlag(location2, keys, "file", mustBeString); + let namespace = getFlag(location2, keys, "namespace", mustBeString); + let line = getFlag(location2, keys, "line", mustBeInteger); + let column = getFlag(location2, keys, "column", mustBeInteger); + let length = getFlag(location2, keys, "length", mustBeInteger); + let lineText = getFlag(location2, keys, "lineText", mustBeString); + let suggestion = getFlag(location2, keys, "suggestion", mustBeString); + checkForInvalidFlags(location2, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location2 = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location2, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path, contents, hash }) { + let text = null; + return { + path, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} + +// lib/npm/browser.ts +var version = "0.24.2"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (options) => ensureServiceIsRunning().context(options); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (metafile, options) => ensureServiceIsRunning().analyzeMetafile(metafile, options); +var buildSync = () => { + throw new Error(`The "buildSync" API only works in node`); +}; +var transformSync = () => { + throw new Error(`The "transformSync" API only works in node`); +}; +var formatMessagesSync = () => { + throw new Error(`The "formatMessagesSync" API only works in node`); +}; +var analyzeMetafileSync = () => { + throw new Error(`The "analyzeMetafileSync" API only works in node`); +}; +var stop = () => { + if (stopService) stopService(); + return Promise.resolve(); +}; +var initializePromise; +var stopService; +var longLivedService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + if (initializePromise) throw new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'); + throw new Error('You need to call "initialize" before calling this'); +}; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + let wasmURL = options.wasmURL; + let wasmModule = options.wasmModule; + let useWorker = options.worker !== false; + if (!wasmURL && !wasmModule) throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option'); + if (initializePromise) throw new Error('Cannot call "initialize" more than once'); + initializePromise = startRunningService(wasmURL || "", wasmModule, useWorker); + initializePromise.catch(() => { + initializePromise = void 0; + }); + return initializePromise; +}; +var startRunningService = async (wasmURL, wasmModule, useWorker) => { + let worker; + let rejectAllWith; + const rejectAllPromise = new Promise((resolve) => rejectAllWith = resolve); + if (useWorker) { + let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b\n },\n gojs: {\n // Go\'s SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n // func wasmExit(code int32)\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n // func resetMemoryDataView()\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n // func nanotime1() int64\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n // func walltime() (sec int64, nsec int32)\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = (/* @__PURE__ */ new Date()).getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n // func scheduleTimeoutEvent(delay int64) int32\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8)\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n // func clearTimeoutEvent(id int32)\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n // func getRandomData(r []byte)\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n // func finalizeRef(v ref)\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n // func stringVal(value string) ref\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n // func valueGet(v ref, p string) ref\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n // func valueSet(v ref, p string, x ref)\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n // func valueDelete(v ref, p string)\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n // func valueIndex(v ref, i int) ref\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n // valueSetIndex(v ref, i int, x ref)\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n // func valueInvoke(v ref, args []ref) (ref, bool)\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueNew(v ref, args []ref) (ref, bool)\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueLength(v ref) int\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n // valuePrepareString(v ref) (ref, int)\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n // valueLoadString(v ref, b []byte)\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n // func valueInstanceOf(v ref, t ref) bool\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin) resumeStdin();\n }\n return go;\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.24.2"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\n return go;\n };\n async function tryToInstantiateModule(wasm, go) {\n if (wasm instanceof WebAssembly.Module) {\n return WebAssembly.instantiate(wasm, go.importObject);\n }\n const res = await fetch(wasm);\n if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`);\n if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {\n const result2 = await WebAssembly.instantiateStreaming(res, go.importObject);\n return result2.instance;\n }\n const bytes = await res.arrayBuffer();\n const result = await WebAssembly.instantiate(bytes, go.importObject);\n return result.instance;\n }\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" }); + worker = new Worker(URL.createObjectURL(blob)); + } else { + let onmessage = ((postMessage) => { + // Copyright 2018 The Go Authors. All rights reserved. + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + let onmessage; + let globalThis = {}; + for (let o = self; o; o = Object.getPrototypeOf(o)) + for (let k of Object.getOwnPropertyNames(o)) + if (!(k in globalThis)) + Object.defineProperty(globalThis, k, { get: () => self[k] }); + "use strict"; + (() => { + const enosys = () => { + const err = new Error("not implemented"); + err.code = "ENOSYS"; + return err; + }; + if (!globalThis.fs) { + let outputBuf = ""; + globalThis.fs = { + constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, + // unused + writeSync(fd, buf) { + outputBuf += decoder.decode(buf); + const nl = outputBuf.lastIndexOf("\n"); + if (nl != -1) { + console.log(outputBuf.substring(0, nl)); + outputBuf = outputBuf.substring(nl + 1); + } + return buf.length; + }, + write(fd, buf, offset, length, position, callback) { + if (offset !== 0 || length !== buf.length || position !== null) { + callback(enosys()); + return; + } + const n = this.writeSync(fd, buf); + callback(null, n); + }, + chmod(path, mode, callback) { + callback(enosys()); + }, + chown(path, uid, gid, callback) { + callback(enosys()); + }, + close(fd, callback) { + callback(enosys()); + }, + fchmod(fd, mode, callback) { + callback(enosys()); + }, + fchown(fd, uid, gid, callback) { + callback(enosys()); + }, + fstat(fd, callback) { + callback(enosys()); + }, + fsync(fd, callback) { + callback(null); + }, + ftruncate(fd, length, callback) { + callback(enosys()); + }, + lchown(path, uid, gid, callback) { + callback(enosys()); + }, + link(path, link, callback) { + callback(enosys()); + }, + lstat(path, callback) { + callback(enosys()); + }, + mkdir(path, perm, callback) { + callback(enosys()); + }, + open(path, flags, mode, callback) { + callback(enosys()); + }, + read(fd, buffer, offset, length, position, callback) { + callback(enosys()); + }, + readdir(path, callback) { + callback(enosys()); + }, + readlink(path, callback) { + callback(enosys()); + }, + rename(from, to, callback) { + callback(enosys()); + }, + rmdir(path, callback) { + callback(enosys()); + }, + stat(path, callback) { + callback(enosys()); + }, + symlink(path, link, callback) { + callback(enosys()); + }, + truncate(path, length, callback) { + callback(enosys()); + }, + unlink(path, callback) { + callback(enosys()); + }, + utimes(path, atime, mtime, callback) { + callback(enosys()); + } + }; + } + if (!globalThis.process) { + globalThis.process = { + getuid() { + return -1; + }, + getgid() { + return -1; + }, + geteuid() { + return -1; + }, + getegid() { + return -1; + }, + getgroups() { + throw enosys(); + }, + pid: -1, + ppid: -1, + umask() { + throw enosys(); + }, + cwd() { + throw enosys(); + }, + chdir() { + throw enosys(); + } + }; + } + if (!globalThis.crypto) { + throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)"); + } + if (!globalThis.performance) { + throw new Error("globalThis.performance is not available, polyfill required (performance.now only)"); + } + if (!globalThis.TextEncoder) { + throw new Error("globalThis.TextEncoder is not available, polyfill required"); + } + if (!globalThis.TextDecoder) { + throw new Error("globalThis.TextDecoder is not available, polyfill required"); + } + const encoder = new TextEncoder("utf-8"); + const decoder = new TextDecoder("utf-8"); + globalThis.Go = class { + constructor() { + this.argv = ["js"]; + this.env = {}; + this.exit = (code) => { + if (code !== 0) { + console.warn("exit code:", code); + } + }; + this._exitPromise = new Promise((resolve) => { + this._resolveExitPromise = resolve; + }); + this._pendingEvent = null; + this._scheduledTimeouts = /* @__PURE__ */ new Map(); + this._nextCallbackTimeoutID = 1; + const setInt64 = (addr, v) => { + this.mem.setUint32(addr + 0, v, true); + this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true); + }; + const setInt32 = (addr, v) => { + this.mem.setUint32(addr + 0, v, true); + }; + const getInt64 = (addr) => { + const low = this.mem.getUint32(addr + 0, true); + const high = this.mem.getInt32(addr + 4, true); + return low + high * 4294967296; + }; + const loadValue = (addr) => { + const f = this.mem.getFloat64(addr, true); + if (f === 0) { + return void 0; + } + if (!isNaN(f)) { + return f; + } + const id = this.mem.getUint32(addr, true); + return this._values[id]; + }; + const storeValue = (addr, v) => { + const nanHead = 2146959360; + if (typeof v === "number" && v !== 0) { + if (isNaN(v)) { + this.mem.setUint32(addr + 4, nanHead, true); + this.mem.setUint32(addr, 0, true); + return; + } + this.mem.setFloat64(addr, v, true); + return; + } + if (v === void 0) { + this.mem.setFloat64(addr, 0, true); + return; + } + let id = this._ids.get(v); + if (id === void 0) { + id = this._idPool.pop(); + if (id === void 0) { + id = this._values.length; + } + this._values[id] = v; + this._goRefCounts[id] = 0; + this._ids.set(v, id); + } + this._goRefCounts[id]++; + let typeFlag = 0; + switch (typeof v) { + case "object": + if (v !== null) { + typeFlag = 1; + } + break; + case "string": + typeFlag = 2; + break; + case "symbol": + typeFlag = 3; + break; + case "function": + typeFlag = 4; + break; + } + this.mem.setUint32(addr + 4, nanHead | typeFlag, true); + this.mem.setUint32(addr, id, true); + }; + const loadSlice = (addr) => { + const array = getInt64(addr + 0); + const len = getInt64(addr + 8); + return new Uint8Array(this._inst.exports.mem.buffer, array, len); + }; + const loadSliceOfValues = (addr) => { + const array = getInt64(addr + 0); + const len = getInt64(addr + 8); + const a = new Array(len); + for (let i = 0; i < len; i++) { + a[i] = loadValue(array + i * 8); + } + return a; + }; + const loadString = (addr) => { + const saddr = getInt64(addr + 0); + const len = getInt64(addr + 8); + return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len)); + }; + const timeOrigin = Date.now() - performance.now(); + this.importObject = { + _gotest: { + add: (a, b) => a + b + }, + gojs: { + // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters) + // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported + // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function). + // This changes the SP, thus we have to update the SP used by the imported function. + // func wasmExit(code int32) + "runtime.wasmExit": (sp) => { + sp >>>= 0; + const code = this.mem.getInt32(sp + 8, true); + this.exited = true; + delete this._inst; + delete this._values; + delete this._goRefCounts; + delete this._ids; + delete this._idPool; + this.exit(code); + }, + // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32) + "runtime.wasmWrite": (sp) => { + sp >>>= 0; + const fd = getInt64(sp + 8); + const p = getInt64(sp + 16); + const n = this.mem.getInt32(sp + 24, true); + globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n)); + }, + // func resetMemoryDataView() + "runtime.resetMemoryDataView": (sp) => { + sp >>>= 0; + this.mem = new DataView(this._inst.exports.mem.buffer); + }, + // func nanotime1() int64 + "runtime.nanotime1": (sp) => { + sp >>>= 0; + setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6); + }, + // func walltime() (sec int64, nsec int32) + "runtime.walltime": (sp) => { + sp >>>= 0; + const msec = (/* @__PURE__ */ new Date()).getTime(); + setInt64(sp + 8, msec / 1e3); + this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true); + }, + // func scheduleTimeoutEvent(delay int64) int32 + "runtime.scheduleTimeoutEvent": (sp) => { + sp >>>= 0; + const id = this._nextCallbackTimeoutID; + this._nextCallbackTimeoutID++; + this._scheduledTimeouts.set(id, setTimeout( + () => { + this._resume(); + while (this._scheduledTimeouts.has(id)) { + console.warn("scheduleTimeoutEvent: missed timeout event"); + this._resume(); + } + }, + getInt64(sp + 8) + )); + this.mem.setInt32(sp + 16, id, true); + }, + // func clearTimeoutEvent(id int32) + "runtime.clearTimeoutEvent": (sp) => { + sp >>>= 0; + const id = this.mem.getInt32(sp + 8, true); + clearTimeout(this._scheduledTimeouts.get(id)); + this._scheduledTimeouts.delete(id); + }, + // func getRandomData(r []byte) + "runtime.getRandomData": (sp) => { + sp >>>= 0; + crypto.getRandomValues(loadSlice(sp + 8)); + }, + // func finalizeRef(v ref) + "syscall/js.finalizeRef": (sp) => { + sp >>>= 0; + const id = this.mem.getUint32(sp + 8, true); + this._goRefCounts[id]--; + if (this._goRefCounts[id] === 0) { + const v = this._values[id]; + this._values[id] = null; + this._ids.delete(v); + this._idPool.push(id); + } + }, + // func stringVal(value string) ref + "syscall/js.stringVal": (sp) => { + sp >>>= 0; + storeValue(sp + 24, loadString(sp + 8)); + }, + // func valueGet(v ref, p string) ref + "syscall/js.valueGet": (sp) => { + sp >>>= 0; + const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16)); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 32, result); + }, + // func valueSet(v ref, p string, x ref) + "syscall/js.valueSet": (sp) => { + sp >>>= 0; + Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32)); + }, + // func valueDelete(v ref, p string) + "syscall/js.valueDelete": (sp) => { + sp >>>= 0; + Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16)); + }, + // func valueIndex(v ref, i int) ref + "syscall/js.valueIndex": (sp) => { + sp >>>= 0; + storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16))); + }, + // valueSetIndex(v ref, i int, x ref) + "syscall/js.valueSetIndex": (sp) => { + sp >>>= 0; + Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24)); + }, + // func valueCall(v ref, m string, args []ref) (ref, bool) + "syscall/js.valueCall": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const m = Reflect.get(v, loadString(sp + 16)); + const args = loadSliceOfValues(sp + 32); + const result = Reflect.apply(m, v, args); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 56, result); + this.mem.setUint8(sp + 64, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 56, err); + this.mem.setUint8(sp + 64, 0); + } + }, + // func valueInvoke(v ref, args []ref) (ref, bool) + "syscall/js.valueInvoke": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const args = loadSliceOfValues(sp + 16); + const result = Reflect.apply(v, void 0, args); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, result); + this.mem.setUint8(sp + 48, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, err); + this.mem.setUint8(sp + 48, 0); + } + }, + // func valueNew(v ref, args []ref) (ref, bool) + "syscall/js.valueNew": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const args = loadSliceOfValues(sp + 16); + const result = Reflect.construct(v, args); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, result); + this.mem.setUint8(sp + 48, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, err); + this.mem.setUint8(sp + 48, 0); + } + }, + // func valueLength(v ref) int + "syscall/js.valueLength": (sp) => { + sp >>>= 0; + setInt64(sp + 16, parseInt(loadValue(sp + 8).length)); + }, + // valuePrepareString(v ref) (ref, int) + "syscall/js.valuePrepareString": (sp) => { + sp >>>= 0; + const str = encoder.encode(String(loadValue(sp + 8))); + storeValue(sp + 16, str); + setInt64(sp + 24, str.length); + }, + // valueLoadString(v ref, b []byte) + "syscall/js.valueLoadString": (sp) => { + sp >>>= 0; + const str = loadValue(sp + 8); + loadSlice(sp + 16).set(str); + }, + // func valueInstanceOf(v ref, t ref) bool + "syscall/js.valueInstanceOf": (sp) => { + sp >>>= 0; + this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0); + }, + // func copyBytesToGo(dst []byte, src ref) (int, bool) + "syscall/js.copyBytesToGo": (sp) => { + sp >>>= 0; + const dst = loadSlice(sp + 8); + const src = loadValue(sp + 32); + if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) { + this.mem.setUint8(sp + 48, 0); + return; + } + const toCopy = src.subarray(0, dst.length); + dst.set(toCopy); + setInt64(sp + 40, toCopy.length); + this.mem.setUint8(sp + 48, 1); + }, + // func copyBytesToJS(dst ref, src []byte) (int, bool) + "syscall/js.copyBytesToJS": (sp) => { + sp >>>= 0; + const dst = loadValue(sp + 8); + const src = loadSlice(sp + 16); + if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) { + this.mem.setUint8(sp + 48, 0); + return; + } + const toCopy = src.subarray(0, dst.length); + dst.set(toCopy); + setInt64(sp + 40, toCopy.length); + this.mem.setUint8(sp + 48, 1); + }, + "debug": (value) => { + console.log(value); + } + } + }; + } + async run(instance) { + if (!(instance instanceof WebAssembly.Instance)) { + throw new Error("Go.run: WebAssembly.Instance expected"); + } + this._inst = instance; + this.mem = new DataView(this._inst.exports.mem.buffer); + this._values = [ + // JS values that Go currently has references to, indexed by reference id + NaN, + 0, + null, + true, + false, + globalThis, + this + ]; + this._goRefCounts = new Array(this._values.length).fill(Infinity); + this._ids = /* @__PURE__ */ new Map([ + // mapping from JS values to reference ids + [0, 1], + [null, 2], + [true, 3], + [false, 4], + [globalThis, 5], + [this, 6] + ]); + this._idPool = []; + this.exited = false; + let offset = 4096; + const strPtr = (str) => { + const ptr = offset; + const bytes = encoder.encode(str + "\0"); + new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes); + offset += bytes.length; + if (offset % 8 !== 0) { + offset += 8 - offset % 8; + } + return ptr; + }; + const argc = this.argv.length; + const argvPtrs = []; + this.argv.forEach((arg) => { + argvPtrs.push(strPtr(arg)); + }); + argvPtrs.push(0); + const keys = Object.keys(this.env).sort(); + keys.forEach((key) => { + argvPtrs.push(strPtr(`${key}=${this.env[key]}`)); + }); + argvPtrs.push(0); + const argv = offset; + argvPtrs.forEach((ptr) => { + this.mem.setUint32(offset, ptr, true); + this.mem.setUint32(offset + 4, 0, true); + offset += 8; + }); + const wasmMinDataAddr = 4096 + 8192; + if (offset >= wasmMinDataAddr) { + throw new Error("total length of command line and environment variables exceeds limit"); + } + this._inst.exports.run(argc, argv); + if (this.exited) { + this._resolveExitPromise(); + } + await this._exitPromise; + } + _resume() { + if (this.exited) { + throw new Error("Go program has already exited"); + } + this._inst.exports.resume(); + if (this.exited) { + this._resolveExitPromise(); + } + } + _makeFuncWrapper(id) { + const go = this; + return function() { + const event = { id, this: this, args: arguments }; + go._pendingEvent = event; + go._resume(); + return event.result; + }; + } + }; + })(); + onmessage = ({ data: wasm }) => { + let decoder = new TextDecoder(); + let fs = globalThis.fs; + let stderr = ""; + fs.writeSync = (fd, buffer) => { + if (fd === 1) { + postMessage(buffer); + } else if (fd === 2) { + stderr += decoder.decode(buffer); + let parts = stderr.split("\n"); + if (parts.length > 1) console.log(parts.slice(0, -1).join("\n")); + stderr = parts[parts.length - 1]; + } else { + throw new Error("Bad write"); + } + return buffer.length; + }; + let stdin = []; + let resumeStdin; + let stdinPos = 0; + onmessage = ({ data }) => { + if (data.length > 0) { + stdin.push(data); + if (resumeStdin) resumeStdin(); + } + return go; + }; + fs.read = (fd, buffer, offset, length, position, callback) => { + if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) { + throw new Error("Bad read"); + } + if (stdin.length === 0) { + resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback); + return; + } + let first = stdin[0]; + let count = Math.max(0, Math.min(length, first.length - stdinPos)); + buffer.set(first.subarray(stdinPos, stdinPos + count), offset); + stdinPos += count; + if (stdinPos === first.length) { + stdin.shift(); + stdinPos = 0; + } + callback(null, count); + }; + let go = new globalThis.Go(); + go.argv = ["", `--service=${"0.24.2"}`]; + tryToInstantiateModule(wasm, go).then( + (instance) => { + postMessage(null); + go.run(instance); + }, + (error) => { + postMessage(error); + } + ); + return go; + }; + async function tryToInstantiateModule(wasm, go) { + if (wasm instanceof WebAssembly.Module) { + return WebAssembly.instantiate(wasm, go.importObject); + } + const res = await fetch(wasm); + if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`); + if ("instantiateStreaming" in WebAssembly && /^application\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) { + const result2 = await WebAssembly.instantiateStreaming(res, go.importObject); + return result2.instance; + } + const bytes = await res.arrayBuffer(); + const result = await WebAssembly.instantiate(bytes, go.importObject); + return result.instance; + } + return (m) => onmessage(m); + })((data) => worker.onmessage({ data })); + let go; + worker = { + onmessage: null, + postMessage: (data) => setTimeout(() => { + try { + go = onmessage({ data }); + } catch (error) { + rejectAllWith(error); + } + }), + terminate() { + if (go) + for (let timeout of go._scheduledTimeouts.values()) + clearTimeout(timeout); + } + }; + } + let firstMessageResolve; + let firstMessageReject; + const firstMessagePromise = new Promise((resolve, reject) => { + firstMessageResolve = resolve; + firstMessageReject = reject; + }); + worker.onmessage = ({ data: error }) => { + worker.onmessage = ({ data }) => readFromStdout(data); + if (error) firstMessageReject(error); + else firstMessageResolve(); + }; + worker.postMessage(wasmModule || new URL(wasmURL, location.href).toString()); + let { readFromStdout, service } = createChannel({ + writeToStdin(bytes) { + worker.postMessage(bytes); + }, + isSync: false, + hasFS: false, + esbuild: browser_exports + }); + await firstMessagePromise; + stopService = () => { + worker.terminate(); + initializePromise = void 0; + stopService = void 0; + longLivedService = void 0; + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.buildOrContext({ + callName: "build", + refs: null, + options, + isTTY: false, + defaultWD: "/", + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.buildOrContext({ + callName: "context", + refs: null, + options, + isTTY: false, + defaultWD: "/", + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + transform: (input, options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.transform({ + callName: "transform", + refs: null, + input, + options: options || {}, + isTTY: false, + fs: { + readFile(_, callback) { + callback(new Error("Internal error"), null); + }, + writeFile(_, callback) { + callback(null); + } + }, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + formatMessages: (messages, options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.formatMessages({ + callName: "formatMessages", + refs: null, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.analyzeMetafile({ + callName: "analyzeMetafile", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }) + }; +}; +var browser_default = browser_exports; +export { + analyzeMetafile, + analyzeMetafileSync, + build, + buildSync, + context, + browser_default as default, + formatMessages, + formatMessagesSync, + initialize, + stop, + transform, + transformSync, + version +}; diff --git a/node_modules/esbuild-wasm/esm/browser.min.js b/node_modules/esbuild-wasm/esm/browser.min.js new file mode 100644 index 0000000000000000000000000000000000000000..21353a3c5afe59c28702a2df45fc074cdc3395ed --- /dev/null +++ b/node_modules/esbuild-wasm/esm/browser.min.js @@ -0,0 +1,20 @@ +var ze=Object.defineProperty;var Ke=(e,t)=>{for(var n in t)ze(e,n,{get:t[n],enumerable:!0})};var ve={};Ke(ve,{analyzeMetafile:()=>ut,analyzeMetafileSync:()=>pt,build:()=>lt,buildSync:()=>ct,context:()=>st,default:()=>ht,formatMessages:()=>at,formatMessagesSync:()=>dt,initialize:()=>mt,stop:()=>gt,transform:()=>ot,transformSync:()=>ft,version:()=>it});function Oe(e){let t=i=>{if(i===null)n.write8(0);else if(typeof i=="boolean")n.write8(1),n.write8(+i);else if(typeof i=="number")n.write8(2),n.write32(i|0);else if(typeof i=="string")n.write8(3),n.write(Z(i));else if(i instanceof Uint8Array)n.write8(4),n.write(i);else if(i instanceof Array){n.write8(5),n.write32(i.length);for(let u of i)t(u)}else{let u=Object.keys(i);n.write8(6),n.write32(u.length);for(let l of u)n.write(Z(l)),t(i[l])}},n=new de;return n.write32(0),n.write32(e.id<<1|+!e.isRequest),t(e.value),xe(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function Se(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return re(n.read());case 4:return n.read();case 5:{let g=n.read32(),s=[];for(let m=0;m>>=1;let l=t();if(n.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:u,value:l}}var de=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let n=new Uint8Array((this.len+t)*2);n.set(this.buf),this.buf=n}return this.len+=t,this.len-t}write8(t){let n=this._write(1);this.buf[n]=t}write32(t){let n=this._write(4);xe(this.buf,t,n)}write(t){let n=this._write(4+t.length);xe(this.buf,t.length,n),this.buf.set(t,n+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return Ee(this.buf,this._read(4))}read(){let t=this.read32(),n=new Uint8Array(t),i=this._read(n.length);return n.set(this.buf.subarray(i,i+t)),n}},Z,re,Re;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;Z=n=>e.encode(n),re=n=>t.decode(n),Re='new TextEncoder().encode("")'}else if(typeof Buffer!="undefined")Z=e=>Buffer.from(e),re=e=>{let{buffer:t,byteOffset:n,byteLength:i}=e;return Buffer.from(t,n,i).toString()},Re='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Re} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`);function Ee(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function xe(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var V=JSON.stringify,ke="warning",$e="silent";function Me(e){if(G(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var me=()=>null,W=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",ye=e=>e instanceof RegExp?null:"a RegExp object",le=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Pe=e=>typeof e=="function"?null:"a function",K=e=>Array.isArray(e)?null:"an array",ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Ve=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ye=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ce=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Fe=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Je=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ge=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Te=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",Qe=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let u=e[n];if(t[n+""]=!0,u===void 0)return;let l=i(u);if(l!==null)throw new Error(`${V(n)} must be ${l}`);return u}function Y(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${V(i)}`)}function De(e){let t=Object.create(null),n=r(e,t,"wasmURL",Qe),i=r(e,t,"wasmModule",Ye),u=r(e,t,"worker",W);return Y(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:u}}function Be(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${V(n)} in mangle cache to map to either a string or false`)}}return t}function he(e,t,n,i,u){let l=r(t,n,"color",W),g=r(t,n,"logLevel",y),s=r(t,n,"logLimit",le);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${g||u}`),e.push(`--log-limit=${s||0}`)}function G(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+V(n):""} to be a string, got ${typeof e} instead`);return e}function Ue(e,t,n){let i=r(t,n,"legalComments",y),u=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",W),g=r(t,n,"target",Ge),s=r(t,n,"format",y),m=r(t,n,"globalName",y),U=r(t,n,"mangleProps",ye),P=r(t,n,"reserveProps",ye),b=r(t,n,"mangleQuoted",W),j=r(t,n,"minify",W),T=r(t,n,"minifySyntax",W),L=r(t,n,"minifyWhitespace",W),q=r(t,n,"minifyIdentifiers",W),S=r(t,n,"lineLimit",le),_=r(t,n,"drop",K),J=r(t,n,"dropLabels",K),w=r(t,n,"charset",y),p=r(t,n,"treeShaking",W),f=r(t,n,"ignoreAnnotations",W),o=r(t,n,"jsx",y),v=r(t,n,"jsxFactory",y),O=r(t,n,"jsxFragment",y),M=r(t,n,"jsxImportSource",y),E=r(t,n,"jsxDev",W),a=r(t,n,"jsxSideEffects",W),c=r(t,n,"define",ee),h=r(t,n,"logOverride",ee),C=r(t,n,"supported",ee),F=r(t,n,"pure",K),$=r(t,n,"keepNames",W),x=r(t,n,"platform",y),A=r(t,n,"tsconfigRaw",Je);if(i&&e.push(`--legal-comments=${i}`),u!==void 0&&e.push(`--source-root=${u}`),l!==void 0&&e.push(`--sources-content=${l}`),g&&(Array.isArray(g)?e.push(`--target=${Array.from(g).map(Me).join(",")}`):e.push(`--target=${Me(g)}`)),s&&e.push(`--format=${s}`),m&&e.push(`--global-name=${m}`),x&&e.push(`--platform=${x}`),A&&e.push(`--tsconfig-raw=${typeof A=="string"?A:JSON.stringify(A)}`),j&&e.push("--minify"),T&&e.push("--minify-syntax"),L&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),S&&e.push(`--line-limit=${S}`),w&&e.push(`--charset=${w}`),p!==void 0&&e.push(`--tree-shaking=${p}`),f&&e.push("--ignore-annotations"),_)for(let R of _)e.push(`--drop:${G(R,"drop")}`);if(J&&e.push(`--drop-labels=${Array.from(J).map(R=>G(R,"dropLabels")).join(",")}`),U&&e.push(`--mangle-props=${U.source}`),P&&e.push(`--reserve-props=${P.source}`),b!==void 0&&e.push(`--mangle-quoted=${b}`),o&&e.push(`--jsx=${o}`),v&&e.push(`--jsx-factory=${v}`),O&&e.push(`--jsx-fragment=${O}`),M&&e.push(`--jsx-import-source=${M}`),E&&e.push("--jsx-dev"),a&&e.push("--jsx-side-effects"),c)for(let R in c){if(R.indexOf("=")>=0)throw new Error(`Invalid define: ${R}`);e.push(`--define:${R}=${G(c[R],"define",R)}`)}if(h)for(let R in h){if(R.indexOf("=")>=0)throw new Error(`Invalid log override: ${R}`);e.push(`--log-override:${R}=${G(h[R],"log override",R)}`)}if(C)for(let R in C){if(R.indexOf("=")>=0)throw new Error(`Invalid supported: ${R}`);let k=C[R];if(typeof k!="boolean")throw new Error(`Expected value for supported ${V(R)} to be a boolean, got ${typeof k} instead`);e.push(`--supported:${R}=${k}`)}if(F)for(let R of F)e.push(`--pure:${G(R,"pure")}`);$&&e.push("--keep-names")}function He(e,t,n,i,u){var oe;let l=[],g=[],s=Object.create(null),m=null,U=null;he(l,t,s,n,i),Ue(l,t,s);let P=r(t,s,"sourcemap",Fe),b=r(t,s,"bundle",W),j=r(t,s,"splitting",W),T=r(t,s,"preserveSymlinks",W),L=r(t,s,"metafile",W),q=r(t,s,"outfile",y),S=r(t,s,"outdir",y),_=r(t,s,"outbase",y),J=r(t,s,"tsconfig",y),w=r(t,s,"resolveExtensions",K),p=r(t,s,"nodePaths",K),f=r(t,s,"mainFields",K),o=r(t,s,"conditions",K),v=r(t,s,"external",K),O=r(t,s,"packages",y),M=r(t,s,"alias",ee),E=r(t,s,"loader",ee),a=r(t,s,"outExtension",ee),c=r(t,s,"publicPath",y),h=r(t,s,"entryNames",y),C=r(t,s,"chunkNames",y),F=r(t,s,"assetNames",y),$=r(t,s,"inject",K),x=r(t,s,"banner",ee),A=r(t,s,"footer",ee),R=r(t,s,"entryPoints",Ve),k=r(t,s,"absWorkingDir",y),D=r(t,s,"stdin",ee),N=(oe=r(t,s,"write",W))!=null?oe:u,B=r(t,s,"allowOverwrite",W),H=r(t,s,"mangleCache",ee);if(s.plugins=!0,Y(t,s,`in ${e}() call`),P&&l.push(`--sourcemap${P===!0?"":`=${P}`}`),b&&l.push("--bundle"),B&&l.push("--allow-overwrite"),j&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),q&&l.push(`--outfile=${q}`),S&&l.push(`--outdir=${S}`),_&&l.push(`--outbase=${_}`),J&&l.push(`--tsconfig=${J}`),O&&l.push(`--packages=${O}`),w){let d=[];for(let I of w){if(G(I,"resolve extension"),I.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${I}`);d.push(I)}l.push(`--resolve-extensions=${d.join(",")}`)}if(c&&l.push(`--public-path=${c}`),h&&l.push(`--entry-names=${h}`),C&&l.push(`--chunk-names=${C}`),F&&l.push(`--asset-names=${F}`),f){let d=[];for(let I of f){if(G(I,"main field"),I.indexOf(",")>=0)throw new Error(`Invalid main field: ${I}`);d.push(I)}l.push(`--main-fields=${d.join(",")}`)}if(o){let d=[];for(let I of o){if(G(I,"condition"),I.indexOf(",")>=0)throw new Error(`Invalid condition: ${I}`);d.push(I)}l.push(`--conditions=${d.join(",")}`)}if(v)for(let d of v)l.push(`--external:${G(d,"external")}`);if(M)for(let d in M){if(d.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${d}`);l.push(`--alias:${d}=${G(M[d],"alias",d)}`)}if(x)for(let d in x){if(d.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${d}`);l.push(`--banner:${d}=${G(x[d],"banner",d)}`)}if(A)for(let d in A){if(d.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${d}`);l.push(`--footer:${d}=${G(A[d],"footer",d)}`)}if($)for(let d of $)l.push(`--inject:${G(d,"inject")}`);if(E)for(let d in E){if(d.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${d}`);l.push(`--loader:${d}=${G(E[d],"loader",d)}`)}if(a)for(let d in a){if(d.indexOf("=")>=0)throw new Error(`Invalid out extension: ${d}`);l.push(`--out-extension:${d}=${G(a[d],"out extension",d)}`)}if(R)if(Array.isArray(R))for(let d=0,I=R.length;d{let p=s+w.length;if(p>g.length){let o=new Uint8Array(p*2);o.set(g),g=o}g.set(w,s),s+=w.length;let f=0;for(;f+4<=s;){let o=Ee(g,f);if(f+4+o>s)break;f+=4,L(g.subarray(f,f+o)),f+=o}f>0&&(g.copyWithin(0,f,s),s-=f)},U=w=>{n.didClose=!0,w&&(n.reason=": "+(w.message||w));let p="The service was stopped"+n.reason;for(let f in i)i[f](p,null);i={}},P=(w,p,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=u++;i[o]=(v,O)=>{try{f(v,O)}finally{w&&w.unref()}},w&&w.ref(),e.writeToStdin(Oe({id:o,isRequest:!0,value:p}))},b=(w,p)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Oe({id:w,isRequest:!1,value:p}))},j=async(w,p)=>{try{if(p.command==="ping"){b(w,{});return}if(typeof p.key=="number"){let f=t[p.key];if(!f)return;let o=f[p.command];if(o){await o(w,p);return}}throw new Error("Invalid command: "+p.command)}catch(f){let o=[ie(f,e,null,void 0,"")];try{b(w,{errors:o})}catch(v){}}},T=!0,L=w=>{if(T){T=!1;let f=String.fromCharCode(...w);if(f!=="0.24.2")throw new Error(`Cannot start service: Host version "0.24.2" does not match binary version ${V(f)}`);return}let p=Se(w);if(p.isRequest)j(p.id,p.value);else{let f=i[p.id];delete i[p.id],p.value.error?f(p.value.error,{}):f(null,p.value)}};return{readFromStdout:m,afterClose:U,service:{buildOrContext:({callName:w,refs:p,options:f,isTTY:o,defaultWD:v,callback:O})=>{let M=0,E=l++,a={},c={ref(){++M===1&&p&&p.ref()},unref(){--M===0&&(delete t[E],p&&p.unref())}};t[E]=a,c.ref(),Ze(w,E,P,b,c,e,a,f,o,v,(h,C)=>{try{O(h,C)}finally{c.unref()}})},transform:({callName:w,refs:p,input:f,options:o,isTTY:v,fs:O,callback:M})=>{let E=Le(),a=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:C}=Xe(w,o,v,$e),F={command:"transform",flags:h,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};C&&(F.mangleCache=C),P(p,F,($,x)=>{if($)return M(new Error($),null);let A=ae(x.errors,E),R=ae(x.warnings,E),k=1,D=()=>{if(--k===0){let N={warnings:R,code:x.code,map:x.map,mangleCache:void 0,legalComments:void 0};"legalComments"in x&&(N.legalComments=x==null?void 0:x.legalComments),x.mangleCache&&(N.mangleCache=x==null?void 0:x.mangleCache),M(null,N)}};if(A.length>0)return M(ce("Transform failed",A,R),null);x.codeFS&&(k++,O.readFile(x.code,(N,B)=>{N!==null?M(N,null):(x.code=B,D())})),x.mapFS&&(k++,O.readFile(x.map,(N,B)=>{N!==null?M(N,null):(x.map=B,D())})),D()})}catch(h){let C=[];try{he(C,o,{},v,$e)}catch($){}let F=ie(h,e,E,void 0,"");P(p,{command:"error",flags:C,error:F},()=>{F.detail=E.load(F.detail),M(ce("Transform failed",[F],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=a;a=()=>O.writeFile(f,c)}a(null)},formatMessages:({callName:w,refs:p,messages:f,options:o,callback:v})=>{if(!o)throw new Error(`Missing second argument in ${w}() call`);let O={},M=r(o,O,"kind",y),E=r(o,O,"color",W),a=r(o,O,"terminalWidth",le);if(Y(o,O,`in ${w}() call`),M===void 0)throw new Error(`Missing "kind" in ${w}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${w}() call`);let c={command:"format-msgs",messages:ne(f,"messages",null,"",a),isWarning:M==="warning"};E!==void 0&&(c.color=E),a!==void 0&&(c.terminalWidth=a),P(p,c,(h,C)=>{if(h)return v(new Error(h),null);v(null,C.messages)})},analyzeMetafile:({callName:w,refs:p,metafile:f,options:o,callback:v})=>{o===void 0&&(o={});let O={},M=r(o,O,"color",W),E=r(o,O,"verbose",W);Y(o,O,`in ${w}() call`);let a={command:"analyze-metafile",metafile:f};M!==void 0&&(a.color=M),E!==void 0&&(a.verbose=E),P(p,a,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function Ze(e,t,n,i,u,l,g,s,m,U,P){let b=Le(),j=e==="context",T=(S,_)=>{let J=[];try{he(J,s,{},m,ke)}catch(p){}let w=ie(S,l,b,void 0,_);n(u,{command:"error",flags:J,error:w},()=>{w.detail=b.load(w.detail),P(ce(j?"Context failed":"Build failed",[w],[]),null)})},L;if(typeof s=="object"){let S=s.plugins;if(S!==void 0){if(!Array.isArray(S))return T(new Error('"plugins" must be an array'),"");L=S}}if(L&&L.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");et(t,n,i,u,l,g,s,L,b).then(S=>{if(!S.ok)return T(S.error,S.pluginName);try{q(S.requestPlugins,S.runOnEndCallbacks,S.scheduleOnDisposeCallbacks)}catch(_){T(_,"")}},S=>T(S,""));return}try{q(null,(S,_)=>_([],[]),()=>{})}catch(S){T(S,"")}function q(S,_,J){let w=l.hasFS,{entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M,nodePaths:E,mangleCache:a}=He(e,s,m,ke,w);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M||U,nodePaths:E,context:j};S&&(c.plugins=S),a&&(c.mangleCache=a);let h=($,x)=>{let A={errors:ae($.errors,b),warnings:ae($.warnings,b),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=A.errors.slice(),k=A.warnings.slice();$.outputFiles&&(A.outputFiles=$.outputFiles.map(nt)),$.metafile&&(A.metafile=JSON.parse($.metafile)),$.mangleCache&&(A.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(re($.writeToStdout).replace(/\n$/,"")),_(A,(D,N)=>{if(R.length>0||D.length>0){let B=ce("Build failed",R.concat(D),k.concat(N));return x(B,null,D,N)}x(null,A,D,N)})},C,F;j&&(g["on-end"]=($,x)=>new Promise(A=>{h(x,(R,k,D,N)=>{let B={errors:D,warnings:N};F&&F(R,k),C=void 0,F=void 0,i($,B),A()})})),n(u,c,($,x)=>{if($)return P(new Error($),null);if(!j)return h(x,(k,D)=>(J(),P(k,D)));if(x.errors.length>0)return P(ce("Context failed",x.errors,x.warnings),null);let A=!1,R={rebuild:()=>(C||(C=new Promise((k,D)=>{let N;F=(H,z)=>{N||(N=()=>H?D(H):k(z))};let B=()=>{n(u,{command:"rebuild",key:t},(z,oe)=>{z?D(new Error(z)):N?N():B()})};B()})),C),watch:(k={})=>new Promise((D,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');Y(k,{},"in watch() call"),n(u,{command:"watch",key:t},z=>{z?N(new Error(z)):D(void 0)})}),serve:(k={})=>new Promise((D,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let B={},H=r(k,B,"port",le),z=r(k,B,"host",y),oe=r(k,B,"servedir",y),d=r(k,B,"keyfile",y),I=r(k,B,"certfile",y),X=r(k,B,"fallback",y),te=r(k,B,"onRequest",Pe);Y(k,B,"in serve() call");let Q={command:"serve",key:t,onRequest:!!te};H!==void 0&&(Q.port=H),z!==void 0&&(Q.host=z),oe!==void 0&&(Q.servedir=oe),d!==void 0&&(Q.keyfile=d),I!==void 0&&(Q.certfile=I),X!==void 0&&(Q.fallback=X),n(u,Q,(ue,Ne)=>{if(ue)return N(new Error(ue));te&&(g["serve-request"]=(Ie,We)=>{te(We.args),i(Ie,{})}),D(Ne)})}),cancel:()=>new Promise(k=>{if(A)return k();n(u,{command:"cancel",key:t},()=>{k()})}),dispose:()=>new Promise(k=>{if(A)return k();A=!0,n(u,{command:"dispose",key:t},()=>{k(),J(),u.unref()})})};u.ref(),P(null,R)})}}var et=async(e,t,n,i,u,l,g,s,m)=>{let U=[],P=[],b={},j={},T=[],L=0,q=0,S=[],_=!1;s=[...s];for(let p of s){let f={};if(typeof p!="object")throw new Error(`Plugin at index ${q} must be an object`);let o=r(p,f,"name",y);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${q} is missing a name`);try{let v=r(p,f,"setup",Pe);if(typeof v!="function")throw new Error("Plugin is missing a setup function");Y(p,f,`on plugin ${V(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};q++;let E=v({initialOptions:g,resolve:(a,c={})=>{if(!_)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof a!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),C=r(c,h,"pluginName",y),F=r(c,h,"importer",y),$=r(c,h,"namespace",y),x=r(c,h,"resolveDir",y),A=r(c,h,"kind",y),R=r(c,h,"pluginData",me),k=r(c,h,"with",ee);return Y(c,h,"in resolve() call"),new Promise((D,N)=>{let B={command:"resolve",path:a,key:e,pluginName:o};if(C!=null&&(B.pluginName=C),F!=null&&(B.importer=F),$!=null&&(B.namespace=$),x!=null&&(B.resolveDir=x),A!=null)B.kind=A;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(B.pluginData=m.store(R)),k!=null&&(B.with=tt(k,"with")),t(i,B,(H,z)=>{H!==null?N(new Error(H)):D({errors:ae(z.errors,m),warnings:ae(z.warnings,m),path:z.path,external:z.external,sideEffects:z.sideEffects,namespace:z.namespace,suffix:z.suffix,pluginData:m.load(z.pluginData)})})})},onStart(a){let c='This error came from the "onStart" callback registered here:',h=pe(new Error(c),u,"onStart");U.push({name:o,callback:a,note:h}),O.onStart=!0},onEnd(a){let c='This error came from the "onEnd" callback registered here:',h=pe(new Error(c),u,"onEnd");P.push({name:o,callback:a,note:h}),O.onEnd=!0},onResolve(a,c){let h='This error came from the "onResolve" callback registered here:',C=pe(new Error(h),u,"onResolve"),F={},$=r(a,F,"filter",ye),x=r(a,F,"namespace",y);if(Y(a,F,`in onResolve() call for plugin ${V(o)}`),$==null)throw new Error("onResolve() call is missing a filter");let A=L++;b[A]={name:o,callback:c,note:C},O.onResolve.push({id:A,filter:$.source,namespace:x||""})},onLoad(a,c){let h='This error came from the "onLoad" callback registered here:',C=pe(new Error(h),u,"onLoad"),F={},$=r(a,F,"filter",ye),x=r(a,F,"namespace",y);if(Y(a,F,`in onLoad() call for plugin ${V(o)}`),$==null)throw new Error("onLoad() call is missing a filter");let A=L++;j[A]={name:o,callback:c,note:C},O.onLoad.push({id:A,filter:$.source,namespace:x||""})},onDispose(a){T.push(a)},esbuild:u.esbuild});E&&await E,S.push(O)}catch(v){return{ok:!1,error:v,pluginName:o}}}l["on-start"]=async(p,f)=>{m.clear();let o={errors:[],warnings:[]};await Promise.all(U.map(async({name:v,callback:O,note:M})=>{try{let E=await O();if(E!=null){if(typeof E!="object")throw new Error(`Expected onStart() callback in plugin ${V(v)} to return an object`);let a={},c=r(E,a,"errors",K),h=r(E,a,"warnings",K);Y(E,a,`from onStart() callback in plugin ${V(v)}`),c!=null&&o.errors.push(...ne(c,"errors",m,v,void 0)),h!=null&&o.warnings.push(...ne(h,"warnings",m,v,void 0))}}catch(E){o.errors.push(ie(E,u,m,M&&M(),v))}})),n(p,o)},l["on-resolve"]=async(p,f)=>{let o={},v="",O,M;for(let E of f.ids)try{({name:v,callback:O,note:M}=b[E]);let a=await O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:m.load(f.pluginData),with:f.with});if(a!=null){if(typeof a!="object")throw new Error(`Expected onResolve() callback in plugin ${V(v)} to return an object`);let c={},h=r(a,c,"pluginName",y),C=r(a,c,"path",y),F=r(a,c,"namespace",y),$=r(a,c,"suffix",y),x=r(a,c,"external",W),A=r(a,c,"sideEffects",W),R=r(a,c,"pluginData",me),k=r(a,c,"errors",K),D=r(a,c,"warnings",K),N=r(a,c,"watchFiles",K),B=r(a,c,"watchDirs",K);Y(a,c,`from onResolve() callback in plugin ${V(v)}`),o.id=E,h!=null&&(o.pluginName=h),C!=null&&(o.path=C),F!=null&&(o.namespace=F),$!=null&&(o.suffix=$),x!=null&&(o.external=x),A!=null&&(o.sideEffects=A),R!=null&&(o.pluginData=m.store(R)),k!=null&&(o.errors=ne(k,"errors",m,v,void 0)),D!=null&&(o.warnings=ne(D,"warnings",m,v,void 0)),N!=null&&(o.watchFiles=ge(N,"watchFiles")),B!=null&&(o.watchDirs=ge(B,"watchDirs"));break}}catch(a){o={id:E,errors:[ie(a,u,m,M&&M(),v)]};break}n(p,o)},l["on-load"]=async(p,f)=>{let o={},v="",O,M;for(let E of f.ids)try{({name:v,callback:O,note:M}=j[E]);let a=await O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:m.load(f.pluginData),with:f.with});if(a!=null){if(typeof a!="object")throw new Error(`Expected onLoad() callback in plugin ${V(v)} to return an object`);let c={},h=r(a,c,"pluginName",y),C=r(a,c,"contents",Te),F=r(a,c,"resolveDir",y),$=r(a,c,"pluginData",me),x=r(a,c,"loader",y),A=r(a,c,"errors",K),R=r(a,c,"warnings",K),k=r(a,c,"watchFiles",K),D=r(a,c,"watchDirs",K);Y(a,c,`from onLoad() callback in plugin ${V(v)}`),o.id=E,h!=null&&(o.pluginName=h),C instanceof Uint8Array?o.contents=C:C!=null&&(o.contents=Z(C)),F!=null&&(o.resolveDir=F),$!=null&&(o.pluginData=m.store($)),x!=null&&(o.loader=x),A!=null&&(o.errors=ne(A,"errors",m,v,void 0)),R!=null&&(o.warnings=ne(R,"warnings",m,v,void 0)),k!=null&&(o.watchFiles=ge(k,"watchFiles")),D!=null&&(o.watchDirs=ge(D,"watchDirs"));break}}catch(a){o={id:E,errors:[ie(a,u,m,M&&M(),v)]};break}n(p,o)};let J=(p,f)=>f([],[]);P.length>0&&(J=(p,f)=>{(async()=>{let o=[],v=[];for(let{name:O,callback:M,note:E}of P){let a,c;try{let h=await M(p);if(h!=null){if(typeof h!="object")throw new Error(`Expected onEnd() callback in plugin ${V(O)} to return an object`);let C={},F=r(h,C,"errors",K),$=r(h,C,"warnings",K);Y(h,C,`from onEnd() callback in plugin ${V(O)}`),F!=null&&(a=ne(F,"errors",m,O,void 0)),$!=null&&(c=ne($,"warnings",m,O,void 0))}}catch(h){a=[ie(h,u,m,E&&E(),O)]}if(a){o.push(...a);try{p.errors.push(...a)}catch(h){}}if(c){v.push(...c);try{p.warnings.push(...c)}catch(h){}}}f(o,v)})()});let w=()=>{for(let p of T)setTimeout(()=>p(),0)};return _=!0,{ok:!0,requestPlugins:S,runOnEndCallbacks:J,scheduleOnDisposeCallbacks:w}};function Le(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function pe(e,t,n){let i,u=!1;return()=>{if(u)return i;u=!0;try{let l=(e.stack+"").split(` +`);l.splice(1,1);let g=qe(t,l,n);if(g)return i={text:e.message,location:g},i}catch(l){}}}function ie(e,t,n,i,u){let l="Internal error",g=null;try{l=(e&&e.message||e)+""}catch(s){}try{g=qe(t,(e.stack+"").split(` +`),"")}catch(s){}return{id:"",pluginName:u,text:l,location:g,notes:i?[i]:[],detail:n?n.store(e):-1}}function qe(e,t,n){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let u=1;u{if(g===i)return` +...`;if(!l.location)return` +error: ${l.text}`;let{file:s,line:m,column:U}=l.location,P=l.pluginName?`[plugin: ${l.pluginName}] `:"";return` +${s}:${m}:${U}: ERROR: ${P}${l.text}`}).join("");let u=new Error(e);for(let[l,g]of[["errors",t],["warnings",n]])Object.defineProperty(u,l,{configurable:!0,enumerable:!0,get:()=>g,set:s=>Object.defineProperty(u,l,{configurable:!0,enumerable:!0,value:s})});return u}function ae(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Ae(e,t,n){if(e==null)return null;let i={},u=r(e,i,"file",y),l=r(e,i,"namespace",y),g=r(e,i,"line",le),s=r(e,i,"column",le),m=r(e,i,"length",le),U=r(e,i,"lineText",y),P=r(e,i,"suggestion",y);if(Y(e,i,t),U){let b=U.slice(0,(s&&s>0?s:0)+(m&&m>0?m:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(b)&&!/\n/.test(U)&&(U=b)}return{file:u||"",namespace:l||"",line:g||0,column:s||0,length:m||0,lineText:U||"",suggestion:P||""}}function ne(e,t,n,i,u){let l=[],g=0;for(let s of e){let m={},U=r(s,m,"id",y),P=r(s,m,"pluginName",y),b=r(s,m,"text",y),j=r(s,m,"location",Ce),T=r(s,m,"notes",K),L=r(s,m,"detail",me),q=`in element ${g} of "${t}"`;Y(s,m,q);let S=[];if(T)for(let _ of T){let J={},w=r(_,J,"text",y),p=r(_,J,"location",Ce);Y(_,J,q),S.push({text:w||"",location:Ae(p,q,u)})}l.push({id:U||"",pluginName:P||i,text:b||"",location:Ae(j,q,u),notes:S,detail:n?n.store(L):-1}),g++}return l}function ge(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${V(t)} must be an array of strings`);n.push(i)}return n}function tt(e,t){let n=Object.create(null);for(let i in e){let u=e[i];if(typeof u!="string")throw new Error(`key ${V(i)} in object ${V(t)} must be a string`);n[i]=u}return n}function nt({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let u=this.contents;return(i===null||u!==t)&&(t=u,i=re(u)),i}}}var it="0.24.2",lt=e=>fe().build(e),st=e=>fe().context(e),ot=(e,t)=>fe().transform(e,t),at=(e,t)=>fe().formatMessages(e,t),ut=(e,t)=>fe().analyzeMetafile(e,t),ct=()=>{throw new Error('The "buildSync" API only works in node')},ft=()=>{throw new Error('The "transformSync" API only works in node')},dt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},pt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},gt=()=>(be&&be(),Promise.resolve()),se,be,we,fe=()=>{if(we)return we;throw se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},mt=e=>{e=De(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(se)throw new Error('Cannot call "initialize" more than once');return se=yt(t||"",n,i),se.catch(()=>{se=void 0}),se},yt=async(e,t,n)=>{let i,u,l=new Promise(b=>u=b);if(n){let b=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(i,s){c+=y.decode(s);const n=c.lastIndexOf(`\n`);return n!=-1&&(console.log(c.substring(0,n)),c=c.substring(n+1)),s.length},write(i,s,n,o,u,h){if(n!==0||o!==s.length||u!==null){h(r());return}const m=this.writeSync(i,s);h(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,u,h){h(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),y=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let a=this._ids.get(e);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=e,this._goRefCounts[a]=0,this._ids.set(e,a)),this._goRefCounts[a]++;let g=0;switch(typeof e){case"object":e!==null&&(g=1);break;case"string":g=2;break;case"symbol":g=3;break;case"function":g=4;break}this.mem.setUint32(t+4,2146959360|g,!0),this.mem.setUint32(t,a,!0)},u=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},h=t=>{const e=s(t+0),l=s(t+8),a=new Array(l);for(let g=0;g{const e=s(t+0),l=s(t+8);return y.decode(new DataView(this._inst.exports.mem.buffer,e,l))},d=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e},gojs:{"runtime.wasmExit":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;const e=s(t+8),l=s(t+16),a=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,c(t+8,(d+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();c(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(u(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),a=h(t+32),g=Reflect.apply(l,e,a);t=this._inst.exports.getsp()>>>0,o(t+56,g),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,c(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),c(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);u(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=u(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),c(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=u(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),c(t+40,a.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const s=d=>{const t=i,e=f.encode(d+"\\0");return new Uint8Array(this.mem.buffer,i,e.length).set(e),i+=e.length,i%8!==0&&(i+=8-i%8),t},n=this.argv.length,o=[];this.argv.forEach(d=>{o.push(s(d))}),o.push(0),Object.keys(this.env).sort().forEach(d=>{o.push(s(`${d}=${this.env[d]}`))}),o.push(0);const h=i;if(o.forEach(d=>{this.mem.setUint32(i,d,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,h),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const i=this;return function(){const s={id:c,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,y=globalThis.fs,c="";y.writeSync=(u,h)=>{if(u===1)postMessage(h);else if(u===2){c+=f.decode(h);let m=c.split(`\n`);m.length>1&&console.log(m.slice(0,-1).join(`\n`)),c=m[m.length-1]}else throw new Error("Bad write");return h.length};let i=[],s,n=0;onmessage=({data:u})=>(u.length>0&&(i.push(u),s&&s()),o),y.read=(u,h,m,d,t,e)=>{if(u!==0||m!==0||d!==h.length||t!==null)throw new Error("Bad read");if(i.length===0){s=()=>y.read(u,h,m,d,t,e);return}let l=i[0],a=Math.max(0,Math.min(d,l.length-n));h.set(l.subarray(n,n+a),m),n+=a,n===l.length&&(i.shift(),n=0),e(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(r,o).then(u=>{postMessage(null),o.run(u)},u=>{postMessage(u)}),o};async function tryToInstantiateModule(r,f){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const y=await fetch(r);if(!y.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(y.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(y,f.importObject)).instance;const c=await y.arrayBuffer();return(await WebAssembly.instantiate(c,f.importObject)).instance}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(i,s){c+=y.decode(s);const n=c.lastIndexOf(` +`);return n!=-1&&(console.log(c.substring(0,n)),c=c.substring(n+1)),s.length},write(i,s,n,o,u,h){if(n!==0||o!==s.length||u!==null){h(r());return}const m=this.writeSync(i,s);h(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,u,h){h(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),y=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let a=this._ids.get(e);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=e,this._goRefCounts[a]=0,this._ids.set(e,a)),this._goRefCounts[a]++;let g=0;switch(typeof e){case"object":e!==null&&(g=1);break;case"string":g=2;break;case"symbol":g=3;break;case"function":g=4;break}this.mem.setUint32(t+4,2146959360|g,!0),this.mem.setUint32(t,a,!0)},u=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},h=t=>{const e=s(t+0),l=s(t+8),a=new Array(l);for(let g=0;g{const e=s(t+0),l=s(t+8);return y.decode(new DataView(this._inst.exports.mem.buffer,e,l))},d=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e},gojs:{"runtime.wasmExit":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;const e=s(t+8),l=s(t+16),a=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,c(t+8,(d+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();c(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(u(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),a=h(t+32),g=Reflect.apply(l,e,a);t=this._inst.exports.getsp()>>>0,o(t+56,g),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,c(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),c(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);u(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=u(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),c(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=u(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),c(t+40,a.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const s=d=>{const t=i,e=f.encode(d+"\0");return new Uint8Array(this.mem.buffer,i,e.length).set(e),i+=e.length,i%8!==0&&(i+=8-i%8),t},n=this.argv.length,o=[];this.argv.forEach(d=>{o.push(s(d))}),o.push(0),Object.keys(this.env).sort().forEach(d=>{o.push(s(`${d}=${this.env[d]}`))}),o.push(0);const h=i;if(o.forEach(d=>{this.mem.setUint32(i,d,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,h),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const i=this;return function(){const s={id:c,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,y=globalThis.fs,c="";y.writeSync=(u,h)=>{if(u===1)postMessage(h);else if(u===2){c+=f.decode(h);let m=c.split(` +`);m.length>1&&console.log(m.slice(0,-1).join(` +`)),c=m[m.length-1]}else throw new Error("Bad write");return h.length};let i=[],s,n=0;onmessage=({data:u})=>(u.length>0&&(i.push(u),s&&s()),o),y.read=(u,h,m,d,t,e)=>{if(u!==0||m!==0||d!==h.length||t!==null)throw new Error("Bad read");if(i.length===0){s=()=>y.read(u,h,m,d,t,e);return}let l=i[0],a=Math.max(0,Math.min(d,l.length-n));h.set(l.subarray(n,n+a),m),n+=a,n===l.length&&(i.shift(),n=0),e(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(r,o).then(u=>{postMessage(null),o.run(u)},u=>{postMessage(u)}),o};async function tryToInstantiateModule(r,f){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const y=await fetch(r);if(!y.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(y.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(y,f.importObject)).instance;const c=await y.arrayBuffer();return(await WebAssembly.instantiate(c,f.importObject)).instance}return r=>onmessage(r);})(T=>i.onmessage({data:T})),j;i={onmessage:null,postMessage:T=>setTimeout(()=>{try{j=b({data:T})}catch(L){u(L)}}),terminate(){if(j)for(let T of j._scheduledTimeouts.values())clearTimeout(T)}}}let g,s,m=new Promise((b,j)=>{g=b,s=j});i.onmessage=({data:b})=>{i.onmessage=({data:j})=>U(j),b?s(b):g()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:U,service:P}=je({writeToStdin(b){i.postMessage(b)},isSync:!1,hasFS:!1,esbuild:ve});await m,be=()=>{i.terminate(),se=void 0,be=void 0,we=void 0},we={build:b=>new Promise((j,T)=>{l.then(T),P.buildOrContext({callName:"build",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),context:b=>new Promise((j,T)=>{l.then(T),P.buildOrContext({callName:"context",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),transform:(b,j)=>new Promise((T,L)=>{l.then(L),P.transform({callName:"transform",refs:null,input:b,options:j||{},isTTY:!1,fs:{readFile(q,S){S(new Error("Internal error"),null)},writeFile(q,S){S(null)}},callback:(q,S)=>q?L(q):T(S)})}),formatMessages:(b,j)=>new Promise((T,L)=>{l.then(L),P.formatMessages({callName:"formatMessages",refs:null,messages:b,options:j,callback:(q,S)=>q?L(q):T(S)})}),analyzeMetafile:(b,j)=>new Promise((T,L)=>{l.then(L),P.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof b=="string"?b:JSON.stringify(b),options:j,callback:(q,S)=>q?L(q):T(S)})})}},ht=ve;export{ut as analyzeMetafile,pt as analyzeMetafileSync,lt as build,ct as buildSync,st as context,ht as default,at as formatMessages,dt as formatMessagesSync,mt as initialize,gt as stop,ot as transform,ft as transformSync,it as version}; diff --git a/node_modules/esbuild-wasm/lib/browser.d.ts b/node_modules/esbuild-wasm/lib/browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7053070fe0b5e83b41d4ec9042a7149ac231577 --- /dev/null +++ b/node_modules/esbuild-wasm/lib/browser.d.ts @@ -0,0 +1,705 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'bundle' | 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: string[] | Record | { in: string, out: string }[] + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + onRequest?: (args: ServeOnRequestArgs) => void +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + host: string +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record + }[] + format?: 'cjs' | 'esm' + with?: Record + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +export interface WatchOptions { +} + +export interface BuildContext { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise + + cancel(): Promise + dispose(): Promise +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape = In & { [Key in Exclude]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build(options: SameShape): Promise> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context(options: SameShape): Promise> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync(options: SameShape): BuildResult + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/node_modules/esbuild-wasm/lib/browser.js b/node_modules/esbuild-wasm/lib/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..e13da41667a8691fd42ffdeb7dcc4a2a3cc5f25d --- /dev/null +++ b/node_modules/esbuild-wasm/lib/browser.js @@ -0,0 +1,2438 @@ +(module=>{ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// lib/npm/browser.ts +var browser_exports = {}; +__export(browser_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => browser_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); +module.exports = __toCommonJS(browser_exports); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateTarget(target) { + validateStringValue(target, "target"); + if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); + return target; +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArray); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArray); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArray); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) { + if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); + else flags.push(`--target=${validateTarget(target)}`); + } + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); + if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); + if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY, logLevelDefault, writeDefault) { + var _a; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); + let mainFields = getFlag(options, keys, "mainFields", mustBeArray); + let conditions = getFlag(options, keys, "conditions", mustBeArray); + let external = getFlag(options, keys, "external", mustBeArray); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArray); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) { + let values = []; + for (let value of resolveExtensions) { + validateStringValue(value, "resolve extension"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); + values.push(value); + } + flags.push(`--resolve-extensions=${values.join(",")}`); + } + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) { + let values = []; + for (let value of mainFields) { + validateStringValue(value, "main field"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); + values.push(value); + } + flags.push(`--main-fields=${values.join(",")}`); + } + if (conditions) { + let values = []; + for (let value of conditions) { + validateStringValue(value, "condition"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); + values.push(value); + } + flags.push(`--conditions=${values.join(",")}`); + } + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path of inject) flags.push(`--inject:${validateStringValue(path, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = (id, request) => __async(this, null, function* () { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + yield callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch (e2) { + } + } + }); + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.24.2") { + throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY, defaultWD, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY, + defaultWD, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY, fs, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY, transformLogLevelDefault); + } catch (e2) { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY, defaultWD, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY, buildLogLevelDefault); + } catch (e2) { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeInteger); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => __async(void 0, null, function* () { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) yield promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = (id, request) => __async(void 0, null, function* () { + details.clear(); + let response = { errors: [], warnings: [] }; + yield Promise.all(onStartCallbacks.map((_0) => __async(void 0, [_0], function* ({ name, callback, note }) { + try { + let result = yield callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + }))); + sendResponse(id, response); + }); + requestCallbacks["on-resolve"] = (id, request) => __async(void 0, null, function* () { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = yield callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path != null) response.path = path; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }); + requestCallbacks["on-load"] = (id, request) => __async(void 0, null, function* () { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = yield callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }); + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (() => __async(void 0, null, function* () { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = yield callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch (e) { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch (e) { + } + } + } + done(onEndErrors, onEndWarnings); + }))(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}); +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location2 = parseStackLinesV8(streamIn, lines, ident); + if (location2) { + note = { text: e.message, location: location2 }; + return note; + } + } catch (e2) { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location2 = null; + try { + text = (e && e.message || e) + ""; + } catch (e2) { + } + try { + location2 = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch (e2) { + } + return { id: "", pluginName, text, location: location2, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch (e) { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location2, where, terminalWidth) { + if (location2 == null) return null; + let keys = {}; + let file = getFlag(location2, keys, "file", mustBeString); + let namespace = getFlag(location2, keys, "namespace", mustBeString); + let line = getFlag(location2, keys, "line", mustBeInteger); + let column = getFlag(location2, keys, "column", mustBeInteger); + let length = getFlag(location2, keys, "length", mustBeInteger); + let lineText = getFlag(location2, keys, "lineText", mustBeString); + let suggestion = getFlag(location2, keys, "suggestion", mustBeString); + checkForInvalidFlags(location2, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location2 = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location2, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path, contents, hash }) { + let text = null; + return { + path, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} + +// lib/npm/browser.ts +var version = "0.24.2"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (options) => ensureServiceIsRunning().context(options); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (metafile, options) => ensureServiceIsRunning().analyzeMetafile(metafile, options); +var buildSync = () => { + throw new Error(`The "buildSync" API only works in node`); +}; +var transformSync = () => { + throw new Error(`The "transformSync" API only works in node`); +}; +var formatMessagesSync = () => { + throw new Error(`The "formatMessagesSync" API only works in node`); +}; +var analyzeMetafileSync = () => { + throw new Error(`The "analyzeMetafileSync" API only works in node`); +}; +var stop = () => { + if (stopService) stopService(); + return Promise.resolve(); +}; +var initializePromise; +var stopService; +var longLivedService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + if (initializePromise) throw new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'); + throw new Error('You need to call "initialize" before calling this'); +}; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + let wasmURL = options.wasmURL; + let wasmModule = options.wasmModule; + let useWorker = options.worker !== false; + if (!wasmURL && !wasmModule) throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option'); + if (initializePromise) throw new Error('Cannot call "initialize" more than once'); + initializePromise = startRunningService(wasmURL || "", wasmModule, useWorker); + initializePromise.catch(() => { + initializePromise = void 0; + }); + return initializePromise; +}; +var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, null, function* () { + let worker; + let rejectAllWith; + const rejectAllPromise = new Promise((resolve) => rejectAllWith = resolve); + if (useWorker) { + let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n };\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b\n },\n gojs: {\n // Go\'s SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n // func wasmExit(code int32)\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n // func resetMemoryDataView()\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n // func nanotime1() int64\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n // func walltime() (sec int64, nsec int32)\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = (/* @__PURE__ */ new Date()).getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n // func scheduleTimeoutEvent(delay int64) int32\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8)\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n // func clearTimeoutEvent(id int32)\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n // func getRandomData(r []byte)\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n // func finalizeRef(v ref)\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n // func stringVal(value string) ref\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n // func valueGet(v ref, p string) ref\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n // func valueSet(v ref, p string, x ref)\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n // func valueDelete(v ref, p string)\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n // func valueIndex(v ref, i int) ref\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n // valueSetIndex(v ref, i int, x ref)\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n // func valueInvoke(v ref, args []ref) (ref, bool)\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueNew(v ref, args []ref) (ref, bool)\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueLength(v ref) int\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n // valuePrepareString(v ref) (ref, int)\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n // valueLoadString(v ref, b []byte)\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n // func valueInstanceOf(v ref, t ref) bool\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n run(instance) {\n return __async(this, null, function* () {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n yield this._exitPromise;\n });\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin) resumeStdin();\n }\n return go;\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.24.2"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\n return go;\n };\n function tryToInstantiateModule(wasm, go) {\n return __async(this, null, function* () {\n if (wasm instanceof WebAssembly.Module) {\n return WebAssembly.instantiate(wasm, go.importObject);\n }\n const res = yield fetch(wasm);\n if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`);\n if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {\n const result2 = yield WebAssembly.instantiateStreaming(res, go.importObject);\n return result2.instance;\n }\n const bytes = yield res.arrayBuffer();\n const result = yield WebAssembly.instantiate(bytes, go.importObject);\n return result.instance;\n });\n }\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" }); + worker = new Worker(URL.createObjectURL(blob)); + } else { + let onmessage = ((postMessage) => { + // Copyright 2018 The Go Authors. All rights reserved. + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); + }; + let onmessage; + let globalThis = {}; + for (let o = self; o; o = Object.getPrototypeOf(o)) + for (let k of Object.getOwnPropertyNames(o)) + if (!(k in globalThis)) + Object.defineProperty(globalThis, k, { get: () => self[k] }); + "use strict"; + (() => { + const enosys = () => { + const err = new Error("not implemented"); + err.code = "ENOSYS"; + return err; + }; + if (!globalThis.fs) { + let outputBuf = ""; + globalThis.fs = { + constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, + // unused + writeSync(fd, buf) { + outputBuf += decoder.decode(buf); + const nl = outputBuf.lastIndexOf("\n"); + if (nl != -1) { + console.log(outputBuf.substring(0, nl)); + outputBuf = outputBuf.substring(nl + 1); + } + return buf.length; + }, + write(fd, buf, offset, length, position, callback) { + if (offset !== 0 || length !== buf.length || position !== null) { + callback(enosys()); + return; + } + const n = this.writeSync(fd, buf); + callback(null, n); + }, + chmod(path, mode, callback) { + callback(enosys()); + }, + chown(path, uid, gid, callback) { + callback(enosys()); + }, + close(fd, callback) { + callback(enosys()); + }, + fchmod(fd, mode, callback) { + callback(enosys()); + }, + fchown(fd, uid, gid, callback) { + callback(enosys()); + }, + fstat(fd, callback) { + callback(enosys()); + }, + fsync(fd, callback) { + callback(null); + }, + ftruncate(fd, length, callback) { + callback(enosys()); + }, + lchown(path, uid, gid, callback) { + callback(enosys()); + }, + link(path, link, callback) { + callback(enosys()); + }, + lstat(path, callback) { + callback(enosys()); + }, + mkdir(path, perm, callback) { + callback(enosys()); + }, + open(path, flags, mode, callback) { + callback(enosys()); + }, + read(fd, buffer, offset, length, position, callback) { + callback(enosys()); + }, + readdir(path, callback) { + callback(enosys()); + }, + readlink(path, callback) { + callback(enosys()); + }, + rename(from, to, callback) { + callback(enosys()); + }, + rmdir(path, callback) { + callback(enosys()); + }, + stat(path, callback) { + callback(enosys()); + }, + symlink(path, link, callback) { + callback(enosys()); + }, + truncate(path, length, callback) { + callback(enosys()); + }, + unlink(path, callback) { + callback(enosys()); + }, + utimes(path, atime, mtime, callback) { + callback(enosys()); + } + }; + } + if (!globalThis.process) { + globalThis.process = { + getuid() { + return -1; + }, + getgid() { + return -1; + }, + geteuid() { + return -1; + }, + getegid() { + return -1; + }, + getgroups() { + throw enosys(); + }, + pid: -1, + ppid: -1, + umask() { + throw enosys(); + }, + cwd() { + throw enosys(); + }, + chdir() { + throw enosys(); + } + }; + } + if (!globalThis.crypto) { + throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)"); + } + if (!globalThis.performance) { + throw new Error("globalThis.performance is not available, polyfill required (performance.now only)"); + } + if (!globalThis.TextEncoder) { + throw new Error("globalThis.TextEncoder is not available, polyfill required"); + } + if (!globalThis.TextDecoder) { + throw new Error("globalThis.TextDecoder is not available, polyfill required"); + } + const encoder = new TextEncoder("utf-8"); + const decoder = new TextDecoder("utf-8"); + globalThis.Go = class { + constructor() { + this.argv = ["js"]; + this.env = {}; + this.exit = (code) => { + if (code !== 0) { + console.warn("exit code:", code); + } + }; + this._exitPromise = new Promise((resolve) => { + this._resolveExitPromise = resolve; + }); + this._pendingEvent = null; + this._scheduledTimeouts = /* @__PURE__ */ new Map(); + this._nextCallbackTimeoutID = 1; + const setInt64 = (addr, v) => { + this.mem.setUint32(addr + 0, v, true); + this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true); + }; + const setInt32 = (addr, v) => { + this.mem.setUint32(addr + 0, v, true); + }; + const getInt64 = (addr) => { + const low = this.mem.getUint32(addr + 0, true); + const high = this.mem.getInt32(addr + 4, true); + return low + high * 4294967296; + }; + const loadValue = (addr) => { + const f = this.mem.getFloat64(addr, true); + if (f === 0) { + return void 0; + } + if (!isNaN(f)) { + return f; + } + const id = this.mem.getUint32(addr, true); + return this._values[id]; + }; + const storeValue = (addr, v) => { + const nanHead = 2146959360; + if (typeof v === "number" && v !== 0) { + if (isNaN(v)) { + this.mem.setUint32(addr + 4, nanHead, true); + this.mem.setUint32(addr, 0, true); + return; + } + this.mem.setFloat64(addr, v, true); + return; + } + if (v === void 0) { + this.mem.setFloat64(addr, 0, true); + return; + } + let id = this._ids.get(v); + if (id === void 0) { + id = this._idPool.pop(); + if (id === void 0) { + id = this._values.length; + } + this._values[id] = v; + this._goRefCounts[id] = 0; + this._ids.set(v, id); + } + this._goRefCounts[id]++; + let typeFlag = 0; + switch (typeof v) { + case "object": + if (v !== null) { + typeFlag = 1; + } + break; + case "string": + typeFlag = 2; + break; + case "symbol": + typeFlag = 3; + break; + case "function": + typeFlag = 4; + break; + } + this.mem.setUint32(addr + 4, nanHead | typeFlag, true); + this.mem.setUint32(addr, id, true); + }; + const loadSlice = (addr) => { + const array = getInt64(addr + 0); + const len = getInt64(addr + 8); + return new Uint8Array(this._inst.exports.mem.buffer, array, len); + }; + const loadSliceOfValues = (addr) => { + const array = getInt64(addr + 0); + const len = getInt64(addr + 8); + const a = new Array(len); + for (let i = 0; i < len; i++) { + a[i] = loadValue(array + i * 8); + } + return a; + }; + const loadString = (addr) => { + const saddr = getInt64(addr + 0); + const len = getInt64(addr + 8); + return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len)); + }; + const timeOrigin = Date.now() - performance.now(); + this.importObject = { + _gotest: { + add: (a, b) => a + b + }, + gojs: { + // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters) + // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported + // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function). + // This changes the SP, thus we have to update the SP used by the imported function. + // func wasmExit(code int32) + "runtime.wasmExit": (sp) => { + sp >>>= 0; + const code = this.mem.getInt32(sp + 8, true); + this.exited = true; + delete this._inst; + delete this._values; + delete this._goRefCounts; + delete this._ids; + delete this._idPool; + this.exit(code); + }, + // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32) + "runtime.wasmWrite": (sp) => { + sp >>>= 0; + const fd = getInt64(sp + 8); + const p = getInt64(sp + 16); + const n = this.mem.getInt32(sp + 24, true); + globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n)); + }, + // func resetMemoryDataView() + "runtime.resetMemoryDataView": (sp) => { + sp >>>= 0; + this.mem = new DataView(this._inst.exports.mem.buffer); + }, + // func nanotime1() int64 + "runtime.nanotime1": (sp) => { + sp >>>= 0; + setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6); + }, + // func walltime() (sec int64, nsec int32) + "runtime.walltime": (sp) => { + sp >>>= 0; + const msec = (/* @__PURE__ */ new Date()).getTime(); + setInt64(sp + 8, msec / 1e3); + this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true); + }, + // func scheduleTimeoutEvent(delay int64) int32 + "runtime.scheduleTimeoutEvent": (sp) => { + sp >>>= 0; + const id = this._nextCallbackTimeoutID; + this._nextCallbackTimeoutID++; + this._scheduledTimeouts.set(id, setTimeout( + () => { + this._resume(); + while (this._scheduledTimeouts.has(id)) { + console.warn("scheduleTimeoutEvent: missed timeout event"); + this._resume(); + } + }, + getInt64(sp + 8) + )); + this.mem.setInt32(sp + 16, id, true); + }, + // func clearTimeoutEvent(id int32) + "runtime.clearTimeoutEvent": (sp) => { + sp >>>= 0; + const id = this.mem.getInt32(sp + 8, true); + clearTimeout(this._scheduledTimeouts.get(id)); + this._scheduledTimeouts.delete(id); + }, + // func getRandomData(r []byte) + "runtime.getRandomData": (sp) => { + sp >>>= 0; + crypto.getRandomValues(loadSlice(sp + 8)); + }, + // func finalizeRef(v ref) + "syscall/js.finalizeRef": (sp) => { + sp >>>= 0; + const id = this.mem.getUint32(sp + 8, true); + this._goRefCounts[id]--; + if (this._goRefCounts[id] === 0) { + const v = this._values[id]; + this._values[id] = null; + this._ids.delete(v); + this._idPool.push(id); + } + }, + // func stringVal(value string) ref + "syscall/js.stringVal": (sp) => { + sp >>>= 0; + storeValue(sp + 24, loadString(sp + 8)); + }, + // func valueGet(v ref, p string) ref + "syscall/js.valueGet": (sp) => { + sp >>>= 0; + const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16)); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 32, result); + }, + // func valueSet(v ref, p string, x ref) + "syscall/js.valueSet": (sp) => { + sp >>>= 0; + Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32)); + }, + // func valueDelete(v ref, p string) + "syscall/js.valueDelete": (sp) => { + sp >>>= 0; + Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16)); + }, + // func valueIndex(v ref, i int) ref + "syscall/js.valueIndex": (sp) => { + sp >>>= 0; + storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16))); + }, + // valueSetIndex(v ref, i int, x ref) + "syscall/js.valueSetIndex": (sp) => { + sp >>>= 0; + Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24)); + }, + // func valueCall(v ref, m string, args []ref) (ref, bool) + "syscall/js.valueCall": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const m = Reflect.get(v, loadString(sp + 16)); + const args = loadSliceOfValues(sp + 32); + const result = Reflect.apply(m, v, args); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 56, result); + this.mem.setUint8(sp + 64, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 56, err); + this.mem.setUint8(sp + 64, 0); + } + }, + // func valueInvoke(v ref, args []ref) (ref, bool) + "syscall/js.valueInvoke": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const args = loadSliceOfValues(sp + 16); + const result = Reflect.apply(v, void 0, args); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, result); + this.mem.setUint8(sp + 48, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, err); + this.mem.setUint8(sp + 48, 0); + } + }, + // func valueNew(v ref, args []ref) (ref, bool) + "syscall/js.valueNew": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const args = loadSliceOfValues(sp + 16); + const result = Reflect.construct(v, args); + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, result); + this.mem.setUint8(sp + 48, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; + storeValue(sp + 40, err); + this.mem.setUint8(sp + 48, 0); + } + }, + // func valueLength(v ref) int + "syscall/js.valueLength": (sp) => { + sp >>>= 0; + setInt64(sp + 16, parseInt(loadValue(sp + 8).length)); + }, + // valuePrepareString(v ref) (ref, int) + "syscall/js.valuePrepareString": (sp) => { + sp >>>= 0; + const str = encoder.encode(String(loadValue(sp + 8))); + storeValue(sp + 16, str); + setInt64(sp + 24, str.length); + }, + // valueLoadString(v ref, b []byte) + "syscall/js.valueLoadString": (sp) => { + sp >>>= 0; + const str = loadValue(sp + 8); + loadSlice(sp + 16).set(str); + }, + // func valueInstanceOf(v ref, t ref) bool + "syscall/js.valueInstanceOf": (sp) => { + sp >>>= 0; + this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0); + }, + // func copyBytesToGo(dst []byte, src ref) (int, bool) + "syscall/js.copyBytesToGo": (sp) => { + sp >>>= 0; + const dst = loadSlice(sp + 8); + const src = loadValue(sp + 32); + if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) { + this.mem.setUint8(sp + 48, 0); + return; + } + const toCopy = src.subarray(0, dst.length); + dst.set(toCopy); + setInt64(sp + 40, toCopy.length); + this.mem.setUint8(sp + 48, 1); + }, + // func copyBytesToJS(dst ref, src []byte) (int, bool) + "syscall/js.copyBytesToJS": (sp) => { + sp >>>= 0; + const dst = loadValue(sp + 8); + const src = loadSlice(sp + 16); + if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) { + this.mem.setUint8(sp + 48, 0); + return; + } + const toCopy = src.subarray(0, dst.length); + dst.set(toCopy); + setInt64(sp + 40, toCopy.length); + this.mem.setUint8(sp + 48, 1); + }, + "debug": (value) => { + console.log(value); + } + } + }; + } + run(instance) { + return __async(this, null, function* () { + if (!(instance instanceof WebAssembly.Instance)) { + throw new Error("Go.run: WebAssembly.Instance expected"); + } + this._inst = instance; + this.mem = new DataView(this._inst.exports.mem.buffer); + this._values = [ + // JS values that Go currently has references to, indexed by reference id + NaN, + 0, + null, + true, + false, + globalThis, + this + ]; + this._goRefCounts = new Array(this._values.length).fill(Infinity); + this._ids = /* @__PURE__ */ new Map([ + // mapping from JS values to reference ids + [0, 1], + [null, 2], + [true, 3], + [false, 4], + [globalThis, 5], + [this, 6] + ]); + this._idPool = []; + this.exited = false; + let offset = 4096; + const strPtr = (str) => { + const ptr = offset; + const bytes = encoder.encode(str + "\0"); + new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes); + offset += bytes.length; + if (offset % 8 !== 0) { + offset += 8 - offset % 8; + } + return ptr; + }; + const argc = this.argv.length; + const argvPtrs = []; + this.argv.forEach((arg) => { + argvPtrs.push(strPtr(arg)); + }); + argvPtrs.push(0); + const keys = Object.keys(this.env).sort(); + keys.forEach((key) => { + argvPtrs.push(strPtr(`${key}=${this.env[key]}`)); + }); + argvPtrs.push(0); + const argv = offset; + argvPtrs.forEach((ptr) => { + this.mem.setUint32(offset, ptr, true); + this.mem.setUint32(offset + 4, 0, true); + offset += 8; + }); + const wasmMinDataAddr = 4096 + 8192; + if (offset >= wasmMinDataAddr) { + throw new Error("total length of command line and environment variables exceeds limit"); + } + this._inst.exports.run(argc, argv); + if (this.exited) { + this._resolveExitPromise(); + } + yield this._exitPromise; + }); + } + _resume() { + if (this.exited) { + throw new Error("Go program has already exited"); + } + this._inst.exports.resume(); + if (this.exited) { + this._resolveExitPromise(); + } + } + _makeFuncWrapper(id) { + const go = this; + return function() { + const event = { id, this: this, args: arguments }; + go._pendingEvent = event; + go._resume(); + return event.result; + }; + } + }; + })(); + onmessage = ({ data: wasm }) => { + let decoder = new TextDecoder(); + let fs = globalThis.fs; + let stderr = ""; + fs.writeSync = (fd, buffer) => { + if (fd === 1) { + postMessage(buffer); + } else if (fd === 2) { + stderr += decoder.decode(buffer); + let parts = stderr.split("\n"); + if (parts.length > 1) console.log(parts.slice(0, -1).join("\n")); + stderr = parts[parts.length - 1]; + } else { + throw new Error("Bad write"); + } + return buffer.length; + }; + let stdin = []; + let resumeStdin; + let stdinPos = 0; + onmessage = ({ data }) => { + if (data.length > 0) { + stdin.push(data); + if (resumeStdin) resumeStdin(); + } + return go; + }; + fs.read = (fd, buffer, offset, length, position, callback) => { + if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) { + throw new Error("Bad read"); + } + if (stdin.length === 0) { + resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback); + return; + } + let first = stdin[0]; + let count = Math.max(0, Math.min(length, first.length - stdinPos)); + buffer.set(first.subarray(stdinPos, stdinPos + count), offset); + stdinPos += count; + if (stdinPos === first.length) { + stdin.shift(); + stdinPos = 0; + } + callback(null, count); + }; + let go = new globalThis.Go(); + go.argv = ["", `--service=${"0.24.2"}`]; + tryToInstantiateModule(wasm, go).then( + (instance) => { + postMessage(null); + go.run(instance); + }, + (error) => { + postMessage(error); + } + ); + return go; + }; + function tryToInstantiateModule(wasm, go) { + return __async(this, null, function* () { + if (wasm instanceof WebAssembly.Module) { + return WebAssembly.instantiate(wasm, go.importObject); + } + const res = yield fetch(wasm); + if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`); + if ("instantiateStreaming" in WebAssembly && /^application\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) { + const result2 = yield WebAssembly.instantiateStreaming(res, go.importObject); + return result2.instance; + } + const bytes = yield res.arrayBuffer(); + const result = yield WebAssembly.instantiate(bytes, go.importObject); + return result.instance; + }); + } + return (m) => onmessage(m); + })((data) => worker.onmessage({ data })); + let go; + worker = { + onmessage: null, + postMessage: (data) => setTimeout(() => { + try { + go = onmessage({ data }); + } catch (error) { + rejectAllWith(error); + } + }), + terminate() { + if (go) + for (let timeout of go._scheduledTimeouts.values()) + clearTimeout(timeout); + } + }; + } + let firstMessageResolve; + let firstMessageReject; + const firstMessagePromise = new Promise((resolve, reject) => { + firstMessageResolve = resolve; + firstMessageReject = reject; + }); + worker.onmessage = ({ data: error }) => { + worker.onmessage = ({ data }) => readFromStdout(data); + if (error) firstMessageReject(error); + else firstMessageResolve(); + }; + worker.postMessage(wasmModule || new URL(wasmURL, location.href).toString()); + let { readFromStdout, service } = createChannel({ + writeToStdin(bytes) { + worker.postMessage(bytes); + }, + isSync: false, + hasFS: false, + esbuild: browser_exports + }); + yield firstMessagePromise; + stopService = () => { + worker.terminate(); + initializePromise = void 0; + stopService = void 0; + longLivedService = void 0; + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.buildOrContext({ + callName: "build", + refs: null, + options, + isTTY: false, + defaultWD: "/", + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.buildOrContext({ + callName: "context", + refs: null, + options, + isTTY: false, + defaultWD: "/", + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + transform: (input, options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.transform({ + callName: "transform", + refs: null, + input, + options: options || {}, + isTTY: false, + fs: { + readFile(_, callback) { + callback(new Error("Internal error"), null); + }, + writeFile(_, callback) { + callback(null); + } + }, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + formatMessages: (messages, options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.formatMessages({ + callName: "formatMessages", + refs: null, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => { + rejectAllPromise.then(reject); + service.analyzeMetafile({ + callName: "analyzeMetafile", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }) + }; +}); +var browser_default = browser_exports; +})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}}); diff --git a/node_modules/esbuild-wasm/lib/browser.min.js b/node_modules/esbuild-wasm/lib/browser.min.js new file mode 100644 index 0000000000000000000000000000000000000000..dcdcfd3b7b3ab101a32bcfeb1e569f86510e3baf --- /dev/null +++ b/node_modules/esbuild-wasm/lib/browser.min.js @@ -0,0 +1,22 @@ +(module=>{ +"use strict";var xe=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Je=(e,t)=>{for(var n in t)xe(e,n,{get:t[n],enumerable:!0})},Ge=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ve(t))!Ye.call(e,a)&&a!==n&&xe(e,a,{get:()=>t[a],enumerable:!(i=_e(t,a))||i.enumerable});return e};var Qe=e=>Ge(xe({},"__esModule",{value:!0}),e);var ne=(e,t,n)=>new Promise((i,a)=>{var l=d=>{try{s(n.next(d))}catch(F){a(F)}},p=d=>{try{s(n.throw(d))}catch(F){a(F)}},s=d=>d.done?i(d.value):Promise.resolve(d.value).then(l,p);s((n=n.apply(e,t)).next())});var Re={};Je(Re,{analyzeMetafile:()=>mt,analyzeMetafileSync:()=>wt,build:()=>ft,buildSync:()=>yt,context:()=>dt,default:()=>Ot,formatMessages:()=>gt,formatMessagesSync:()=>bt,initialize:()=>Rt,stop:()=>vt,transform:()=>pt,transformSync:()=>ht,version:()=>ct});module.exports=Qe(Re);function Se(e){let t=i=>{if(i===null)n.write8(0);else if(typeof i=="boolean")n.write8(1),n.write8(+i);else if(typeof i=="number")n.write8(2),n.write32(i|0);else if(typeof i=="string")n.write8(3),n.write(Z(i));else if(i instanceof Uint8Array)n.write8(4),n.write(i);else if(i instanceof Array){n.write8(5),n.write32(i.length);for(let a of i)t(a)}else{let a=Object.keys(i);n.write8(6),n.write32(a.length);for(let l of a)n.write(Z(l)),t(i[l])}},n=new pe;return n.write32(0),n.write32(e.id<<1|+!e.isRequest),t(e.value),Ee(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function $e(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return ie(n.read());case 4:return n.read();case 5:{let p=n.read32(),s=[];for(let d=0;d>>=1;let l=t();if(n.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:a,value:l}}var pe=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let n=new Uint8Array((this.len+t)*2);n.set(this.buf),this.buf=n}return this.len+=t,this.len-t}write8(t){let n=this._write(1);this.buf[n]=t}write32(t){let n=this._write(4);Ee(this.buf,t,n)}write(t){let n=this._write(4+t.length);Ee(this.buf,t.length,n),this.buf.set(t,n+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return ke(this.buf,this._read(4))}read(){let t=this.read32(),n=new Uint8Array(t),i=this._read(n.length);return n.set(this.buf.subarray(i,i+t)),n}},Z,ie,Oe;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;Z=n=>e.encode(n),ie=n=>t.decode(n),Oe='new TextEncoder().encode("")'}else if(typeof Buffer!="undefined")Z=e=>Buffer.from(e),ie=e=>{let{buffer:t,byteOffset:n,byteLength:i}=e;return Buffer.from(t,n,i).toString()},Oe='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Oe} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`);function ke(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ee(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var V=JSON.stringify,Me="warning",Ce="silent";function Ae(e){if(G(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var ye=()=>null,W=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",he=e=>e instanceof RegExp?null:"a RegExp object",se=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Te=e=>typeof e=="function"?null:"a function",K=e=>Array.isArray(e)?null:"an array",ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Xe=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ze=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Pe=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",De=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",et=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",tt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Be=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",nt=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let a=e[n];if(t[n+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${V(n)} must be ${l}`);return a}function Y(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${V(i)}`)}function Ue(e){let t=Object.create(null),n=r(e,t,"wasmURL",nt),i=r(e,t,"wasmModule",Ze),a=r(e,t,"worker",W);return Y(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:a}}function je(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${V(n)} in mangle cache to map to either a string or false`)}}return t}function be(e,t,n,i,a){let l=r(t,n,"color",W),p=r(t,n,"logLevel",y),s=r(t,n,"logLimit",se);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${p||a}`),e.push(`--log-limit=${s||0}`)}function G(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+V(n):""} to be a string, got ${typeof e} instead`);return e}function Le(e,t,n){let i=r(t,n,"legalComments",y),a=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",W),p=r(t,n,"target",tt),s=r(t,n,"format",y),d=r(t,n,"globalName",y),F=r(t,n,"mangleProps",he),A=r(t,n,"reserveProps",he),b=r(t,n,"mangleQuoted",W),j=r(t,n,"minify",W),T=r(t,n,"minifySyntax",W),L=r(t,n,"minifyWhitespace",W),q=r(t,n,"minifyIdentifiers",W),E=r(t,n,"lineLimit",se),_=r(t,n,"drop",K),J=r(t,n,"dropLabels",K),w=r(t,n,"charset",y),m=r(t,n,"treeShaking",W),f=r(t,n,"ignoreAnnotations",W),o=r(t,n,"jsx",y),v=r(t,n,"jsxFactory",y),O=r(t,n,"jsxFragment",y),M=r(t,n,"jsxImportSource",y),D=r(t,n,"jsxDev",W),u=r(t,n,"jsxSideEffects",W),c=r(t,n,"define",ee),h=r(t,n,"logOverride",ee),S=r(t,n,"supported",ee),P=r(t,n,"pure",K),$=r(t,n,"keepNames",W),x=r(t,n,"platform",y),C=r(t,n,"tsconfigRaw",et);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),p&&(Array.isArray(p)?e.push(`--target=${Array.from(p).map(Ae).join(",")}`):e.push(`--target=${Ae(p)}`)),s&&e.push(`--format=${s}`),d&&e.push(`--global-name=${d}`),x&&e.push(`--platform=${x}`),C&&e.push(`--tsconfig-raw=${typeof C=="string"?C:JSON.stringify(C)}`),j&&e.push("--minify"),T&&e.push("--minify-syntax"),L&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),E&&e.push(`--line-limit=${E}`),w&&e.push(`--charset=${w}`),m!==void 0&&e.push(`--tree-shaking=${m}`),f&&e.push("--ignore-annotations"),_)for(let R of _)e.push(`--drop:${G(R,"drop")}`);if(J&&e.push(`--drop-labels=${Array.from(J).map(R=>G(R,"dropLabels")).join(",")}`),F&&e.push(`--mangle-props=${F.source}`),A&&e.push(`--reserve-props=${A.source}`),b!==void 0&&e.push(`--mangle-quoted=${b}`),o&&e.push(`--jsx=${o}`),v&&e.push(`--jsx-factory=${v}`),O&&e.push(`--jsx-fragment=${O}`),M&&e.push(`--jsx-import-source=${M}`),D&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),c)for(let R in c){if(R.indexOf("=")>=0)throw new Error(`Invalid define: ${R}`);e.push(`--define:${R}=${G(c[R],"define",R)}`)}if(h)for(let R in h){if(R.indexOf("=")>=0)throw new Error(`Invalid log override: ${R}`);e.push(`--log-override:${R}=${G(h[R],"log override",R)}`)}if(S)for(let R in S){if(R.indexOf("=")>=0)throw new Error(`Invalid supported: ${R}`);let k=S[R];if(typeof k!="boolean")throw new Error(`Expected value for supported ${V(R)} to be a boolean, got ${typeof k} instead`);e.push(`--supported:${R}=${k}`)}if(P)for(let R of P)e.push(`--pure:${G(R,"pure")}`);$&&e.push("--keep-names")}function rt(e,t,n,i,a){var ae;let l=[],p=[],s=Object.create(null),d=null,F=null;be(l,t,s,n,i),Le(l,t,s);let A=r(t,s,"sourcemap",De),b=r(t,s,"bundle",W),j=r(t,s,"splitting",W),T=r(t,s,"preserveSymlinks",W),L=r(t,s,"metafile",W),q=r(t,s,"outfile",y),E=r(t,s,"outdir",y),_=r(t,s,"outbase",y),J=r(t,s,"tsconfig",y),w=r(t,s,"resolveExtensions",K),m=r(t,s,"nodePaths",K),f=r(t,s,"mainFields",K),o=r(t,s,"conditions",K),v=r(t,s,"external",K),O=r(t,s,"packages",y),M=r(t,s,"alias",ee),D=r(t,s,"loader",ee),u=r(t,s,"outExtension",ee),c=r(t,s,"publicPath",y),h=r(t,s,"entryNames",y),S=r(t,s,"chunkNames",y),P=r(t,s,"assetNames",y),$=r(t,s,"inject",K),x=r(t,s,"banner",ee),C=r(t,s,"footer",ee),R=r(t,s,"entryPoints",Xe),k=r(t,s,"absWorkingDir",y),B=r(t,s,"stdin",ee),N=(ae=r(t,s,"write",W))!=null?ae:a,U=r(t,s,"allowOverwrite",W),H=r(t,s,"mangleCache",ee);if(s.plugins=!0,Y(t,s,`in ${e}() call`),A&&l.push(`--sourcemap${A===!0?"":`=${A}`}`),b&&l.push("--bundle"),U&&l.push("--allow-overwrite"),j&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),q&&l.push(`--outfile=${q}`),E&&l.push(`--outdir=${E}`),_&&l.push(`--outbase=${_}`),J&&l.push(`--tsconfig=${J}`),O&&l.push(`--packages=${O}`),w){let g=[];for(let I of w){if(G(I,"resolve extension"),I.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${I}`);g.push(I)}l.push(`--resolve-extensions=${g.join(",")}`)}if(c&&l.push(`--public-path=${c}`),h&&l.push(`--entry-names=${h}`),S&&l.push(`--chunk-names=${S}`),P&&l.push(`--asset-names=${P}`),f){let g=[];for(let I of f){if(G(I,"main field"),I.indexOf(",")>=0)throw new Error(`Invalid main field: ${I}`);g.push(I)}l.push(`--main-fields=${g.join(",")}`)}if(o){let g=[];for(let I of o){if(G(I,"condition"),I.indexOf(",")>=0)throw new Error(`Invalid condition: ${I}`);g.push(I)}l.push(`--conditions=${g.join(",")}`)}if(v)for(let g of v)l.push(`--external:${G(g,"external")}`);if(M)for(let g in M){if(g.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${g}`);l.push(`--alias:${g}=${G(M[g],"alias",g)}`)}if(x)for(let g in x){if(g.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${g}`);l.push(`--banner:${g}=${G(x[g],"banner",g)}`)}if(C)for(let g in C){if(g.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${g}`);l.push(`--footer:${g}=${G(C[g],"footer",g)}`)}if($)for(let g of $)l.push(`--inject:${G(g,"inject")}`);if(D)for(let g in D){if(g.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${g}`);l.push(`--loader:${g}=${G(D[g],"loader",g)}`)}if(u)for(let g in u){if(g.indexOf("=")>=0)throw new Error(`Invalid out extension: ${g}`);l.push(`--out-extension:${g}=${G(u[g],"out extension",g)}`)}if(R)if(Array.isArray(R))for(let g=0,I=R.length;g{let m=s+w.length;if(m>p.length){let o=new Uint8Array(m*2);o.set(p),p=o}p.set(w,s),s+=w.length;let f=0;for(;f+4<=s;){let o=ke(p,f);if(f+4+o>s)break;f+=4,L(p.subarray(f,f+o)),f+=o}f>0&&(p.copyWithin(0,f,s),s-=f)},F=w=>{n.didClose=!0,w&&(n.reason=": "+(w.message||w));let m="The service was stopped"+n.reason;for(let f in i)i[f](m,null);i={}},A=(w,m,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=a++;i[o]=(v,O)=>{try{f(v,O)}finally{w&&w.unref()}},w&&w.ref(),e.writeToStdin(Se({id:o,isRequest:!0,value:m}))},b=(w,m)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Se({id:w,isRequest:!1,value:m}))},j=(w,m)=>ne(this,null,function*(){try{if(m.command==="ping"){b(w,{});return}if(typeof m.key=="number"){let f=t[m.key];if(!f)return;let o=f[m.command];if(o){yield o(w,m);return}}throw new Error("Invalid command: "+m.command)}catch(f){let o=[le(f,e,null,void 0,"")];try{b(w,{errors:o})}catch(v){}}}),T=!0,L=w=>{if(T){T=!1;let f=String.fromCharCode(...w);if(f!=="0.24.2")throw new Error(`Cannot start service: Host version "0.24.2" does not match binary version ${V(f)}`);return}let m=$e(w);if(m.isRequest)j(m.id,m.value);else{let f=i[m.id];delete i[m.id],m.value.error?f(m.value.error,{}):f(null,m.value)}};return{readFromStdout:d,afterClose:F,service:{buildOrContext:({callName:w,refs:m,options:f,isTTY:o,defaultWD:v,callback:O})=>{let M=0,D=l++,u={},c={ref(){++M===1&&m&&m.ref()},unref(){--M===0&&(delete t[D],m&&m.unref())}};t[D]=u,c.ref(),lt(w,D,A,b,c,e,u,f,o,v,(h,S)=>{try{O(h,S)}finally{c.unref()}})},transform:({callName:w,refs:m,input:f,options:o,isTTY:v,fs:O,callback:M})=>{let D=Ne(),u=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:S}=it(w,o,v,Ce),P={command:"transform",flags:h,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};S&&(P.mangleCache=S),A(m,P,($,x)=>{if($)return M(new Error($),null);let C=ue(x.errors,D),R=ue(x.warnings,D),k=1,B=()=>{if(--k===0){let N={warnings:R,code:x.code,map:x.map,mangleCache:void 0,legalComments:void 0};"legalComments"in x&&(N.legalComments=x==null?void 0:x.legalComments),x.mangleCache&&(N.mangleCache=x==null?void 0:x.mangleCache),M(null,N)}};if(C.length>0)return M(fe("Transform failed",C,R),null);x.codeFS&&(k++,O.readFile(x.code,(N,U)=>{N!==null?M(N,null):(x.code=U,B())})),x.mapFS&&(k++,O.readFile(x.map,(N,U)=>{N!==null?M(N,null):(x.map=U,B())})),B()})}catch(h){let S=[];try{be(S,o,{},v,Ce)}catch($){}let P=le(h,e,D,void 0,"");A(m,{command:"error",flags:S,error:P},()=>{P.detail=D.load(P.detail),M(fe("Transform failed",[P],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=u;u=()=>O.writeFile(f,c)}u(null)},formatMessages:({callName:w,refs:m,messages:f,options:o,callback:v})=>{if(!o)throw new Error(`Missing second argument in ${w}() call`);let O={},M=r(o,O,"kind",y),D=r(o,O,"color",W),u=r(o,O,"terminalWidth",se);if(Y(o,O,`in ${w}() call`),M===void 0)throw new Error(`Missing "kind" in ${w}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${w}() call`);let c={command:"format-msgs",messages:re(f,"messages",null,"",u),isWarning:M==="warning"};D!==void 0&&(c.color=D),u!==void 0&&(c.terminalWidth=u),A(m,c,(h,S)=>{if(h)return v(new Error(h),null);v(null,S.messages)})},analyzeMetafile:({callName:w,refs:m,metafile:f,options:o,callback:v})=>{o===void 0&&(o={});let O={},M=r(o,O,"color",W),D=r(o,O,"verbose",W);Y(o,O,`in ${w}() call`);let u={command:"analyze-metafile",metafile:f};M!==void 0&&(u.color=M),D!==void 0&&(u.verbose=D),A(m,u,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function lt(e,t,n,i,a,l,p,s,d,F,A){let b=Ne(),j=e==="context",T=(E,_)=>{let J=[];try{be(J,s,{},d,Me)}catch(m){}let w=le(E,l,b,void 0,_);n(a,{command:"error",flags:J,error:w},()=>{w.detail=b.load(w.detail),A(fe(j?"Context failed":"Build failed",[w],[]),null)})},L;if(typeof s=="object"){let E=s.plugins;if(E!==void 0){if(!Array.isArray(E))return T(new Error('"plugins" must be an array'),"");L=E}}if(L&&L.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");st(t,n,i,a,l,p,s,L,b).then(E=>{if(!E.ok)return T(E.error,E.pluginName);try{q(E.requestPlugins,E.runOnEndCallbacks,E.scheduleOnDisposeCallbacks)}catch(_){T(_,"")}},E=>T(E,""));return}try{q(null,(E,_)=>_([],[]),()=>{})}catch(E){T(E,"")}function q(E,_,J){let w=l.hasFS,{entries:m,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M,nodePaths:D,mangleCache:u}=rt(e,s,d,Me,w);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:m,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M||F,nodePaths:D,context:j};E&&(c.plugins=E),u&&(c.mangleCache=u);let h=($,x)=>{let C={errors:ue($.errors,b),warnings:ue($.warnings,b),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=C.errors.slice(),k=C.warnings.slice();$.outputFiles&&(C.outputFiles=$.outputFiles.map(at)),$.metafile&&(C.metafile=JSON.parse($.metafile)),$.mangleCache&&(C.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(ie($.writeToStdout).replace(/\n$/,"")),_(C,(B,N)=>{if(R.length>0||B.length>0){let U=fe("Build failed",R.concat(B),k.concat(N));return x(U,null,B,N)}x(null,C,B,N)})},S,P;j&&(p["on-end"]=($,x)=>new Promise(C=>{h(x,(R,k,B,N)=>{let U={errors:B,warnings:N};P&&P(R,k),S=void 0,P=void 0,i($,U),C()})})),n(a,c,($,x)=>{if($)return A(new Error($),null);if(!j)return h(x,(k,B)=>(J(),A(k,B)));if(x.errors.length>0)return A(fe("Context failed",x.errors,x.warnings),null);let C=!1,R={rebuild:()=>(S||(S=new Promise((k,B)=>{let N;P=(H,z)=>{N||(N=()=>H?B(H):k(z))};let U=()=>{n(a,{command:"rebuild",key:t},(z,ae)=>{z?B(new Error(z)):N?N():U()})};U()})),S),watch:(k={})=>new Promise((B,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');Y(k,{},"in watch() call"),n(a,{command:"watch",key:t},z=>{z?N(new Error(z)):B(void 0)})}),serve:(k={})=>new Promise((B,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let U={},H=r(k,U,"port",se),z=r(k,U,"host",y),ae=r(k,U,"servedir",y),g=r(k,U,"keyfile",y),I=r(k,U,"certfile",y),X=r(k,U,"fallback",y),te=r(k,U,"onRequest",Te);Y(k,U,"in serve() call");let Q={command:"serve",key:t,onRequest:!!te};H!==void 0&&(Q.port=H),z!==void 0&&(Q.host=z),ae!==void 0&&(Q.servedir=ae),g!==void 0&&(Q.keyfile=g),I!==void 0&&(Q.certfile=I),X!==void 0&&(Q.fallback=X),n(a,Q,(ce,We)=>{if(ce)return N(new Error(ce));te&&(p["serve-request"]=(ze,Ke)=>{te(Ke.args),i(ze,{})}),B(We)})}),cancel:()=>new Promise(k=>{if(C)return k();n(a,{command:"cancel",key:t},()=>{k()})}),dispose:()=>new Promise(k=>{if(C)return k();C=!0,n(a,{command:"dispose",key:t},()=>{k(),J(),a.unref()})})};a.ref(),A(null,R)})}}var st=(e,t,n,i,a,l,p,s,d)=>ne(void 0,null,function*(){let F=[],A=[],b={},j={},T=[],L=0,q=0,E=[],_=!1;s=[...s];for(let m of s){let f={};if(typeof m!="object")throw new Error(`Plugin at index ${q} must be an object`);let o=r(m,f,"name",y);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${q} is missing a name`);try{let v=r(m,f,"setup",Te);if(typeof v!="function")throw new Error("Plugin is missing a setup function");Y(m,f,`on plugin ${V(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};q++;let D=v({initialOptions:p,resolve:(u,c={})=>{if(!_)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),S=r(c,h,"pluginName",y),P=r(c,h,"importer",y),$=r(c,h,"namespace",y),x=r(c,h,"resolveDir",y),C=r(c,h,"kind",y),R=r(c,h,"pluginData",ye),k=r(c,h,"with",ee);return Y(c,h,"in resolve() call"),new Promise((B,N)=>{let U={command:"resolve",path:u,key:e,pluginName:o};if(S!=null&&(U.pluginName=S),P!=null&&(U.importer=P),$!=null&&(U.namespace=$),x!=null&&(U.resolveDir=x),C!=null)U.kind=C;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(U.pluginData=d.store(R)),k!=null&&(U.with=ot(k,"with")),t(i,U,(H,z)=>{H!==null?N(new Error(H)):B({errors:ue(z.errors,d),warnings:ue(z.warnings,d),path:z.path,external:z.external,sideEffects:z.sideEffects,namespace:z.namespace,suffix:z.suffix,pluginData:d.load(z.pluginData)})})})},onStart(u){let c='This error came from the "onStart" callback registered here:',h=ge(new Error(c),a,"onStart");F.push({name:o,callback:u,note:h}),O.onStart=!0},onEnd(u){let c='This error came from the "onEnd" callback registered here:',h=ge(new Error(c),a,"onEnd");A.push({name:o,callback:u,note:h}),O.onEnd=!0},onResolve(u,c){let h='This error came from the "onResolve" callback registered here:',S=ge(new Error(h),a,"onResolve"),P={},$=r(u,P,"filter",he),x=r(u,P,"namespace",y);if(Y(u,P,`in onResolve() call for plugin ${V(o)}`),$==null)throw new Error("onResolve() call is missing a filter");let C=L++;b[C]={name:o,callback:c,note:S},O.onResolve.push({id:C,filter:$.source,namespace:x||""})},onLoad(u,c){let h='This error came from the "onLoad" callback registered here:',S=ge(new Error(h),a,"onLoad"),P={},$=r(u,P,"filter",he),x=r(u,P,"namespace",y);if(Y(u,P,`in onLoad() call for plugin ${V(o)}`),$==null)throw new Error("onLoad() call is missing a filter");let C=L++;j[C]={name:o,callback:c,note:S},O.onLoad.push({id:C,filter:$.source,namespace:x||""})},onDispose(u){T.push(u)},esbuild:a.esbuild});D&&(yield D),E.push(O)}catch(v){return{ok:!1,error:v,pluginName:o}}}l["on-start"]=(m,f)=>ne(void 0,null,function*(){d.clear();let o={errors:[],warnings:[]};yield Promise.all(F.map(D=>ne(void 0,[D],function*({name:v,callback:O,note:M}){try{let u=yield O();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"errors",K),S=r(u,c,"warnings",K);Y(u,c,`from onStart() callback in plugin ${V(v)}`),h!=null&&o.errors.push(...re(h,"errors",d,v,void 0)),S!=null&&o.warnings.push(...re(S,"warnings",d,v,void 0))}}catch(u){o.errors.push(le(u,a,d,M&&M(),v))}}))),n(m,o)}),l["on-resolve"]=(m,f)=>ne(void 0,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=b[D]);let u=yield O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"pluginName",y),S=r(u,c,"path",y),P=r(u,c,"namespace",y),$=r(u,c,"suffix",y),x=r(u,c,"external",W),C=r(u,c,"sideEffects",W),R=r(u,c,"pluginData",ye),k=r(u,c,"errors",K),B=r(u,c,"warnings",K),N=r(u,c,"watchFiles",K),U=r(u,c,"watchDirs",K);Y(u,c,`from onResolve() callback in plugin ${V(v)}`),o.id=D,h!=null&&(o.pluginName=h),S!=null&&(o.path=S),P!=null&&(o.namespace=P),$!=null&&(o.suffix=$),x!=null&&(o.external=x),C!=null&&(o.sideEffects=C),R!=null&&(o.pluginData=d.store(R)),k!=null&&(o.errors=re(k,"errors",d,v,void 0)),B!=null&&(o.warnings=re(B,"warnings",d,v,void 0)),N!=null&&(o.watchFiles=me(N,"watchFiles")),U!=null&&(o.watchDirs=me(U,"watchDirs"));break}}catch(u){o={id:D,errors:[le(u,a,d,M&&M(),v)]};break}n(m,o)}),l["on-load"]=(m,f)=>ne(void 0,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=j[D]);let u=yield O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"pluginName",y),S=r(u,c,"contents",Be),P=r(u,c,"resolveDir",y),$=r(u,c,"pluginData",ye),x=r(u,c,"loader",y),C=r(u,c,"errors",K),R=r(u,c,"warnings",K),k=r(u,c,"watchFiles",K),B=r(u,c,"watchDirs",K);Y(u,c,`from onLoad() callback in plugin ${V(v)}`),o.id=D,h!=null&&(o.pluginName=h),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=Z(S)),P!=null&&(o.resolveDir=P),$!=null&&(o.pluginData=d.store($)),x!=null&&(o.loader=x),C!=null&&(o.errors=re(C,"errors",d,v,void 0)),R!=null&&(o.warnings=re(R,"warnings",d,v,void 0)),k!=null&&(o.watchFiles=me(k,"watchFiles")),B!=null&&(o.watchDirs=me(B,"watchDirs"));break}}catch(u){o={id:D,errors:[le(u,a,d,M&&M(),v)]};break}n(m,o)});let J=(m,f)=>f([],[]);A.length>0&&(J=(m,f)=>{ne(void 0,null,function*(){let o=[],v=[];for(let{name:O,callback:M,note:D}of A){let u,c;try{let h=yield M(m);if(h!=null){if(typeof h!="object")throw new Error(`Expected onEnd() callback in plugin ${V(O)} to return an object`);let S={},P=r(h,S,"errors",K),$=r(h,S,"warnings",K);Y(h,S,`from onEnd() callback in plugin ${V(O)}`),P!=null&&(u=re(P,"errors",d,O,void 0)),$!=null&&(c=re($,"warnings",d,O,void 0))}}catch(h){u=[le(h,a,d,D&&D(),O)]}if(u){o.push(...u);try{m.errors.push(...u)}catch(h){}}if(c){v.push(...c);try{m.warnings.push(...c)}catch(h){}}}f(o,v)})});let w=()=>{for(let m of T)setTimeout(()=>m(),0)};return _=!0,{ok:!0,requestPlugins:E,runOnEndCallbacks:J,scheduleOnDisposeCallbacks:w}});function Ne(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function ge(e,t,n){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(` +`);l.splice(1,1);let p=Ie(t,l,n);if(p)return i={text:e.message,location:p},i}catch(l){}}}function le(e,t,n,i,a){let l="Internal error",p=null;try{l=(e&&e.message||e)+""}catch(s){}try{p=Ie(t,(e.stack+"").split(` +`),"")}catch(s){}return{id:"",pluginName:a,text:l,location:p,notes:i?[i]:[],detail:n?n.store(e):-1}}function Ie(e,t,n){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let a=1;a{if(p===i)return` +...`;if(!l.location)return` +error: ${l.text}`;let{file:s,line:d,column:F}=l.location,A=l.pluginName?`[plugin: ${l.pluginName}] `:"";return` +${s}:${d}:${F}: ERROR: ${A}${l.text}`}).join("");let a=new Error(e);for(let[l,p]of[["errors",t],["warnings",n]])Object.defineProperty(a,l,{configurable:!0,enumerable:!0,get:()=>p,set:s=>Object.defineProperty(a,l,{configurable:!0,enumerable:!0,value:s})});return a}function ue(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Fe(e,t,n){if(e==null)return null;let i={},a=r(e,i,"file",y),l=r(e,i,"namespace",y),p=r(e,i,"line",se),s=r(e,i,"column",se),d=r(e,i,"length",se),F=r(e,i,"lineText",y),A=r(e,i,"suggestion",y);if(Y(e,i,t),F){let b=F.slice(0,(s&&s>0?s:0)+(d&&d>0?d:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(b)&&!/\n/.test(F)&&(F=b)}return{file:a||"",namespace:l||"",line:p||0,column:s||0,length:d||0,lineText:F||"",suggestion:A||""}}function re(e,t,n,i,a){let l=[],p=0;for(let s of e){let d={},F=r(s,d,"id",y),A=r(s,d,"pluginName",y),b=r(s,d,"text",y),j=r(s,d,"location",Pe),T=r(s,d,"notes",K),L=r(s,d,"detail",ye),q=`in element ${p} of "${t}"`;Y(s,d,q);let E=[];if(T)for(let _ of T){let J={},w=r(_,J,"text",y),m=r(_,J,"location",Pe);Y(_,J,q),E.push({text:w||"",location:Fe(m,q,a)})}l.push({id:F||"",pluginName:A||i,text:b||"",location:Fe(j,q,a),notes:E,detail:n?n.store(L):-1}),p++}return l}function me(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${V(t)} must be an array of strings`);n.push(i)}return n}function ot(e,t){let n=Object.create(null);for(let i in e){let a=e[i];if(typeof a!="string")throw new Error(`key ${V(i)} in object ${V(t)} must be a string`);n[i]=a}return n}function at({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let a=this.contents;return(i===null||a!==t)&&(t=a,i=ie(a)),i}}}var ct="0.24.2",ft=e=>de().build(e),dt=e=>de().context(e),pt=(e,t)=>de().transform(e,t),gt=(e,t)=>de().formatMessages(e,t),mt=(e,t)=>de().analyzeMetafile(e,t),yt=()=>{throw new Error('The "buildSync" API only works in node')},ht=()=>{throw new Error('The "transformSync" API only works in node')},bt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},wt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},vt=()=>(we&&we(),Promise.resolve()),oe,we,ve,de=()=>{if(ve)return ve;throw oe?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},Rt=e=>{e=Ue(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(oe)throw new Error('Cannot call "initialize" more than once');return oe=xt(t||"",n,i),oe.catch(()=>{oe=void 0}),oe},xt=(e,t,n)=>ne(void 0,null,function*(){let i,a,l=new Promise(b=>a=b);if(n){let b=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nvar w=(r,f,d)=>new Promise((u,i)=>{var s=c=>{try{o(d.next(c))}catch(h){i(h)}},n=c=>{try{o(d.throw(c))}catch(h){i(h)}},o=c=>c.done?u(c.value):Promise.resolve(c.value).then(s,n);o((d=d.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const u=new Error("not implemented");return u.code="ENOSYS",u};if(!globalThis.fs){let u="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(i,s){u+=d.decode(s);const n=u.lastIndexOf(`\n`);return n!=-1&&(console.log(u.substring(0,n)),u=u.substring(n+1)),s.length},write(i,s,n,o,c,h){if(n!==0||o!==s.length||c!==null){h(r());return}const m=this.writeSync(i,s);h(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,h){h(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),d=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const u=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let a=this._ids.get(e);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=e,this._goRefCounts[a]=0,this._ids.set(e,a)),this._goRefCounts[a]++;let y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,a,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},h=t=>{const e=s(t+0),l=s(t+8),a=new Array(l);for(let y=0;y{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e},gojs:{"runtime.wasmExit":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;const e=s(t+8),l=s(t+16),a=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,u(t+8,(g+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();u(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),a=h(t+32),y=Reflect.apply(l,e,a);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,u(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),u(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(u){return w(this,null,function*(){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const s=g=>{const t=i,e=f.encode(g+"\\0");return new Uint8Array(this.mem.buffer,i,e.length).set(e),i+=e.length,i%8!==0&&(i+=8-i%8),t},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const h=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,h),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(u){const i=this;return function(){const s={id:u,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,u="";d.writeSync=(c,h)=>{if(c===1)postMessage(h);else if(c===2){u+=f.decode(h);let m=u.split(`\n`);m.length>1&&console.log(m.slice(0,-1).join(`\n`)),u=m[m.length-1]}else throw new Error("Bad write");return h.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,h,m,g,t,e)=>{if(c!==0||m!==0||g!==h.length||t!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,h,m,g,t,e);return}let l=i[0],a=Math.max(0,Math.min(g,l.length-n));h.set(l.subarray(n,n+a),m),n+=a,n===l.length&&(i.shift(),n=0),e(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return w(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const u=yield d.arrayBuffer();return(yield WebAssembly.instantiate(u,f.importObject)).instance})}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +var w=(r,f,d)=>new Promise((u,i)=>{var s=c=>{try{o(d.next(c))}catch(h){i(h)}},n=c=>{try{o(d.throw(c))}catch(h){i(h)}},o=c=>c.done?u(c.value):Promise.resolve(c.value).then(s,n);o((d=d.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const u=new Error("not implemented");return u.code="ENOSYS",u};if(!globalThis.fs){let u="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(i,s){u+=d.decode(s);const n=u.lastIndexOf(` +`);return n!=-1&&(console.log(u.substring(0,n)),u=u.substring(n+1)),s.length},write(i,s,n,o,c,h){if(n!==0||o!==s.length||c!==null){h(r());return}const m=this.writeSync(i,s);h(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,h){h(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),d=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const u=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let a=this._ids.get(e);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=e,this._goRefCounts[a]=0,this._ids.set(e,a)),this._goRefCounts[a]++;let y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,a,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},h=t=>{const e=s(t+0),l=s(t+8),a=new Array(l);for(let y=0;y{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e},gojs:{"runtime.wasmExit":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;const e=s(t+8),l=s(t+16),a=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,u(t+8,(g+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();u(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),a=h(t+32),y=Reflect.apply(l,e,a);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,u(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),u(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(u){return w(this,null,function*(){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const s=g=>{const t=i,e=f.encode(g+"\0");return new Uint8Array(this.mem.buffer,i,e.length).set(e),i+=e.length,i%8!==0&&(i+=8-i%8),t},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const h=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,h),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(u){const i=this;return function(){const s={id:u,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,u="";d.writeSync=(c,h)=>{if(c===1)postMessage(h);else if(c===2){u+=f.decode(h);let m=u.split(` +`);m.length>1&&console.log(m.slice(0,-1).join(` +`)),u=m[m.length-1]}else throw new Error("Bad write");return h.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,h,m,g,t,e)=>{if(c!==0||m!==0||g!==h.length||t!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,h,m,g,t,e);return}let l=i[0],a=Math.max(0,Math.min(g,l.length-n));h.set(l.subarray(n,n+a),m),n+=a,n===l.length&&(i.shift(),n=0),e(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return w(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const u=yield d.arrayBuffer();return(yield WebAssembly.instantiate(u,f.importObject)).instance})}return r=>onmessage(r);})(T=>i.onmessage({data:T})),j;i={onmessage:null,postMessage:T=>setTimeout(()=>{try{j=b({data:T})}catch(L){a(L)}}),terminate(){if(j)for(let T of j._scheduledTimeouts.values())clearTimeout(T)}}}let p,s,d=new Promise((b,j)=>{p=b,s=j});i.onmessage=({data:b})=>{i.onmessage=({data:j})=>F(j),b?s(b):p()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:F,service:A}=qe({writeToStdin(b){i.postMessage(b)},isSync:!1,hasFS:!1,esbuild:Re});yield d,we=()=>{i.terminate(),oe=void 0,we=void 0,ve=void 0},ve={build:b=>new Promise((j,T)=>{l.then(T),A.buildOrContext({callName:"build",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),context:b=>new Promise((j,T)=>{l.then(T),A.buildOrContext({callName:"context",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),transform:(b,j)=>new Promise((T,L)=>{l.then(L),A.transform({callName:"transform",refs:null,input:b,options:j||{},isTTY:!1,fs:{readFile(q,E){E(new Error("Internal error"),null)},writeFile(q,E){E(null)}},callback:(q,E)=>q?L(q):T(E)})}),formatMessages:(b,j)=>new Promise((T,L)=>{l.then(L),A.formatMessages({callName:"formatMessages",refs:null,messages:b,options:j,callback:(q,E)=>q?L(q):T(E)})}),analyzeMetafile:(b,j)=>new Promise((T,L)=>{l.then(L),A.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof b=="string"?b:JSON.stringify(b),options:j,callback:(q,E)=>q?L(q):T(E)})})}}),Ot=Re; +})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}}); diff --git a/node_modules/esbuild-wasm/lib/main.d.ts b/node_modules/esbuild-wasm/lib/main.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7053070fe0b5e83b41d4ec9042a7149ac231577 --- /dev/null +++ b/node_modules/esbuild-wasm/lib/main.d.ts @@ -0,0 +1,705 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'bundle' | 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: string[] | Record | { in: string, out: string }[] + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + onRequest?: (args: ServeOnRequestArgs) => void +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + host: string +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record + }[] + format?: 'cjs' | 'esm' + with?: Record + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +export interface WatchOptions { +} + +export interface BuildContext { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise + + cancel(): Promise + dispose(): Promise +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape = In & { [Key in Exclude]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build(options: SameShape): Promise> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context(options: SameShape): Promise> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync(options: SameShape): BuildResult + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/node_modules/esbuild-wasm/lib/main.js b/node_modules/esbuild-wasm/lib/main.js new file mode 100644 index 0000000000000000000000000000000000000000..cf8c423a9386bfb3ea36be003c304aa64695315f --- /dev/null +++ b/node_modules/esbuild-wasm/lib/main.js @@ -0,0 +1,2051 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/npm/node.ts +var node_exports = {}; +__export(node_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => node_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); +module.exports = __toCommonJS(node_exports); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateTarget(target) { + validateStringValue(target, "target"); + if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); + return target; +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY2) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArray); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArray); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArray); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) { + if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); + else flags.push(`--target=${validateTarget(target)}`); + } + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); + if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); + if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { + var _a2; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); + let mainFields = getFlag(options, keys, "mainFields", mustBeArray); + let conditions = getFlag(options, keys, "conditions", mustBeArray); + let external = getFlag(options, keys, "external", mustBeArray); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArray); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) { + let values = []; + for (let value of resolveExtensions) { + validateStringValue(value, "resolve extension"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); + values.push(value); + } + flags.push(`--resolve-extensions=${values.join(",")}`); + } + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) { + let values = []; + for (let value of mainFields) { + validateStringValue(value, "main field"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); + values.push(value); + } + flags.push(`--main-fields=${values.join(",")}`); + } + if (conditions) { + let values = []; + for (let value of conditions) { + validateStringValue(value, "condition"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); + values.push(value); + } + flags.push(`--conditions=${values.join(",")}`); + } + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.24.2") { + throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY2, + defaultWD2, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs3.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs3.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); + } catch { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs3.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); + } catch { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD2, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeInteger); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path3, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path: path3, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + details.clear(); + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path3 = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path3 != null) response.path = path3; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}; +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location = parseStackLinesV8(streamIn, lines, ident); + if (location) { + note = { text: e.message, location }; + return note; + } + } catch { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location = null; + try { + text = (e && e.message || e) + ""; + } catch { + } + try { + location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch { + } + return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location, where, terminalWidth) { + if (location == null) return null; + let keys = {}; + let file = getFlag(location, keys, "file", mustBeString); + let namespace = getFlag(location, keys, "namespace", mustBeString); + let line = getFlag(location, keys, "line", mustBeInteger); + let column = getFlag(location, keys, "column", mustBeInteger); + let length = getFlag(location, keys, "length", mustBeInteger); + let lineText = getFlag(location, keys, "lineText", mustBeString); + let suggestion = getFlag(location, keys, "suggestion", mustBeString); + checkForInvalidFlags(location, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path: path3, contents, hash }) { + let text = null; + return { + path: path3, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; + +// lib/npm/node.ts +var child_process = require("child_process"); +var crypto = require("crypto"); +var path2 = require("path"); +var fs2 = require("fs"); +var os2 = require("os"); +var tty = require("tty"); +var worker_threads; +if (process.env.ESBUILD_WORKER_THREADS !== "0") { + try { + worker_threads = require("worker_threads"); + } catch { + } + let [major, minor] = process.versions.node.split("."); + if ( + // { + if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) { + throw new Error( + `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. + +More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` + ); + } + if (true) { + return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]]; + } else { + const { binPath, isWASM } = generateBinPath(); + if (isWASM) { + return ["node", [binPath]]; + } else { + return [binPath, []]; + } + } +}; +var isTTY = () => tty.isatty(2); +var fsSync = { + readFile(tempFile, callback) { + try { + let contents = fs2.readFileSync(tempFile, "utf8"); + try { + fs2.unlinkSync(tempFile); + } catch { + } + callback(null, contents); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFileSync(tempFile, contents); + callback(tempFile); + } catch { + callback(null); + } + } +}; +var fsAsync = { + readFile(tempFile, callback) { + try { + fs2.readFile(tempFile, "utf8", (err, contents) => { + try { + fs2.unlink(tempFile, () => callback(err, contents)); + } catch { + callback(err, contents); + } + }); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); + } catch { + callback(null); + } + } +}; +var version = "0.24.2"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); +var buildSync = (options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.buildSync(options); + } + let result; + runServiceSync((service) => service.buildOrContext({ + callName: "buildSync", + refs: null, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var transformSync = (input, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.transformSync(input, options); + } + let result; + runServiceSync((service) => service.transform({ + callName: "transformSync", + refs: null, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsSync, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var formatMessagesSync = (messages, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.formatMessagesSync(messages, options); + } + let result; + runServiceSync((service) => service.formatMessages({ + callName: "formatMessagesSync", + refs: null, + messages, + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var analyzeMetafileSync = (metafile, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.analyzeMetafileSync(metafile, options); + } + let result; + runServiceSync((service) => service.analyzeMetafile({ + callName: "analyzeMetafileSync", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var stop = () => { + if (stopService) stopService(); + if (workerThreadService) workerThreadService.stop(); + return Promise.resolve(); +}; +var initializeWasCalled = false; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); + if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); + if (options.worker) throw new Error(`The "worker" option only works in the browser`); + if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); + ensureServiceIsRunning(); + initializeWasCalled = true; + return Promise.resolve(); +}; +var defaultWD = process.cwd(); +var longLivedService; +var stopService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + let [command, args] = esbuildCommandAndArgs(); + let child = child_process.spawn(command, args.concat(`--service=${"0.24.2"}`, "--ping"), { + windowsHide: true, + stdio: ["pipe", "pipe", "inherit"], + cwd: defaultWD + }); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + child.stdin.write(bytes, (err) => { + if (err) afterClose(err); + }); + }, + readFileSync: fs2.readFileSync, + isSync: false, + hasFS: true, + esbuild: node_exports + }); + child.stdin.on("error", afterClose); + child.on("error", afterClose); + const stdin = child.stdin; + const stdout = child.stdout; + stdout.on("data", readFromStdout); + stdout.on("end", afterClose); + stopService = () => { + stdin.destroy(); + stdout.destroy(); + child.kill(); + initializeWasCalled = false; + longLivedService = void 0; + stopService = void 0; + }; + let refCount = 0; + child.unref(); + if (stdin.unref) { + stdin.unref(); + } + if (stdout.unref) { + stdout.unref(); + } + const refs = { + ref() { + if (++refCount === 1) child.ref(); + }, + unref() { + if (--refCount === 0) child.unref(); + } + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + service.buildOrContext({ + callName: "build", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => service.buildOrContext({ + callName: "context", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + transform: (input, options) => new Promise((resolve, reject) => service.transform({ + callName: "transform", + refs, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsAsync, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({ + callName: "formatMessages", + refs, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({ + callName: "analyzeMetafile", + refs, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })) + }; + return longLivedService; +}; +var runServiceSync = (callback) => { + let [command, args] = esbuildCommandAndArgs(); + let stdin = new Uint8Array(); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + if (stdin.length !== 0) throw new Error("Must run at most one command"); + stdin = bytes; + }, + isSync: true, + hasFS: true, + esbuild: node_exports + }); + callback(service); + let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.2"}`), { + cwd: defaultWD, + windowsHide: true, + input: stdin, + // We don't know how large the output could be. If it's too large, the + // command will fail with ENOBUFS. Reserve 16mb for now since that feels + // like it should be enough. Also allow overriding this with an environment + // variable. + maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 + }); + readFromStdout(stdout); + afterClose(null); +}; +var randomFileName = () => { + return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); +}; +var workerThreadService = null; +var startWorkerThreadService = (worker_threads2) => { + let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); + let worker = new worker_threads2.Worker(__filename, { + workerData: { workerPort, defaultWD, esbuildVersion: "0.24.2" }, + transferList: [workerPort], + // From node's documentation: https://nodejs.org/api/worker_threads.html + // + // Take care when launching worker threads from preload scripts (scripts loaded + // and run using the `-r` command line flag). Unless the `execArgv` option is + // explicitly set, new Worker threads automatically inherit the command line flags + // from the running process and will preload the same preload scripts as the main + // thread. If the preload script unconditionally launches a worker thread, every + // thread spawned will spawn another until the application crashes. + // + execArgv: [] + }); + let nextID = 0; + let fakeBuildError = (text) => { + let error = new Error(`Build failed with 1 error: +error: ${text}`); + let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; + error.errors = errors; + error.warnings = []; + return error; + }; + let validateBuildSyncOptions = (options) => { + if (!options) return; + let plugins = options.plugins; + if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); + }; + let applyProperties = (object, properties) => { + for (let key in properties) { + object[key] = properties[key]; + } + }; + let runCallSync = (command, args) => { + let id = nextID++; + let sharedBuffer = new SharedArrayBuffer(8); + let sharedBufferView = new Int32Array(sharedBuffer); + let msg = { sharedBuffer, id, command, args }; + worker.postMessage(msg); + let status = Atomics.wait(sharedBufferView, 0, 0); + if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); + let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); + if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); + if (reject) { + applyProperties(reject, properties); + throw reject; + } + return resolve; + }; + worker.unref(); + return { + buildSync(options) { + validateBuildSyncOptions(options); + return runCallSync("build", [options]); + }, + transformSync(input, options) { + return runCallSync("transform", [input, options]); + }, + formatMessagesSync(messages, options) { + return runCallSync("formatMessages", [messages, options]); + }, + analyzeMetafileSync(metafile, options) { + return runCallSync("analyzeMetafile", [metafile, options]); + }, + stop() { + worker.terminate(); + workerThreadService = null; + } + }; +}; +var startSyncServiceWorker = () => { + let workerPort = worker_threads.workerData.workerPort; + let parentPort = worker_threads.parentPort; + let extractProperties = (object) => { + let properties = {}; + if (object && typeof object === "object") { + for (let key in object) { + properties[key] = object[key]; + } + } + return properties; + }; + try { + let service = ensureServiceIsRunning(); + defaultWD = worker_threads.workerData.defaultWD; + parentPort.on("message", (msg) => { + (async () => { + let { sharedBuffer, id, command, args } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + try { + switch (command) { + case "build": + workerPort.postMessage({ id, resolve: await service.build(args[0]) }); + break; + case "transform": + workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); + break; + case "formatMessages": + workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); + break; + case "analyzeMetafile": + workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); + break; + default: + throw new Error(`Invalid command: ${command}`); + } + } catch (reject) { + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + } + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + })(); + }); + } catch (reject) { + parentPort.on("message", (msg) => { + let { sharedBuffer, id } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + }); + } +}; +if (isInternalWorkerThread) { + startSyncServiceWorker(); +} +var node_default = node_exports; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + analyzeMetafile, + analyzeMetafileSync, + build, + buildSync, + context, + formatMessages, + formatMessagesSync, + initialize, + stop, + transform, + transformSync, + version +}); diff --git a/node_modules/esbuild-wasm/package.json b/node_modules/esbuild-wasm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d106d3fcb9176e72e8264b6a895ab09dbbc580ad --- /dev/null +++ b/node_modules/esbuild-wasm/package.json @@ -0,0 +1,19 @@ +{ + "name": "esbuild-wasm", + "version": "0.24.2", + "description": "The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "main": "lib/main.js", + "browser": "lib/browser.js", + "types": "lib/main.d.ts", + "directories": { + "bin": "bin" + } +} diff --git a/node_modules/esbuild-wasm/wasm_exec.js b/node_modules/esbuild-wasm/wasm_exec.js new file mode 100644 index 0000000000000000000000000000000000000000..bc6f210242824c25b5ee619afa507767b6e587be --- /dev/null +++ b/node_modules/esbuild-wasm/wasm_exec.js @@ -0,0 +1,561 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +"use strict"; + +(() => { + const enosys = () => { + const err = new Error("not implemented"); + err.code = "ENOSYS"; + return err; + }; + + if (!globalThis.fs) { + let outputBuf = ""; + globalThis.fs = { + constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused + writeSync(fd, buf) { + outputBuf += decoder.decode(buf); + const nl = outputBuf.lastIndexOf("\n"); + if (nl != -1) { + console.log(outputBuf.substring(0, nl)); + outputBuf = outputBuf.substring(nl + 1); + } + return buf.length; + }, + write(fd, buf, offset, length, position, callback) { + if (offset !== 0 || length !== buf.length || position !== null) { + callback(enosys()); + return; + } + const n = this.writeSync(fd, buf); + callback(null, n); + }, + chmod(path, mode, callback) { callback(enosys()); }, + chown(path, uid, gid, callback) { callback(enosys()); }, + close(fd, callback) { callback(enosys()); }, + fchmod(fd, mode, callback) { callback(enosys()); }, + fchown(fd, uid, gid, callback) { callback(enosys()); }, + fstat(fd, callback) { callback(enosys()); }, + fsync(fd, callback) { callback(null); }, + ftruncate(fd, length, callback) { callback(enosys()); }, + lchown(path, uid, gid, callback) { callback(enosys()); }, + link(path, link, callback) { callback(enosys()); }, + lstat(path, callback) { callback(enosys()); }, + mkdir(path, perm, callback) { callback(enosys()); }, + open(path, flags, mode, callback) { callback(enosys()); }, + read(fd, buffer, offset, length, position, callback) { callback(enosys()); }, + readdir(path, callback) { callback(enosys()); }, + readlink(path, callback) { callback(enosys()); }, + rename(from, to, callback) { callback(enosys()); }, + rmdir(path, callback) { callback(enosys()); }, + stat(path, callback) { callback(enosys()); }, + symlink(path, link, callback) { callback(enosys()); }, + truncate(path, length, callback) { callback(enosys()); }, + unlink(path, callback) { callback(enosys()); }, + utimes(path, atime, mtime, callback) { callback(enosys()); }, + }; + } + + if (!globalThis.process) { + globalThis.process = { + getuid() { return -1; }, + getgid() { return -1; }, + geteuid() { return -1; }, + getegid() { return -1; }, + getgroups() { throw enosys(); }, + pid: -1, + ppid: -1, + umask() { throw enosys(); }, + cwd() { throw enosys(); }, + chdir() { throw enosys(); }, + } + } + + if (!globalThis.crypto) { + throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)"); + } + + if (!globalThis.performance) { + throw new Error("globalThis.performance is not available, polyfill required (performance.now only)"); + } + + if (!globalThis.TextEncoder) { + throw new Error("globalThis.TextEncoder is not available, polyfill required"); + } + + if (!globalThis.TextDecoder) { + throw new Error("globalThis.TextDecoder is not available, polyfill required"); + } + + const encoder = new TextEncoder("utf-8"); + const decoder = new TextDecoder("utf-8"); + + globalThis.Go = class { + constructor() { + this.argv = ["js"]; + this.env = {}; + this.exit = (code) => { + if (code !== 0) { + console.warn("exit code:", code); + } + }; + this._exitPromise = new Promise((resolve) => { + this._resolveExitPromise = resolve; + }); + this._pendingEvent = null; + this._scheduledTimeouts = new Map(); + this._nextCallbackTimeoutID = 1; + + const setInt64 = (addr, v) => { + this.mem.setUint32(addr + 0, v, true); + this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true); + } + + const setInt32 = (addr, v) => { + this.mem.setUint32(addr + 0, v, true); + } + + const getInt64 = (addr) => { + const low = this.mem.getUint32(addr + 0, true); + const high = this.mem.getInt32(addr + 4, true); + return low + high * 4294967296; + } + + const loadValue = (addr) => { + const f = this.mem.getFloat64(addr, true); + if (f === 0) { + return undefined; + } + if (!isNaN(f)) { + return f; + } + + const id = this.mem.getUint32(addr, true); + return this._values[id]; + } + + const storeValue = (addr, v) => { + const nanHead = 0x7FF80000; + + if (typeof v === "number" && v !== 0) { + if (isNaN(v)) { + this.mem.setUint32(addr + 4, nanHead, true); + this.mem.setUint32(addr, 0, true); + return; + } + this.mem.setFloat64(addr, v, true); + return; + } + + if (v === undefined) { + this.mem.setFloat64(addr, 0, true); + return; + } + + let id = this._ids.get(v); + if (id === undefined) { + id = this._idPool.pop(); + if (id === undefined) { + id = this._values.length; + } + this._values[id] = v; + this._goRefCounts[id] = 0; + this._ids.set(v, id); + } + this._goRefCounts[id]++; + let typeFlag = 0; + switch (typeof v) { + case "object": + if (v !== null) { + typeFlag = 1; + } + break; + case "string": + typeFlag = 2; + break; + case "symbol": + typeFlag = 3; + break; + case "function": + typeFlag = 4; + break; + } + this.mem.setUint32(addr + 4, nanHead | typeFlag, true); + this.mem.setUint32(addr, id, true); + } + + const loadSlice = (addr) => { + const array = getInt64(addr + 0); + const len = getInt64(addr + 8); + return new Uint8Array(this._inst.exports.mem.buffer, array, len); + } + + const loadSliceOfValues = (addr) => { + const array = getInt64(addr + 0); + const len = getInt64(addr + 8); + const a = new Array(len); + for (let i = 0; i < len; i++) { + a[i] = loadValue(array + i * 8); + } + return a; + } + + const loadString = (addr) => { + const saddr = getInt64(addr + 0); + const len = getInt64(addr + 8); + return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len)); + } + + const timeOrigin = Date.now() - performance.now(); + this.importObject = { + _gotest: { + add: (a, b) => a + b, + }, + gojs: { + // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters) + // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported + // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function). + // This changes the SP, thus we have to update the SP used by the imported function. + + // func wasmExit(code int32) + "runtime.wasmExit": (sp) => { + sp >>>= 0; + const code = this.mem.getInt32(sp + 8, true); + this.exited = true; + delete this._inst; + delete this._values; + delete this._goRefCounts; + delete this._ids; + delete this._idPool; + this.exit(code); + }, + + // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32) + "runtime.wasmWrite": (sp) => { + sp >>>= 0; + const fd = getInt64(sp + 8); + const p = getInt64(sp + 16); + const n = this.mem.getInt32(sp + 24, true); + fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n)); + }, + + // func resetMemoryDataView() + "runtime.resetMemoryDataView": (sp) => { + sp >>>= 0; + this.mem = new DataView(this._inst.exports.mem.buffer); + }, + + // func nanotime1() int64 + "runtime.nanotime1": (sp) => { + sp >>>= 0; + setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000); + }, + + // func walltime() (sec int64, nsec int32) + "runtime.walltime": (sp) => { + sp >>>= 0; + const msec = (new Date).getTime(); + setInt64(sp + 8, msec / 1000); + this.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true); + }, + + // func scheduleTimeoutEvent(delay int64) int32 + "runtime.scheduleTimeoutEvent": (sp) => { + sp >>>= 0; + const id = this._nextCallbackTimeoutID; + this._nextCallbackTimeoutID++; + this._scheduledTimeouts.set(id, setTimeout( + () => { + this._resume(); + while (this._scheduledTimeouts.has(id)) { + // for some reason Go failed to register the timeout event, log and try again + // (temporary workaround for https://github.com/golang/go/issues/28975) + console.warn("scheduleTimeoutEvent: missed timeout event"); + this._resume(); + } + }, + getInt64(sp + 8), + )); + this.mem.setInt32(sp + 16, id, true); + }, + + // func clearTimeoutEvent(id int32) + "runtime.clearTimeoutEvent": (sp) => { + sp >>>= 0; + const id = this.mem.getInt32(sp + 8, true); + clearTimeout(this._scheduledTimeouts.get(id)); + this._scheduledTimeouts.delete(id); + }, + + // func getRandomData(r []byte) + "runtime.getRandomData": (sp) => { + sp >>>= 0; + crypto.getRandomValues(loadSlice(sp + 8)); + }, + + // func finalizeRef(v ref) + "syscall/js.finalizeRef": (sp) => { + sp >>>= 0; + const id = this.mem.getUint32(sp + 8, true); + this._goRefCounts[id]--; + if (this._goRefCounts[id] === 0) { + const v = this._values[id]; + this._values[id] = null; + this._ids.delete(v); + this._idPool.push(id); + } + }, + + // func stringVal(value string) ref + "syscall/js.stringVal": (sp) => { + sp >>>= 0; + storeValue(sp + 24, loadString(sp + 8)); + }, + + // func valueGet(v ref, p string) ref + "syscall/js.valueGet": (sp) => { + sp >>>= 0; + const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16)); + sp = this._inst.exports.getsp() >>> 0; // see comment above + storeValue(sp + 32, result); + }, + + // func valueSet(v ref, p string, x ref) + "syscall/js.valueSet": (sp) => { + sp >>>= 0; + Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32)); + }, + + // func valueDelete(v ref, p string) + "syscall/js.valueDelete": (sp) => { + sp >>>= 0; + Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16)); + }, + + // func valueIndex(v ref, i int) ref + "syscall/js.valueIndex": (sp) => { + sp >>>= 0; + storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16))); + }, + + // valueSetIndex(v ref, i int, x ref) + "syscall/js.valueSetIndex": (sp) => { + sp >>>= 0; + Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24)); + }, + + // func valueCall(v ref, m string, args []ref) (ref, bool) + "syscall/js.valueCall": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const m = Reflect.get(v, loadString(sp + 16)); + const args = loadSliceOfValues(sp + 32); + const result = Reflect.apply(m, v, args); + sp = this._inst.exports.getsp() >>> 0; // see comment above + storeValue(sp + 56, result); + this.mem.setUint8(sp + 64, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; // see comment above + storeValue(sp + 56, err); + this.mem.setUint8(sp + 64, 0); + } + }, + + // func valueInvoke(v ref, args []ref) (ref, bool) + "syscall/js.valueInvoke": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const args = loadSliceOfValues(sp + 16); + const result = Reflect.apply(v, undefined, args); + sp = this._inst.exports.getsp() >>> 0; // see comment above + storeValue(sp + 40, result); + this.mem.setUint8(sp + 48, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; // see comment above + storeValue(sp + 40, err); + this.mem.setUint8(sp + 48, 0); + } + }, + + // func valueNew(v ref, args []ref) (ref, bool) + "syscall/js.valueNew": (sp) => { + sp >>>= 0; + try { + const v = loadValue(sp + 8); + const args = loadSliceOfValues(sp + 16); + const result = Reflect.construct(v, args); + sp = this._inst.exports.getsp() >>> 0; // see comment above + storeValue(sp + 40, result); + this.mem.setUint8(sp + 48, 1); + } catch (err) { + sp = this._inst.exports.getsp() >>> 0; // see comment above + storeValue(sp + 40, err); + this.mem.setUint8(sp + 48, 0); + } + }, + + // func valueLength(v ref) int + "syscall/js.valueLength": (sp) => { + sp >>>= 0; + setInt64(sp + 16, parseInt(loadValue(sp + 8).length)); + }, + + // valuePrepareString(v ref) (ref, int) + "syscall/js.valuePrepareString": (sp) => { + sp >>>= 0; + const str = encoder.encode(String(loadValue(sp + 8))); + storeValue(sp + 16, str); + setInt64(sp + 24, str.length); + }, + + // valueLoadString(v ref, b []byte) + "syscall/js.valueLoadString": (sp) => { + sp >>>= 0; + const str = loadValue(sp + 8); + loadSlice(sp + 16).set(str); + }, + + // func valueInstanceOf(v ref, t ref) bool + "syscall/js.valueInstanceOf": (sp) => { + sp >>>= 0; + this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0); + }, + + // func copyBytesToGo(dst []byte, src ref) (int, bool) + "syscall/js.copyBytesToGo": (sp) => { + sp >>>= 0; + const dst = loadSlice(sp + 8); + const src = loadValue(sp + 32); + if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) { + this.mem.setUint8(sp + 48, 0); + return; + } + const toCopy = src.subarray(0, dst.length); + dst.set(toCopy); + setInt64(sp + 40, toCopy.length); + this.mem.setUint8(sp + 48, 1); + }, + + // func copyBytesToJS(dst ref, src []byte) (int, bool) + "syscall/js.copyBytesToJS": (sp) => { + sp >>>= 0; + const dst = loadValue(sp + 8); + const src = loadSlice(sp + 16); + if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) { + this.mem.setUint8(sp + 48, 0); + return; + } + const toCopy = src.subarray(0, dst.length); + dst.set(toCopy); + setInt64(sp + 40, toCopy.length); + this.mem.setUint8(sp + 48, 1); + }, + + "debug": (value) => { + console.log(value); + }, + } + }; + } + + async run(instance) { + if (!(instance instanceof WebAssembly.Instance)) { + throw new Error("Go.run: WebAssembly.Instance expected"); + } + this._inst = instance; + this.mem = new DataView(this._inst.exports.mem.buffer); + this._values = [ // JS values that Go currently has references to, indexed by reference id + NaN, + 0, + null, + true, + false, + globalThis, + this, + ]; + this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id + this._ids = new Map([ // mapping from JS values to reference ids + [0, 1], + [null, 2], + [true, 3], + [false, 4], + [globalThis, 5], + [this, 6], + ]); + this._idPool = []; // unused ids that have been garbage collected + this.exited = false; // whether the Go program has exited + + // Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory. + let offset = 4096; + + const strPtr = (str) => { + const ptr = offset; + const bytes = encoder.encode(str + "\0"); + new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes); + offset += bytes.length; + if (offset % 8 !== 0) { + offset += 8 - (offset % 8); + } + return ptr; + }; + + const argc = this.argv.length; + + const argvPtrs = []; + this.argv.forEach((arg) => { + argvPtrs.push(strPtr(arg)); + }); + argvPtrs.push(0); + + const keys = Object.keys(this.env).sort(); + keys.forEach((key) => { + argvPtrs.push(strPtr(`${key}=${this.env[key]}`)); + }); + argvPtrs.push(0); + + const argv = offset; + argvPtrs.forEach((ptr) => { + this.mem.setUint32(offset, ptr, true); + this.mem.setUint32(offset + 4, 0, true); + offset += 8; + }); + + // The linker guarantees global data starts from at least wasmMinDataAddr. + // Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr. + const wasmMinDataAddr = 4096 + 8192; + if (offset >= wasmMinDataAddr) { + throw new Error("total length of command line and environment variables exceeds limit"); + } + + this._inst.exports.run(argc, argv); + if (this.exited) { + this._resolveExitPromise(); + } + await this._exitPromise; + } + + _resume() { + if (this.exited) { + throw new Error("Go program has already exited"); + } + this._inst.exports.resume(); + if (this.exited) { + this._resolveExitPromise(); + } + } + + _makeFuncWrapper(id) { + const go = this; + return function () { + const event = { id: id, this: this, args: arguments }; + go._pendingEvent = event; + go._resume(); + return event.result; + }; + } + } +})(); diff --git a/node_modules/esbuild-wasm/wasm_exec_node.js b/node_modules/esbuild-wasm/wasm_exec_node.js new file mode 100644 index 0000000000000000000000000000000000000000..986069087bc0bce0beddeb3fb19ebb2b42cf4fdb --- /dev/null +++ b/node_modules/esbuild-wasm/wasm_exec_node.js @@ -0,0 +1,39 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +"use strict"; + +if (process.argv.length < 3) { + console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"); + process.exit(1); +} + +globalThis.require = require; +globalThis.fs = require("fs"); +globalThis.TextEncoder = require("util").TextEncoder; +globalThis.TextDecoder = require("util").TextDecoder; + +globalThis.performance ??= require("performance"); + +globalThis.crypto ??= require("crypto"); + +require("./wasm_exec"); + +const go = new Go(); +go.argv = process.argv.slice(2); +go.env = Object.assign({ TMPDIR: require("os").tmpdir() }, process.env); +go.exit = process.exit; +WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => { + process.on("exit", (code) => { // Node.js exits if no event handler is pending + if (code === 0 && !go.exited) { + // deadlock, make Go print error and stack traces + go._pendingEvent = { id: 0 }; + go._resume(); + } + }); + return go.run(result.instance); +}).catch((err) => { + console.error(err); + process.exit(1); +}); diff --git a/node_modules/esbuild/LICENSE.md b/node_modules/esbuild/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..2027e8dcf3787f5aac9fcd835e2b80cb75a39211 --- /dev/null +++ b/node_modules/esbuild/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Wallace + +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/node_modules/esbuild/README.md b/node_modules/esbuild/README.md new file mode 100644 index 0000000000000000000000000000000000000000..93863d198004eae1c7b17aef26d829dfca4a314f --- /dev/null +++ b/node_modules/esbuild/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details. diff --git a/node_modules/esbuild/bin/esbuild b/node_modules/esbuild/bin/esbuild new file mode 100644 index 0000000000000000000000000000000000000000..497f4fa66411f2cc4a3c7fe41a14521be3717532 --- /dev/null +++ b/node_modules/esbuild/bin/esbuild @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c638273fcf95573ca74af586677800b4dd874c55f8f945adb54316d6902ba14b +size 11120788 diff --git a/node_modules/esbuild/install.js b/node_modules/esbuild/install.js new file mode 100644 index 0000000000000000000000000000000000000000..1019e62435fd0258e39ad6db102194d46bd85ce4 --- /dev/null +++ b/node_modules/esbuild/install.js @@ -0,0 +1,289 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd arm64 LE": "@esbuild/netbsd-arm64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64", + "openharmony arm64 LE": "@esbuild/openharmony-arm64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} + +// lib/npm/node-install.ts +var fs2 = require("fs"); +var os2 = require("os"); +var path2 = require("path"); +var zlib = require("zlib"); +var https = require("https"); +var child_process = require("child_process"); +var versionFromPackageJSON = require(path2.join(__dirname, "package.json")).version; +var toPath = path2.join(__dirname, "bin", "esbuild"); +var isToPathJS = true; +function validateBinaryVersion(...command) { + command.push("--version"); + let stdout; + try { + stdout = child_process.execFileSync(command.shift(), command, { + // Without this, this install script strangely crashes with the error + // "EACCES: permission denied, write" but only on Ubuntu Linux when node is + // installed from the Snap Store. This is not a problem when you download + // the official version of node. The problem appears to be that stderr + // (i.e. file descriptor 2) isn't writable? + // + // More info: + // - https://snapcraft.io/ (what the Snap Store is) + // - https://nodejs.org/dist/ (download the official version of node) + // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 + // + stdio: "pipe" + }).toString().trim(); + } catch (err) { + if (os2.platform() === "darwin" && /_SecTrustEvaluateWithError/.test(err + "")) { + let os3 = "this version of macOS"; + try { + os3 = "macOS " + child_process.execFileSync("sw_vers", ["-productVersion"]).toString().trim(); + } catch { + } + throw new Error(`The "esbuild" package cannot be installed because ${os3} is too outdated. + +The Go compiler (which esbuild relies on) no longer supports ${os3}, +which means the "esbuild" binary executable can't be run. You can either: + + * Update your version of macOS to one that the Go compiler supports + * Use the "esbuild-wasm" package instead of the "esbuild" package + * Build esbuild yourself using an older version of the Go compiler +`); + } + throw err; + } + if (stdout !== versionFromPackageJSON) { + throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`); + } +} +function isYarn() { + const { npm_config_user_agent } = process.env; + if (npm_config_user_agent) { + return /\byarn\//.test(npm_config_user_agent); + } + return false; +} +function fetch(url) { + return new Promise((resolve, reject) => { + https.get(url, (res) => { + if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location) + return fetch(res.headers.location).then(resolve, reject); + if (res.statusCode !== 200) + return reject(new Error(`Server responded with ${res.statusCode}`)); + let chunks = []; + res.on("data", (chunk) => chunks.push(chunk)); + res.on("end", () => resolve(Buffer.concat(chunks))); + }).on("error", reject); + }); +} +function extractFileFromTarGzip(buffer, subpath) { + try { + buffer = zlib.unzipSync(buffer); + } catch (err) { + throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`); + } + let str = (i, n) => String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, ""); + let offset = 0; + subpath = `package/${subpath}`; + while (offset < buffer.length) { + let name = str(offset, 100); + let size = parseInt(str(offset + 124, 12), 8); + offset += 512; + if (!isNaN(size)) { + if (name === subpath) return buffer.subarray(offset, offset + size); + offset += size + 511 & ~511; + } + } + throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`); +} +function installUsingNPM(pkg, subpath, binPath) { + const env = { ...process.env, npm_config_global: void 0 }; + const esbuildLibDir = path2.dirname(require.resolve("esbuild")); + const installDir = path2.join(esbuildLibDir, "npm-install"); + fs2.mkdirSync(installDir); + try { + fs2.writeFileSync(path2.join(installDir, "package.json"), "{}"); + child_process.execSync( + `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${versionFromPackageJSON}`, + { cwd: installDir, stdio: "pipe", env } + ); + const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath); + fs2.renameSync(installedBinPath, binPath); + } finally { + try { + removeRecursive(installDir); + } catch { + } + } +} +function removeRecursive(dir) { + for (const entry of fs2.readdirSync(dir)) { + const entryPath = path2.join(dir, entry); + let stats; + try { + stats = fs2.lstatSync(entryPath); + } catch { + continue; + } + if (stats.isDirectory()) removeRecursive(entryPath); + else fs2.unlinkSync(entryPath); + } + fs2.rmdirSync(dir); +} +function applyManualBinaryPathOverride(overridePath) { + const pathString = JSON.stringify(overridePath); + fs2.writeFileSync(toPath, `#!/usr/bin/env node +require('child_process').execFileSync(${pathString}, process.argv.slice(2), { stdio: 'inherit' }); +`); + const libMain = path2.join(__dirname, "lib", "main.js"); + const code = fs2.readFileSync(libMain, "utf8"); + fs2.writeFileSync(libMain, `var ESBUILD_BINARY_PATH = ${pathString}; +${code}`); +} +function maybeOptimizePackage(binPath) { + const { isWASM } = pkgAndSubpathForCurrentPlatform(); + if (os2.platform() !== "win32" && !isYarn() && !isWASM) { + const tempPath = path2.join(__dirname, "bin-esbuild"); + try { + fs2.linkSync(binPath, tempPath); + fs2.renameSync(tempPath, toPath); + isToPathJS = false; + fs2.unlinkSync(tempPath); + } catch { + } + } +} +async function downloadDirectlyFromNPM(pkg, subpath, binPath) { + const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${versionFromPackageJSON}.tgz`; + console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`); + try { + fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath)); + fs2.chmodSync(binPath, 493); + } catch (e) { + console.error(`[esbuild] Failed to download ${JSON.stringify(url)}: ${e && e.message || e}`); + throw e; + } +} +async function checkAndPreparePackage() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + applyManualBinaryPathOverride(ESBUILD_BINARY_PATH); + return; + } + } + const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + console.error(`[esbuild] Failed to find package "${pkg}" on the file system + +This can happen if you use the "--no-optional" flag. The "optionalDependencies" +package.json feature is used by esbuild to install the correct binary executable +for your current platform. This install script will now attempt to work around +this. If that fails, you need to remove the "--no-optional" flag to use esbuild. +`); + binPath = downloadedBinPath(pkg, subpath); + try { + console.error(`[esbuild] Trying to install package "${pkg}" using npm`); + installUsingNPM(pkg, subpath, binPath); + } catch (e2) { + console.error(`[esbuild] Failed to install package "${pkg}" using npm: ${e2 && e2.message || e2}`); + try { + await downloadDirectlyFromNPM(pkg, subpath, binPath); + } catch (e3) { + throw new Error(`Failed to install package "${pkg}"`); + } + } + } + maybeOptimizePackage(binPath); +} +checkAndPreparePackage().then(() => { + if (isToPathJS) { + validateBinaryVersion(process.execPath, toPath); + } else { + validateBinaryVersion(toPath); + } +}); diff --git a/node_modules/esbuild/lib/main.d.ts b/node_modules/esbuild/lib/main.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e69c39f58b92dda3496b19481468b5057a1084f --- /dev/null +++ b/node_modules/esbuild/lib/main.d.ts @@ -0,0 +1,716 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' +export type AbsPaths = 'code' | 'log' | 'metafile' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#abs-paths */ + absPaths?: AbsPaths[] + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'bundle' | 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: (string | { in: string, out: string })[] | Record + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + cors?: CORSOptions + onRequest?: (args: ServeOnRequestArgs) => void +} + +/** Documentation: https://esbuild.github.io/api/#cors */ +export interface CORSOptions { + origin?: string | string[] +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + hosts: string[] +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record + }[] + format?: 'cjs' | 'esm' + with?: Record + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +/** Documentation: https://esbuild.github.io/api/#watch-arguments */ +export interface WatchOptions { + delay?: number // In milliseconds +} + +export interface BuildContext { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise + + cancel(): Promise + dispose(): Promise +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape = In & { [Key in Exclude]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build(options: SameShape): Promise> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context(options: SameShape): Promise> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync(options: SameShape): BuildResult + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/node_modules/esbuild/lib/main.js b/node_modules/esbuild/lib/main.js new file mode 100644 index 0000000000000000000000000000000000000000..d41cc1b4ecbe944ef9411a399c6a06bfaf5758ed --- /dev/null +++ b/node_modules/esbuild/lib/main.js @@ -0,0 +1,2532 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/npm/node.ts +var node_exports = {}; +__export(node_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => node_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); +module.exports = __toCommonJS(node_exports); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return (buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24) >>> 0; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/uint8array_json_parser.ts +var fromCharCode = String.fromCharCode; +function throwSyntaxError(bytes, index, message) { + const c = bytes[index]; + let line = 1; + let column = 0; + for (let i = 0; i < index; i++) { + if (bytes[i] === 10 /* Newline */) { + line++; + column = 0; + } else { + column++; + } + } + throw new SyntaxError( + message ? message : index === bytes.length ? "Unexpected end of input while parsing JSON" : c >= 32 && c <= 126 ? `Unexpected character ${fromCharCode(c)} in JSON at position ${index} (line ${line}, column ${column})` : `Unexpected byte 0x${c.toString(16)} in JSON at position ${index} (line ${line}, column ${column})` + ); +} +function JSON_parse(bytes) { + if (!(bytes instanceof Uint8Array)) { + throw new Error(`JSON input must be a Uint8Array`); + } + const propertyStack = []; + const objectStack = []; + const stateStack = []; + const length = bytes.length; + let property = null; + let state = 0 /* TopLevel */; + let object; + let i = 0; + while (i < length) { + let c = bytes[i++]; + if (c <= 32 /* Space */) { + continue; + } + let value; + if (state === 2 /* Object */ && property === null && c !== 34 /* Quote */ && c !== 125 /* CloseBrace */) { + throwSyntaxError(bytes, --i); + } + switch (c) { + // True + case 116 /* LowerT */: { + if (bytes[i++] !== 114 /* LowerR */ || bytes[i++] !== 117 /* LowerU */ || bytes[i++] !== 101 /* LowerE */) { + throwSyntaxError(bytes, --i); + } + value = true; + break; + } + // False + case 102 /* LowerF */: { + if (bytes[i++] !== 97 /* LowerA */ || bytes[i++] !== 108 /* LowerL */ || bytes[i++] !== 115 /* LowerS */ || bytes[i++] !== 101 /* LowerE */) { + throwSyntaxError(bytes, --i); + } + value = false; + break; + } + // Null + case 110 /* LowerN */: { + if (bytes[i++] !== 117 /* LowerU */ || bytes[i++] !== 108 /* LowerL */ || bytes[i++] !== 108 /* LowerL */) { + throwSyntaxError(bytes, --i); + } + value = null; + break; + } + // Number begin + case 45 /* Minus */: + case 46 /* Dot */: + case 48 /* Digit0 */: + case 49 /* Digit1 */: + case 50 /* Digit2 */: + case 51 /* Digit3 */: + case 52 /* Digit4 */: + case 53 /* Digit5 */: + case 54 /* Digit6 */: + case 55 /* Digit7 */: + case 56 /* Digit8 */: + case 57 /* Digit9 */: { + let index = i; + value = fromCharCode(c); + c = bytes[i]; + while (true) { + switch (c) { + case 43 /* Plus */: + case 45 /* Minus */: + case 46 /* Dot */: + case 48 /* Digit0 */: + case 49 /* Digit1 */: + case 50 /* Digit2 */: + case 51 /* Digit3 */: + case 52 /* Digit4 */: + case 53 /* Digit5 */: + case 54 /* Digit6 */: + case 55 /* Digit7 */: + case 56 /* Digit8 */: + case 57 /* Digit9 */: + case 101 /* LowerE */: + case 69 /* UpperE */: { + value += fromCharCode(c); + c = bytes[++i]; + continue; + } + } + break; + } + value = +value; + if (isNaN(value)) { + throwSyntaxError(bytes, --index, "Invalid number"); + } + break; + } + // String begin + case 34 /* Quote */: { + value = ""; + while (true) { + if (i >= length) { + throwSyntaxError(bytes, length); + } + c = bytes[i++]; + if (c === 34 /* Quote */) { + break; + } else if (c === 92 /* Backslash */) { + switch (bytes[i++]) { + // Normal escape sequence + case 34 /* Quote */: + value += '"'; + break; + case 47 /* Slash */: + value += "/"; + break; + case 92 /* Backslash */: + value += "\\"; + break; + case 98 /* LowerB */: + value += "\b"; + break; + case 102 /* LowerF */: + value += "\f"; + break; + case 110 /* LowerN */: + value += "\n"; + break; + case 114 /* LowerR */: + value += "\r"; + break; + case 116 /* LowerT */: + value += " "; + break; + // Unicode escape sequence + case 117 /* LowerU */: { + let code = 0; + for (let j = 0; j < 4; j++) { + c = bytes[i++]; + code <<= 4; + if (c >= 48 /* Digit0 */ && c <= 57 /* Digit9 */) code |= c - 48 /* Digit0 */; + else if (c >= 97 /* LowerA */ && c <= 102 /* LowerF */) code |= c + (10 - 97 /* LowerA */); + else if (c >= 65 /* UpperA */ && c <= 70 /* UpperF */) code |= c + (10 - 65 /* UpperA */); + else throwSyntaxError(bytes, --i); + } + value += fromCharCode(code); + break; + } + // Invalid escape sequence + default: + throwSyntaxError(bytes, --i); + break; + } + } else if (c <= 127) { + value += fromCharCode(c); + } else if ((c & 224) === 192) { + value += fromCharCode((c & 31) << 6 | bytes[i++] & 63); + } else if ((c & 240) === 224) { + value += fromCharCode((c & 15) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63); + } else if ((c & 248) == 240) { + let codePoint = (c & 7) << 18 | (bytes[i++] & 63) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63; + if (codePoint > 65535) { + codePoint -= 65536; + value += fromCharCode(codePoint >> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + value += fromCharCode(codePoint); + } + } + value[0]; + break; + } + // Array begin + case 91 /* OpenBracket */: { + value = []; + propertyStack.push(property); + objectStack.push(object); + stateStack.push(state); + property = null; + object = value; + state = 1 /* Array */; + continue; + } + // Object begin + case 123 /* OpenBrace */: { + value = {}; + propertyStack.push(property); + objectStack.push(object); + stateStack.push(state); + property = null; + object = value; + state = 2 /* Object */; + continue; + } + // Array end + case 93 /* CloseBracket */: { + if (state !== 1 /* Array */) { + throwSyntaxError(bytes, --i); + } + value = object; + property = propertyStack.pop(); + object = objectStack.pop(); + state = stateStack.pop(); + break; + } + // Object end + case 125 /* CloseBrace */: { + if (state !== 2 /* Object */) { + throwSyntaxError(bytes, --i); + } + value = object; + property = propertyStack.pop(); + object = objectStack.pop(); + state = stateStack.pop(); + break; + } + default: { + throwSyntaxError(bytes, --i); + } + } + c = bytes[i]; + while (c <= 32 /* Space */) { + c = bytes[++i]; + } + switch (state) { + case 0 /* TopLevel */: { + if (i === length) { + return value; + } + break; + } + case 1 /* Array */: { + object.push(value); + if (c === 44 /* Comma */) { + i++; + continue; + } + if (c === 93 /* CloseBracket */) { + continue; + } + break; + } + case 2 /* Object */: { + if (property === null) { + property = value; + if (c === 58 /* Colon */) { + i++; + continue; + } + } else { + object[property] = value; + property = null; + if (c === 44 /* Comma */) { + i++; + continue; + } + if (c === 125 /* CloseBrace */) { + continue; + } + } + break; + } + } + break; + } + throwSyntaxError(bytes, i); +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateAndJoinStringArray(values, what) { + const toJoin = []; + for (const value of values) { + validateStringValue(value, what); + if (value.indexOf(",") >= 0) throw new Error(`Invalid ${what}: ${value}`); + toJoin.push(value); + } + return toJoin.join(","); +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeValidPortNumber = (value) => typeof value === "number" && value === (value | 0) && value >= 0 && value <= 65535 ? null : "a valid port number"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeArrayOfStrings = (value) => Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "an array of strings"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArrayOfStrings = (value) => typeof value === "string" || Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "a string or an array of strings"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY2) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArrayOfStrings); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArrayOfStrings); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArrayOfStrings); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArrayOfStrings); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + let absPaths = getFlag(options, keys, "absPaths", mustBeArrayOfStrings); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) flags.push(`--target=${validateAndJoinStringArray(Array.isArray(target) ? target : [target], "target")}`); + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${validateAndJoinStringArray(dropLabels, "drop label")}`); + if (absPaths) flags.push(`--abs-paths=${validateAndJoinStringArray(absPaths, "abs paths")}`); + if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`); + if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { + var _a2; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArrayOfStrings); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArrayOfStrings); + let mainFields = getFlag(options, keys, "mainFields", mustBeArrayOfStrings); + let conditions = getFlag(options, keys, "conditions", mustBeArrayOfStrings); + let external = getFlag(options, keys, "external", mustBeArrayOfStrings); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArrayOfStrings); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) flags.push(`--resolve-extensions=${validateAndJoinStringArray(resolveExtensions, "resolve extension")}`); + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) flags.push(`--main-fields=${validateAndJoinStringArray(mainFields, "main field")}`); + if (conditions) flags.push(`--conditions=${validateAndJoinStringArray(conditions, "condition")}`); + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.27.7") { + throw new Error(`Cannot start service: Host version "${"0.27.7"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY2, + defaultWD2, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs3.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs3.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); + } catch { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs3.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); + } catch { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD2, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile && response.metafile.length) result.metafile = parseJSON(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + const delay = getFlag(options2, keys, "delay", mustBeInteger); + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + if (delay) request2.delay = delay; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeValidPortNumber); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const cors = getFlag(options2, keys, "cors", mustBeObject); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + if (cors) { + const corsKeys = {}; + const origin = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings); + checkForInvalidFlags(cors, corsKeys, `on "cors" object`); + if (Array.isArray(origin)) request2.corsOrigin = origin; + else if (origin !== void 0) request2.corsOrigin = [origin]; + } + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path3, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path: path3, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + details.clear(); + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path3 = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path3 != null) response.path = path3; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}; +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location = parseStackLinesV8(streamIn, lines, ident); + if (location) { + note = { text: e.message, location }; + return note; + } + } catch { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location = null; + try { + text = (e && e.message || e) + ""; + } catch { + } + try { + location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch { + } + return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location, where, terminalWidth) { + if (location == null) return null; + let keys = {}; + let file = getFlag(location, keys, "file", mustBeString); + let namespace = getFlag(location, keys, "namespace", mustBeString); + let line = getFlag(location, keys, "line", mustBeInteger); + let column = getFlag(location, keys, "column", mustBeInteger); + let length = getFlag(location, keys, "length", mustBeInteger); + let lineText = getFlag(location, keys, "lineText", mustBeString); + let suggestion = getFlag(location, keys, "suggestion", mustBeString); + checkForInvalidFlags(location, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path: path3, contents, hash }) { + let text = null; + return { + path: path3, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} +function jsRegExpToGoRegExp(regexp) { + let result = regexp.source; + if (regexp.flags) result = `(?${regexp.flags})${result}`; + return result; +} +function parseJSON(bytes) { + let text; + try { + text = decodeUTF8(bytes); + } catch { + return JSON_parse(bytes); + } + return JSON.parse(text); +} + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var packageDarwin_arm64 = "@esbuild/darwin-arm64"; +var packageDarwin_x64 = "@esbuild/darwin-x64"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd arm64 LE": "@esbuild/netbsd-arm64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64", + "openharmony arm64 LE": "@esbuild/openharmony-arm64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function pkgForSomeOtherPlatform() { + const libMainJS = require.resolve("esbuild"); + const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))); + if (path.basename(nodeModulesDirectory) === "node_modules") { + for (const unixKey in knownUnixlikePackages) { + try { + const pkg = knownUnixlikePackages[unixKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + for (const windowsKey in knownWindowsPackages) { + try { + const pkg = knownWindowsPackages[windowsKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + } + return null; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} +function generateBinPath() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; + } + } + const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + binPath = downloadedBinPath(pkg, subpath); + if (!fs.existsSync(binPath)) { + try { + require.resolve(pkg); + } catch { + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + let suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild on Windows or macOS and copying "node_modules" +into a Docker image that runs Linux, or by copying "node_modules" between +Windows and WSL environments. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead of npm which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { + suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild with npm running inside of Rosetta 2 and then +trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta +2 is Apple's on-the-fly x86_64-to-arm64 translation service). + +If you are installing with npm, you can try ensuring that both npm and node are +not running under Rosetta 2 and then reinstalling esbuild. This likely involves +changing how you installed npm and/or node. For example, installing node with +the universal installer here should work: https://nodejs.org/en/download/. Or +you could consider using yarn instead of npm which has built-in support for +installing a package on multiple platforms simultaneously. + +If you are installing with yarn, you can try listing both "arm64" and "x64" +in your ".yarnrc.yml" file using the "supportedArchitectures" feature: +https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + } + throw new Error(` +You installed esbuild for another platform than the one you're currently using. +This won't work because esbuild is written with native code and needs to +install a platform-specific binary executable. +${suggestions} +Another alternative is to use the "esbuild-wasm" package instead, which works +the same way on all platforms. But it comes with a heavy performance cost and +can sometimes be 10x slower than the "esbuild" package, so you may also not +want to do that. +`); + } + throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. + +If you are installing esbuild with npm, make sure that you don't specify the +"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature +of "package.json" is used by esbuild to install the correct binary executable +for your current platform.`); + } + throw e; + } + } + if (/\.zip\//.test(binPath)) { + let pnpapi; + try { + pnpapi = require("pnpapi"); + } catch (e) { + } + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path.join( + root, + "node_modules", + ".cache", + "esbuild", + `pnpapi-${pkg.replace("/", "-")}-${"0.27.7"}-${path.basename(subpath)}` + ); + if (!fs.existsSync(binTargetPath)) { + fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); + fs.copyFileSync(binPath, binTargetPath); + fs.chmodSync(binTargetPath, 493); + } + return { binPath: binTargetPath, isWASM }; + } + } + return { binPath, isWASM }; +} + +// lib/npm/node.ts +var child_process = require("child_process"); +var crypto = require("crypto"); +var path2 = require("path"); +var fs2 = require("fs"); +var os2 = require("os"); +var tty = require("tty"); +var worker_threads; +if (process.env.ESBUILD_WORKER_THREADS !== "0") { + try { + worker_threads = require("worker_threads"); + } catch { + } + let [major, minor] = process.versions.node.split("."); + if ( + // { + if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) { + throw new Error( + `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. + +More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` + ); + } + if (false) { + return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]]; + } else { + const { binPath, isWASM } = generateBinPath(); + if (isWASM) { + return ["node", [binPath]]; + } else { + return [binPath, []]; + } + } +}; +var isTTY = () => tty.isatty(2); +var fsSync = { + readFile(tempFile, callback) { + try { + let contents = fs2.readFileSync(tempFile, "utf8"); + try { + fs2.unlinkSync(tempFile); + } catch { + } + callback(null, contents); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFileSync(tempFile, contents); + callback(tempFile); + } catch { + callback(null); + } + } +}; +var fsAsync = { + readFile(tempFile, callback) { + try { + fs2.readFile(tempFile, "utf8", (err, contents) => { + try { + fs2.unlink(tempFile, () => callback(err, contents)); + } catch { + callback(err, contents); + } + }); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); + } catch { + callback(null); + } + } +}; +var version = "0.27.7"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); +var buildSync = (options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.buildSync(options); + } + let result; + runServiceSync((service) => service.buildOrContext({ + callName: "buildSync", + refs: null, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var transformSync = (input, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.transformSync(input, options); + } + let result; + runServiceSync((service) => service.transform({ + callName: "transformSync", + refs: null, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsSync, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var formatMessagesSync = (messages, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.formatMessagesSync(messages, options); + } + let result; + runServiceSync((service) => service.formatMessages({ + callName: "formatMessagesSync", + refs: null, + messages, + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var analyzeMetafileSync = (metafile, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.analyzeMetafileSync(metafile, options); + } + let result; + runServiceSync((service) => service.analyzeMetafile({ + callName: "analyzeMetafileSync", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var stop = () => { + if (stopService) stopService(); + if (workerThreadService) workerThreadService.stop(); + return Promise.resolve(); +}; +var initializeWasCalled = false; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); + if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); + if (options.worker) throw new Error(`The "worker" option only works in the browser`); + if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); + ensureServiceIsRunning(); + initializeWasCalled = true; + return Promise.resolve(); +}; +var defaultWD = process.cwd(); +var longLivedService; +var stopService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + let [command, args] = esbuildCommandAndArgs(); + let child = child_process.spawn(command, args.concat(`--service=${"0.27.7"}`, "--ping"), { + windowsHide: true, + stdio: ["pipe", "pipe", "inherit"], + cwd: defaultWD + }); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + child.stdin.write(bytes, (err) => { + if (err) afterClose(err); + }); + }, + readFileSync: fs2.readFileSync, + isSync: false, + hasFS: true, + esbuild: node_exports + }); + child.stdin.on("error", afterClose); + child.on("error", afterClose); + const stdin = child.stdin; + const stdout = child.stdout; + stdout.on("data", readFromStdout); + stdout.on("end", afterClose); + stopService = () => { + stdin.destroy(); + stdout.destroy(); + child.kill(); + initializeWasCalled = false; + longLivedService = void 0; + stopService = void 0; + }; + let refCount = 0; + child.unref(); + if (stdin.unref) { + stdin.unref(); + } + if (stdout.unref) { + stdout.unref(); + } + const refs = { + ref() { + if (++refCount === 1) child.ref(); + }, + unref() { + if (--refCount === 0) child.unref(); + } + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + service.buildOrContext({ + callName: "build", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => service.buildOrContext({ + callName: "context", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + transform: (input, options) => new Promise((resolve, reject) => service.transform({ + callName: "transform", + refs, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsAsync, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({ + callName: "formatMessages", + refs, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({ + callName: "analyzeMetafile", + refs, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })) + }; + return longLivedService; +}; +var runServiceSync = (callback) => { + let [command, args] = esbuildCommandAndArgs(); + let stdin = new Uint8Array(); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + if (stdin.length !== 0) throw new Error("Must run at most one command"); + stdin = bytes; + }, + isSync: true, + hasFS: true, + esbuild: node_exports + }); + callback(service); + let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.27.7"}`), { + cwd: defaultWD, + windowsHide: true, + input: stdin, + // We don't know how large the output could be. If it's too large, the + // command will fail with ENOBUFS. Reserve 16mb for now since that feels + // like it should be enough. Also allow overriding this with an environment + // variable. + maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 + }); + readFromStdout(stdout); + afterClose(null); +}; +var randomFileName = () => { + return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); +}; +var workerThreadService = null; +var startWorkerThreadService = (worker_threads2) => { + let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); + let worker = new worker_threads2.Worker(__filename, { + workerData: { workerPort, defaultWD, esbuildVersion: "0.27.7" }, + transferList: [workerPort], + // From node's documentation: https://nodejs.org/api/worker_threads.html + // + // Take care when launching worker threads from preload scripts (scripts loaded + // and run using the `-r` command line flag). Unless the `execArgv` option is + // explicitly set, new Worker threads automatically inherit the command line flags + // from the running process and will preload the same preload scripts as the main + // thread. If the preload script unconditionally launches a worker thread, every + // thread spawned will spawn another until the application crashes. + // + execArgv: [] + }); + let nextID = 0; + let fakeBuildError = (text) => { + let error = new Error(`Build failed with 1 error: +error: ${text}`); + let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; + error.errors = errors; + error.warnings = []; + return error; + }; + let validateBuildSyncOptions = (options) => { + if (!options) return; + let plugins = options.plugins; + if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); + }; + let applyProperties = (object, properties) => { + for (let key in properties) { + object[key] = properties[key]; + } + }; + let runCallSync = (command, args) => { + let id = nextID++; + let sharedBuffer = new SharedArrayBuffer(8); + let sharedBufferView = new Int32Array(sharedBuffer); + let msg = { sharedBuffer, id, command, args }; + worker.postMessage(msg); + let status = Atomics.wait(sharedBufferView, 0, 0); + if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); + let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); + if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); + if (reject) { + applyProperties(reject, properties); + throw reject; + } + return resolve; + }; + worker.unref(); + return { + buildSync(options) { + validateBuildSyncOptions(options); + return runCallSync("build", [options]); + }, + transformSync(input, options) { + return runCallSync("transform", [input, options]); + }, + formatMessagesSync(messages, options) { + return runCallSync("formatMessages", [messages, options]); + }, + analyzeMetafileSync(metafile, options) { + return runCallSync("analyzeMetafile", [metafile, options]); + }, + stop() { + worker.terminate(); + workerThreadService = null; + } + }; +}; +var startSyncServiceWorker = () => { + let workerPort = worker_threads.workerData.workerPort; + let parentPort = worker_threads.parentPort; + let extractProperties = (object) => { + let properties = {}; + if (object && typeof object === "object") { + for (let key in object) { + properties[key] = object[key]; + } + } + return properties; + }; + try { + let service = ensureServiceIsRunning(); + defaultWD = worker_threads.workerData.defaultWD; + parentPort.on("message", (msg) => { + (async () => { + let { sharedBuffer, id, command, args } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + try { + switch (command) { + case "build": + workerPort.postMessage({ id, resolve: await service.build(args[0]) }); + break; + case "transform": + workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); + break; + case "formatMessages": + workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); + break; + case "analyzeMetafile": + workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); + break; + default: + throw new Error(`Invalid command: ${command}`); + } + } catch (reject) { + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + } + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + })(); + }); + } catch (reject) { + parentPort.on("message", (msg) => { + let { sharedBuffer, id } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + }); + } +}; +if (isInternalWorkerThread) { + startSyncServiceWorker(); +} +var node_default = node_exports; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + analyzeMetafile, + analyzeMetafileSync, + build, + buildSync, + context, + formatMessages, + formatMessagesSync, + initialize, + stop, + transform, + transformSync, + version +}); diff --git a/node_modules/esbuild/package.json b/node_modules/esbuild/package.json new file mode 100644 index 0000000000000000000000000000000000000000..db1b66d62f3a70397b5eb7a4300b9c50c22b6ae6 --- /dev/null +++ b/node_modules/esbuild/package.json @@ -0,0 +1,49 @@ +{ + "name": "esbuild", + "version": "0.27.7", + "description": "An extremely fast JavaScript and CSS bundler and minifier.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "scripts": { + "postinstall": "node install.js" + }, + "main": "lib/main.js", + "types": "lib/main.d.ts", + "engines": { + "node": ">=18" + }, + "bin": { + "esbuild": "bin/esbuild" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + }, + "license": "MIT" +} diff --git a/node_modules/escape-string-regexp/index.d.ts b/node_modules/escape-string-regexp/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8f928814c9b7f3c8036e1494aff58126bbe22a5 --- /dev/null +++ b/node_modules/escape-string-regexp/index.d.ts @@ -0,0 +1,16 @@ +/** +Escape RegExp special characters. + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +@example +``` +import escapeStringRegexp from 'escape-string-regexp'; + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` +*/ +export default function escapeStringRegexp(string: string): string; diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9ce9323ff246d2cafb0a1c3768f49ca9b7efee13 --- /dev/null +++ b/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +export default function escapeStringRegexp(string) { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +} diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license new file mode 100644 index 0000000000000000000000000000000000000000..fa7ceba3eb4a9657a9db7f3ffca4e4e97a9019de --- /dev/null +++ b/node_modules/escape-string-regexp/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +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/node_modules/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9390a6bd22f04aa58ca46e7bca09a7e47f49f179 --- /dev/null +++ b/node_modules/escape-string-regexp/package.json @@ -0,0 +1,40 @@ +{ + "name": "escape-string-regexp", + "version": "5.0.0", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": "sindresorhus/escape-string-regexp", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "escape", + "regex", + "regexp", + "regular", + "expression", + "string", + "special", + "characters" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..839df6e51c2a0dd867654db637a7147b18cbd2e7 --- /dev/null +++ b/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,34 @@ +# escape-string-regexp + +> Escape RegExp special characters + +## Install + +``` +$ npm install escape-string-regexp +``` + +## Usage + +```js +import escapeStringRegexp from 'escape-string-regexp'; + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/eslint-config-next/core-web-vitals.js b/node_modules/eslint-config-next/core-web-vitals.js new file mode 100644 index 0000000000000000000000000000000000000000..312797f39e58a7ece663acf9883ed3f426338c31 --- /dev/null +++ b/node_modules/eslint-config-next/core-web-vitals.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('.'), 'plugin:@next/next/core-web-vitals'], +} diff --git a/node_modules/eslint-config-next/index.js b/node_modules/eslint-config-next/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4c95a88ad4fba7c4257ab5071dbc581d63ee55b4 --- /dev/null +++ b/node_modules/eslint-config-next/index.js @@ -0,0 +1,129 @@ +/* + * @rushstack/eslint-patch is used to include plugins as dev + * dependencies instead of imposing them as peer dependencies + * + * https://www.npmjs.com/package/@rushstack/eslint-patch + */ +const keptPaths = [] +const sortedPaths = [] +const cwd = process.cwd().replace(/\\/g, '/') +const originalPaths = require.resolve.paths('eslint-plugin-import') + +// eslint throws a conflict error when plugins resolve to different +// locations, since we want to lock our dependencies by default +// but also need to allow using user dependencies this updates +// our resolve paths to first check the cwd and iterate to +// eslint-config-next's dependencies if needed + +for (let i = originalPaths.length - 1; i >= 0; i--) { + const currentPath = originalPaths[i] + + if (currentPath.replace(/\\/g, '/').startsWith(cwd)) { + sortedPaths.push(currentPath) + } else { + keptPaths.unshift(currentPath) + } +} + +// maintain order of node_modules outside of cwd +sortedPaths.push(...keptPaths) + +const hookPropertyMap = new Map( + [ + '@typescript-eslint/eslint-plugin', + 'eslint-plugin-import', + 'eslint-plugin-react', + 'eslint-plugin-jsx-a11y', + ].map((request) => [ + request, + require.resolve(request, { paths: sortedPaths }), + ]) +) + +const mod = require('module') +const resolveFilename = mod._resolveFilename +mod._resolveFilename = function (request, parent, isMain, options) { + const hookResolved = hookPropertyMap.get(request) + if (hookResolved) { + request = hookResolved + } + return resolveFilename.call(mod, request, parent, isMain, options) +} + +require('@rushstack/eslint-patch/modern-module-resolution') + +module.exports = { + extends: [ + 'plugin:react/recommended', + 'plugin:react-hooks/recommended', + 'plugin:@next/next/recommended', + ], + plugins: ['import', 'react', 'jsx-a11y'], + rules: { + 'import/no-anonymous-default-export': 'warn', + 'react/no-unknown-property': 'off', + 'react/react-in-jsx-scope': 'off', + 'react/prop-types': 'off', + 'jsx-a11y/alt-text': [ + 'warn', + { + elements: ['img'], + img: ['Image'], + }, + ], + 'jsx-a11y/aria-props': 'warn', + 'jsx-a11y/aria-proptypes': 'warn', + 'jsx-a11y/aria-unsupported-elements': 'warn', + 'jsx-a11y/role-has-required-aria-props': 'warn', + 'jsx-a11y/role-supports-aria-props': 'warn', + 'react/jsx-no-target-blank': 'off', + }, + parser: './parser.js', + parserOptions: { + requireConfigFile: false, + sourceType: 'module', + allowImportExportEverywhere: true, + babelOptions: { + presets: ['next/babel'], + caller: { + // Eslint supports top level await when a parser for it is included. We enable the parser by default for Babel. + supportsTopLevelAwait: true, + }, + }, + }, + overrides: [ + { + files: ['**/*.ts?(x)'], + parser: '@typescript-eslint/parser', + parserOptions: { + sourceType: 'module', + }, + }, + ], + settings: { + react: { + version: 'detect', + }, + 'import/parsers': { + [require.resolve('@typescript-eslint/parser')]: [ + '.ts', + '.mts', + '.cts', + '.tsx', + '.d.ts', + ], + }, + 'import/resolver': { + [require.resolve('eslint-import-resolver-node')]: { + extensions: ['.js', '.jsx', '.ts', '.tsx'], + }, + [require.resolve('eslint-import-resolver-typescript')]: { + alwaysTryTypes: true, + }, + }, + }, + env: { + browser: true, + node: true, + }, +} diff --git a/node_modules/eslint-config-next/package.json b/node_modules/eslint-config-next/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cc6ebe73a9a4b59b9897768e0bd75369ce3bade3 --- /dev/null +++ b/node_modules/eslint-config-next/package.json @@ -0,0 +1,33 @@ +{ + "name": "eslint-config-next", + "version": "15.5.19", + "description": "ESLint configuration used by Next.js.", + "main": "index.js", + "license": "MIT", + "repository": { + "url": "vercel/next.js", + "directory": "packages/eslint-config-next" + }, + "homepage": "https://nextjs.org/docs/app/api-reference/config/eslint", + "dependencies": { + "@next/eslint-plugin-next": "15.5.19", + "@rushstack/eslint-patch": "^1.10.3", + "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jsx-a11y": "^6.10.0", + "eslint-plugin-react": "^7.37.0", + "eslint-plugin-react-hooks": "^5.0.0" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0 || ^9.0.0", + "typescript": ">=3.3.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } +} diff --git a/node_modules/eslint-config-next/parser.js b/node_modules/eslint-config-next/parser.js new file mode 100644 index 0000000000000000000000000000000000000000..b0366825e354245c6d88ca5b5195975aabda46bf --- /dev/null +++ b/node_modules/eslint-config-next/parser.js @@ -0,0 +1,14 @@ +const { + parse, + parseForESLint, +} = require('next/dist/compiled/babel/eslint-parser') +const { version } = require('./package.json') + +module.exports = { + parse, + parseForESLint, + meta: { + name: 'eslint-config-next/parser', + version, + }, +} diff --git a/node_modules/eslint-config-next/typescript.js b/node_modules/eslint-config-next/typescript.js new file mode 100644 index 0000000000000000000000000000000000000000..e30a3b41f5e95eec85256b97254e1a40819c8232 --- /dev/null +++ b/node_modules/eslint-config-next/typescript.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['plugin:@typescript-eslint/recommended'], + rules: { + '@typescript-eslint/no-unused-vars': 1, + '@typescript-eslint/no-unused-expressions': 1, + }, +} diff --git a/node_modules/eslint-import-resolver-node/LICENSE b/node_modules/eslint-import-resolver-node/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c6ade2a433a2d64efb01cb1289b895357dd03cf9 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +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/node_modules/eslint-import-resolver-node/README.md b/node_modules/eslint-import-resolver-node/README.md new file mode 100644 index 0000000000000000000000000000000000000000..20fe1e5af443d5d13df9d5d451a5854e53e0ea58 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/README.md @@ -0,0 +1,44 @@ +# eslint-import-resolver-node + +[![npm](https://img.shields.io/npm/v/eslint-import-resolver-node.svg)](https://www.npmjs.com/package/eslint-import-resolver-node) + +Default Node-style module resolution plugin for [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import). + +Published separately to allow pegging to a specific version in case of breaking +changes. + +Config is passed directly through to [`resolve`](https://www.npmjs.com/package/resolve#resolve-sync-id-opts) as options: + +```yaml +settings: + import/resolver: + node: + extensions: + # if unset, default is just '.js', but it must be re-added explicitly if set + - .js + - .jsx + - .es6 + - .coffee + + paths: + # an array of absolute paths which will also be searched + # think NODE_PATH + - /usr/local/share/global_modules + + # this is technically for identifying `node_modules` alternate names + moduleDirectory: + + - node_modules # defaults to 'node_modules', but... + - bower_components + + - project/src # can add a path segment here that will act like + # a source root, for in-project aliasing (i.e. + # `import MyStore from 'stores/my-store'`) +``` + +or to use the default options: + +```yaml +settings: + import/resolver: node +``` diff --git a/node_modules/eslint-import-resolver-node/index.js b/node_modules/eslint-import-resolver-node/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7f207fbf318c3bfabfda0241f399e8f0c505f3b0 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/index.js @@ -0,0 +1,66 @@ +'use strict'; + +const resolve = require('resolve/sync'); +const isCoreModule = require('is-core-module'); +const path = require('path'); + +const log = require('debug')('eslint-plugin-import:resolver:node'); + +exports.interfaceVersion = 2; + +exports.resolve = function (source, file, config) { + log('Resolving:', source, 'from:', file); + let resolvedPath; + + if (isCoreModule(source)) { + log('resolved to core'); + return { found: true, path: null }; + } + + try { + const cachedFilter = function (pkg, dir) { return packageFilter(pkg, dir, config); }; + resolvedPath = resolve(source, opts(file, config, cachedFilter)); + log('Resolved to:', resolvedPath); + return { found: true, path: resolvedPath }; + } catch (err) { + log('resolve threw error:', err); + return { found: false }; + } +}; + +function opts(file, config, packageFilter) { + return Object.assign({ // more closely matches Node (#333) + // plus 'mjs' for native modules! (#939) + extensions: ['.mjs', '.js', '.json', '.node'], + }, config, { + // path.resolve will handle paths relative to CWD + basedir: path.dirname(path.resolve(file)), + packageFilter, + }); +} + +function identity(x) { return x; } + +function packageFilter(pkg, dir, config) { + let found = false; + const file = path.join(dir, 'dummy.js'); + if (pkg.module) { + try { + resolve(String(pkg.module).replace(/^(?:\.\/)?/, './'), opts(file, config, identity)); + pkg.main = pkg.module; + found = true; + } catch (err) { + log('resolve threw error trying to find pkg.module:', err); + } + } + if (!found && pkg['jsnext:main']) { + try { + resolve(String(pkg['jsnext:main']).replace(/^(?:\.\/)?/, './'), opts(file, config, identity)); + pkg.main = pkg['jsnext:main']; + found = true; + } catch (err) { + log('resolve threw error trying to find pkg[\'jsnext:main\']:', err); + } + } + return pkg; +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md b/node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..820d21e3322b9d2778786ea743dd5e818991d595 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md @@ -0,0 +1,395 @@ + +3.1.0 / 2017-09-26 +================== + + * Add `DEBUG_HIDE_DATE` env var (#486) + * Remove ReDoS regexp in %o formatter (#504) + * Remove "component" from package.json + * Remove `component.json` + * Ignore package-lock.json + * Examples: fix colors printout + * Fix: browser detection + * Fix: spelling mistake (#496, @EdwardBetts) + +3.0.1 / 2017-08-24 +================== + + * Fix: Disable colors in Edge and Internet Explorer (#489) + +3.0.0 / 2017-08-08 +================== + + * Breaking: Remove DEBUG_FD (#406) + * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) + * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) + * Addition: document `enabled` flag (#465) + * Addition: add 256 colors mode (#481) + * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) + * Update: component: update "ms" to v2.0.0 + * Update: separate the Node and Browser tests in Travis-CI + * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots + * Update: separate Node.js and web browser examples for organization + * Update: update "browserify" to v14.4.0 + * Fix: fix Readme typo (#473) + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE b/node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..658c933d28255e8c716899789e8c0f846e5dc125 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +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/node_modules/eslint-import-resolver-node/node_modules/debug/README.md b/node_modules/eslint-import-resolver-node/node_modules/debug/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0ee7634ddd0a4a6337fe7677e99ba78cd626fa07 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/README.md @@ -0,0 +1,437 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> + +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/node_modules/eslint-import-resolver-node/node_modules/debug/node.js b/node_modules/eslint-import-resolver-node/node_modules/debug/node.js new file mode 100644 index 0000000000000000000000000000000000000000..7fc36fe6dbecbfd41530c5a490cc738ec2968653 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/package.json b/node_modules/eslint-import-resolver-node/node_modules/debug/package.json new file mode 100644 index 0000000000000000000000000000000000000000..191c8154787cb9f8662967d4c4f8f9f3467a2bbf --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/package.json @@ -0,0 +1,51 @@ +{ + "name": "debug", + "version": "3.2.7", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "node.js", + "dist/debug.js", + "LICENSE", + "README.md" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + }, + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "browserify": "14.4.0", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.0.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "xo": "^0.23.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "unpkg": "./dist/debug.js" +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..c924b0ac4d4882e4a72a116436ed17a487c2fc05 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js @@ -0,0 +1,180 @@ +"use strict"; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +/** + * Colors. + */ + +exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ +// eslint-disable-next-line complexity + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } // Internet Explorer and Edge do not support colors. + + + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + + + return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); +} +/** + * Colorize log arguments if enabled. + * + * @api public + */ + + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if (match === '%%') { + return; + } + + index++; + + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + args.splice(lastC, 0, c); +} +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + +function log() { + var _console; + + // This hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + var r; + + try { + r = exports.storage.getItem('debug'); + } catch (error) {} // Swallow + // XXX (@Qix-) should we be logging these? + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + + + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); +var formatters = module.exports.formatters; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; + diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/common.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/common.js new file mode 100644 index 0000000000000000000000000000000000000000..e0de3fb530f1c2ea33c4c65bcfd39b98a53600d7 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/common.js @@ -0,0 +1,249 @@ +"use strict"; + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + Object.keys(env).forEach(function (key) { + createDebug[key] = env[key]; + }); + /** + * Active `debug` instances. + */ + + createDebug.instances = []; + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + + createDebug.formatters = {}; + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + + function selectColor(namespace) { + var hash = 0; + + for (var i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + + createDebug.selectColor = selectColor; + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function createDebug(namespace) { + var prevTime; + + function debug() { + // Disabled? + if (!debug.enabled) { + return; + } + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var self = debug; // Set `diff` timestamp + + var curr = Number(new Date()); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } // Apply any `formatters` transformations + + + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return match; + } + + index++; + var formatter = createDebug.formatters[format]; + + if (typeof formatter === 'function') { + var val = args[index]; + match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; + } + + return match; + }); // Apply env-specific formatting (colors, etc.) + + createDebug.formatArgs.call(self, args); + var logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = createDebug.enabled(namespace); + debug.useColors = createDebug.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + debug.extend = extend; // Debug.formatArgs = formatArgs; + // debug.rawLog = rawLog; + // env-specific initialization logic for debug instances + + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + createDebug.instances.push(debug); + return debug; + } + + function destroy() { + var index = createDebug.instances.indexOf(this); + + if (index !== -1) { + createDebug.instances.splice(index, 1); + return true; + } + + return false; + } + + function extend(namespace, delimiter) { + return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.names = []; + createDebug.skips = []; + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < createDebug.instances.length; i++) { + var instance = createDebug.instances[i]; + instance.enabled = createDebug.enabled(instance.namespace); + } + } + /** + * Disable debug output. + * + * @api public + */ + + + function disable() { + createDebug.enable(''); + } + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + var i; + var len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + + return val; + } + + createDebug.enable(createDebug.load()); + return createDebug; +} + +module.exports = setup; + diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..021731593ac517b224bddda8c450bac52889843a --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js @@ -0,0 +1,12 @@ +"use strict"; + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} + diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js new file mode 100644 index 0000000000000000000000000000000000000000..1e6a5f16aecdd38a2bfb607f3d82e299f7624f9a --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js @@ -0,0 +1,177 @@ +"use strict"; + +/** + * Module dependencies. + */ +var tty = require('tty'); + +var util = require('util'); +/** + * This is the Node.js implementation of `debug()`. + */ + + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + var supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221]; + } +} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be. + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // Camel-case + var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { + return k.toUpperCase(); + }); // Coerce string value into JS value + + var val = process.env[key]; + + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); +} +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + +function formatArgs(args) { + var name = this.namespace, + useColors = this.useColors; + + if (useColors) { + var c = this.color; + var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c); + var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m"); + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + + return new Date().toISOString() + ' '; +} +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + + +function log() { + return process.stderr.write(util.format.apply(util, arguments) + '\n'); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + return process.env.DEBUG; +} +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + +function init(debug) { + debug.inspectOpts = {}; + var keys = Object.keys(exports.inspectOpts); + + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); +var formatters = module.exports.formatters; +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(function (str) { return str.trim(); }) + .join(' '); +}; +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + diff --git a/node_modules/eslint-import-resolver-node/package.json b/node_modules/eslint-import-resolver-node/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bfaab404139cd51e6e2ff454ddfede8ab914e863 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/package.json @@ -0,0 +1,41 @@ +{ + "name": "eslint-import-resolver-node", + "version": "0.3.9", + "description": "Node default behavior import resolution plugin for eslint-plugin-import.", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "prepublishOnly": "cp ../../{LICENSE,.npmrc} ./", + "tests-only": "nyc mocha", + "test": "npm run tests-only" + }, + "repository": { + "type": "git", + "url": "https://github.com/import-js/eslint-plugin-import" + }, + "keywords": [ + "eslint", + "eslintplugin", + "esnext", + "modules", + "eslint-plugin-import" + ], + "author": "Ben Mosher (me@benmosher.com)", + "license": "MIT", + "bugs": { + "url": "https://github.com/import-js/eslint-plugin-import/issues" + }, + "homepage": "https://github.com/import-js/eslint-plugin-import", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + }, + "devDependencies": { + "chai": "^3.5.0", + "mocha": "^3.5.3", + "nyc": "^11.9.0" + } +} diff --git a/node_modules/eslint-import-resolver-typescript/LICENSE b/node_modules/eslint-import-resolver-typescript/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..652813cd7b1754fcab54bd0cc060e9c4175a1858 --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/LICENSE @@ -0,0 +1,5 @@ +Copyright 2021 Alex Gorbatchev + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/eslint-import-resolver-typescript/README.md b/node_modules/eslint-import-resolver-typescript/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e41bc64ab345e4a3d76a7e95f05629332d50bd66 --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/README.md @@ -0,0 +1,346 @@ +# eslint-import-resolver-typescript + +[![GitHub Actions](https://github.com/import-js/eslint-import-resolver-typescript/workflows/CI/badge.svg)](https://github.com/import-js/eslint-import-resolver-typescript/actions/workflows/ci.yml) +[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fimport-js%2Feslint-import-resolver-typescript%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage) +[![npm](https://img.shields.io/npm/v/eslint-import-resolver-typescript.svg)](https://www.npmjs.com/package/eslint-import-resolver-typescript) +[![GitHub Release](https://img.shields.io/github/release/import-js/eslint-import-resolver-typescript)](https://github.com/import-js/eslint-import-resolver-typescript/releases) + +[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org) +[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com) +[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) +[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) +[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/changesets/changesets) + +This plugin adds [`TypeScript`][] support to [`eslint-plugin-import`][] (Or maybe you want to try [`eslint-plugin-import-x`][] for faster speed) + +This means you can: + +- `import`/`require` files with extension `.cts`/`.mts`/`.ts`/`.tsx`/`.d.cts`/`.d.mts`/`.d.ts` +- Use [`paths`](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) defined in `tsconfig.json` +- Prefer resolving `@types/*` definitions over plain `.js`/`.jsx` +- Multiple tsconfigs support just like normal +- `imports/exports` fields support in `package.json` + +## TOC + +- [Notice](#notice) +- [Installation](#installation) + - [`eslint-plugin-import`](#eslint-plugin-import) + - [`eslint-plugin-import-x`](#eslint-plugin-import-x) +- [Configuration](#configuration) + - [`eslint.config.js`](#eslintconfigjs) + - [`.eslintrc`](#eslintrc) +- [Options from `rspack-resolver`](#options-from-rspack-resolver) + - [`conditionNames`](#conditionnames) + - [`extensions`](#extensions) + - [`extensionAlias`](#extensionalias) + - [`mainFields`](#mainfields) + - [Other options](#other-options) + - [Default options](#default-options) +- [Contributing](#contributing) +- [Sponsors](#sponsors) +- [Backers](#backers) +- [Changelog](#changelog) +- [License](#license) + +## Notice + +After version 2.0.0, `.d.ts` will take higher priority then normal `.js`/`.jsx` files on resolving `node_modules` packages in favor of `@types/*` definitions or its own definition. + +If you're facing some problems on rules `import/default` or `import/named` from [`eslint-plugin-import`][], do not post any issue here, because they are just working exactly as [expected](https://github.com/import-js/eslint-import-resolver-typescript/issues/31#issuecomment-539751607) on our sides, take [import-js/eslint-plugin-import#1525](https://github.com/import-js/eslint-plugin-import/issues/1525) as reference or post a new issue to [`eslint-plugin-import`][] instead. + +## Installation + +### `eslint-plugin-import` + +```sh +# npm +npm i -D eslint-plugin-import eslint-import-resolver-typescript + +# pnpm +pnpm i -D eslint-plugin-import eslint-import-resolver-typescript + +# yarn +yarn add -D eslint-plugin-import eslint-import-resolver-typescript +``` + +### `eslint-plugin-import-x` + +```sh +# npm +npm i -D eslint-plugin-import-x eslint-import-resolver-typescript + +# pnpm +pnpm i -D eslint-plugin-import-x eslint-import-resolver-typescript + +# yarn +yarn add -D eslint-plugin-import-x eslint-import-resolver-typescript +``` + +## Configuration + +### `eslint.config.js` + +If you are using `eslint-plugin-import-x@>=4.5.0`, you can use import/require to reference `eslint-import-resolver-typescript` directly in your ESLint flat config: + +```js +// eslint.config.js, CommonJS is also supported +import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript' + +export default [ + { + settings: { + 'import-x/resolver-next': [ + createTypeScriptImportResolver({ + alwaysTryTypes: true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + + // Choose from one of the "project" configs below or omit to use /tsconfig.json by default + + // use /path/to/folder/tsconfig.json + project: 'path/to/folder', + + // Multiple tsconfigs (Useful for monorepos) + + // use a glob pattern + project: 'packages/*/tsconfig.json', + + // use an array + project: [ + 'packages/module-a/tsconfig.json', + 'packages/module-b/tsconfig.json', + ], + + // use an array of glob patterns + project: [ + 'packages/*/tsconfig.json', + 'other-packages/*/tsconfig.json', + ], + + // use /jsconfig.json + project: 'jsconfig.json', + }), + ], + }, + }, +] +``` + +But if you are using `eslint-plugin-import` or the older version of `eslint-plugin-import-x`, you can't use require/import: + +```js +// eslint.config.js, CommonJS is also supported +export default [ + { + settings: { + 'import/resolver': { + typescript: { + alwaysTryTypes: true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + + // Choose from one of the "project" configs below or omit to use /tsconfig.json by default + + // use /path/to/folder/tsconfig.json + project: 'path/to/folder', + + // Multiple tsconfigs (Useful for monorepos) + + // use a glob pattern + project: 'packages/*/tsconfig.json', + + // use an array + project: [ + 'packages/module-a/tsconfig.json', + 'packages/module-b/tsconfig.json', + ], + + // use an array of glob patterns + project: [ + 'packages/*/tsconfig.json', + 'other-packages/*/tsconfig.json', + ], + + // use /jsconfig.json + project: 'jsconfig.json', + }, + }, + }, + }, +] +``` + +### `.eslintrc` + +Add the following to your `.eslintrc` config: + +```jsonc +{ + "plugins": ["import"], + "rules": { + // turn on errors for missing imports + "import/no-unresolved": "error", + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"], + }, + "import/resolver": { + "typescript": { + "alwaysTryTypes": true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + + // Choose from one of the "project" configs below or omit to use /tsconfig.json by default + + // use /path/to/folder/tsconfig.json + "project": "path/to/folder", + + // Multiple tsconfigs (Useful for monorepos) + + // use a glob pattern + "project": "packages/*/tsconfig.json", + + // use an array + "project": [ + "packages/module-a/tsconfig.json", + "packages/module-b/tsconfig.json", + ], + + // use an array of glob patterns + "project": [ + "packages/*/tsconfig.json", + "other-packages/*/tsconfig.json", + ], + + // use /jsconfig.json + "project": "jsconfig.json", + }, + }, + }, +} +``` + +## Options from [`rspack-resolver`][] + +### `conditionNames` + +Default: + +```jsonc +[ + "types", + "import", + + // APF: https://angular.io/guide/angular-package-format + "esm2020", + "es2020", + "es2015", + + "require", + "node", + "node-addons", + "browser", + "default", +] +``` + +### `extensions` + +Default: + +```jsonc +[ + // `.mts`, `.cts`, `.d.mts`, `.d.cts`, `.mjs`, `.cjs` are not included because `.cjs` and `.mjs` must be used explicitly + ".ts", + ".tsx", + ".d.ts", + ".js", + ".jsx", + ".json", + ".node", +] +``` + +### `extensionAlias` + +Default: + +```jsonc +{ + ".js": [ + ".ts", + // `.tsx` can also be compiled as `.js` + ".tsx", + ".d.ts", + ".js", + ], + ".jsx": [".tsx", ".d.ts", ".jsx"], + ".cjs": [".cts", ".d.cts", ".cjs"], + ".mjs": [".mts", ".d.mts", ".mjs"], +} +``` + +### `mainFields` + +Default: + +```jsonc +[ + "types", + "typings", + + // APF: https://angular.io/guide/angular-package-format + "fesm2020", + "fesm2015", + "esm2020", + "es2020", + + "module", + "jsnext:main", + + "main", +] +``` + +### Other options + +You can pass through other options of [`rspack-resolver`][] directly + +### Default options + +You can reuse `defaultConditionNames`, `defaultExtensions`, `defaultExtensionAlias` and `defaultMainFields` by `require/import` them directly + +## Contributing + +- Make sure your change is covered by a test import. +- Make sure that `yarn test` passes without a failure. +- Make sure that `yarn lint` passes without conflicts. +- Make sure your code changes match our [type-coverage](https://github.com/plantain-00/type-coverage) settings: `yarn type-coverage`. + +We have [GitHub Actions](https://github.com/import-js/eslint-import-resolver-typescript/actions) which will run the above commands on your PRs. + +If either fails, we won't be able to merge your PR until it's fixed. + +[![Sponsors](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin) + +## Sponsors + +| 1stG | RxTS | UnTS | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) | + +## Backers + +| 1stG | RxTS | UnTS | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) | + +## Changelog + +Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md). + +## License + +[ISC][] + +[`eslint-plugin-import`]: https://github.com/import-js/eslint-plugin-import +[`eslint-plugin-import-x`]: https://github.com/un-ts/eslint-plugin-import-x +[`rspack-resolver`]: https://github.com/unrs/rspack-resolver +[`typescript`]: https://www.typescriptlang.org +[isc]: https://opensource.org/licenses/ISC diff --git a/node_modules/eslint-import-resolver-typescript/lib/index.cjs b/node_modules/eslint-import-resolver-typescript/lib/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..fd05d961e10a692c35d2e7850e0cbdfc80bee32f --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/lib/index.cjs @@ -0,0 +1,397 @@ +'use strict'; + +var fs = require('node:fs'); +var module$1 = require('node:module'); +var path = require('node:path'); +var isNodeCoreModule = require('@nolyfill/is-core-module'); +var debug = require('debug'); +var getTsconfig = require('get-tsconfig'); +var isBunModule = require('is-bun-module'); +var stableHash = require('stable-hash'); +var tinyglobby = require('tinyglobby'); +var unrsResolver = require('unrs-resolver'); + +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +const IMPORTER_NAME = "eslint-import-resolver-typescript"; +const log = debug(IMPORTER_NAME); +const defaultConditionNames = [ + "types", + "import", + // APF: https://angular.io/guide/angular-package-format + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" +]; +const defaultExtensions = [ + ".ts", + ".tsx", + ".d.ts", + ".js", + ".jsx", + ".json", + ".node" +]; +const defaultExtensionAlias = { + ".js": [ + ".ts", + // `.tsx` can also be compiled as `.js` + ".tsx", + ".d.ts", + ".js" + ], + ".jsx": [".tsx", ".d.ts", ".jsx"], + ".cjs": [".cts", ".d.cts", ".cjs"], + ".mjs": [".mts", ".d.mts", ".mjs"] +}; +const defaultMainFields = [ + "types", + "typings", + // APF: https://angular.io/guide/angular-package-format + "fesm2020", + "fesm2015", + "esm2020", + "es2020", + "module", + "jsnext:main", + "main" +]; +const interfaceVersion = 2; +const JS_EXT_PATTERN = /\.(?:[cm]js|jsx?)$/; +const RELATIVE_PATH_PATTERN = /^\.{1,2}(?:\/.*)?$/; +let previousOptionsHash; +let optionsHash; +let cachedOptions; +let cachedCwd; +let mappersCachedOptions; +let mappers = []; +let resolverCachedOptions; +let cachedResolver; +function resolve(source, file, options, resolver) { + var _a, _b, _c, _d; + if (!cachedOptions || previousOptionsHash !== (optionsHash = stableHash.stableHash(options))) { + previousOptionsHash = optionsHash; + cachedOptions = __spreadProps(__spreadValues({}, options), { + conditionNames: (_a = options == null ? void 0 : options.conditionNames) != null ? _a : defaultConditionNames, + extensions: (_b = options == null ? void 0 : options.extensions) != null ? _b : defaultExtensions, + extensionAlias: (_c = options == null ? void 0 : options.extensionAlias) != null ? _c : defaultExtensionAlias, + mainFields: (_d = options == null ? void 0 : options.mainFields) != null ? _d : defaultMainFields + }); + } + if (!resolver) { + if (!cachedResolver || resolverCachedOptions !== cachedOptions) { + cachedResolver = new unrsResolver.ResolverFactory(cachedOptions); + resolverCachedOptions = cachedOptions; + } + resolver = cachedResolver; + } + log("looking for", source, "in", file); + source = removeQuerystring(source); + if (isNodeCoreModule(source) || isBunModule.isBunModule(source)) { + log("matched core:", source); + return { + found: true, + path: null + }; + } + if (process.versions.pnp && source === "pnpapi") { + return { + found: true, + path: module$1.findPnpApi(file).resolveToUnqualified(source, file, { + considerBuiltins: false + }) + }; + } + initMappers(cachedOptions); + let mappedPaths = getMappedPaths(source, file, cachedOptions.extensions, true); + if (mappedPaths.length > 0) { + log("matched ts path:", ...mappedPaths); + } else { + mappedPaths = [source]; + } + let foundNodePath; + for (const mappedPath of mappedPaths) { + try { + const resolved = resolver.sync( + path.dirname(path.resolve(file)), + mappedPath + ); + if (resolved.path) { + foundNodePath = resolved.path; + break; + } + } catch (e) { + log("failed to resolve with", mappedPath); + } + } + if ((JS_EXT_PATTERN.test(foundNodePath) || cachedOptions.alwaysTryTypes && !foundNodePath) && !/^@types[/\\]/.test(source) && !path.isAbsolute(source) && !source.startsWith(".")) { + const definitelyTyped = resolve( + "@types" + path.sep + mangleScopedPackage(source), + file, + options + ); + if (definitelyTyped.found) { + return definitelyTyped; + } + } + if (foundNodePath) { + log("matched node path:", foundNodePath); + return { + found: true, + path: foundNodePath + }; + } + log("didn't find ", source); + return { + found: false + }; +} +function createTypeScriptImportResolver(options) { + var _a, _b, _c, _d; + const resolver = new unrsResolver.ResolverFactory(__spreadProps(__spreadValues({}, options), { + conditionNames: (_a = options == null ? void 0 : options.conditionNames) != null ? _a : defaultConditionNames, + extensions: (_b = options == null ? void 0 : options.extensions) != null ? _b : defaultExtensions, + extensionAlias: (_c = options == null ? void 0 : options.extensionAlias) != null ? _c : defaultExtensionAlias, + mainFields: (_d = options == null ? void 0 : options.mainFields) != null ? _d : defaultMainFields + })); + return { + interfaceVersion: 3, + name: IMPORTER_NAME, + resolve(source, file) { + return resolve(source, file, options, resolver); + } + }; +} +function removeQuerystring(id) { + const querystringIndex = id.lastIndexOf("?"); + if (querystringIndex !== -1) { + return id.slice(0, querystringIndex); + } + return id; +} +const isFile = (path2) => { + var _a; + try { + return !!(path2 && ((_a = fs.statSync(path2, { throwIfNoEntry: false })) == null ? void 0 : _a.isFile())); + } catch (e) { + return false; + } +}; +const isModule = (modulePath) => !!modulePath && isFile(path.resolve(modulePath, "package.json")); +function getMappedPaths(source, file, extensions = defaultExtensions, retry) { + const originalExtensions = extensions; + extensions = ["", ...extensions]; + let paths = []; + if (RELATIVE_PATH_PATTERN.test(source)) { + const resolved = path.resolve(path.dirname(file), source); + if (isFile(resolved)) { + paths = [resolved]; + } + } else { + let mapperFns = mappers.filter(({ files }) => files.has(file)).map(({ mapperFn }) => mapperFn); + if (mapperFns.length === 0) { + mapperFns = mappers.map((mapper) => ({ + mapperFn: mapper.mapperFn, + counter: equalChars(path.dirname(file), path.dirname(mapper.path)) + })).sort( + (a, b) => ( + // Sort in descending order where the nearest one has the longest counter + b.counter - a.counter + ) + ).map(({ mapperFn }) => mapperFn); + } + paths = mapperFns.map( + (mapperFn) => mapperFn(source).map((item) => [ + ...extensions.map((ext) => `${item}${ext}`), + ...originalExtensions.map((ext) => `${item}/index${ext}`) + ]) + ).flat( + /* The depth is always 2 */ + 2 + ).map(toNativePathSeparator).filter((mappedPath) => { + try { + const stat = fs.statSync(mappedPath, { throwIfNoEntry: false }); + if (stat === void 0) { + return false; + } + if (stat.isFile()) { + return true; + } + if (stat.isDirectory()) { + return isModule(mappedPath); + } + } catch (e) { + return false; + } + return false; + }); + } + if (retry && paths.length === 0) { + const isJs = JS_EXT_PATTERN.test(source); + if (isJs) { + const jsExt = path.extname(source); + const tsExt = jsExt.replace("js", "ts"); + const basename = source.replace(JS_EXT_PATTERN, ""); + let resolved = getMappedPaths(basename + tsExt, file); + if (resolved.length === 0 && jsExt === ".js") { + const tsxExt = jsExt.replace("js", "tsx"); + resolved = getMappedPaths(basename + tsxExt, file); + } + if (resolved.length === 0) { + resolved = getMappedPaths( + basename + ".d" + (tsExt === ".tsx" ? ".ts" : tsExt), + file + ); + } + if (resolved.length > 0) { + return resolved; + } + } + for (const ext of extensions) { + const mappedPaths = isJs ? [] : getMappedPaths(source + ext, file); + const resolved = mappedPaths.length > 0 ? mappedPaths : getMappedPaths(source + `/index${ext}`, file); + if (resolved.length > 0) { + return resolved; + } + } + } + return paths; +} +function initMappers(options) { + if (mappers.length > 0 && mappersCachedOptions === options && cachedCwd === process.cwd()) { + return; + } + cachedCwd = process.cwd(); + const configPaths = (typeof options.project === "string" ? [options.project] : ( + // eslint-disable-next-line sonarjs/no-nested-conditional + Array.isArray(options.project) ? options.project : [cachedCwd] + )).map((config) => replacePathSeparator(config, path.sep, path.posix.sep)); + const defaultInclude = ["**/*"]; + const defaultIgnore = ["**/node_modules/**"]; + const projectPaths = [ + .../* @__PURE__ */ new Set([ + ...configPaths.filter((p) => !tinyglobby.isDynamicPattern(p)).map((p) => path.resolve(process.cwd(), p)), + ...tinyglobby.globSync( + configPaths.filter((path2) => tinyglobby.isDynamicPattern(path2)), + { + absolute: true, + dot: true, + expandDirectories: false, + ignore: defaultIgnore + } + ) + ]) + ]; + mappers = projectPaths.map((projectPath) => { + var _a, _b; + let tsconfigResult; + if (isFile(projectPath)) { + const { dir, base } = path.parse(projectPath); + tsconfigResult = getTsconfig.getTsconfig(dir, base); + } else { + tsconfigResult = getTsconfig.getTsconfig(projectPath); + } + if (!tsconfigResult) { + return; + } + const mapperFn = getTsconfig.createPathsMatcher(tsconfigResult); + if (!mapperFn) { + return; + } + const files = tsconfigResult.config.files == null && tsconfigResult.config.include == null ? ( + // Include everything if no files or include options + tinyglobby.globSync(defaultInclude, { + absolute: true, + cwd: path.dirname(tsconfigResult.path), + dot: true, + ignore: [ + ...(_a = tsconfigResult.config.exclude) != null ? _a : [], + ...defaultIgnore + ] + }) + ) : [ + // https://www.typescriptlang.org/tsconfig/#files + ...tsconfigResult.config.files != null && tsconfigResult.config.files.length > 0 ? tsconfigResult.config.files.map( + (file) => path.normalize( + path.resolve(path.dirname(tsconfigResult.path), file) + ) + ) : [], + // https://www.typescriptlang.org/tsconfig/#include + ...tsconfigResult.config.include != null && tsconfigResult.config.include.length > 0 ? tinyglobby.globSync(tsconfigResult.config.include, { + absolute: true, + cwd: path.dirname(tsconfigResult.path), + dot: true, + ignore: [ + ...(_b = tsconfigResult.config.exclude) != null ? _b : [], + ...defaultIgnore + ] + }) : [] + ]; + return { + path: toNativePathSeparator(tsconfigResult.path), + files: new Set(files.map(toNativePathSeparator)), + mapperFn + }; + }).filter(Boolean); + mappersCachedOptions = options; +} +function mangleScopedPackage(moduleName) { + if (moduleName.startsWith("@")) { + const replaceSlash = moduleName.replace(path.sep, "__"); + if (replaceSlash !== moduleName) { + return replaceSlash.slice(1); + } + } + return moduleName; +} +function replacePathSeparator(p, from, to) { + return from === to ? p : p.replaceAll(from, to); +} +function toNativePathSeparator(p) { + return replacePathSeparator( + p, + path[process.platform === "win32" ? "posix" : "win32"].sep, + path[process.platform === "win32" ? "win32" : "posix"].sep + ); +} +function equalChars(a, b) { + if (a.length === 0 || b.length === 0) { + return 0; + } + let i = 0; + const length = Math.min(a.length, b.length); + while (i < length && a.charAt(i) === b.charAt(i)) { + i += 1; + } + return i; +} + +exports.createTypeScriptImportResolver = createTypeScriptImportResolver; +exports.defaultConditionNames = defaultConditionNames; +exports.defaultExtensionAlias = defaultExtensionAlias; +exports.defaultExtensions = defaultExtensions; +exports.defaultMainFields = defaultMainFields; +exports.interfaceVersion = interfaceVersion; +exports.resolve = resolve; diff --git a/node_modules/eslint-import-resolver-typescript/lib/index.d.ts b/node_modules/eslint-import-resolver-typescript/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4abeed2218bd6930b9a29917f561254aebb3f4b2 --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/lib/index.d.ts @@ -0,0 +1,27 @@ +import { type NapiResolveOptions, ResolverFactory } from 'unrs-resolver'; +export declare const defaultConditionNames: string[]; +export declare const defaultExtensions: string[]; +export declare const defaultExtensionAlias: { + '.js': string[]; + '.jsx': string[]; + '.cjs': string[]; + '.mjs': string[]; +}; +export declare const defaultMainFields: string[]; +export declare const interfaceVersion = 2; +export interface TsResolverOptions extends NapiResolveOptions { + alwaysTryTypes?: boolean; + project?: string[] | string; +} +export declare function resolve(source: string, file: string, options?: TsResolverOptions | null, resolver?: ResolverFactory | null): { + found: boolean; + path?: string | null; +}; +export declare function createTypeScriptImportResolver(options?: TsResolverOptions | null): { + interfaceVersion: number; + name: string; + resolve(source: string, file: string): { + found: boolean; + path?: string | null; + }; +}; diff --git a/node_modules/eslint-import-resolver-typescript/lib/index.es2020.mjs b/node_modules/eslint-import-resolver-typescript/lib/index.es2020.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7d418d041ffd353d0c1983a2c6601c7fdba88df7 --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/lib/index.es2020.mjs @@ -0,0 +1,368 @@ +import fs from 'node:fs'; +import module from 'node:module'; +import path from 'node:path'; +import isNodeCoreModule from '@nolyfill/is-core-module'; +import debug from 'debug'; +import { getTsconfig, createPathsMatcher } from 'get-tsconfig'; +import { isBunModule } from 'is-bun-module'; +import { stableHash } from 'stable-hash'; +import { globSync, isDynamicPattern } from 'tinyglobby'; +import { ResolverFactory } from 'unrs-resolver'; + +const IMPORTER_NAME = "eslint-import-resolver-typescript"; +const log = debug(IMPORTER_NAME); +const defaultConditionNames = [ + "types", + "import", + // APF: https://angular.io/guide/angular-package-format + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" +]; +const defaultExtensions = [ + ".ts", + ".tsx", + ".d.ts", + ".js", + ".jsx", + ".json", + ".node" +]; +const defaultExtensionAlias = { + ".js": [ + ".ts", + // `.tsx` can also be compiled as `.js` + ".tsx", + ".d.ts", + ".js" + ], + ".jsx": [".tsx", ".d.ts", ".jsx"], + ".cjs": [".cts", ".d.cts", ".cjs"], + ".mjs": [".mts", ".d.mts", ".mjs"] +}; +const defaultMainFields = [ + "types", + "typings", + // APF: https://angular.io/guide/angular-package-format + "fesm2020", + "fesm2015", + "esm2020", + "es2020", + "module", + "jsnext:main", + "main" +]; +const interfaceVersion = 2; +const JS_EXT_PATTERN = /\.(?:[cm]js|jsx?)$/; +const RELATIVE_PATH_PATTERN = /^\.{1,2}(?:\/.*)?$/; +let previousOptionsHash; +let optionsHash; +let cachedOptions; +let cachedCwd; +let mappersCachedOptions; +let mappers = []; +let resolverCachedOptions; +let cachedResolver; +function resolve(source, file, options, resolver) { + if (!cachedOptions || previousOptionsHash !== (optionsHash = stableHash(options))) { + previousOptionsHash = optionsHash; + cachedOptions = { + ...options, + conditionNames: options?.conditionNames ?? defaultConditionNames, + extensions: options?.extensions ?? defaultExtensions, + extensionAlias: options?.extensionAlias ?? defaultExtensionAlias, + mainFields: options?.mainFields ?? defaultMainFields + }; + } + if (!resolver) { + if (!cachedResolver || resolverCachedOptions !== cachedOptions) { + cachedResolver = new ResolverFactory(cachedOptions); + resolverCachedOptions = cachedOptions; + } + resolver = cachedResolver; + } + log("looking for", source, "in", file); + source = removeQuerystring(source); + if (isNodeCoreModule(source) || isBunModule(source)) { + log("matched core:", source); + return { + found: true, + path: null + }; + } + if (process.versions.pnp && source === "pnpapi") { + return { + found: true, + path: module.findPnpApi(file).resolveToUnqualified(source, file, { + considerBuiltins: false + }) + }; + } + initMappers(cachedOptions); + let mappedPaths = getMappedPaths(source, file, cachedOptions.extensions, true); + if (mappedPaths.length > 0) { + log("matched ts path:", ...mappedPaths); + } else { + mappedPaths = [source]; + } + let foundNodePath; + for (const mappedPath of mappedPaths) { + try { + const resolved = resolver.sync( + path.dirname(path.resolve(file)), + mappedPath + ); + if (resolved.path) { + foundNodePath = resolved.path; + break; + } + } catch { + log("failed to resolve with", mappedPath); + } + } + if ((JS_EXT_PATTERN.test(foundNodePath) || cachedOptions.alwaysTryTypes && !foundNodePath) && !/^@types[/\\]/.test(source) && !path.isAbsolute(source) && !source.startsWith(".")) { + const definitelyTyped = resolve( + "@types" + path.sep + mangleScopedPackage(source), + file, + options + ); + if (definitelyTyped.found) { + return definitelyTyped; + } + } + if (foundNodePath) { + log("matched node path:", foundNodePath); + return { + found: true, + path: foundNodePath + }; + } + log("didn't find ", source); + return { + found: false + }; +} +function createTypeScriptImportResolver(options) { + const resolver = new ResolverFactory({ + ...options, + conditionNames: options?.conditionNames ?? defaultConditionNames, + extensions: options?.extensions ?? defaultExtensions, + extensionAlias: options?.extensionAlias ?? defaultExtensionAlias, + mainFields: options?.mainFields ?? defaultMainFields + }); + return { + interfaceVersion: 3, + name: IMPORTER_NAME, + resolve(source, file) { + return resolve(source, file, options, resolver); + } + }; +} +function removeQuerystring(id) { + const querystringIndex = id.lastIndexOf("?"); + if (querystringIndex !== -1) { + return id.slice(0, querystringIndex); + } + return id; +} +const isFile = (path2) => { + try { + return !!(path2 && fs.statSync(path2, { throwIfNoEntry: false })?.isFile()); + } catch { + return false; + } +}; +const isModule = (modulePath) => !!modulePath && isFile(path.resolve(modulePath, "package.json")); +function getMappedPaths(source, file, extensions = defaultExtensions, retry) { + const originalExtensions = extensions; + extensions = ["", ...extensions]; + let paths = []; + if (RELATIVE_PATH_PATTERN.test(source)) { + const resolved = path.resolve(path.dirname(file), source); + if (isFile(resolved)) { + paths = [resolved]; + } + } else { + let mapperFns = mappers.filter(({ files }) => files.has(file)).map(({ mapperFn }) => mapperFn); + if (mapperFns.length === 0) { + mapperFns = mappers.map((mapper) => ({ + mapperFn: mapper.mapperFn, + counter: equalChars(path.dirname(file), path.dirname(mapper.path)) + })).sort( + (a, b) => ( + // Sort in descending order where the nearest one has the longest counter + b.counter - a.counter + ) + ).map(({ mapperFn }) => mapperFn); + } + paths = mapperFns.map( + (mapperFn) => mapperFn(source).map((item) => [ + ...extensions.map((ext) => `${item}${ext}`), + ...originalExtensions.map((ext) => `${item}/index${ext}`) + ]) + ).flat( + /* The depth is always 2 */ + 2 + ).map(toNativePathSeparator).filter((mappedPath) => { + try { + const stat = fs.statSync(mappedPath, { throwIfNoEntry: false }); + if (stat === void 0) { + return false; + } + if (stat.isFile()) { + return true; + } + if (stat.isDirectory()) { + return isModule(mappedPath); + } + } catch { + return false; + } + return false; + }); + } + if (retry && paths.length === 0) { + const isJs = JS_EXT_PATTERN.test(source); + if (isJs) { + const jsExt = path.extname(source); + const tsExt = jsExt.replace("js", "ts"); + const basename = source.replace(JS_EXT_PATTERN, ""); + let resolved = getMappedPaths(basename + tsExt, file); + if (resolved.length === 0 && jsExt === ".js") { + const tsxExt = jsExt.replace("js", "tsx"); + resolved = getMappedPaths(basename + tsxExt, file); + } + if (resolved.length === 0) { + resolved = getMappedPaths( + basename + ".d" + (tsExt === ".tsx" ? ".ts" : tsExt), + file + ); + } + if (resolved.length > 0) { + return resolved; + } + } + for (const ext of extensions) { + const mappedPaths = isJs ? [] : getMappedPaths(source + ext, file); + const resolved = mappedPaths.length > 0 ? mappedPaths : getMappedPaths(source + `/index${ext}`, file); + if (resolved.length > 0) { + return resolved; + } + } + } + return paths; +} +function initMappers(options) { + if (mappers.length > 0 && mappersCachedOptions === options && cachedCwd === process.cwd()) { + return; + } + cachedCwd = process.cwd(); + const configPaths = (typeof options.project === "string" ? [options.project] : ( + // eslint-disable-next-line sonarjs/no-nested-conditional + Array.isArray(options.project) ? options.project : [cachedCwd] + )).map((config) => replacePathSeparator(config, path.sep, path.posix.sep)); + const defaultInclude = ["**/*"]; + const defaultIgnore = ["**/node_modules/**"]; + const projectPaths = [ + .../* @__PURE__ */ new Set([ + ...configPaths.filter((p) => !isDynamicPattern(p)).map((p) => path.resolve(process.cwd(), p)), + ...globSync( + configPaths.filter((path2) => isDynamicPattern(path2)), + { + absolute: true, + dot: true, + expandDirectories: false, + ignore: defaultIgnore + } + ) + ]) + ]; + mappers = projectPaths.map((projectPath) => { + let tsconfigResult; + if (isFile(projectPath)) { + const { dir, base } = path.parse(projectPath); + tsconfigResult = getTsconfig(dir, base); + } else { + tsconfigResult = getTsconfig(projectPath); + } + if (!tsconfigResult) { + return; + } + const mapperFn = createPathsMatcher(tsconfigResult); + if (!mapperFn) { + return; + } + const files = tsconfigResult.config.files == null && tsconfigResult.config.include == null ? ( + // Include everything if no files or include options + globSync(defaultInclude, { + absolute: true, + cwd: path.dirname(tsconfigResult.path), + dot: true, + ignore: [ + ...tsconfigResult.config.exclude ?? [], + ...defaultIgnore + ] + }) + ) : [ + // https://www.typescriptlang.org/tsconfig/#files + ...tsconfigResult.config.files != null && tsconfigResult.config.files.length > 0 ? tsconfigResult.config.files.map( + (file) => path.normalize( + path.resolve(path.dirname(tsconfigResult.path), file) + ) + ) : [], + // https://www.typescriptlang.org/tsconfig/#include + ...tsconfigResult.config.include != null && tsconfigResult.config.include.length > 0 ? globSync(tsconfigResult.config.include, { + absolute: true, + cwd: path.dirname(tsconfigResult.path), + dot: true, + ignore: [ + ...tsconfigResult.config.exclude ?? [], + ...defaultIgnore + ] + }) : [] + ]; + return { + path: toNativePathSeparator(tsconfigResult.path), + files: new Set(files.map(toNativePathSeparator)), + mapperFn + }; + }).filter(Boolean); + mappersCachedOptions = options; +} +function mangleScopedPackage(moduleName) { + if (moduleName.startsWith("@")) { + const replaceSlash = moduleName.replace(path.sep, "__"); + if (replaceSlash !== moduleName) { + return replaceSlash.slice(1); + } + } + return moduleName; +} +function replacePathSeparator(p, from, to) { + return from === to ? p : p.replaceAll(from, to); +} +function toNativePathSeparator(p) { + return replacePathSeparator( + p, + path[process.platform === "win32" ? "posix" : "win32"].sep, + path[process.platform === "win32" ? "win32" : "posix"].sep + ); +} +function equalChars(a, b) { + if (a.length === 0 || b.length === 0) { + return 0; + } + let i = 0; + const length = Math.min(a.length, b.length); + while (i < length && a.charAt(i) === b.charAt(i)) { + i += 1; + } + return i; +} + +export { createTypeScriptImportResolver, defaultConditionNames, defaultExtensionAlias, defaultExtensions, defaultMainFields, interfaceVersion, resolve }; diff --git a/node_modules/eslint-import-resolver-typescript/lib/index.js b/node_modules/eslint-import-resolver-typescript/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..abc3ae7b743fd1ec4590e3d675f93da26e28c301 --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/lib/index.js @@ -0,0 +1,368 @@ +import fs from 'node:fs'; +import module from 'node:module'; +import path from 'node:path'; +import isNodeCoreModule from '@nolyfill/is-core-module'; +import debug from 'debug'; +import { createPathsMatcher, getTsconfig } from 'get-tsconfig'; +import { isBunModule } from 'is-bun-module'; +import { stableHash } from 'stable-hash'; +import { globSync, isDynamicPattern } from 'tinyglobby'; +import { ResolverFactory } from 'unrs-resolver'; +const IMPORTER_NAME = 'eslint-import-resolver-typescript'; +const log = debug(IMPORTER_NAME); +export const defaultConditionNames = [ + 'types', + 'import', + 'esm2020', + 'es2020', + 'es2015', + 'require', + 'node', + 'node-addons', + 'browser', + 'default', +]; +export const defaultExtensions = [ + '.ts', + '.tsx', + '.d.ts', + '.js', + '.jsx', + '.json', + '.node', +]; +export const defaultExtensionAlias = { + '.js': [ + '.ts', + '.tsx', + '.d.ts', + '.js', + ], + '.jsx': ['.tsx', '.d.ts', '.jsx'], + '.cjs': ['.cts', '.d.cts', '.cjs'], + '.mjs': ['.mts', '.d.mts', '.mjs'], +}; +export const defaultMainFields = [ + 'types', + 'typings', + 'fesm2020', + 'fesm2015', + 'esm2020', + 'es2020', + 'module', + 'jsnext:main', + 'main', +]; +export const interfaceVersion = 2; +const JS_EXT_PATTERN = /\.(?:[cm]js|jsx?)$/; +const RELATIVE_PATH_PATTERN = /^\.{1,2}(?:\/.*)?$/; +let previousOptionsHash; +let optionsHash; +let cachedOptions; +let cachedCwd; +let mappersCachedOptions; +let mappers = []; +let resolverCachedOptions; +let cachedResolver; +export function resolve(source, file, options, resolver) { + if (!cachedOptions || + previousOptionsHash !== (optionsHash = stableHash(options))) { + previousOptionsHash = optionsHash; + cachedOptions = { + ...options, + conditionNames: options?.conditionNames ?? defaultConditionNames, + extensions: options?.extensions ?? defaultExtensions, + extensionAlias: options?.extensionAlias ?? defaultExtensionAlias, + mainFields: options?.mainFields ?? defaultMainFields, + }; + } + if (!resolver) { + if (!cachedResolver || resolverCachedOptions !== cachedOptions) { + cachedResolver = new ResolverFactory(cachedOptions); + resolverCachedOptions = cachedOptions; + } + resolver = cachedResolver; + } + log('looking for', source, 'in', file); + source = removeQuerystring(source); + if (isNodeCoreModule(source) || isBunModule(source)) { + log('matched core:', source); + return { + found: true, + path: null, + }; + } + if (process.versions.pnp && source === 'pnpapi') { + return { + found: true, + path: module.findPnpApi(file).resolveToUnqualified(source, file, { + considerBuiltins: false, + }), + }; + } + initMappers(cachedOptions); + let mappedPaths = getMappedPaths(source, file, cachedOptions.extensions, true); + if (mappedPaths.length > 0) { + log('matched ts path:', ...mappedPaths); + } + else { + mappedPaths = [source]; + } + let foundNodePath; + for (const mappedPath of mappedPaths) { + try { + const resolved = resolver.sync(path.dirname(path.resolve(file)), mappedPath); + if (resolved.path) { + foundNodePath = resolved.path; + break; + } + } + catch { + log('failed to resolve with', mappedPath); + } + } + if ((JS_EXT_PATTERN.test(foundNodePath) || + (cachedOptions.alwaysTryTypes && !foundNodePath)) && + !/^@types[/\\]/.test(source) && + !path.isAbsolute(source) && + !source.startsWith('.')) { + const definitelyTyped = resolve('@types' + path.sep + mangleScopedPackage(source), file, options); + if (definitelyTyped.found) { + return definitelyTyped; + } + } + if (foundNodePath) { + log('matched node path:', foundNodePath); + return { + found: true, + path: foundNodePath, + }; + } + log("didn't find ", source); + return { + found: false, + }; +} +export function createTypeScriptImportResolver(options) { + const resolver = new ResolverFactory({ + ...options, + conditionNames: options?.conditionNames ?? defaultConditionNames, + extensions: options?.extensions ?? defaultExtensions, + extensionAlias: options?.extensionAlias ?? defaultExtensionAlias, + mainFields: options?.mainFields ?? defaultMainFields, + }); + return { + interfaceVersion: 3, + name: IMPORTER_NAME, + resolve(source, file) { + return resolve(source, file, options, resolver); + }, + }; +} +function removeQuerystring(id) { + const querystringIndex = id.lastIndexOf('?'); + if (querystringIndex !== -1) { + return id.slice(0, querystringIndex); + } + return id; +} +const isFile = (path) => { + try { + return !!(path && fs.statSync(path, { throwIfNoEntry: false })?.isFile()); + } + catch { + return false; + } +}; +const isModule = (modulePath) => !!modulePath && isFile(path.resolve(modulePath, 'package.json')); +function getMappedPaths(source, file, extensions = defaultExtensions, retry) { + const originalExtensions = extensions; + extensions = ['', ...extensions]; + let paths = []; + if (RELATIVE_PATH_PATTERN.test(source)) { + const resolved = path.resolve(path.dirname(file), source); + if (isFile(resolved)) { + paths = [resolved]; + } + } + else { + let mapperFns = mappers + .filter(({ files }) => files.has(file)) + .map(({ mapperFn }) => mapperFn); + if (mapperFns.length === 0) { + mapperFns = mappers + .map(mapper => ({ + mapperFn: mapper.mapperFn, + counter: equalChars(path.dirname(file), path.dirname(mapper.path)), + })) + .sort((a, b) => b.counter - a.counter) + .map(({ mapperFn }) => mapperFn); + } + paths = mapperFns + .map(mapperFn => mapperFn(source).map(item => [ + ...extensions.map(ext => `${item}${ext}`), + ...originalExtensions.map(ext => `${item}/index${ext}`), + ])) + .flat(2) + .map(toNativePathSeparator) + .filter(mappedPath => { + try { + const stat = fs.statSync(mappedPath, { throwIfNoEntry: false }); + if (stat === undefined) { + return false; + } + if (stat.isFile()) { + return true; + } + if (stat.isDirectory()) { + return isModule(mappedPath); + } + } + catch { + return false; + } + return false; + }); + } + if (retry && paths.length === 0) { + const isJs = JS_EXT_PATTERN.test(source); + if (isJs) { + const jsExt = path.extname(source); + const tsExt = jsExt.replace('js', 'ts'); + const basename = source.replace(JS_EXT_PATTERN, ''); + let resolved = getMappedPaths(basename + tsExt, file); + if (resolved.length === 0 && jsExt === '.js') { + const tsxExt = jsExt.replace('js', 'tsx'); + resolved = getMappedPaths(basename + tsxExt, file); + } + if (resolved.length === 0) { + resolved = getMappedPaths(basename + '.d' + (tsExt === '.tsx' ? '.ts' : tsExt), file); + } + if (resolved.length > 0) { + return resolved; + } + } + for (const ext of extensions) { + const mappedPaths = isJs ? [] : getMappedPaths(source + ext, file); + const resolved = mappedPaths.length > 0 + ? mappedPaths + : getMappedPaths(source + `/index${ext}`, file); + if (resolved.length > 0) { + return resolved; + } + } + } + return paths; +} +function initMappers(options) { + if (mappers.length > 0 && + mappersCachedOptions === options && + cachedCwd === process.cwd()) { + return; + } + cachedCwd = process.cwd(); + const configPaths = (typeof options.project === 'string' + ? [options.project] + : + Array.isArray(options.project) + ? options.project + : [cachedCwd]) + .map(config => replacePathSeparator(config, path.sep, path.posix.sep)); + const defaultInclude = ['**/*']; + const defaultIgnore = ['**/node_modules/**']; + const projectPaths = [ + ...new Set([ + ...configPaths + .filter(p => !isDynamicPattern(p)) + .map(p => path.resolve(process.cwd(), p)), + ...globSync(configPaths.filter(path => isDynamicPattern(path)), { + absolute: true, + dot: true, + expandDirectories: false, + ignore: defaultIgnore, + }), + ]), + ]; + mappers = projectPaths + .map(projectPath => { + let tsconfigResult; + if (isFile(projectPath)) { + const { dir, base } = path.parse(projectPath); + tsconfigResult = getTsconfig(dir, base); + } + else { + tsconfigResult = getTsconfig(projectPath); + } + if (!tsconfigResult) { + return; + } + const mapperFn = createPathsMatcher(tsconfigResult); + if (!mapperFn) { + return; + } + const files = tsconfigResult.config.files == null && + tsconfigResult.config.include == null + ? + globSync(defaultInclude, { + absolute: true, + cwd: path.dirname(tsconfigResult.path), + dot: true, + ignore: [ + ...(tsconfigResult.config.exclude ?? []), + ...defaultIgnore, + ], + }) + : [ + ...(tsconfigResult.config.files != null && + tsconfigResult.config.files.length > 0 + ? tsconfigResult.config.files.map(file => path.normalize(path.resolve(path.dirname(tsconfigResult.path), file))) + : []), + ...(tsconfigResult.config.include != null && + tsconfigResult.config.include.length > 0 + ? globSync(tsconfigResult.config.include, { + absolute: true, + cwd: path.dirname(tsconfigResult.path), + dot: true, + ignore: [ + ...(tsconfigResult.config.exclude ?? []), + ...defaultIgnore, + ], + }) + : []), + ]; + return { + path: toNativePathSeparator(tsconfigResult.path), + files: new Set(files.map(toNativePathSeparator)), + mapperFn, + }; + }) + .filter(Boolean); + mappersCachedOptions = options; +} +function mangleScopedPackage(moduleName) { + if (moduleName.startsWith('@')) { + const replaceSlash = moduleName.replace(path.sep, '__'); + if (replaceSlash !== moduleName) { + return replaceSlash.slice(1); + } + } + return moduleName; +} +function replacePathSeparator(p, from, to) { + return from === to ? p : p.replaceAll(from, to); +} +function toNativePathSeparator(p) { + return replacePathSeparator(p, path[process.platform === 'win32' ? 'posix' : 'win32'].sep, path[process.platform === 'win32' ? 'win32' : 'posix'].sep); +} +function equalChars(a, b) { + if (a.length === 0 || b.length === 0) { + return 0; + } + let i = 0; + const length = Math.min(a.length, b.length); + while (i < length && a.charAt(i) === b.charAt(i)) { + i += 1; + } + return i; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/eslint-import-resolver-typescript/lib/index.js.map b/node_modules/eslint-import-resolver-typescript/lib/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1fe638a6fc2af15ac1c86a2894557ede0b98edfb --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAA2B,eAAe,EAAE,MAAM,eAAe,CAAA;AAExE,MAAM,aAAa,GAAG,mCAAmC,CAAA;AAEzD,MAAM,GAAG,GAAG,KAAK,CAAC,aAAa,CAAC,CAAA;AAEhC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,OAAO;IACP,QAAQ;IAGR,SAAS;IACT,QA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package.json b/node_modules/eslint-import-resolver-typescript/package.json new file mode 100644 index 0000000000000000000000000000000000000000..75432682f196c4546984c6ff44d17c1ebea27d2b --- /dev/null +++ b/node_modules/eslint-import-resolver-typescript/package.json @@ -0,0 +1,65 @@ +{ + "name": "eslint-import-resolver-typescript", + "version": "3.10.1", + "type": "module", + "description": "This plugin adds `TypeScript` support to `eslint-plugin-import`", + "repository": "https://github.com/import-js/eslint-import-resolver-typescript", + "author": "Alex Gorbatchev ", + "contributors": [ + "JounQin (https://www.1stG.me)" + ], + "funding": "https://opencollective.com/eslint-import-resolver-typescript", + "license": "ISC", + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "main": "lib/index.cjs", + "types": "lib/index.d.ts", + "module": "lib/index.js", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "es2020": "./lib/index.es2020.mjs", + "fesm2020": "./lib/index.es2020.mjs", + "import": "./lib/index.js", + "require": "./lib/index.cjs" + }, + "./package.json": "./package.json" + }, + "es2020": "lib/index.es2020.mjs", + "fesm2020": "lib/index.es2020.mjs", + "files": [ + "lib", + "shim.d.ts", + "!**/*.tsbuildinfo" + ], + "keywords": [ + "typescript", + "eslint", + "import", + "resolver", + "plugin" + ], + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + }, + "dependencies": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.4.0", + "get-tsconfig": "^4.10.0", + "is-bun-module": "^2.0.0", + "stable-hash": "^0.0.5", + "tinyglobby": "^0.2.13", + "unrs-resolver": "^1.6.2" + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/.nycrc b/node_modules/eslint-module-utils/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..1084360870c9774162f15a30bc8f6c9a9407d4fc --- /dev/null +++ b/node_modules/eslint-module-utils/.nycrc @@ -0,0 +1,15 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "lcov", "text", "html", "json"], + "instrument": false, + "exclude": [ + "coverage", + "test", + "tests", + "resolvers/*/test", + "scripts", + "memo-parser", + "lib" + ] +} diff --git a/node_modules/eslint-module-utils/CHANGELOG.md b/node_modules/eslint-module-utils/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..9a35cfba7f9a8b87d25418fa0e525a5a9f59e515 --- /dev/null +++ b/node_modules/eslint-module-utils/CHANGELOG.md @@ -0,0 +1,253 @@ +# Change Log +All notable changes to this module will be documented in this file. +This project adheres to [Semantic Versioning](https://semver.org/). +This change log adheres to standards from [Keep a CHANGELOG](https://keepachangelog.com). + +## Unreleased + +## v2.12.1 - 2025-06-19 + +### Fixed +- `unambiguous`: detect modules exported from minified code ([#3124], thanks [@michaelfaith]) + +### Changed +- [refactor] `parse`: avoid using a regex here (thanks [@ljharb]) + +## v2.12.0 - 2024-09-26 + +### Added +- `hash`: add support for hashing functions ([#3072], thanks [@michaelfaith]) + +## v2.11.1 - 2024-09-23 + +### Fixed +- `parse`: remove unneeded extra backticks ([#3057], thanks [@G-Rath]) +- `parse`: espree parser isn't working with flat config ([#3061], thanks [@michaelfaith]) +- `parse`: add `ecmaVersion` and `sourceType` to `parserOptions` ([#3061], thanks [@michaelfaith]) + +## v2.11.0 - 2024-09-05 + +### New +- `declaredScope`: take a `node` for modern eslint versions (thanks [@michaelfaith]) + +## v2.10.0 - 2024-09-05 + +### New +- add context compatibility helpers ([#3049], thanks [@michaelfaith]) + +## v2.9.0 - 2024-09-02 + +### New +- add support for Flat Config ([#3018], thanks [@michaelfaith]) + +## v2.8.2 - 2024-08-25 + +### Fixed +- `parse`: also delete `parserOptions.projectService` ([#3039], thanks [@Mysak0CZ]) + +### Changed +- [types] use shared config (thanks [@ljharb]) +- [meta] add `exports`, `main` +- [meta] add `repository.directory` field +- [refactor] avoid hoisting + +## v2.8.1 - 2024-02-26 + +### Fixed +- `parse`: also delete `parserOptions.EXPERIMENTAL_useProjectService` ([#2963], thanks [@JoshuaKGoldberg]) + +### Changed +- add types (thanks [@ljharb]) + +## v2.8.0 - 2023-04-14 + +### New +- `parse`: support flat config ([#2714], thanks [@DMartens]) + +### Fixed +- Improve performance of `fullResolve` for large projects ([#2755], thanks [@leipert]) + +## v2.7.4 - 2022-08-11 + +### Fixed +- [Fix] Ignore hashbang and BOM while parsing ([#2431], thanks [@silverwind]) + +### Changed +- [patch] mark eslint as an optional peer dep ([#2523], thanks [@wmertens]) + +## v2.7.3 - 2022-01-26 + +### Fixed +- `parse`: restore compatibility by making the return value `ast` again ([#2350], thanks [@ljharb]) + +## v2.7.2 - 2022-01-01 + +### Fixed +- [patch] Fix `@babel/eslint-parser` 8 compatibility ([#2343], thanks [@nicolo-ribaudo]) + +### Changed +- [Refactor] inline `pkgDir` implementation; remove `pkg-dir` + +## v2.7.1 - 2021-10-13 + +### Fixed +- fixed SyntaxError in node <= 6: Unexpected token ) in parse.js ([#2261], thanks [@VitusFW]) + +## v2.7.0 - 2021-10-11 + +### Added +- `fileExistsWithCaseSync`: add `strict` argument ([#1262], thanks [@sergei-startsev]) +- add `visit`, to support dynamic imports ([#1660], [#2212], thanks [@maxkomarychev], [@aladdin-add], [@Hypnosphi]) +- create internal replacement for `pkg-up` and `read-pkg-up` ([#2047], [@mgwalker]) + +## v2.6.2 - 2021-08-08 + +### Fixed +- Use `context.getPhysicalFilename()` when available (ESLint 7.28+) ([#2160], thanks [@pmcelhaney]) + +## v2.6.1 - 2021-05-13 + +### Fixed +- `no-unresolved`: check `import()` ([#2026], thanks [@aladdin-add]) +- Add fix for Windows Subsystem for Linux ([#1786], thanks [@manuth]) + +### Changed +- [deps] update `debug` +- [Refactor] use `Array.isArray` instead of `instanceof Array` + +## v2.6.0 - 2020-03-28 + +### Added +- Print more helpful info if parsing fails ([#1671], thanks [@kaiyoma]) + +## v2.5.2 - 2020-01-12 + +### Fixed +- Makes the loader resolution more tolerant ([#1606], thanks [@arcanis]) +- Use `createRequire` instead of `createRequireFromPath` if available ([#1602], thanks [@iamnapo]) + +## v2.5.1 - 2020-01-11 + +### Fixed +- Uses createRequireFromPath to resolve loaders ([#1591], thanks [@arcanis]) +- report the error stack on a resolution error ([#599], thanks [@sompylasar]) + +## v2.5.0 - 2019-12-07 + +### Added +- support `parseForESLint` from custom parser ([#1435], thanks [@JounQin]) + +### Changed + - Avoid superfluous calls and code ([#1551], thanks [@brettz9]) + +## v2.4.1 - 2019-07-19 + +### Fixed + - Improve parse perf when using `@typescript-eslint/parser` ([#1409], thanks [@bradzacher]) + - Improve support for TypeScript declare structures ([#1356], thanks [@christophercurrie]) + +## v2.4.0 - 2019-04-13 + +### Added + - no-useless-path-segments: Add noUselessIndex option ([#1290], thanks [@timkraut]) + +### Fixed + - Fix overwriting of dynamic import() CallExpression ([`no-cycle`], [`no-relative-parent-import`], [`no-unresolved`], [`no-useless-path-segments`]) ([#1218], [#1166], [#1035], thanks [@vikr01]) + + +## v2.3.0 - 2019-01-22 +### Fixed +- use `process.hrtime()` for cache dates ([#1160], thanks [@hulkish]) + +## v2.2.0 - 2018-03-29 +### Changed +- `parse`: attach node locations by default. +- `moduleVisitor`: visitor now gets the full `import` statement node as a second + argument, so rules may report against the full statement / `require` call instead + of only the string literal node. + +## v2.1.1 - 2017-06-22 + +Re-releasing v2.1.0 after vetting (again) and unable to reproduce issue. + + +## v2.1.0 - 2017-06-02 [YANKED] + +Yanked due to critical issue with cache key resulting from #839. + +### Added +- `parse` now additionally passes `filePath` to `parser` in `parserOptions` like `eslint` core does + +## v2.0.0 - 2016-11-07 +### Changed +- `unambiguous` no longer exposes fast test regex + +### Fixed +- `unambiguous.test()` regex is now properly in multiline mode + +[#3124]: https://github.com/import-js/eslint-plugin-import/pull/3124 +[#3072]: https://github.com/import-js/eslint-plugin-import/pull/3072 +[#3061]: https://github.com/import-js/eslint-plugin-import/pull/3061 +[#3057]: https://github.com/import-js/eslint-plugin-import/pull/3057 +[#3049]: https://github.com/import-js/eslint-plugin-import/pull/3049 +[#3039]: https://github.com/import-js/eslint-plugin-import/pull/3039 +[#3018]: https://github.com/import-js/eslint-plugin-import/pull/3018 +[#2963]: https://github.com/import-js/eslint-plugin-import/pull/2963 +[#2755]: https://github.com/import-js/eslint-plugin-import/pull/2755 +[#2714]: https://github.com/import-js/eslint-plugin-import/pull/2714 +[#2523]: https://github.com/import-js/eslint-plugin-import/pull/2523 +[#2431]: https://github.com/import-js/eslint-plugin-import/pull/2431 +[#2350]: https://github.com/import-js/eslint-plugin-import/issues/2350 +[#2343]: https://github.com/import-js/eslint-plugin-import/pull/2343 +[#2261]: https://github.com/import-js/eslint-plugin-import/pull/2261 +[#2212]: https://github.com/import-js/eslint-plugin-import/pull/2212 +[#2160]: https://github.com/import-js/eslint-plugin-import/pull/2160 +[#2047]: https://github.com/import-js/eslint-plugin-import/pull/2047 +[#2026]: https://github.com/import-js/eslint-plugin-import/pull/2026 +[#1786]: https://github.com/import-js/eslint-plugin-import/pull/1786 +[#1671]: https://github.com/import-js/eslint-plugin-import/pull/1671 +[#1660]: https://github.com/import-js/eslint-plugin-import/pull/1660 +[#1606]: https://github.com/import-js/eslint-plugin-import/pull/1606 +[#1602]: https://github.com/import-js/eslint-plugin-import/pull/1602 +[#1591]: https://github.com/import-js/eslint-plugin-import/pull/1591 +[#1551]: https://github.com/import-js/eslint-plugin-import/pull/1551 +[#1435]: https://github.com/import-js/eslint-plugin-import/pull/1435 +[#1409]: https://github.com/import-js/eslint-plugin-import/pull/1409 +[#1356]: https://github.com/import-js/eslint-plugin-import/pull/1356 +[#1290]: https://github.com/import-js/eslint-plugin-import/pull/1290 +[#1262]: https://github.com/import-js/eslint-plugin-import/pull/1262 +[#1218]: https://github.com/import-js/eslint-plugin-import/pull/1218 +[#1166]: https://github.com/import-js/eslint-plugin-import/issues/1166 +[#1160]: https://github.com/import-js/eslint-plugin-import/pull/1160 +[#1035]: https://github.com/import-js/eslint-plugin-import/issues/1035 +[#599]: https://github.com/import-js/eslint-plugin-import/pull/599 + +[@aladdin-add]: https://github.com/aladdin-add +[@arcanis]: https://github.com/arcanis +[@bradzacher]: https://github.com/bradzacher +[@brettz9]: https://github.com/brettz9 +[@christophercurrie]: https://github.com/christophercurrie +[@DMartens]: https://github.com/DMartens +[@G-Rath]: https://github.com/G-Rath +[@hulkish]: https://github.com/hulkish +[@Hypnosphi]: https://github.com/Hypnosphi +[@iamnapo]: https://github.com/iamnapo +[@JoshuaKGoldberg]: https://github.com/JoshuaKGoldberg +[@JounQin]: https://github.com/JounQin +[@kaiyoma]: https://github.com/kaiyoma +[@leipert]: https://github.com/leipert +[@ljharb]: https://github.com/ljharb +[@manuth]: https://github.com/manuth +[@maxkomarychev]: https://github.com/maxkomarychev +[@mgwalker]: https://github.com/mgwalker +[@michaelfaith]: https://github.com/michaelfaith +[@Mysak0CZ]: https://github.com/Mysak0CZ +[@nicolo-ribaudo]: https://github.com/nicolo-ribaudo +[@pmcelhaney]: https://github.com/pmcelhaney +[@sergei-startsev]: https://github.com/sergei-startsev +[@silverwind]: https://github.com/silverwind +[@sompylasar]: https://github.com/sompylasar +[@timkraut]: https://github.com/timkraut +[@vikr01]: https://github.com/vikr01 +[@VitusFW]: https://github.com/VitusFW +[@wmertens]: https://github.com/wmertens diff --git a/node_modules/eslint-module-utils/LICENSE b/node_modules/eslint-module-utils/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c6ade2a433a2d64efb01cb1289b895357dd03cf9 --- /dev/null +++ b/node_modules/eslint-module-utils/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +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/node_modules/eslint-module-utils/ModuleCache.d.ts b/node_modules/eslint-module-utils/ModuleCache.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72a72a0699a3c631571d41bd0de3271a96a553ca --- /dev/null +++ b/node_modules/eslint-module-utils/ModuleCache.d.ts @@ -0,0 +1,22 @@ +import type { ESLintSettings } from "./types"; + +export type CacheKey = unknown; +export type CacheObject = { + result: unknown; + lastSeen: ReturnType; +}; + +declare class ModuleCache { + map: Map; + + constructor(map?: Map); + + get(cacheKey: CacheKey, settings: ESLintSettings): T | undefined; + + set(cacheKey: CacheKey, result: T): T; + + static getSettings(settings: ESLintSettings): { lifetime: number } & Omit; +} +export default ModuleCache; + +export type { ModuleCache } diff --git a/node_modules/eslint-module-utils/ModuleCache.js b/node_modules/eslint-module-utils/ModuleCache.js new file mode 100644 index 0000000000000000000000000000000000000000..24c76849ddc5c7d9d5edc2b7023c2b8cbe085bfe --- /dev/null +++ b/node_modules/eslint-module-utils/ModuleCache.js @@ -0,0 +1,52 @@ +'use strict'; + +exports.__esModule = true; + +const log = require('debug')('eslint-module-utils:ModuleCache'); + +/** @type {import('./ModuleCache').ModuleCache} */ +class ModuleCache { + /** @param {typeof import('./ModuleCache').ModuleCache.prototype.map} map */ + constructor(map) { + this.map = map || /** @type {{typeof import('./ModuleCache').ModuleCache.prototype.map} */ new Map(); + } + + /** @type {typeof import('./ModuleCache').ModuleCache.prototype.set} */ + set(cacheKey, result) { + this.map.set(cacheKey, { result, lastSeen: process.hrtime() }); + log('setting entry for', cacheKey); + return result; + } + + /** @type {typeof import('./ModuleCache').ModuleCache.prototype.get} */ + get(cacheKey, settings) { + if (this.map.has(cacheKey)) { + const f = this.map.get(cacheKey); + // check freshness + // @ts-expect-error TS can't narrow properly from `has` and `get` + if (process.hrtime(f.lastSeen)[0] < settings.lifetime) { return f.result; } + } else { + log('cache miss for', cacheKey); + } + // cache miss + return undefined; + } + + /** @type {typeof import('./ModuleCache').ModuleCache.getSettings} */ + static getSettings(settings) { + /** @type {ReturnType} */ + const cacheSettings = Object.assign({ + lifetime: 30, // seconds + }, settings['import/cache']); + + // parse infinity + // @ts-expect-error the lack of type overlap is because we're abusing `cacheSettings` as a temporary object + if (cacheSettings.lifetime === '∞' || cacheSettings.lifetime === 'Infinity') { + cacheSettings.lifetime = Infinity; + } + + return cacheSettings; + } +} + +exports.default = ModuleCache; diff --git a/node_modules/eslint-module-utils/contextCompat.d.ts b/node_modules/eslint-module-utils/contextCompat.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43fe0a91b81fbb2c89e30c53ba10b7c0af960918 --- /dev/null +++ b/node_modules/eslint-module-utils/contextCompat.d.ts @@ -0,0 +1,38 @@ +import { Scope, SourceCode, Rule } from 'eslint'; +import * as ESTree from 'estree'; + +type LegacyContext = { + getFilename: () => string, + getPhysicalFilename: () => string, + getSourceCode: () => SourceCode, + getScope: never, + getAncestors: never, + getDeclaredVariables: never, +}; + +type NewContext = { + filename: string, + sourceCode: SourceCode, + getPhysicalFilename?: () => string, + getScope: () => Scope.Scope, + getAncestors: () => ESTree.Node[], + getDeclaredVariables: (node: ESTree.Node) => Scope.Variable[], +}; + +export type Context = LegacyContext | NewContext | Rule.RuleContext; + +declare function getAncestors(context: Context, node: ESTree.Node): ESTree.Node[]; +declare function getDeclaredVariables(context: Context, node: ESTree.Node): Scope.Variable[]; +declare function getFilename(context: Context): string; +declare function getPhysicalFilename(context: Context): string; +declare function getScope(context: Context, node: ESTree.Node): Scope.Scope; +declare function getSourceCode(context: Context): SourceCode; + +export { + getAncestors, + getDeclaredVariables, + getFilename, + getPhysicalFilename, + getScope, + getSourceCode, +}; diff --git a/node_modules/eslint-module-utils/contextCompat.js b/node_modules/eslint-module-utils/contextCompat.js new file mode 100644 index 0000000000000000000000000000000000000000..b1bdc598ef52ec5a3dfa0ff86a9070a47cffcac0 --- /dev/null +++ b/node_modules/eslint-module-utils/contextCompat.js @@ -0,0 +1,72 @@ +'use strict'; + +exports.__esModule = true; + +/** @type {import('./contextCompat').getAncestors} */ +function getAncestors(context, node) { + const sourceCode = getSourceCode(context); + + if (sourceCode && sourceCode.getAncestors) { + return sourceCode.getAncestors(node); + } + + return context.getAncestors(); +} + +/** @type {import('./contextCompat').getDeclaredVariables} */ +function getDeclaredVariables(context, node) { + const sourceCode = getSourceCode(context); + + if (sourceCode && sourceCode.getDeclaredVariables) { + return sourceCode.getDeclaredVariables(node); + } + + return context.getDeclaredVariables(node); +} + +/** @type {import('./contextCompat').getFilename} */ +function getFilename(context) { + if ('filename' in context) { + return context.filename; + } + + return context.getFilename(); +} + +/** @type {import('./contextCompat').getPhysicalFilename} */ +function getPhysicalFilename(context) { + if (context.getPhysicalFilename) { + return context.getPhysicalFilename(); + } + + return getFilename(context); +} + +/** @type {import('./contextCompat').getScope} */ +function getScope(context, node) { + const sourceCode = getSourceCode(context); + + if (sourceCode && sourceCode.getScope) { + return sourceCode.getScope(node); + } + + return context.getScope(); +} + +/** @type {import('./contextCompat').getSourceCode} */ +function getSourceCode(context) { + if ('sourceCode' in context) { + return context.sourceCode; + } + + return context.getSourceCode(); +} + +module.exports = { + getAncestors, + getDeclaredVariables, + getFilename, + getPhysicalFilename, + getScope, + getSourceCode, +}; diff --git a/node_modules/eslint-module-utils/declaredScope.d.ts b/node_modules/eslint-module-utils/declaredScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..90053e8e70c9d2eeef365bb38088c2a700d9127a --- /dev/null +++ b/node_modules/eslint-module-utils/declaredScope.d.ts @@ -0,0 +1,10 @@ +import { Rule, Scope } from 'eslint'; +import * as ESTree from 'estree'; + +declare function declaredScope( + context: Rule.RuleContext, + name: string, + node?: ESTree.Node, +): Scope.Scope['type'] | undefined; + +export default declaredScope; diff --git a/node_modules/eslint-module-utils/declaredScope.js b/node_modules/eslint-module-utils/declaredScope.js new file mode 100644 index 0000000000000000000000000000000000000000..aa3e38b47a3d830315bdd94817b703008f420c34 --- /dev/null +++ b/node_modules/eslint-module-utils/declaredScope.js @@ -0,0 +1,13 @@ +'use strict'; + +exports.__esModule = true; + +const { getScope } = require('./contextCompat'); + +/** @type {import('./declaredScope').default} */ +exports.default = function declaredScope(context, name, node) { + const references = (node ? getScope(context, node) : context.getScope()).references; + const reference = references.find((x) => x.identifier.name === name); + if (!reference || !reference.resolved) { return undefined; } + return reference.resolved.scope.type; +}; diff --git a/node_modules/eslint-module-utils/hash.d.ts b/node_modules/eslint-module-utils/hash.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e4cf471bd2e3c13d426ceb6557301e2f40da6b0 --- /dev/null +++ b/node_modules/eslint-module-utils/hash.d.ts @@ -0,0 +1,14 @@ +import type { Hash } from 'crypto'; + +declare function hashArray(value: Array, hash?: Hash): Hash; + +declare function hashObject(value: T, hash?: Hash): Hash; + +declare function hashify( + value: Array | object | unknown, + hash?: Hash, +): Hash; + +export default hashify; + +export { hashArray, hashObject }; diff --git a/node_modules/eslint-module-utils/hash.js b/node_modules/eslint-module-utils/hash.js new file mode 100644 index 0000000000000000000000000000000000000000..21ed524a9f8483170da34fdedde9d484fd4a571e --- /dev/null +++ b/node_modules/eslint-module-utils/hash.js @@ -0,0 +1,66 @@ +/** + * utilities for hashing config objects. + * basically iteratively updates hash with a JSON-like format + */ + +'use strict'; + +exports.__esModule = true; + +const createHash = require('crypto').createHash; + +const stringify = JSON.stringify; + +/** @type {import('./hash').default} */ +function hashify(value, hash) { + if (!hash) { hash = createHash('sha256'); } + + if (Array.isArray(value)) { + hashArray(value, hash); + } else if (typeof value === 'function') { + hash.update(String(value)); + } else if (value instanceof Object) { + hashObject(value, hash); + } else { + hash.update(stringify(value) || 'undefined'); + } + + return hash; +} +exports.default = hashify; + +/** @type {import('./hash').hashArray} */ +function hashArray(array, hash) { + if (!hash) { hash = createHash('sha256'); } + + hash.update('['); + for (let i = 0; i < array.length; i++) { + hashify(array[i], hash); + hash.update(','); + } + hash.update(']'); + + return hash; +} +hashify.array = hashArray; +exports.hashArray = hashArray; + +/** @type {import('./hash').hashObject} */ +function hashObject(object, optionalHash) { + const hash = optionalHash || createHash('sha256'); + + hash.update('{'); + Object.keys(object).sort().forEach((key) => { + hash.update(stringify(key)); + hash.update(':'); + // @ts-expect-error the key is guaranteed to exist on the object here + hashify(object[key], hash); + hash.update(','); + }); + hash.update('}'); + + return hash; +} +hashify.object = hashObject; +exports.hashObject = hashObject; + diff --git a/node_modules/eslint-module-utils/ignore.d.ts b/node_modules/eslint-module-utils/ignore.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..53953b33e9cb4ab10f0ea995f351fb31d7146222 --- /dev/null +++ b/node_modules/eslint-module-utils/ignore.d.ts @@ -0,0 +1,12 @@ +import { Rule } from 'eslint'; +import type { ESLintSettings, Extension } from './types'; + +declare function ignore(path: string, context: Rule.RuleContext): boolean; + +declare function getFileExtensions(settings: ESLintSettings): Set; + +declare function hasValidExtension(path: string, context: Rule.RuleContext): path is `${string}${Extension}`; + +export default ignore; + +export { getFileExtensions, hasValidExtension } diff --git a/node_modules/eslint-module-utils/ignore.js b/node_modules/eslint-module-utils/ignore.js new file mode 100644 index 0000000000000000000000000000000000000000..a42d4ceb1f16d2ee13e07b8ef70c1e2131b7b295 --- /dev/null +++ b/node_modules/eslint-module-utils/ignore.js @@ -0,0 +1,73 @@ +'use strict'; + +exports.__esModule = true; + +const extname = require('path').extname; + +const log = require('debug')('eslint-plugin-import:utils:ignore'); + +// one-shot memoized +/** @type {Set} */ let cachedSet; +/** @type {import('./types').ESLintSettings} */ let lastSettings; + +/** @type {import('./ignore').getFileExtensions} */ +function makeValidExtensionSet(settings) { + // start with explicit JS-parsed extensions + /** @type {Set} */ + const exts = new Set(settings['import/extensions'] || ['.js', '.mjs', '.cjs']); + + // all alternate parser extensions are also valid + if ('import/parsers' in settings) { + for (const parser in settings['import/parsers']) { + const parserSettings = settings['import/parsers'][parser]; + if (!Array.isArray(parserSettings)) { + throw new TypeError('"settings" for ' + parser + ' must be an array'); + } + parserSettings.forEach((ext) => exts.add(ext)); + } + } + + return exts; +} +exports.getFileExtensions = makeValidExtensionSet; + +/** @type {(context: import('eslint').Rule.RuleContext) => Set} */ +function validExtensions(context) { + if (cachedSet && context.settings === lastSettings) { + return cachedSet; + } + + lastSettings = context.settings; + cachedSet = makeValidExtensionSet(context.settings); + return cachedSet; +} + +/** @type {import('./ignore').hasValidExtension} */ +function hasValidExtension(path, context) { + // eslint-disable-next-line no-extra-parens + return validExtensions(context).has(/** @type {import('./types').Extension} */ (extname(path))); +} +exports.hasValidExtension = hasValidExtension; + +/** @type {import('./ignore').default} */ +exports.default = function ignore(path, context) { + // check extension whitelist first (cheap) + if (!hasValidExtension(path, context)) { + return true; + } + + if (!('import/ignore' in context.settings)) { + return false; + } + const ignoreStrings = context.settings['import/ignore']; + + for (let i = 0; i < ignoreStrings.length; i++) { + const regex = new RegExp(ignoreStrings[i]); + if (regex.test(path)) { + log(`ignoring ${path}, matched pattern /${ignoreStrings[i]}/`); + return true; + } + } + + return false; +}; diff --git a/node_modules/eslint-module-utils/module-require.d.ts b/node_modules/eslint-module-utils/module-require.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..91df90d616eceb92bf29970d92ed99d4ad6748df --- /dev/null +++ b/node_modules/eslint-module-utils/module-require.d.ts @@ -0,0 +1,3 @@ +declare function moduleRequire(p: string): T; + +export default moduleRequire; diff --git a/node_modules/eslint-module-utils/module-require.js b/node_modules/eslint-module-utils/module-require.js new file mode 100644 index 0000000000000000000000000000000000000000..14006c5dc62b61909d1a3c57ba662a154c6694fc --- /dev/null +++ b/node_modules/eslint-module-utils/module-require.js @@ -0,0 +1,36 @@ +'use strict'; + +exports.__esModule = true; + +const Module = require('module'); +const path = require('path'); + +// borrowed from babel-eslint +/** @type {(filename: string) => Module} */ +function createModule(filename) { + const mod = new Module(filename); + mod.filename = filename; + // @ts-expect-error _nodeModulesPaths are undocumented + mod.paths = Module._nodeModulePaths(path.dirname(filename)); + return mod; +} + +/** @type {import('./module-require').default} */ +exports.default = function moduleRequire(p) { + try { + // attempt to get espree relative to eslint + const eslintPath = require.resolve('eslint'); + const eslintModule = createModule(eslintPath); + // @ts-expect-error _resolveFilename is undocumented + return require(Module._resolveFilename(p, eslintModule)); + } catch (err) { /* ignore */ } + + try { + // try relative to entry point + // @ts-expect-error TODO: figure out what this is + return require.main.require(p); + } catch (err) { /* ignore */ } + + // finally, try from here + return require(p); +}; diff --git a/node_modules/eslint-module-utils/moduleVisitor.d.ts b/node_modules/eslint-module-utils/moduleVisitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f30186d7178d38b7fca7a30ca5e90aa9c741122 --- /dev/null +++ b/node_modules/eslint-module-utils/moduleVisitor.d.ts @@ -0,0 +1,26 @@ +import type { Rule } from 'eslint'; +import type { Node } from 'estree'; + +type Visitor = (source: Node, importer: unknown) => any; + +type Options = { + amd?: boolean; + commonjs?: boolean; + esmodule?: boolean; + ignore?: string[]; +}; + +declare function moduleVisitor( + visitor: Visitor, + options?: Options, +): object; + +export default moduleVisitor; + +export type Schema = NonNullable; + +declare function makeOptionsSchema(additionalProperties?: Partial): Schema + +declare const optionsSchema: Schema; + +export { makeOptionsSchema, optionsSchema }; diff --git a/node_modules/eslint-module-utils/moduleVisitor.js b/node_modules/eslint-module-utils/moduleVisitor.js new file mode 100644 index 0000000000000000000000000000000000000000..acdee6774f1aa0416a3663c663b20f68e58b3834 --- /dev/null +++ b/node_modules/eslint-module-utils/moduleVisitor.js @@ -0,0 +1,164 @@ +'use strict'; + +exports.__esModule = true; + +/** @typedef {import('estree').Node} Node */ +/** @typedef {{ arguments: import('estree').CallExpression['arguments'], callee: Node }} Call */ +/** @typedef {import('estree').ImportDeclaration | import('estree').ExportNamedDeclaration | import('estree').ExportAllDeclaration} Declaration */ + +/** + * Returns an object of node visitors that will call + * 'visitor' with every discovered module path. + * + * @type {(import('./moduleVisitor').default)} + */ +exports.default = function visitModules(visitor, options) { + const ignore = options && options.ignore; + const amd = !!(options && options.amd); + const commonjs = !!(options && options.commonjs); + // if esmodule is not explicitly disabled, it is assumed to be enabled + const esmodule = !!Object.assign({ esmodule: true }, options).esmodule; + + const ignoreRegExps = ignore == null ? [] : ignore.map((p) => new RegExp(p)); + + /** @type {(source: undefined | null | import('estree').Literal, importer: Parameters[1]) => void} */ + function checkSourceValue(source, importer) { + if (source == null) { return; } //? + + // handle ignore + if (ignoreRegExps.some((re) => re.test(String(source.value)))) { return; } + + // fire visitor + visitor(source, importer); + } + + // for import-y declarations + /** @type {(node: Declaration) => void} */ + function checkSource(node) { + checkSourceValue(node.source, node); + } + + // for esmodule dynamic `import()` calls + /** @type {(node: import('estree').ImportExpression | import('estree').CallExpression) => void} */ + function checkImportCall(node) { + /** @type {import('estree').Expression | import('estree').Literal | import('estree').CallExpression['arguments'][0]} */ + let modulePath; + // refs https://github.com/estree/estree/blob/HEAD/es2020.md#importexpression + if (node.type === 'ImportExpression') { + modulePath = node.source; + } else if (node.type === 'CallExpression') { + // @ts-expect-error this structure is from an older version of eslint + if (node.callee.type !== 'Import') { return; } + if (node.arguments.length !== 1) { return; } + + modulePath = node.arguments[0]; + } else { + throw new TypeError('this should be unreachable'); + } + + if (modulePath.type !== 'Literal') { return; } + if (typeof modulePath.value !== 'string') { return; } + + checkSourceValue(modulePath, node); + } + + // for CommonJS `require` calls + // adapted from @mctep: https://git.io/v4rAu + /** @type {(call: Call) => void} */ + function checkCommon(call) { + if (call.callee.type !== 'Identifier') { return; } + if (call.callee.name !== 'require') { return; } + if (call.arguments.length !== 1) { return; } + + const modulePath = call.arguments[0]; + if (modulePath.type !== 'Literal') { return; } + if (typeof modulePath.value !== 'string') { return; } + + checkSourceValue(modulePath, call); + } + + /** @type {(call: Call) => void} */ + function checkAMD(call) { + if (call.callee.type !== 'Identifier') { return; } + if (call.callee.name !== 'require' && call.callee.name !== 'define') { return; } + if (call.arguments.length !== 2) { return; } + + const modules = call.arguments[0]; + if (modules.type !== 'ArrayExpression') { return; } + + for (const element of modules.elements) { + if (!element) { continue; } + if (element.type !== 'Literal') { continue; } + if (typeof element.value !== 'string') { continue; } + + if ( + element.value === 'require' + || element.value === 'exports' + ) { + continue; // magic modules: https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#magic-modules + } + + checkSourceValue(element, element); + } + } + + const visitors = {}; + if (esmodule) { + Object.assign(visitors, { + ImportDeclaration: checkSource, + ExportNamedDeclaration: checkSource, + ExportAllDeclaration: checkSource, + CallExpression: checkImportCall, + ImportExpression: checkImportCall, + }); + } + + if (commonjs || amd) { + const currentCallExpression = visitors.CallExpression; + visitors.CallExpression = /** @type {(call: Call) => void} */ function (call) { + if (currentCallExpression) { currentCallExpression(call); } + if (commonjs) { checkCommon(call); } + if (amd) { checkAMD(call); } + }; + } + + return visitors; +}; + +/** + * make an options schema for the module visitor, optionally adding extra fields. + * @type {import('./moduleVisitor').makeOptionsSchema} + */ +function makeOptionsSchema(additionalProperties) { + /** @type {import('./moduleVisitor').Schema} */ + const base = { + type: 'object', + properties: { + commonjs: { type: 'boolean' }, + amd: { type: 'boolean' }, + esmodule: { type: 'boolean' }, + ignore: { + type: 'array', + minItems: 1, + items: { type: 'string' }, + uniqueItems: true, + }, + }, + additionalProperties: false, + }; + + if (additionalProperties) { + for (const key in additionalProperties) { + // @ts-expect-error TS always has trouble with arbitrary object assignment/mutation + base.properties[key] = additionalProperties[key]; + } + } + + return base; +} +exports.makeOptionsSchema = makeOptionsSchema; + +/** + * json schema object for options parameter. can be used to build rule options schema object. + */ +exports.optionsSchema = makeOptionsSchema(); diff --git a/node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md b/node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..820d21e3322b9d2778786ea743dd5e818991d595 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md @@ -0,0 +1,395 @@ + +3.1.0 / 2017-09-26 +================== + + * Add `DEBUG_HIDE_DATE` env var (#486) + * Remove ReDoS regexp in %o formatter (#504) + * Remove "component" from package.json + * Remove `component.json` + * Ignore package-lock.json + * Examples: fix colors printout + * Fix: browser detection + * Fix: spelling mistake (#496, @EdwardBetts) + +3.0.1 / 2017-08-24 +================== + + * Fix: Disable colors in Edge and Internet Explorer (#489) + +3.0.0 / 2017-08-08 +================== + + * Breaking: Remove DEBUG_FD (#406) + * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) + * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) + * Addition: document `enabled` flag (#465) + * Addition: add 256 colors mode (#481) + * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) + * Update: component: update "ms" to v2.0.0 + * Update: separate the Node and Browser tests in Travis-CI + * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots + * Update: separate Node.js and web browser examples for organization + * Update: update "browserify" to v14.4.0 + * Fix: fix Readme typo (#473) + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/eslint-module-utils/node_modules/debug/LICENSE b/node_modules/eslint-module-utils/node_modules/debug/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..658c933d28255e8c716899789e8c0f846e5dc125 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +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/node_modules/eslint-module-utils/node_modules/debug/README.md b/node_modules/eslint-module-utils/node_modules/debug/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0ee7634ddd0a4a6337fe7677e99ba78cd626fa07 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/README.md @@ -0,0 +1,437 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> + +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/node_modules/eslint-module-utils/node_modules/debug/node.js b/node_modules/eslint-module-utils/node_modules/debug/node.js new file mode 100644 index 0000000000000000000000000000000000000000..7fc36fe6dbecbfd41530c5a490cc738ec2968653 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/eslint-module-utils/node_modules/debug/package.json b/node_modules/eslint-module-utils/node_modules/debug/package.json new file mode 100644 index 0000000000000000000000000000000000000000..191c8154787cb9f8662967d4c4f8f9f3467a2bbf --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/package.json @@ -0,0 +1,51 @@ +{ + "name": "debug", + "version": "3.2.7", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "node.js", + "dist/debug.js", + "LICENSE", + "README.md" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + }, + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "browserify": "14.4.0", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.0.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "xo": "^0.23.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "unpkg": "./dist/debug.js" +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/browser.js b/node_modules/eslint-module-utils/node_modules/debug/src/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..c924b0ac4d4882e4a72a116436ed17a487c2fc05 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/browser.js @@ -0,0 +1,180 @@ +"use strict"; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +/** + * Colors. + */ + +exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ +// eslint-disable-next-line complexity + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } // Internet Explorer and Edge do not support colors. + + + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + + + return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); +} +/** + * Colorize log arguments if enabled. + * + * @api public + */ + + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if (match === '%%') { + return; + } + + index++; + + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + args.splice(lastC, 0, c); +} +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + +function log() { + var _console; + + // This hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + var r; + + try { + r = exports.storage.getItem('debug'); + } catch (error) {} // Swallow + // XXX (@Qix-) should we be logging these? + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + + + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); +var formatters = module.exports.formatters; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; + diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/common.js b/node_modules/eslint-module-utils/node_modules/debug/src/common.js new file mode 100644 index 0000000000000000000000000000000000000000..e0de3fb530f1c2ea33c4c65bcfd39b98a53600d7 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/common.js @@ -0,0 +1,249 @@ +"use strict"; + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + Object.keys(env).forEach(function (key) { + createDebug[key] = env[key]; + }); + /** + * Active `debug` instances. + */ + + createDebug.instances = []; + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + + createDebug.formatters = {}; + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + + function selectColor(namespace) { + var hash = 0; + + for (var i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + + createDebug.selectColor = selectColor; + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function createDebug(namespace) { + var prevTime; + + function debug() { + // Disabled? + if (!debug.enabled) { + return; + } + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var self = debug; // Set `diff` timestamp + + var curr = Number(new Date()); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } // Apply any `formatters` transformations + + + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return match; + } + + index++; + var formatter = createDebug.formatters[format]; + + if (typeof formatter === 'function') { + var val = args[index]; + match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; + } + + return match; + }); // Apply env-specific formatting (colors, etc.) + + createDebug.formatArgs.call(self, args); + var logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = createDebug.enabled(namespace); + debug.useColors = createDebug.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + debug.extend = extend; // Debug.formatArgs = formatArgs; + // debug.rawLog = rawLog; + // env-specific initialization logic for debug instances + + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + createDebug.instances.push(debug); + return debug; + } + + function destroy() { + var index = createDebug.instances.indexOf(this); + + if (index !== -1) { + createDebug.instances.splice(index, 1); + return true; + } + + return false; + } + + function extend(namespace, delimiter) { + return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.names = []; + createDebug.skips = []; + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < createDebug.instances.length; i++) { + var instance = createDebug.instances[i]; + instance.enabled = createDebug.enabled(instance.namespace); + } + } + /** + * Disable debug output. + * + * @api public + */ + + + function disable() { + createDebug.enable(''); + } + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + var i; + var len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + + return val; + } + + createDebug.enable(createDebug.load()); + return createDebug; +} + +module.exports = setup; + diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/index.js b/node_modules/eslint-module-utils/node_modules/debug/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..021731593ac517b224bddda8c450bac52889843a --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/index.js @@ -0,0 +1,12 @@ +"use strict"; + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} + diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/node.js b/node_modules/eslint-module-utils/node_modules/debug/src/node.js new file mode 100644 index 0000000000000000000000000000000000000000..1e6a5f16aecdd38a2bfb607f3d82e299f7624f9a --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/node.js @@ -0,0 +1,177 @@ +"use strict"; + +/** + * Module dependencies. + */ +var tty = require('tty'); + +var util = require('util'); +/** + * This is the Node.js implementation of `debug()`. + */ + + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + var supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221]; + } +} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be. + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // Camel-case + var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { + return k.toUpperCase(); + }); // Coerce string value into JS value + + var val = process.env[key]; + + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); +} +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + +function formatArgs(args) { + var name = this.namespace, + useColors = this.useColors; + + if (useColors) { + var c = this.color; + var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c); + var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m"); + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + + return new Date().toISOString() + ' '; +} +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + + +function log() { + return process.stderr.write(util.format.apply(util, arguments) + '\n'); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + return process.env.DEBUG; +} +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + +function init(debug) { + debug.inspectOpts = {}; + var keys = Object.keys(exports.inspectOpts); + + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); +var formatters = module.exports.formatters; +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(function (str) { return str.trim(); }) + .join(' '); +}; +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + diff --git a/node_modules/eslint-module-utils/package.json b/node_modules/eslint-module-utils/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8cbbf84d3c66c03a535b40c78ab043f841d620c1 --- /dev/null +++ b/node_modules/eslint-module-utils/package.json @@ -0,0 +1,83 @@ +{ + "name": "eslint-module-utils", + "version": "2.12.1", + "description": "Core utilities to support eslint-plugin-import and other module-related plugins.", + "engines": { + "node": ">=4" + }, + "main": false, + "exports": { + "./contextCompat": "./contextCompat.js", + "./ModuleCache": "./ModuleCache.js", + "./ModuleCache.js": "./ModuleCache.js", + "./declaredScope": "./declaredScope.js", + "./declaredScope.js": "./declaredScope.js", + "./hash": "./hash.js", + "./hash.js": "./hash.js", + "./ignore": "./ignore.js", + "./ignore.js": "./ignore.js", + "./module-require": "./module-require.js", + "./module-require.js": "./module-require.js", + "./moduleVisitor": "./moduleVisitor.js", + "./moduleVisitor.js": "./moduleVisitor.js", + "./parse": "./parse.js", + "./parse.js": "./parse.js", + "./pkgDir": "./pkgDir.js", + "./pkgDir.js": "./pkgDir.js", + "./pkgUp": "./pkgUp.js", + "./pkgUp.js": "./pkgUp.js", + "./readPkgUp": "./readPkgUp.js", + "./readPkgUp.js": "./readPkgUp.js", + "./resolve": "./resolve.js", + "./resolve.js": "./resolve.js", + "./unambiguous": "./unambiguous.js", + "./unambiguous.js": "./unambiguous.js", + "./visit": "./visit.js", + "./visit.js": "./visit.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepublishOnly": "cp ../{LICENSE,.npmrc} ./", + "tsc": "tsc -p .", + "posttsc": "attw -P .", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/import-js/eslint-plugin-import.git", + "directory": "utils" + }, + "keywords": [ + "eslint-plugin-import", + "eslint", + "modules", + "esmodules" + ], + "author": "Ben Mosher ", + "license": "MIT", + "bugs": { + "url": "https://github.com/import-js/eslint-plugin-import/issues" + }, + "homepage": "https://github.com/import-js/eslint-plugin-import#readme", + "dependencies": { + "debug": "^3.2.7" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.2", + "@ljharb/tsconfig": "^0.3.2", + "@types/debug": "^4.1.12", + "@types/eslint": "^8.56.3", + "@types/node": "^20.19.1", + "typescript": "next" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + }, + "publishConfig": { + "ignore": [ + ".attw.json" + ] + } +} diff --git a/node_modules/eslint-module-utils/parse.d.ts b/node_modules/eslint-module-utils/parse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f92ab3edc6067ea6055e26d18caa774f2aa74da5 --- /dev/null +++ b/node_modules/eslint-module-utils/parse.d.ts @@ -0,0 +1,11 @@ +import { AST, Rule } from 'eslint'; + + + +declare function parse( + path: string, + content: string, + context: Rule.RuleContext +): AST.Program | null | undefined; + +export default parse; diff --git a/node_modules/eslint-module-utils/parse.js b/node_modules/eslint-module-utils/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..fb0fba7b9304d5f262f4dd36c5d6218cdd95347d --- /dev/null +++ b/node_modules/eslint-module-utils/parse.js @@ -0,0 +1,193 @@ +'use strict'; + +exports.__esModule = true; + +/** @typedef {`.${string}`} Extension */ +/** @typedef {NonNullable & { 'import/extensions'?: Extension[], 'import/parsers'?: { [k: string]: Extension[] }, 'import/cache'?: { lifetime: number | '∞' | 'Infinity' } }} ESLintSettings */ + +const moduleRequire = require('./module-require').default; +const extname = require('path').extname; +const fs = require('fs'); + +const log = require('debug')('eslint-plugin-import:parse'); + +/** @type {(parserPath: NonNullable) => unknown} */ +function getBabelEslintVisitorKeys(parserPath) { + if (parserPath.endsWith('index.js')) { + const hypotheticalLocation = parserPath.replace('index.js', 'visitor-keys.js'); + if (fs.existsSync(hypotheticalLocation)) { + const keys = moduleRequire(hypotheticalLocation); + return keys.default || keys; + } + } + return null; +} + +/** @type {(parserPath: import('eslint').Rule.RuleContext['parserPath'], parserInstance: { VisitorKeys: unknown }, parsedResult?: { visitorKeys?: unknown }) => unknown} */ +function keysFromParser(parserPath, parserInstance, parsedResult) { + // Exposed by @typescript-eslint/parser and @babel/eslint-parser + if (parsedResult && parsedResult.visitorKeys) { + return parsedResult.visitorKeys; + } + // The old babel parser doesn't have a `parseForESLint` eslint function, so we don't end + // up with a `parsedResult` here. It also doesn't expose the visitor keys on the parser itself, + // so we have to try and infer the visitor-keys module from the parserPath. + // This is NOT supported in flat config! + if (typeof parserPath === 'string' && parserPath.indexOf('babel-eslint') > -1) { + return getBabelEslintVisitorKeys(parserPath); + } + // The espree parser doesn't have the `parseForESLint` function, so we don't end up with a + // `parsedResult` here, but it does expose the visitor keys on the parser instance that we can use. + if (parserInstance && parserInstance.VisitorKeys) { + return parserInstance.VisitorKeys; + } + return null; +} + +// this exists to smooth over the unintentional breaking change in v2.7. +// TODO, semver-major: avoid mutating `ast` and return a plain object instead. +/** @type {(ast: T, visitorKeys: unknown) => T} */ +function makeParseReturn(ast, visitorKeys) { + if (ast) { + // @ts-expect-error see TODO + ast.visitorKeys = visitorKeys; + // @ts-expect-error see TODO + ast.ast = ast; + } + return ast; +} + +/** @type {(text: string) => string} */ +function stripUnicodeBOM(text) { + return text.charCodeAt(0) === 0xFEFF ? text.slice(1) : text; +} + +/** @type {(text: string) => string} */ +function transformHashbang(text) { + return text.replace(/^#!([^\r\n]+)/u, (_, captured) => `//${captured}`); +} + +/** @type {(path: string, context: import('eslint').Rule.RuleContext & { settings?: ESLintSettings }) => import('eslint').Rule.RuleContext['parserPath']} */ +function getParserPath(path, context) { + const parsers = context.settings['import/parsers']; + if (parsers != null) { + // eslint-disable-next-line no-extra-parens + const extension = /** @type {Extension} */ (extname(path)); + for (const parserPath in parsers) { + if (parsers[parserPath].indexOf(extension) > -1) { + // use this alternate parser + log('using alt parser:', parserPath); + return parserPath; + } + } + } + // default to use ESLint parser + return context.parserPath; +} + +/** @type {(path: string, context: import('eslint').Rule.RuleContext) => string | null | import('eslint').Linter.ParserModule | import('eslint').Linter.FlatConfigParserModule} */ +function getParser(path, context) { + const parserPath = getParserPath(path, context); + if (parserPath) { + return parserPath; + } + if ( + !!context.languageOptions + && !!context.languageOptions.parser + && typeof context.languageOptions.parser !== 'string' + && ( + // @ts-expect-error TODO: figure out a better type + typeof context.languageOptions.parser.parse === 'function' + // @ts-expect-error TODO: figure out a better type + || typeof context.languageOptions.parser.parseForESLint === 'function' + ) + ) { + return context.languageOptions.parser; + } + + return null; +} + +/** @type {import('./parse').default} */ +exports.default = function parse(path, content, context) { + if (context == null) { throw new Error('need context to parse properly'); } + + // ESLint in "flat" mode only sets context.languageOptions.parserOptions + const languageOptions = context.languageOptions; + let parserOptions = languageOptions && languageOptions.parserOptions || context.parserOptions; + const parserOrPath = getParser(path, context); + + if (!parserOrPath) { throw new Error('parserPath or languageOptions.parser is required!'); } + + // hack: espree blows up with frozen options + parserOptions = Object.assign({}, parserOptions); + parserOptions.ecmaFeatures = Object.assign({}, parserOptions.ecmaFeatures); + + // always include comments and tokens (for doc parsing) + parserOptions.comment = true; + parserOptions.attachComment = true; // keeping this for backward-compat with older parsers + parserOptions.tokens = true; + + // attach node locations + parserOptions.loc = true; + parserOptions.range = true; + + // provide the `filePath` like eslint itself does, in `parserOptions` + // https://github.com/eslint/eslint/blob/3ec436ee/lib/linter.js#L637 + parserOptions.filePath = path; + + // @typescript-eslint/parser will parse the entire project with typechecking if you provide + // "project" or "projects" in parserOptions. Removing these options means the parser will + // only parse one file in isolate mode, which is much, much faster. + // https://github.com/import-js/eslint-plugin-import/issues/1408#issuecomment-509298962 + delete parserOptions.EXPERIMENTAL_useProjectService; + delete parserOptions.projectService; + delete parserOptions.project; + delete parserOptions.projects; + + // If this is a flat config, we need to add ecmaVersion and sourceType (if present) from languageOptions + if (languageOptions && languageOptions.ecmaVersion) { + parserOptions.ecmaVersion = languageOptions.ecmaVersion; + } + if (languageOptions && languageOptions.sourceType) { + // @ts-expect-error languageOptions is from the flatConfig Linter type in 8.57 while parserOptions is not. + // Non-flat config parserOptions.sourceType doesn't have "commonjs" in the type. Once upgraded to v9 types, + // they'll be the same and this expect-error should be removed. + parserOptions.sourceType = languageOptions.sourceType; + } + + // require the parser relative to the main module (i.e., ESLint) + const parser = typeof parserOrPath === 'string' ? moduleRequire(parserOrPath) : parserOrPath; + + // replicate bom strip and hashbang transform of ESLint + // https://github.com/eslint/eslint/blob/b93af98b3c417225a027cabc964c38e779adb945/lib/linter/linter.js#L779 + content = transformHashbang(stripUnicodeBOM(String(content))); + + if (typeof parser.parseForESLint === 'function') { + let ast; + try { + const parserRaw = parser.parseForESLint(content, parserOptions); + ast = parserRaw.ast; + // @ts-expect-error TODO: FIXME + return makeParseReturn(ast, keysFromParser(parserOrPath, parser, parserRaw)); + } catch (e) { + console.warn(); + console.warn('Error while parsing ' + parserOptions.filePath); + // @ts-expect-error e is almost certainly an Error here + console.warn('Line ' + e.lineNumber + ', column ' + e.column + ': ' + e.message); + } + if (!ast || typeof ast !== 'object') { + console.warn( + // Can only be invalid for custom parser per imports/parser + '`parseForESLint` from parser `' + (typeof parserOrPath === 'string' ? parserOrPath : 'context.languageOptions.parser') + '` is invalid and will just be ignored' + ); + } else { + // @ts-expect-error TODO: FIXME + return makeParseReturn(ast, keysFromParser(parserOrPath, parser, undefined)); + } + } + + const ast = parser.parse(content, parserOptions); + // @ts-expect-error TODO: FIXME + return makeParseReturn(ast, keysFromParser(parserOrPath, parser, undefined)); +}; diff --git a/node_modules/eslint-module-utils/pkgDir.d.ts b/node_modules/eslint-module-utils/pkgDir.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af01e2e9bfb5622b8b2b3e74d39983667865a026 --- /dev/null +++ b/node_modules/eslint-module-utils/pkgDir.d.ts @@ -0,0 +1,3 @@ +declare function pkgDir(cwd: string): string | null; + +export default pkgDir; diff --git a/node_modules/eslint-module-utils/pkgDir.js b/node_modules/eslint-module-utils/pkgDir.js new file mode 100644 index 0000000000000000000000000000000000000000..84c334680a4d73b29ff6fd393d9807006a9e34f5 --- /dev/null +++ b/node_modules/eslint-module-utils/pkgDir.js @@ -0,0 +1,12 @@ +'use strict'; + +const path = require('path'); +const pkgUp = require('./pkgUp').default; + +exports.__esModule = true; + +/** @type {import('./pkgDir').default} */ +exports.default = function (cwd) { + const fp = pkgUp({ cwd }); + return fp ? path.dirname(fp) : null; +}; diff --git a/node_modules/eslint-module-utils/pkgUp.d.ts b/node_modules/eslint-module-utils/pkgUp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6382457bec4b48d811b722fea05720990f572476 --- /dev/null +++ b/node_modules/eslint-module-utils/pkgUp.d.ts @@ -0,0 +1,3 @@ +declare function pkgUp(opts?: { cwd?: string }): string | null; + +export default pkgUp; diff --git a/node_modules/eslint-module-utils/pkgUp.js b/node_modules/eslint-module-utils/pkgUp.js new file mode 100644 index 0000000000000000000000000000000000000000..076e59fd761ed81ac35c236e48924ef80659a91b --- /dev/null +++ b/node_modules/eslint-module-utils/pkgUp.js @@ -0,0 +1,61 @@ +'use strict'; + +exports.__esModule = true; + +const fs = require('fs'); +const path = require('path'); + +/** + * Derived significantly from package find-up@2.0.0. See license below. + * + * @copyright Sindre Sorhus + * MIT License + * + * Copyright (c) Sindre Sorhus (https://sindresorhus.com) + * + * 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. + */ + +/** @type {(filename: string | string[], cwd?: string) => string | null} */ +function findUp(filename, cwd) { + let dir = path.resolve(cwd || ''); + const root = path.parse(dir).root; + + /** @type {string[]} */ // @ts-expect-error TS sucks with concat + const filenames = [].concat(filename); + + // eslint-disable-next-line no-constant-condition + while (true) { + const file = filenames.find((el) => fs.existsSync(path.resolve(dir, el))); + + if (file) { + return path.join(dir, file); + } + if (dir === root) { + return null; + } + + dir = path.dirname(dir); + } +} + +/** @type {import('./pkgUp').default} */ +exports.default = function pkgUp(opts) { + return findUp('package.json', opts && opts.cwd); +}; diff --git a/node_modules/eslint-module-utils/readPkgUp.d.ts b/node_modules/eslint-module-utils/readPkgUp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5fc1668879e85973b448819fb4acfaca4b1eca22 --- /dev/null +++ b/node_modules/eslint-module-utils/readPkgUp.d.ts @@ -0,0 +1,5 @@ +import pkgUp from './pkgUp'; + +declare function readPkgUp(opts?: Parameters[0]): {} | { pkg: string, path: string }; + +export default readPkgUp; diff --git a/node_modules/eslint-module-utils/readPkgUp.js b/node_modules/eslint-module-utils/readPkgUp.js new file mode 100644 index 0000000000000000000000000000000000000000..08371931f2a6c76fa9b0996db4af8e0aa22c305b --- /dev/null +++ b/node_modules/eslint-module-utils/readPkgUp.js @@ -0,0 +1,55 @@ +'use strict'; + +exports.__esModule = true; + +const fs = require('fs'); +const pkgUp = require('./pkgUp').default; + +/** @type {(str: string) => string} */ +function stripBOM(str) { + return str.replace(/^\uFEFF/, ''); +} + +/** + * Derived significantly from read-pkg-up@2.0.0. See license below. + * + * @copyright Sindre Sorhus + * MIT License + * + * Copyright (c) Sindre Sorhus (https://sindresorhus.com) + * + * 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. + */ +/** @type {import('./readPkgUp').default} */ +exports.default = function readPkgUp(opts) { + const fp = pkgUp(opts); + + if (!fp) { + return {}; + } + + try { + return { + pkg: JSON.parse(stripBOM(fs.readFileSync(fp, { encoding: 'utf-8' }))), + path: fp, + }; + } catch (e) { + return {}; + } +}; diff --git a/node_modules/eslint-module-utils/resolve.d.ts b/node_modules/eslint-module-utils/resolve.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb885bcfaf4d1755095c2f9edc1ef7b549c27728 --- /dev/null +++ b/node_modules/eslint-module-utils/resolve.d.ts @@ -0,0 +1,30 @@ +import type { Rule } from 'eslint'; + +import type ModuleCache from './ModuleCache'; +import type { ESLintSettings } from './types'; + +export type ResultNotFound = { found: false, path?: undefined }; +export type ResultFound = { found: true, path: string | null }; +export type ResolvedResult = ResultNotFound | ResultFound; + +export type ResolverResolve = (modulePath: string, sourceFile:string, config: unknown) => ResolvedResult; +export type ResolverResolveImport = (modulePath: string, sourceFile:string, config: unknown) => string | undefined; +export type Resolver = { interfaceVersion?: 1 | 2, resolve: ResolverResolve, resolveImport: ResolverResolveImport }; + +declare function resolve( + p: string, + context: Rule.RuleContext, +): ResolvedResult['path']; + +export default resolve; + +declare function fileExistsWithCaseSync( + filepath: string | null, + cacheSettings: ESLintSettings, + strict: boolean +): boolean | ReturnType; + +declare function relative(modulePath: string, sourceFile: string, settings: ESLintSettings): ResolvedResult['path']; + + +export { fileExistsWithCaseSync, relative }; diff --git a/node_modules/eslint-module-utils/resolve.js b/node_modules/eslint-module-utils/resolve.js new file mode 100644 index 0000000000000000000000000000000000000000..b332d2ec2cb6383d6478076064448d9233dbc2d2 --- /dev/null +++ b/node_modules/eslint-module-utils/resolve.js @@ -0,0 +1,254 @@ +'use strict'; + +exports.__esModule = true; + +const fs = require('fs'); +const Module = require('module'); +const path = require('path'); +const { getPhysicalFilename } = require('./contextCompat'); + +const hashObject = require('./hash').hashObject; +const ModuleCache = require('./ModuleCache').default; +const pkgDir = require('./pkgDir').default; + +const CASE_SENSITIVE_FS = !fs.existsSync(path.join(__dirname.toUpperCase(), 'reSOLVE.js')); +exports.CASE_SENSITIVE_FS = CASE_SENSITIVE_FS; + +const ERROR_NAME = 'EslintPluginImportResolveError'; + +const fileExistsCache = new ModuleCache(); + +// Polyfill Node's `Module.createRequireFromPath` if not present (added in Node v10.12.0) +// Use `Module.createRequire` if available (added in Node v12.2.0) +const createRequire = Module.createRequire + // @ts-expect-error this only exists in older node + || Module.createRequireFromPath + || /** @type {(filename: string) => unknown} */ function (filename) { + const mod = new Module(filename, void null); + mod.filename = filename; + // @ts-expect-error _nodeModulePaths is undocumented + mod.paths = Module._nodeModulePaths(path.dirname(filename)); + + // @ts-expect-error _compile is undocumented + mod._compile(`module.exports = require;`, filename); + + return mod.exports; + }; + +/** @type {(resolver: object) => resolver is import('./resolve').Resolver} */ +function isResolverValid(resolver) { + if ('interfaceVersion' in resolver && resolver.interfaceVersion === 2) { + return 'resolve' in resolver && !!resolver.resolve && typeof resolver.resolve === 'function'; + } + return 'resolveImport' in resolver && !!resolver.resolveImport && typeof resolver.resolveImport === 'function'; +} + +/** @type {(target: T, sourceFile?: string | null | undefined) => undefined | ReturnType} */ +function tryRequire(target, sourceFile) { + let resolved; + try { + // Check if the target exists + if (sourceFile != null) { + try { + resolved = createRequire(path.resolve(sourceFile)).resolve(target); + } catch (e) { + resolved = require.resolve(target); + } + } else { + resolved = require.resolve(target); + } + } catch (e) { + // If the target does not exist then just return undefined + return undefined; + } + + // If the target exists then return the loaded module + return require(resolved); +} + +/** @type {>(resolvers: string[] | string | { [k: string]: string }, map: T) => T} */ +function resolverReducer(resolvers, map) { + if (Array.isArray(resolvers)) { + resolvers.forEach((r) => resolverReducer(r, map)); + return map; + } + + if (typeof resolvers === 'string') { + map.set(resolvers, null); + return map; + } + + if (typeof resolvers === 'object') { + for (const key in resolvers) { + map.set(key, resolvers[key]); + } + return map; + } + + const err = new Error('invalid resolver config'); + err.name = ERROR_NAME; + throw err; +} + +/** @type {(sourceFile: string) => string} */ +function getBaseDir(sourceFile) { + return pkgDir(sourceFile) || process.cwd(); +} + +/** @type {(name: string, sourceFile: string) => import('./resolve').Resolver} */ +function requireResolver(name, sourceFile) { + // Try to resolve package with conventional name + const resolver = tryRequire(`eslint-import-resolver-${name}`, sourceFile) + || tryRequire(name, sourceFile) + || tryRequire(path.resolve(getBaseDir(sourceFile), name)); + + if (!resolver) { + const err = new Error(`unable to load resolver "${name}".`); + err.name = ERROR_NAME; + throw err; + } + if (!isResolverValid(resolver)) { + const err = new Error(`${name} with invalid interface loaded as resolver`); + err.name = ERROR_NAME; + throw err; + } + + return resolver; +} + +// https://stackoverflow.com/a/27382838 +/** @type {import('./resolve').fileExistsWithCaseSync} */ +exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cacheSettings, strict) { + // don't care if the FS is case-sensitive + if (CASE_SENSITIVE_FS) { return true; } + + // null means it resolved to a builtin + if (filepath === null) { return true; } + if (filepath.toLowerCase() === process.cwd().toLowerCase() && !strict) { return true; } + const parsedPath = path.parse(filepath); + const dir = parsedPath.dir; + + let result = fileExistsCache.get(filepath, cacheSettings); + if (result != null) { return result; } + + // base case + if (dir === '' || parsedPath.root === filepath) { + result = true; + } else { + const filenames = fs.readdirSync(dir); + if (filenames.indexOf(parsedPath.base) === -1) { + result = false; + } else { + result = fileExistsWithCaseSync(dir, cacheSettings, strict); + } + } + fileExistsCache.set(filepath, result); + return result; +}; + +/** @type {import('./types').ESLintSettings | null} */ +let prevSettings = null; +let memoizedHash = ''; +/** @type {(modulePath: string, sourceFile: string, settings: import('./types').ESLintSettings) => import('./resolve').ResolvedResult} */ +function fullResolve(modulePath, sourceFile, settings) { + // check if this is a bonus core module + const coreSet = new Set(settings['import/core-modules']); + if (coreSet.has(modulePath)) { return { found: true, path: null }; } + + const sourceDir = path.dirname(sourceFile); + + if (prevSettings !== settings) { + memoizedHash = hashObject(settings).digest('hex'); + prevSettings = settings; + } + + const cacheKey = sourceDir + memoizedHash + modulePath; + + const cacheSettings = ModuleCache.getSettings(settings); + + const cachedPath = fileExistsCache.get(cacheKey, cacheSettings); + if (cachedPath !== undefined) { return { found: true, path: cachedPath }; } + + /** @type {(resolvedPath: string | null) => void} */ + function cache(resolvedPath) { + fileExistsCache.set(cacheKey, resolvedPath); + } + + /** @type {(resolver: import('./resolve').Resolver, config: unknown) => import('./resolve').ResolvedResult} */ + function withResolver(resolver, config) { + if (resolver.interfaceVersion === 2) { + return resolver.resolve(modulePath, sourceFile, config); + } + + try { + const resolved = resolver.resolveImport(modulePath, sourceFile, config); + if (resolved === undefined) { return { found: false }; } + return { found: true, path: resolved }; + } catch (err) { + return { found: false }; + } + } + + const configResolvers = settings['import/resolver'] + || { node: settings['import/resolve'] }; // backward compatibility + + const resolvers = resolverReducer(configResolvers, new Map()); + + for (const pair of resolvers) { + const name = pair[0]; + const config = pair[1]; + const resolver = requireResolver(name, sourceFile); + const resolved = withResolver(resolver, config); + + if (!resolved.found) { continue; } + + // else, counts + cache(resolved.path); + return resolved; + } + + // failed + // cache(undefined) + return { found: false }; +} + +/** @type {import('./resolve').relative} */ +function relative(modulePath, sourceFile, settings) { + return fullResolve(modulePath, sourceFile, settings).path; +} +exports.relative = relative; + +/** @type {Set} */ +const erroredContexts = new Set(); + +/** + * Given + * @param p - module path + * @param context - ESLint context + * @return - the full module filesystem path; null if package is core; undefined if not found + * @type {import('./resolve').default} + */ +function resolve(p, context) { + try { + return relative(p, getPhysicalFilename(context), context.settings); + } catch (err) { + if (!erroredContexts.has(context)) { + // The `err.stack` string starts with `err.name` followed by colon and `err.message`. + // We're filtering out the default `err.name` because it adds little value to the message. + // @ts-expect-error this might be an Error + let errMessage = err.message; + // @ts-expect-error this might be an Error + if (err.name !== ERROR_NAME && err.stack) { + // @ts-expect-error this might be an Error + errMessage = err.stack.replace(/^Error: /, ''); + } + context.report({ + message: `Resolve error: ${errMessage}`, + loc: { line: 1, column: 0 }, + }); + erroredContexts.add(context); + } + } +} +resolve.relative = relative; +exports.default = resolve; diff --git a/node_modules/eslint-module-utils/tsconfig.json b/node_modules/eslint-module-utils/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..9e6fbc5cc1b2a436810528f817f2b7f58863c9e0 --- /dev/null +++ b/node_modules/eslint-module-utils/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ES2017", + "moduleResolution": "node", + "maxNodeModuleJsDepth": 0, + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/eslint-module-utils/types.d.ts b/node_modules/eslint-module-utils/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e0c4f5749d7622013aed4631dc8564975fd7551a --- /dev/null +++ b/node_modules/eslint-module-utils/types.d.ts @@ -0,0 +1,9 @@ +import type { Rule } from 'eslint'; + +export type Extension = `.${string}`; + +export type ESLintSettings = NonNullable & { + 'import/extensions'?: Extension[]; + 'import/parsers'?: { [k: string]: Extension[] }; + 'import/cache'?: { lifetime: number | '∞' | 'Infinity' }; +}; diff --git a/node_modules/eslint-module-utils/unambiguous.d.ts b/node_modules/eslint-module-utils/unambiguous.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1679224189c017f8c84cec0f2815f8877aff8d66 --- /dev/null +++ b/node_modules/eslint-module-utils/unambiguous.d.ts @@ -0,0 +1,7 @@ +import type { AST } from 'eslint'; + +declare function isModule(ast: AST.Program): boolean; + +declare function test(content: string): boolean; + +export { isModule, test } diff --git a/node_modules/eslint-module-utils/unambiguous.js b/node_modules/eslint-module-utils/unambiguous.js new file mode 100644 index 0000000000000000000000000000000000000000..df7b9be7a53a38ee999d26bb7a36ae4705a0aea2 --- /dev/null +++ b/node_modules/eslint-module-utils/unambiguous.js @@ -0,0 +1,29 @@ +'use strict'; + +exports.__esModule = true; + +const pattern = /(^|[;})])\s*(export|import)((\s+\w)|(\s*[{*=]))|import\(/m; +/** + * detect possible imports/exports without a full parse. + * + * A negative test means that a file is definitely _not_ a module. + * A positive test means it _could_ be. + * + * Not perfect, just a fast way to disqualify large non-ES6 modules and + * avoid a parse. + * @type {import('./unambiguous').test} + */ +exports.test = function isMaybeUnambiguousModule(content) { + return pattern.test(content); +}; + +// future-/Babel-proof at the expense of being a little loose +const unambiguousNodeType = /^(?:(?:Exp|Imp)ort.*Declaration|TSExportAssignment)$/; + +/** + * Given an AST, return true if the AST unambiguously represents a module. + * @type {import('./unambiguous').isModule} + */ +exports.isModule = function isUnambiguousModule(ast) { + return ast.body && ast.body.some((node) => unambiguousNodeType.test(node.type)); +}; diff --git a/node_modules/eslint-module-utils/visit.d.ts b/node_modules/eslint-module-utils/visit.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..50559aaab08aca1379fd91c74a90cb72e158e390 --- /dev/null +++ b/node_modules/eslint-module-utils/visit.d.ts @@ -0,0 +1,9 @@ +import type { Node } from 'estree'; + +declare function visit( + node: Node, + keys: { [k in Node['type']]?: (keyof Node)[] }, + visitorSpec: { [k in Node['type'] | `${Node['type']}:Exit`]?: Function } +): void; + +export default visit; diff --git a/node_modules/eslint-module-utils/visit.js b/node_modules/eslint-module-utils/visit.js new file mode 100644 index 0000000000000000000000000000000000000000..dd0c6248daaaff1526e310b1b440bbe26f5f0cab --- /dev/null +++ b/node_modules/eslint-module-utils/visit.js @@ -0,0 +1,30 @@ +'use strict'; + +exports.__esModule = true; + +/** @type {import('./visit').default} */ +exports.default = function visit(node, keys, visitorSpec) { + if (!node || !keys) { + return; + } + const type = node.type; + const visitor = visitorSpec[type]; + if (typeof visitor === 'function') { + visitor(node); + } + const childFields = keys[type]; + if (!childFields) { + return; + } + childFields.forEach((fieldName) => { + // @ts-expect-error TS sucks with concat + [].concat(node[fieldName]).forEach((item) => { + visit(item, keys, visitorSpec); + }); + }); + + const exit = visitorSpec[`${type}:Exit`]; + if (typeof exit === 'function') { + exit(node); + } +}; diff --git a/node_modules/eslint-plugin-import/CHANGELOG.md b/node_modules/eslint-plugin-import/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..fb12deb24de2ad0599208cbfe4dd103c843733ca --- /dev/null +++ b/node_modules/eslint-plugin-import/CHANGELOG.md @@ -0,0 +1,2083 @@ +# Change Log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](https://semver.org/). +This change log adheres to standards from [Keep a CHANGELOG](https://keepachangelog.com). + +## [Unreleased] + +## [2.32.0] - 2025-06-20 + +### Added +- add [`enforce-node-protocol-usage`] rule and `import/node-version` setting ([#3024], thanks [@GoldStrikeArch] and [@sevenc-nanashi]) +- add TypeScript types ([#3097], thanks [@G-Rath]) +- [`extensions`]: add `pathGroupOverrides to allow enforcement decision overrides based on specifier ([#3105], thanks [@Xunnamius]) +- [`order`]: add `sortTypesGroup` option to allow intragroup sorting of type-only imports ([#3104], thanks [@Xunnamius]) +- [`order`]: add `newlines-between-types` option to control intragroup sorting of type-only imports ([#3127], thanks [@Xunnamius]) +- [`order`]: add `consolidateIslands` option to collapse excess spacing for aesthetically pleasing imports ([#3129], thanks [@Xunnamius]) + +### Fixed +- [`no-unused-modules`]: provide more meaningful error message when no .eslintrc is present ([#3116], thanks [@michaelfaith]) +- configs: added missing name attribute for eslint config inspector ([#3151], thanks [@NishargShah]) +- [`order`]: ensure arcane imports do not cause undefined behavior ([#3128], thanks [@Xunnamius]) +- [`order`]: resolve undefined property access issue when using `named` ordering ([#3166], thanks [@Xunnamius]) +- [`enforce-node-protocol-usage`]: avoid a crash with some TS code ([#3173], thanks [@ljharb]) +- [`order`]: codify invariants from docs into config schema ([#3152], thanks [@Xunnamius]) + +### Changed +- [Docs] [`extensions`], [`order`]: improve documentation ([#3106], thanks [@Xunnamius]) +- [Docs] add flat config guide for using `tseslint.config()` ([#3125], thanks [@lnuvy]) +- [Docs] add missing comma ([#3122], thanks [@RyanGst]) +- [readme] Update flatConfig example to include typescript config ([#3138], thanks [@intellix]) +- [Refactor] [`order`]: remove unnecessary negative check ([#3167], thanks [@JounQin]) +- [Docs] [`no-unused-modules`]: add missing double quote ([#3191], thanks [@albertpastrana]) +- [Docs] `no-restricted-paths`: clarify wording and fix errors ([#3172], thanks [@greim]) + +## [2.31.0] - 2024-10-03 + +### Added +- support eslint v9 ([#2996], thanks [@G-Rath] [@michaelfaith]) +- [`order`]: allow validating named imports ([#3043], thanks [@manuth]) +- [`extensions`]: add the `checkTypeImports` option ([#2817], thanks [@phryneas]) + +### Fixed +- `ExportMap` / flat config: include `languageOptions` in context ([#3052], thanks [@michaelfaith]) +- [`no-named-as-default`]: Allow using an identifier if the export is both a named and a default export ([#3032], thanks [@akwodkiewicz]) +- [`export`]: False positive for exported overloaded functions in TS ([#3065], thanks [@liuxingbaoyu]) +- `exportMap`: export map cache is tainted by unreliable parse results ([#3062], thanks [@michaelfaith]) +- `exportMap`: improve cacheKey when using flat config ([#3072], thanks [@michaelfaith]) +- adjust "is source type module" checks for flat config ([#2996], thanks [@G-Rath]) + +### Changed +- [Docs] [`no-relative-packages`]: fix typo ([#3066], thanks [@joshuaobrien]) +- [Performance] [`no-cycle`]: dont scc for each linted file ([#3068], thanks [@soryy708]) +- [Docs] [`no-cycle`]: add `disableScc` to docs ([#3070], thanks [@soryy708]) +- [Tests] use re-exported `RuleTester` ([#3071], thanks [@G-Rath]) +- [Docs] [`no-restricted-paths`]: fix grammar ([#3073], thanks [@unbeauvoyage]) +- [Tests] [`no-default-export`], [`no-named-export`]: add test case (thanks [@G-Rath]) + +## [2.30.0] - 2024-09-02 + +### Added +- [`dynamic-import-chunkname`]: add `allowEmpty` option to allow empty leading comments ([#2942], thanks [@JiangWeixian]) +- [`dynamic-import-chunkname`]: Allow empty chunk name when webpackMode: 'eager' is set; add suggestions to remove name in eager mode ([#3004], thanks [@amsardesai]) +- [`no-unused-modules`]: Add `ignoreUnusedTypeExports` option ([#3011], thanks [@silverwind]) +- add support for Flat Config ([#3018], thanks [@michaelfaith]) + +### Fixed +- [`no-extraneous-dependencies`]: allow wrong path ([#3012], thanks [@chabb]) +- [`no-cycle`]: use scc algorithm to optimize ([#2998], thanks [@soryy708]) +- [`no-duplicates`]: Removing duplicates breaks in TypeScript ([#3033], thanks [@yesl-kim]) +- [`newline-after-import`]: fix considerComments option when require ([#2952], thanks [@developer-bandi]) +- [`order`]: do not compare first path segment for relative paths ([#2682]) ([#2885], thanks [@mihkeleidast]) + +### Changed +- [Docs] [`no-extraneous-dependencies`]: Make glob pattern description more explicit ([#2944], thanks [@mulztob]) +- [`no-unused-modules`]: add console message to help debug [#2866] +- [Refactor] `ExportMap`: make procedures static instead of monkeypatching exportmap ([#2982], thanks [@soryy708]) +- [Refactor] `ExportMap`: separate ExportMap instance from its builder logic ([#2985], thanks [@soryy708]) +- [Docs] [`order`]: Add a quick note on how unbound imports and --fix ([#2640], thanks [@minervabot]) +- [Tests] appveyor -> GHA (run tests on Windows in both pwsh and WSL + Ubuntu) ([#2987], thanks [@joeyguerra]) +- [actions] migrate OSX tests to GHA ([ljharb#37], thanks [@aks-]) +- [Refactor] `exportMapBuilder`: avoid hoisting ([#2989], thanks [@soryy708]) +- [Refactor] `ExportMap`: extract "builder" logic to separate files ([#2991], thanks [@soryy708]) +- [Docs] [`order`]: update the description of the `pathGroupsExcludedImportTypes` option ([#3036], thanks [@liby]) +- [readme] Clarify how to install the plugin ([#2993], thanks [@jwbth]) + +## [2.29.1] - 2023-12-14 + +### Fixed +- [`no-extraneous-dependencies`]: ignore `export type { ... } from '...'` when `includeTypes` is `false` ([#2919], thanks [@Pandemic1617]) +- [`no-unused-modules`]: support export patterns with array destructuring ([#2930], thanks [@ljharb]) +- [Deps] update `tsconfig-paths` ([#2447], thanks [@domdomegg]) + +## [2.29.0] - 2023-10-22 + +### Added +- TypeScript config: add .cts and .mts extensions ([#2851], thanks [@Zamiell]) +- [`newline-after-import`]: new option `exactCount` and docs update ([#1933], thanks [@anikethsaha] and [@reosarevok]) +- [`newline-after-import`]: fix `exactCount` with `considerComments` false positive, when there is a leading comment ([#2884], thanks [@kinland]) + +## [2.28.1] - 2023-08-18 + +### Fixed +- [`order`]: revert breaking change to single nested group ([#2854], thanks [@yndajas]) + +### Changed +- [Docs] remove duplicate fixable notices in docs ([#2850], thanks [@bmish]) + +## [2.28.0] - 2023-07-27 + +### Fixed +- [`no-duplicates`]: remove duplicate identifiers in duplicate imports ([#2577], thanks [@joe-matsec]) +- [`consistent-type-specifier-style`]: fix accidental removal of comma in certain cases ([#2754], thanks [@bradzacher]) +- [Perf] `ExportMap`: Improve `ExportMap.for` performance on larger codebases ([#2756], thanks [@leipert]) +- [`no-extraneous-dependencies`]/TypeScript: do not error when importing inline type from dev dependencies ([#2735], thanks [@andyogo]) +- [`newline-after-import`]/TypeScript: do not error when re-exporting a namespaced import ([#2832], thanks [@laurens-dg]) +- [`order`]: partial fix for [#2687] (thanks [@ljharb]) +- [`no-duplicates`]: Detect across type and regular imports ([#2835], thanks [@benkrejci]) +- [`extensions`]: handle `.` and `..` properly ([#2778], thanks [@benasher44]) +- [`no-unused-modules`]: improve schema (thanks [@ljharb]) +- [`no-unused-modules`]: report error on binding instead of parent export ([#2842], thanks [@Chamion]) + +### Changed +- [Docs] [`no-duplicates`]: fix example schema ([#2684], thanks [@simmo]) +- [Docs] [`group-exports`]: fix syntax highlighting ([#2699], thanks [@devinrhode2]) +- [Docs] [`extensions`]: reference node ESM behavior ([#2748], thanks [@xM8WVqaG]) +- [Refactor] [`exports-last`]: use `array.prototype.findlastindex` (thanks [@ljharb]) +- [Refactor] [`no-anonymous-default-export`]: use `object.fromentries` (thanks [@ljharb]) +- [Refactor] [`no-unused-modules`]: use `array.prototype.flatmap` (thanks [@ljharb]) + +## [2.27.5] - 2023-01-16 + +### Fixed +- [`order]`: Fix group ranks order when alphabetizing ([#2674], thanks [@Pearce-Ropion]) + +## [2.27.4] - 2023-01-11 + +### Fixed +- `semver` should be a prod dep ([#2668]) + +## [2.27.3] - 2023-01-11 + +### Fixed +- [`no-empty-named-blocks`]: rewrite rule to only check import declarations ([#2666]) + +## [2.27.2] - 2023-01-11 + +### Fixed +- [`no-duplicates`]: do not unconditionally require `typescript` ([#2665]) + +## [2.27.1] - 2023-01-11 + +### Fixed +- `array.prototype.flatmap` should be a prod dep ([#2664], thanks [@cristobal]) + +## [2.27.0] - 2023-01-11 + +### Added +- [`newline-after-import`]: add `considerComments` option ([#2399], thanks [@pri1311]) +- [`no-cycle`]: add `allowUnsafeDynamicCyclicDependency` option ([#2387], thanks [@GerkinDev]) +- [`no-restricted-paths`]: support arrays for `from` and `target` options ([#2466], thanks [@AdriAt360]) +- [`no-anonymous-default-export`]: add `allowNew` option ([#2505], thanks [@DamienCassou]) +- [`order`]: Add `distinctGroup` option ([#2395], thanks [@hyperupcall]) +- [`no-extraneous-dependencies`]: Add `includeInternal` option ([#2541], thanks [@bdwain]) +- [`no-extraneous-dependencies`]: Add `includeTypes` option ([#2543], thanks [@bdwain]) +- [`order`]: new `alphabetize.orderImportKind` option to sort imports with same path based on their kind (`type`, `typeof`) ([#2544], thanks [@stropho]) +- [`consistent-type-specifier-style`]: add rule ([#2473], thanks [@bradzacher]) +- Add [`no-empty-named-blocks`] rule ([#2568], thanks [@guilhermelimak]) +- [`prefer-default-export`]: add "target" option ([#2602], thanks [@azyzz228]) +- [`no-absolute-path`]: add fixer ([#2613], thanks [@adipascu]) +- [`no-duplicates`]: support inline type import with `inlineTypeImport` option ([#2475], thanks [@snewcomer]) + +### Fixed +- [`order`]: move nested imports closer to main import entry ([#2396], thanks [@pri1311]) +- [`no-restricted-paths`]: fix an error message ([#2466], thanks [@AdriAt360]) +- [`no-restricted-paths`]: use `Minimatch.match` instead of `minimatch` to comply with Windows Native paths ([#2466], thanks [@AdriAt360]) +- [`order`]: require with member expression could not be fixed if alphabetize.order was used ([#2490], thanks [@msvab]) +- [`order`]: leave more space in rankings for consecutive path groups ([#2506], thanks [@Pearce-Ropion]) +- [`no-cycle`]: add ExportNamedDeclaration statements to dependencies ([#2511], thanks [@BenoitZugmeyer]) +- [`dynamic-import-chunkname`]: prevent false report on a valid webpack magic comment ([#2330], thanks [@mhmadhamster]) +- [`export`]: do not error on TS export overloads ([#1590], thanks [@ljharb]) +- [`no-unresolved`], [`extensions`]: ignore type only exports ([#2436], thanks [@Lukas-Kullmann]) +- `ExportMap`: add missing param to function ([#2589], thanks [@Fdawgs]) +- [`no-unused-modules`]: `checkPkgFieldObject` filters boolean fields from checks ([#2598], thanks [@mpint]) +- [`no-cycle`]: accept Flow `typeof` imports, just like `type` ([#2608], thanks [@gnprice]) +- [`no-import-module-exports`]: avoid a false positive for import variables ([#2315], thanks [@BarryThePenguin]) + +### Changed +- [Tests] [`named`]: Run all TypeScript test ([#2427], thanks [@ProdigySim]) +- [readme] note use of typescript in readme `import/extensions` section ([#2440], thanks [@OutdatedVersion]) +- [Docs] [`order`]: use correct default value ([#2392], thanks [@hyperupcall]) +- [meta] replace git.io link in comments with the original URL ([#2444], thanks [@liby]) +- [Docs] remove global install in readme ([#2412], thanks [@aladdin-add]) +- [readme] clarify `eslint-import-resolver-typescript` usage ([#2503], thanks [@JounQin]) +- [Refactor] [`no-cycle`]: Add per-run caching of traversed paths ([#2419], thanks [@nokel81]) +- [Performance] `ExportMap`: add caching after parsing for an ambiguous module ([#2531], thanks [@stenin-nikita]) +- [Docs] [`no-useless-path-segments`]: fix paths ([#2424], thanks [@s-h-a-d-o-w]) +- [Tests] [`no-cycle`]: add passing test cases ([#2438], thanks [@georeith]) +- [Refactor] [`no-extraneous-dependencies`] improve performance using cache ([#2374], thanks [@meowtec]) +- [meta] `CONTRIBUTING.md`: mention inactive PRs ([#2546], thanks [@stropho]) +- [readme] make json for setting groups multiline ([#2570], thanks [@bertyhell]) +- [Tests] [`no-restricted-paths`]: Tests for `import type` statements ([#2459], thanks [@golergka]) +- [Tests] [`no-restricted-paths`]: fix one failing `import type` test case, submitted by [@golergka], thanks [@azyzz228] +- [Docs] automate docs with eslint-doc-generator ([#2582], thanks [@bmish]) +- [readme] Increase clarity around typescript configuration ([#2588], thanks [@Nfinished]) +- [Docs] update `eslint-doc-generator` to v1.0.0 ([#2605], thanks [@bmish]) +- [Perf] [`no-cycle`], [`no-internal-modules`], [`no-restricted-paths`]: use `anyOf` instead of `oneOf` (thanks [@ljharb], [@remcohaszing]) + +## [2.26.0] - 2022-04-05 + +### Added +- [`no-named-default`], [`no-default-export`], [`prefer-default-export`], [`no-named-export`], [`export`], [`named`], [`namespace`], [`no-unused-modules`]: support arbitrary module namespace names ([#2358], thanks [@sosukesuzuki]) +- [`no-dynamic-require`]: support dynamic import with espree ([#2371], thanks [@sosukesuzuki]) +- [`no-relative-packages`]: add fixer ([#2381], thanks [@forivall]) + +### Fixed +- [`default`]: `typescript-eslint-parser`: avoid a crash on exporting as namespace (thanks [@ljharb]) +- [`export`]/TypeScript: false positive for typescript namespace merging ([#1964], thanks [@magarcia]) +- [`no-duplicates`]: ignore duplicate modules in different TypeScript module declarations ([#2378], thanks [@remcohaszing]) +- [`no-unused-modules`]: avoid a crash when processing re-exports ([#2388], thanks [@ljharb]) + +### Changed +- [Tests] [`no-nodejs-modules`]: add tests for node protocol URL ([#2367], thanks [@sosukesuzuki]) +- [Tests] [`default`], [`no-anonymous-default-export`], [`no-mutable-exports`], [`no-named-as-default-member`], [`no-named-as-default`]: add tests for arbitrary module namespace names ([#2358], thanks [@sosukesuzuki]) +- [Docs] [`no-unresolved`]: Fix RegExp escaping in readme ([#2332], thanks [@stephtr]) +- [Refactor] [`namespace`]: try to improve performance ([#2340], thanks [@ljharb]) +- [Docs] make rule doc titles consistent ([#2393], thanks [@TheJaredWilcurt]) +- [Docs] [`order`]: TS code examples should use TS code blocks ([#2411], thanks [@MM25Zamanian]) +- [Docs] [`no-unresolved`]: fix link ([#2417], thanks [@kylemh]) + +## [2.25.4] - 2022-01-02 + +### Fixed +- `importType`: avoid crashing on a non-string' ([#2305], thanks [@ljharb]) +- [`first`]: prevent crash when parsing angular templates ([#2210], thanks [@ljharb]) +- `importType`: properly resolve `@/*`-aliased imports as internal ([#2334], thanks [@ombene]) +- [`named`]/`ExportMap`: handle named imports from CJS modules that use dynamic import ([#2341], thanks [@ludofischer]) + +### Changed +- [`no-default-import`]: report on the token "default" instead of the entire node ([#2299], thanks [@pmcelhaney]) +- [Docs] [`order`]: Remove duplicate mention of default ([#2280], thanks [@johnthagen]) +- [Deps] update `eslint-module-utils` + +## [2.25.3] - 2021-11-09 + +### Fixed +- [`extensions`]: ignore unresolveable type-only imports ([#2270], [#2271], thanks [@jablko]) +- `importType`: fix `isExternalModule` calculation ([#2282], thanks [@mx-bernhard]) +- [`no-import-module-exports`]: avoid false positives with a shadowed `module` or `exports` ([#2297], thanks [@ljharb]) + +### Changed +- [Docs] [`order`]: add type to the default groups ([#2272], thanks [@charpeni]) +- [readme] Add note to TypeScript docs to install appropriate resolver ([#2279], thanks [@johnthagen]) +- [Refactor] `importType`: combine redundant `isScoped` and `isScopedModule` (thanks [@ljharb]) +- [Docs] HTTP => HTTPS ([#2287], thanks [@Schweinepriester]) + +## [2.25.2] - 2021-10-12 + +### Fixed +- [Deps] update `eslint-module-utils` for real this time ([#2255], thanks [@ljharb]) + +## [2.25.1] - 2021-10-11 + +### Fixed +- [Deps] update `eslint-module-utils` + +## [2.25.0] - 2021-10-11 + +### Added +- Support `eslint` v8 ([#2191], thanks [@ota-meshi]) +- [`no-unresolved`]: add `caseSensitiveStrict` option ([#1262], thanks [@sergei-startsev]) +- [`no-unused-modules`]: add eslint v8 support ([#2194], thanks [@coderaiser]) +- [`no-restricted-paths`]: add/restore glob pattern support ([#2219], thanks [@stropho]) +- [`no-unused-modules`]: support dynamic imports ([#1660], [#2212], thanks [@maxkomarychev], [@aladdin-add], [@Hypnosphi]) + +### Fixed +- [`no-unresolved`]: ignore type-only imports ([#2220], thanks [@jablko]) +- [`order`]: fix sorting imports inside TypeScript module declarations ([#2226], thanks [@remcohaszing]) +- [`default`], `ExportMap`: Resolve extended TypeScript configuration files ([#2240], thanks [@mrmckeb]) + +### Changed +- [Refactor] switch to an internal replacement for `pkg-up` and `read-pkg-up` ([#2047], thanks [@mgwalker]) +- [patch] TypeScript config: remove `.d.ts` from [`import/parsers` setting] and [`import/extensions` setting] ([#2220], thanks [@jablko]) +- [Refactor] [`no-unresolved`], [`no-extraneous-dependencies`]: moduleVisitor usage ([#2233], thanks [@jablko]) + +## [2.24.2] - 2021-08-24 + +### Fixed +- [`named`], [`namespace`]: properly handle ExportAllDeclarations ([#2199], thanks [@ljharb]) + +## [2.24.1] - 2021-08-19 + +### Fixed +- `ExportMap`: Add default export when esModuleInterop is true and anything is exported ([#2184], thanks [@Maxim-Mazurok]) +- [`named`], [`namespace`]: properly set reexports on `export * as … from` ([#1998], [#2161], thanks [@ljharb]) +- [`no-duplicates`]: correctly handle case of mixed default/named type imports ([#2149], thanks [@GoodForOneFare], [@nwalters512]) +- [`no-duplicates`]: avoid crash with empty `import type {}` ([#2201], thanks [@ljharb]) + +### Changed +- [Docs] `max-dependencies`: 📖 Document `ignoreTypeImports` option ([#2196], thanks [@himynameisdave]) + +## [2.24.0] - 2021-08-08 + +### Added +- [`no-dynamic-require`]: add option `esmodule` ([#1223], thanks [@vikr01]) +- [`named`]: add `commonjs` option ([#1222], thanks [@vikr01]) +- [`no-namespace`]: Add `ignore` option ([#2112], thanks [@aberezkin]) +- [`max-dependencies`]: add option `ignoreTypeImports` ([#1847], thanks [@rfermann]) + +### Fixed +- [`no-duplicates`]: ensure autofix avoids excessive newlines ([#2028], thanks [@ertrzyiks]) +- [`extensions`]: avoid crashing on partially typed import/export statements ([#2118], thanks [@ljharb]) +- [`no-extraneous-dependencies`]: add ESM intermediate package.json support ([#2121], thanks [@paztis]) +- Use `context.getPhysicalFilename()` when available (ESLint 7.28+) ([#2160], thanks [@pmcelhaney]) +- [`extensions`]/`importType`: fix isScoped treating @/abc as scoped module ([#2146], thanks [@rperello]) + +### Changed +- [Docs] [`extensions`]: improved cases for using `@/...` ([#2140], thanks [@wenfangdu]) +- [Docs] [`extensions`]: removed incorrect cases ([#2138], thanks [@wenfangdu]) +- [Tests] [`order`]: add tests for `pathGroupsExcludedImportTypes: ['type']` ([#2158], thanks [@atav32]) +- [Docs] [`order`]: improve the documentation for the `pathGroupsExcludedImportTypes` option ([#2156], thanks [@liby]) +- [Tests] [`no-cycle`]: Restructure test files ([#1517], thanks [@soryy708]) +- [Docs] add description how to use plugin with yarn berry ([#2179], thanks [@KostyaZgara]) + +## [2.23.4] - 2021-05-29 + +### Fixed +- [`no-import-module-exports`]: Don't crash if packages have no entrypoint ([#2099], thanks [@eps1lon]) +- [`no-extraneous-dependencies`]: fix package name algorithm ([#2097], thanks [@paztis]) + +## [2.23.3] - 2021-05-21 + +### Fixed +- [`no-restricted-paths`]: fix false positive matches ([#2090], thanks [@malykhinvi]) +- [`no-cycle`]: ignore imports where imported file only imports types of importing file ([#2083], thanks [@cherryblossom000]) +- [`no-cycle`]: fix false negative when file imports a type after importing a value in Flow ([#2083], thanks [@cherryblossom000]) +- [`order`]: restore default behavior unless `type` is in groups ([#2087], thanks [@grit96]) + +### Changed +- [Docs] Add [`no-relative-packages`] to list of to the list of rules ([#2075], thanks [@arvigeus]) + +## [2.23.2] - 2021-05-15 + +### Changed +- [meta] add `safe-publish-latest`; use `prepublishOnly` script for npm 7+ + +## [2.23.1] - 2021-05-14 + +### Fixed +- [`newline-after-import`]: fix crash with `export {}` syntax ([#2063], [#2056], thanks [@ljharb]) +- `ExportMap`: do not crash when tsconfig lacks `.compilerOptions` ([#2067], thanks [@ljharb]) +- [`order`]: fix alphabetical sorting ([#2071], thanks [@grit96]) + +## [2.23.0] - 2021-05-13 + +### Added +- [`no-commonjs`]: Also detect require calls with expressionless template literals: ``` require(`x`) ``` ([#1958], thanks [@FloEdelmann]) +- [`no-internal-modules`]: Add `forbid` option ([#1846], thanks [@guillaumewuip]) +- add [`no-relative-packages`] ([#1860], [#966], thanks [@tapayne88] [@panrafal]) +- add [`no-import-module-exports`] rule: report import declarations with CommonJS exports ([#804], thanks [@kentcdodds] and [@ttmarek]) +- [`no-unused-modules`]: Support destructuring assignment for `export`. ([#1997], thanks [@s-h-a-d-o-w]) +- [`order`]: support type imports ([#2021], thanks [@grit96]) +- [`order`]: Add `warnOnUnassignedImports` option to enable warnings for out of order unassigned imports ([#1990], thanks [@hayes]) + +### Fixed +- [`export`]/TypeScript: properly detect export specifiers as children of a TS module block ([#1889], thanks [@andreubotella]) +- [`order`]: ignore non-module-level requires ([#1940], thanks [@golopot]) +- [`no-webpack-loader-syntax`]/TypeScript: avoid crash on missing name ([#1947], thanks [@leonardodino]) +- [`no-extraneous-dependencies`]: Add package.json cache ([#1948], thanks [@fa93hws]) +- [`prefer-default-export`]: handle empty array destructuring ([#1965], thanks [@ljharb]) +- [`no-unused-modules`]: make type imports mark a module as used (fixes [#1924]) ([#1974], thanks [@cherryblossom000]) +- [`no-cycle`]: fix perf regression ([#1944], thanks [@Blasz]) +- [`first`]: fix handling of `import = require` ([#1963], thanks [@MatthiasKunnen]) +- [`no-cycle`]/[`extensions`]: fix isExternalModule usage ([#1696], thanks [@paztis]) +- [`extensions`]/[`no-cycle`]/[`no-extraneous-dependencies`]: Correct module real path resolution ([#1696], thanks [@paztis]) +- [`no-named-default`]: ignore Flow import type and typeof ([#1983], thanks [@christianvuerings]) +- [`no-extraneous-dependencies`]: Exclude flow `typeof` imports ([#1534], thanks [@devongovett]) +- [`newline-after-import`]: respect decorator annotations ([#1985], thanks [@lilling]) +- [`no-restricted-paths`]: enhance performance for zones with `except` paths ([#2022], thanks [@malykhinvi]) +- [`no-unresolved`]: check import() ([#2026], thanks [@aladdin-add]) + +### Changed +- [Generic Import Callback] Make callback for all imports once in rules ([#1237], thanks [@ljqx]) +- [Docs] [`no-named-as-default`]: add semicolon ([#1897], thanks [@bicstone]) +- [Docs] [`no-extraneous-dependencies`]: correct peerDependencies option default to `true` ([#1993], thanks [@dwardu]) +- [Docs] [`order`]: Document options required to match ordering example ([#1992], thanks [@silviogutierrez]) +- [Tests] [`no-unresolved`]: add tests for `import()` ([#2012], thanks [@davidbonnet]) +- [Docs] Add import/recommended ruleset to README ([#2034], thanks [@edemaine]) + +## [2.22.1] - 2020-09-27 + +### Fixed +- [`default`]/TypeScript: avoid crash on `export =` with a MemberExpression ([#1841], thanks [@ljharb]) +- [`extensions`]/importType: Fix @/abc being treated as scoped module ([#1854], thanks [@3nuc]) +- allow using rest operator in named export ([#1878], thanks [@foray1010]) +- [`dynamic-import-chunkname`]: allow single quotes to match Webpack support ([#1848], thanks [@straub]) + +### Changed +- [`export`]: add tests for a name collision with `export * from` ([#1704], thanks [@tomprats]) + +## [2.22.0] - 2020-06-26 + +### Added +- [`no-unused-modules`]: consider exported TypeScript interfaces, types and enums ([#1819], thanks [@nicolashenry]) +- [`no-cycle`]: allow `maxDepth` option to be `"∞"` (thanks [@ljharb]) + +### Fixed +- [`order`]/TypeScript: properly support `import = object` expressions ([#1823], thanks [@manuth]) +- [`no-extraneous-dependencies`]/TypeScript: do not error when importing type from dev dependencies ([#1820], thanks [@fernandopasik]) +- [`default`]: avoid crash with `export =` ([#1822], thanks [@AndrewLeedham]) +- [`order`]/[`newline-after-import`]: ignore TypeScript's "export import object" ([#1830], thanks [@be5invis]) +- [`dynamic-import-chunkname`]/TypeScript: supports `@typescript-eslint/parser` ([#1833], thanks [@noelebrun]) +- [`order`]/TypeScript: ignore ordering of object imports ([#1831], thanks [@manuth]) +- [`namespace`]: do not report on shadowed import names ([#518], thanks [@ljharb]) +- [`export`]: avoid warning on `export * as` non-conflicts ([#1834], thanks [@ljharb]) + +### Changed +- [`no-extraneous-dependencies`]: add tests for importing types ([#1824], thanks [@taye]) +- [docs] [`no-default-export`]: Fix docs url ([#1836], thanks [@beatrizrezener]) +- [docs] [`imports-first`]: deprecation info and link to `first` docs ([#1835], thanks [@beatrizrezener]) + +## [2.21.2] - 2020-06-09 + +### Fixed +- [`order`]: avoid a crash on TypeScript’s `export import` syntax ([#1808], thanks [@ljharb]) +- [`newline-after-import`]: consider TypeScript `import =` syntax' ([#1811], thanks [@ljharb]) +- [`no-internal-modules`]: avoid a crash on a named export declaration ([#1814], thanks [@ljharb]) + +## [2.21.1] - 2020-06-07 + +### Fixed +- TypeScript: [`import/named`]: avoid requiring `typescript` when not using TS ([#1805], thanks [@ljharb]) + +## [2.21.0] - 2020-06-07 + +### Added +- [`import/default`]: support default export in TSExportAssignment ([#1528], thanks [@joaovieira]) +- [`no-cycle`]: add `ignoreExternal` option ([#1681], thanks [@sveyret]) +- [`order`]: Add support for TypeScript's "import equals"-expressions ([#1785], thanks [@manuth]) +- [`import/default`]: support default export in TSExportAssignment ([#1689], thanks [@Maxim-Mazurok]) +- [`no-restricted-paths`]: add custom message support ([#1802], thanks [@malykhinvi]) + +### Fixed +- [`group-exports`]: Flow type export awareness ([#1702], thanks [@ernestostifano]) +- [`order`]: Recognize pathGroup config for first group ([#1719], [#1724], thanks [@forivall], [@xpl]) +- [`no-unused-modules`]: Fix re-export not counting as usage when used in combination with import ([#1722], thanks [@Ephem]) +- [`no-duplicates`]: Handle TS import type ([#1676], thanks [@kmui2]) +- [`newline-after-import`]: recognize decorators ([#1139], thanks [@atos1990]) +- [`no-unused-modules`]: Revert "[flow] [`no-unused-modules`]: add flow type support" ([#1770], thanks [@Hypnosphi]) +- TypeScript: Add nested namespace handling ([#1763], thanks [@julien1619]) +- [`namespace`]/`ExportMap`: Fix interface declarations for TypeScript ([#1764], thanks [@julien1619]) +- [`no-unused-modules`]: avoid order-dependence ([#1744], thanks [@darkartur]) +- [`no-internal-modules`]: also check `export from` syntax ([#1691], thanks [@adjerbetian]) +- TypeScript: [`export`]: avoid a crash with `export =` ([#1801], thanks [@ljharb]) + +### Changed +- [Refactor] [`no-extraneous-dependencies`]: use moduleVisitor ([#1735], thanks [@adamborowski]) +- TypeScript config: Disable [`named`][] ([#1726], thanks [@astorije]) +- [readme] Remove duplicate [`no-unused-modules`] from docs ([#1690], thanks [@arvigeus]) +- [Docs] [`order`]: fix bad inline config ([#1788], thanks [@nickofthyme]) +- [Tests] Add fix for Windows Subsystem for Linux ([#1786], thanks [@manuth]) +- [Docs] [`no-unused-rules`]: Fix docs for unused exports ([#1776], thanks [@barbogast]) +- [eslint] bump minimum v7 version to v7.2.0 + +## [2.20.2] - 2020-03-28 + +### Fixed +- [`order`]: fix `isExternalModule` detect on windows ([#1651], thanks [@fisker]) +- [`order`]: recognize ".." as a "parent" path ([#1658], thanks [@golopot]) +- [`no-duplicates`]: fix fixer on cases with default import ([#1666], thanks [@golopot]) +- [`no-unused-modules`]: Handle `export { default } from` syntax ([#1631], thanks [@richardxia]) +- [`first`]: Add a way to disable `absolute-first` explicitly ([#1664], thanks [@TheCrueltySage]) +- [Docs] [`no-webpack-loader-syntax`]: Updates webpack URLs ([#1751], thanks [@MikeyBeLike]) + +## [2.20.1] - 2020-02-01 + +### Fixed +- [`export`]: Handle function overloading in `*.d.ts` ([#1619], thanks [@IvanGoncharov]) +- [`no-absolute-path`]: fix a crash with invalid import syntax ([#1616], thanks [@ljharb]) +- [`import/external-module-folders` setting] now correctly works with directories containing modules symlinked from `node_modules` ([#1605], thanks [@skozin]) +- [`extensions`]: for invalid code where `name` does not exist, do not crash ([#1613], thanks [@ljharb]) +- [`extensions`]: Fix scope regex ([#1611], thanks [@yordis]) +- [`no-duplicates`]: allow duplicate imports if one is a namespace and the other not ([#1612], thanks [@sveyret]) +- Add some missing rule meta schemas and types ([#1620], thanks [@bmish]) +- [`named`]: for importing from a module which re-exports named exports from a `node_modules` module ([#1569], [#1447], thanks [@redbugz], [@kentcdodds]) +- [`order`]: Fix alphabetize for mixed requires and imports ([#1626], thanks [@wschurman]) + +### Changed +- [`import/external-module-folders` setting] behavior is more strict now: it will only match complete path segments ([#1605], thanks [@skozin]) +- [meta] fix "files" field to include/exclude the proper files ([#1635], thanks [@ljharb]) +- [Tests] [`order`]: Add TS import type tests ([#1736], thanks [@kmui2]) + +## [2.20.0] - 2020-01-10 + +### Added +- [`order`]: added `caseInsensitive` as an additional option to `alphabetize` ([#1586], thanks [@dbrewer5]) +- [`no-restricted-paths`]: New `except` option per `zone`, allowing exceptions to be defined for a restricted zone ([#1238], thanks [@rsolomon]) +- [`order`]: add option pathGroupsExcludedImportTypes to allow ordering of external import types ([#1565], thanks [@Mairu]) + +### Fixed +- [`no-unused-modules`]: fix usage of [`import/extensions` setting] ([#1560], thanks [@stekycz]) +- [`extensions`]: ignore non-main modules ([#1563], thanks [@saschanaz]) +- TypeScript config: lookup for external modules in @types folder ([#1526], thanks [@joaovieira]) +- [`no-extraneous-dependencies`]: ensure `node.source` is truthy ([#1589], thanks [@ljharb]) +- [`extensions`]: Ignore query strings when checking for extensions ([#1572], thanks [@pcorpet]) + +### Docs +- [`extensions`]: improve `ignorePackages` docs ([#1248], thanks [@ivo-stefchev]) + +## [2.19.1] - 2019-12-08 + +### Fixed +- [`no-extraneous-dependencies`]: ensure `node.source` exists + +## [2.19.0] - 2019-12-08 + +### Added +- [`internal-regex` setting]: regex pattern for marking packages "internal" ([#1491], thanks [@Librazy]) +- [`group-exports`]: make aggregate module exports valid ([#1472], thanks [@atikenny]) +- [`no-namespace`]: Make rule fixable ([#1401], thanks [@TrevorBurnham]) +- support `parseForESLint` from custom parser ([#1435], thanks [@JounQin]) +- [`no-extraneous-dependencies`]: Implement support for [bundledDependencies](https://npm.github.io/using-pkgs-docs/package-json/types/bundleddependencies.html) ([#1436], thanks [@schmidsi])) +- [`no-unused-modules`]: add flow type support ([#1542], thanks [@rfermann]) +- [`order`]: Adds support for pathGroups to allow ordering by defined patterns ([#795], [#1386], thanks [@Mairu]) +- [`no-duplicates`]: Add `considerQueryString` option : allow duplicate imports with different query strings ([#1107], thanks [@pcorpet]). +- [`order`]: Add support for alphabetical sorting of import paths within import groups ([#1360], [#1105], [#629], thanks [@duncanbeevers], [@stropho], [@luczsoma], [@randallreedjr]) +- [`no-commonjs`]: add `allowConditionalRequire` option ([#1439], thanks [@Pessimistress]) + +### Fixed +- [`default`]: make error message less confusing ([#1470], thanks [@golopot]) +- Improve performance of `ExportMap.for` by only loading paths when necessary. ([#1519], thanks [@brendo]) +- Support export of a merged TypeScript namespace declaration ([#1495], thanks [@benmunro]) +- [`order`]: fix autofix to not move imports across fn calls ([#1253], thanks [@tihonove]) +- [`prefer-default-export`]: fix false positive with type export ([#1506], thanks [@golopot]) +- [`extensions`]: Fix `ignorePackages` to produce errors ([#1521], thanks [@saschanaz]) +- [`no-unused-modules`]: fix crash due to `export *` ([#1496], thanks [@Taranys]) +- [`no-cycle`]: should not warn for Flow imports ([#1494], thanks [@maxmalov]) +- [`order`]: fix `@someModule` considered as `unknown` instead of `internal` ([#1493], thanks [@aamulumi]) +- [`no-extraneous-dependencies`]: Check `export from` ([#1049], thanks [@marcusdarmstrong]) + +### Docs +- [`no-useless-path-segments`]: add docs for option `commonjs` ([#1507], thanks [@golopot]) + +### Changed +- [`no-unused-modules`]/`eslint-module-utils`: Avoid superfluous calls and code ([#1551], thanks [@brettz9]) + +## [2.18.2] - 2019-07-19 + +### Fixed +- Skip warning on type interfaces ([#1425], thanks [@lencioni]) + +## [2.18.1] - 2019-07-18 + +### Fixed +- Improve parse perf when using `@typescript-eslint/parser` ([#1409], thanks [@bradzacher]) +- [`prefer-default-export`]: don't warn on TypeAlias & TSTypeAliasDeclaration ([#1377], thanks [@sharmilajesupaul]) +- [`no-unused-modules`]: Exclude package "main"/"bin"/"browser" entry points ([#1404], thanks [@rfermann]) +- [`export`]: false positive for TypeScript overloads ([#1412], thanks [@golopot]) + +### Refactors +- [`no-extraneous-dependencies`], `importType`: remove lodash ([#1419], thanks [@ljharb]) + +## [2.18.0] - 2019-06-24 + +### Added +- Support eslint v6 ([#1393], thanks [@sheepsteak]) +- [`order`]: Adds support for correctly sorting unknown types into a single group ([#1375], thanks [@swernerx]) +- [`order`]: add fixer for destructuring commonjs import ([#1372], thanks [@golopot]) +- TypeScript config: add TS def extensions + defer to TS over JS ([#1366], thanks [@benmosher]) + +### Fixed +- [`no-unused-modules`]: handle ClassDeclaration ([#1371], thanks [@golopot]) + +### Docs +- [`no-cycle`]: split code examples so file separation is obvious ([#1370], thanks [@alex-page]) +- [`no-named-as-default-member`]: update broken link ([#1389], thanks [@fooloomanzoo]) + +## [2.17.3] - 2019-05-23 + +### Fixed +- [`no-common-js`]: Also throw an error when assigning ([#1354], thanks [@charlessuh]) +- [`no-unused-modules`]: don't crash when lint file outside src-folder ([#1347], thanks [@rfermann]) +- [`no-unused-modules`]: make `import { name as otherName }` work ([#1340], [#1342], thanks [@rfermann]) +- [`no-unused-modules`]: make appveyor tests passing ([#1333], thanks [@rfermann]) +- [`named`]: ignore Flow `typeof` imports and `type` exports ([#1345], thanks [@loganfsmyth]) +- [refactor] fix eslint 6 compat by fixing imports (thank [@ljharb]) +- Improve support for TypeScript declare structures ([#1356], thanks [@christophercurrie]) + +### Docs +- add missing [`no-unused-modules`] in README ([#1358], thanks [@golopot]) +- [`no-unused-modules`]: Indicates usage, plugin defaults to no-op, and add description to main README.md ([#1352], thanks [@johndevedu]) +- Document `env` option for `eslint-import-resolver-webpack` ([#1363], thanks [@kgregory]) + +## [2.17.2] - 2019-04-16 + +### Fixed +- [`no-unused-modules`]: avoid crash when using `ignoreExports`-option ([#1331], [#1323], thanks [@rfermann]) +- [`no-unused-modules`]: make sure that rule with no options will not fail ([#1330], [#1334], thanks [@kiwka]) + +## [2.17.1] - 2019-04-13 + +### Fixed +- require v2.4 of `eslint-module-utils` ([#1322]) + +## [2.17.0] - 2019-04-13 + +### Added +- [`no-useless-path-segments`]: Add `noUselessIndex` option ([#1290], thanks [@timkraut]) +- [`no-duplicates`]: Add autofix ([#1312], thanks [@lydell]) +- Add [`no-unused-modules`] rule ([#1142], thanks [@rfermann]) +- support export type named exports from TypeScript ([#1304], thanks [@bradennapier] and [@schmod]) + +### Fixed +- [`order`]: Fix interpreting some external modules being interpreted as internal modules ([#793], [#794] thanks [@ephys]) +- allow aliases that start with @ to be "internal" ([#1293], [#1294], thanks [@jeffshaver]) +- aliased internal modules that look like core modules ([#1297], thanks [@echenley]) +- [`namespace`]: add check for null ExportMap ([#1235], [#1144], thanks [@ljqx]) +- [ExportMap] fix condition for checking if block comment ([#1234], [#1233], thanks [@ljqx]) +- Fix overwriting of dynamic import() CallExpression ([`no-cycle`], [`no-relative-parent-imports`], [`no-unresolved`], [`no-useless-path-segments`]) ([#1218], [#1166], [#1035], thanks [@vikr01]) +- [`export`]: false positives for TypeScript type + value export ([#1319], thanks [@bradzacher]) +- [`export`]: Support TypeScript namespaces ([#1320], [#1300], thanks [@bradzacher]) + +### Docs +- Update readme for TypeScript ([#1256], [#1277], thanks [@kirill-konshin]) +- make rule names consistent ([#1112], thanks [@feychenie]) + +### Tests +- fix broken tests on master ([#1295], thanks [@jeffshaver] and [@ljharb]) +- [`no-commonjs`]: add tests that show corner cases ([#1308], thanks [@TakeScoop]) + +## [2.16.0] - 2019-01-29 + +### Added +- `typescript` config ([#1257], thanks [@kirill-konshin]) + +### Fixed +- Memory leak of `SourceCode` objects for all parsed dependencies, resolved. (issue [#1266], thanks [@asapach] and [@sergei-startsev] for digging in) + +## [2.15.0] - 2019-01-22 + +### Added +- new rule: [`no-named-export`] ([#1157], thanks [@fsmaia]) + +### Fixed +- [`no-extraneous-dependencies`]: `packageDir` option with array value was clobbering package deps instead of merging them ([#1175]/[#1176], thanks [@aravindet] & [@pzhine]) +- [`dynamic-import-chunkname`]: Add proper webpack comment parsing ([#1163], thanks [@st-sloth]) +- [`named`]: fix destructuring assignment ([#1232], thanks [@ljqx]) + +## [2.14.0] - 2018-08-13 + +### Added +- [`no-useless-path-segments`]: add commonJS (CJS) support ([#1128], thanks [@1pete]) +- [`namespace`]: add JSX check ([#1151], thanks [@jf248]) + +### Fixed +- [`no-cycle`]: ignore Flow imports ([#1126], thanks [@gajus]) +- fix Flow type imports ([#1106], thanks [@syymza]) +- [`no-relative-parent-imports`]: resolve paths ([#1135], thanks [@chrislloyd]) +- [`order`]: fix autofixer when using typescript-eslint-parser ([#1137], thanks [@justinanastos]) +- repeat fix from [#797] for [#717], in another place (thanks [@ljharb]) + +### Refactors +- add explicit support for RestElement alongside ExperimentalRestProperty (thanks [@ljharb]) + +## [2.13.0] - 2018-06-24 + +### Added +- Add ESLint 5 support ([#1122], thanks [@ai] and [@ljharb]) +- Add [`no-relative-parent-imports`] rule: disallow relative imports from parent directories ([#1093], thanks [@chrislloyd]) + +### Fixed +- `namespace` rule: ensure it works in eslint 5/ecmaVersion 2018 (thanks [@ljharb]) + +## [2.12.0] - 2018-05-17 + +### Added +- Ignore type imports for [`named`] rule ([#931], thanks [@mattijsbliek]) +- Add documentation for [`no-useless-path-segments`] rule ([#1068], thanks [@manovotny]) +- `packageDir` option for [`no-extraneous-dependencies`] can be array-valued ([#1085], thanks [@hulkish]) + +## [2.11.0] - 2018-04-09 + +### Added +- Fixer for [`first`] ([#1046], thanks [@fengkfengk]) +- `allow-require` option for [`no-commonjs`] rule ([#880], thanks [@futpib]) + +### Fixed +- memory/CPU regression where ASTs were held in memory ([#1058], thanks [@klimashkin]/[@lukeapage]) + +## [2.10.0] - 2018-03-29 + +### Added +- Autofixer for [`order`] rule ([#908], thanks [@tihonove]) +- Add [`no-cycle`] rule: reports import cycles. + +## [2.9.0] - 2018-02-21 + +### Added +- Add [`group-exports`] rule: style-guide rule to report use of multiple named exports ([#721], thanks [@robertrossmann]) +- Add [`no-self-import`] rule: forbids a module from importing itself. ([#727], [#449], [#447], thanks [@giodamelio]). +- Add [`no-default-export`] rule ([#889], thanks [@isiahmeadows]) +- Add [`no-useless-path-segments`] rule ([#912], thanks [@graingert] and [@danny-andrews]) +- ... and more! check the commits for v[2.9.0] + +## [2.8.0] - 2017-10-18 +### Added +- [`exports-last`] rule ([#620] + [#632], thanks [@k15a]) + +### Changed +- Case-sensitivity checking ignores working directory and ancestors. ([#720] + [#858], thanks [@laysent]) + +### Fixed +- support scoped modules containing hyphens ([#744], thanks [@rosswarren]) +- core-modules now resolves files inside declared modules ([#886] / [#891], thanks [@mplewis]) +- TypeError for missing AST fields from TypeScript ([#842] / [#944], thanks [@alexgorbatchev]) + +## [2.7.0] - 2017-07-06 + +### Changed +- [`no-absolute-path`] picks up speed boost, optional AMD support ([#843], thanks [@jseminck]) + +## [2.6.1] - 2017-06-29 + +### Fixed +- update bundled node resolver dependency to latest version + +## [2.6.0] - 2017-06-23 + +### Changed +- update tests / peerDeps for ESLint 4.0 compatibility ([#871], thanks [@mastilver]) +- [`memo-parser`] updated to require `filePath` on parser options as it melts + down if it's not there, now that this plugin always provides it. (see [#863]) + +## [2.5.0] - 2017-06-22 + +Re-releasing v[2.4.0] after discovering that the memory leak is isolated to the [`memo-parser`], +which is more or less experimental anyway. + +### Added +- Autofixer for newline-after-import. ([#686] + [#696], thanks [@eelyafi]) + +## [2.4.0] - 2017-06-02 [YANKED] + +Yanked due to critical issue in eslint-module-utils with cache key resulting from [#839]. + +### Added +- Add `filePath` into `parserOptions` passed to `parser` ([#839], thanks [@sompylasar]) +- Add `allow` option to [`no-unassigned-import`] to allow for files that match the globs ([#671], [#737], thanks [@kevin940726]). + +## [2.3.0] - 2017-05-18 + +### Added +- [`no-anonymous-default-export`] rule: report anonymous default exports ([#712], thanks [@duncanbeevers]). +- Add new value to [`order`]'s `newlines-between` option to allow newlines inside import groups ([#627], [#628], thanks [@giodamelio]) +- Add `count` option to the [`newline-after-import`] rule to allow configuration of number of newlines expected ([#742], thanks [@ntdb]) + +### Changed +- [`no-extraneous-dependencies`]: use `read-pkg-up` to simplify finding + loading `package.json` ([#680], thanks [@wtgtybhertgeghgtwtg]) +- Add support to specify the package.json [`no-extraneous-dependencies`] ([#685], thanks [@ramasilveyra]) + +### Fixed +- attempt to fix crash in [`no-mutable-exports`]. ([#660]) +- "default is a reserved keyword" in no-maned-default tests by locking down babylon to 6.15.0 (#756, thanks @gmathieu) +- support scoped modules containing non word characters + +## [2.2.0] - 2016-11-07 + +### Fixed +- Corrected a few gaffs in the auto-ignore logic to fix major performance issues + with projects that did not explicitly ignore `node_modules`. ([#654]) +- [`import/ignore` setting] was only being respected if the ignored module didn't start with + an `import` or `export` JS statement +- [`prefer-default-export`]: fixed crash on export extensions ([#653]) + +## [2.1.0] - 2016-11-02 + +### Added +- Add [`no-named-default`] rule: style-guide rule to report use of unnecessarily named default imports ([#596], thanks [@ntdb]) +- [`no-extraneous-dependencies`]: check globs against CWD + absolute path ([#602] + [#630], thanks [@ljharb]) + +### Fixed +- [`prefer-default-export`] handles flow `export type` ([#484] + [#639], thanks [@jakubsta]) +- [`prefer-default-export`] handles re-exported default exports ([#609]) +- Fix crash when using [`newline-after-import`] with decorators ([#592]) +- Properly report [`newline-after-import`] when next line is a decorator +- Fixed documentation for the default values for the [`order`] rule ([#601]) + +## [2.0.1] - 2016-10-06 + +### Fixed +- Fixed code that relied on removed dependencies. ([#604]) + +## [2.0.0]! - 2016-09-30 + +### Added +- [`unambiguous`] rule: report modules that are not unambiguously ES modules. +- `recommended` shared config. Roughly `errors` and `warnings` mixed together, + with some `parserOptions` in the mix. ([#402]) +- `react` shared config: added `jsx: true` to `parserOptions.ecmaFeatures`. +- Added [`no-webpack-loader-syntax`] rule: forbid custom Webpack loader syntax in imports. ([#586], thanks [@fson]!) +- Add option `newlines-between: "ignore"` to [`order`] ([#519]) +- Added [`no-unassigned-import`] rule ([#529]) + +### Breaking +- [`import/extensions` setting] defaults to `['.js']`. ([#306]) +- [`import/ignore` setting] defaults to nothing, and ambiguous modules are ignored natively. This means importing from CommonJS modules will no longer be reported by [`default`], [`named`], or [`namespace`], regardless of `import/ignore`. ([#270]) +- [`newline-after-import`]: Removed need for an empty line after an inline `require` call ([#570]) +- [`order`]: Default value for `newlines-between` option is now `ignore` ([#519]) + +### Changed +- `imports-first` is renamed to [`first`]. `imports-first` alias will continue to + exist, but may be removed in a future major release. +- Case-sensitivity: now specifically (and optionally) reported by [`no-unresolved`]. + Other rules will ignore case-mismatches on paths on case-insensitive filesystems. ([#311]) + +### Fixed +- [`no-internal-modules`]: support `@`-scoped packages ([#577]+[#578], thanks [@spalger]) + +## [1.16.0] - 2016-09-22 + +### Added +- Added [`no-dynamic-require`] rule: forbid `require()` calls with expressions. ([#567], [#568]) +- Added [`no-internal-modules`] rule: restrict deep package imports to specific folders. ([#485], thanks [@spalger]!) +- [`extensions`]: allow override of a chosen default with options object ([#555], thanks [@ljharb]!) + +### Fixed +- [`no-named-as-default`] no longer false-positives on `export default from '...'` ([#566], thanks [@preco21]) +- [`default`]: allow re-export of values from ignored files as default ([#545], thanks [@skyrpex]) + +## [1.15.0] - 2016-09-12 + +### Added +- Added an `allow` option to [`no-nodejs-modules`] to allow exceptions ([#452], [#509]). +- Added [`no-absolute-path`] rule ([#530], [#538]) +- [`max-dependencies`] for specifying the maximum number of dependencies (both `import` and `require`) a module can have. (see [#489], thanks [@tizmagik]) +- Added glob option to config for [`no-extraneous-dependencies`], after much bikeshedding. Thanks, [@knpwrs]! ([#527]) + +### Fixed +- [`no-named-as-default-member`] Allow default import to have a property named "default" ([#507], [#508], thanks [@jquense] for both!) + +## [1.14.0] - 2016-08-22 + +### Added +- [`import/parsers` setting]: parse some dependencies (i.e. TypeScript!) with a different parser than the ESLint-configured parser. ([#503]) + +### Fixed +- [`namespace`] exception for get property from `namespace` import, which are re-export from commonjs module ([#499] fixes [#416], thanks [@wKich]) + +## [1.13.0] - 2016-08-11 + +### Added +- `allowComputed` option for [`namespace`] rule. If set to `true`, won't report + computed member references to namespaces. (see [#456]) + +### Changed +- Modified [`no-nodejs-modules`] error message to include the module's name ([#453], [#461]) + +### Fixed +- [`import/extensions` setting] is respected in spite of the appearance of imports + in an imported file. (fixes [#478], thanks [@rhys-vdw]) + +## [1.12.0] - 2016-07-26 + +### Added +- [`import/external-module-folders` setting]: a possibility to configure folders for "external" modules ([#444], thanks [@zloirock]) + +## [1.11.1] - 2016-07-20 + +### Fixed +- [`newline-after-import`] exception for `switch` branches with `require`s iff parsed as `sourceType:'module'`. + (still [#441], thanks again [@ljharb]) + +## [1.11.0] - 2016-07-17 + +### Added +- Added an `peerDependencies` option to [`no-extraneous-dependencies`] to allow/forbid peer dependencies ([#423], [#428], thanks [@jfmengels]!). + +### Fixed +- [`newline-after-import`] exception for multiple `require`s in an arrow + function expression (e.g. `() => require('a') || require('b')`). ([#441], thanks [@ljharb]) + +## [1.10.3] - 2016-07-08 + +### Fixed +- removing `Symbol` dependencies (i.e. `for-of` loops) due to Node 0.10 polyfill + issue (see [#415]). Should not make any discernible semantic difference. + +## [1.10.2] - 2016-07-04 + +### Fixed +- Something horrible happened during `npm prepublish` of 1.10.1. + Several `rm -rf node_modules && npm i` and `gulp clean && npm prepublish`s later, it is rebuilt and republished as 1.10.2. Thanks [@rhettlivingston] for noticing and reporting! + +## [1.10.1] - 2016-07-02 [YANKED] + +### Added +- Officially support ESLint 3.x. (peerDependencies updated to `2.x - 3.x`) + +## [1.10.0] - 2016-06-30 + +### Added +- Added new rule [`no-restricted-paths`]. ([#155]/[#371], thanks [@lo1tuma]) +- [`import/core-modules` setting]: allow configuration of additional module names, + to be treated as builtin modules (a la `path`, etc. in Node). ([#275] + [#365], thanks [@sindresorhus] for driving) +- React Native shared config (based on comment from [#283]) + +### Fixed +- Fixed crash with `newline-after-import` related to the use of switch cases. (fixes [#386], thanks [@ljharb] for reporting) ([#395]) + +## [1.9.2] - 2016-06-21 + +### Fixed +- Issues with ignored/CJS files in [`export`] and [`no-deprecated`] rules. ([#348], [#370]) + +## [1.9.1] - 2016-06-16 + +### Fixed +- Reordered precedence for loading resolvers. ([#373]) + +## [1.9.0] - 2016-06-10 + +### Added +- Added support TomDoc comments to [`no-deprecated`]. ([#321], thanks [@josh]) +- Added support for loading custom resolvers ([#314], thanks [@le0nik]) + +### Fixed +- [`prefer-default-export`] handles `export function` and `export const` in same file ([#359], thanks [@scottnonnenberg]) + +## [1.8.1] - 2016-05-23 + +### Fixed +- `export * from 'foo'` now properly ignores a `default` export from `foo`, if any. ([#328]/[#332], thanks [@jkimbo]) + This impacts all static analysis of imported names. ([`default`], [`named`], [`namespace`], [`export`]) +- Make [`order`]'s `newline-between` option handle multiline import statements ([#313], thanks [@singles]) +- Make [`order`]'s `newline-between` option handle not assigned import statements ([#313], thanks [@singles]) +- Make [`order`]'s `newline-between` option ignore `require` statements inside object literals ([#313], thanks [@singles]) +- [`prefer-default-export`] properly handles deep destructuring, `export * from ...`, and files with no exports. ([#342]+[#343], thanks [@scottnonnenberg]) + +## [1.8.0] - 2016-05-11 + +### Added +- [`prefer-default-export`], new rule. ([#308], thanks [@gavriguy]) + +### Fixed +- Ignore namespace / ES7 re-exports in [`no-mutable-exports`]. ([#317], fixed by [#322]. thanks [@borisyankov] + [@jfmengels]) +- Make [`no-extraneous-dependencies`] handle scoped packages ([#316], thanks [@jfmengels]) + +## [1.7.0] - 2016-05-06 + +### Added +- [`newline-after-import`], new rule. ([#245], thanks [@singles]) +- Added an `optionalDependencies` option to [`no-extraneous-dependencies`] to allow/forbid optional dependencies ([#266], thanks [@jfmengels]). +- Added `newlines-between` option to [`order`] rule ([#298], thanks [@singles]) +- add [`no-mutable-exports`] rule ([#290], thanks [@josh]) +- [`import/extensions` setting]: a list of file extensions to parse as modules + and search for `export`s. If unspecified, all extensions are considered valid (for now). + In v2, this will likely default to `['.js', MODULE_EXT]`. ([#297], to fix [#267]) + +### Fixed +- [`extensions`]: fallback to source path for extension enforcement if imported + module is not resolved. Also, never report for builtins (i.e. `path`). ([#296]) + +## [1.6.1] - 2016-04-28 + +### Fixed +- [`no-named-as-default-member`]: don't crash on rest props. ([#281], thanks [@SimenB]) +- support for Node 6: don't pass `null` to `path` functions. + Thanks to [@strawbrary] for bringing this up ([#272]) and adding OSX support to the Travis + config ([#288]). + +## [1.6.0] - 2016-04-25 + +### Added +- add [`no-named-as-default-member`] to `warnings` canned config +- add [`no-extraneous-dependencies`] rule ([#241], thanks [@jfmengels]) +- add [`extensions`] rule ([#250], thanks [@lo1tuma]) +- add [`no-nodejs-modules`] rule ([#261], thanks [@jfmengels]) +- add [`order`] rule ([#247], thanks [@jfmengels]) +- consider `resolve.fallback` config option in the webpack resolver ([#254]) + +### Changed +- [`imports-first`] now allows directives (i.e. `'use strict'`) strictly before + any imports ([#256], thanks [@lemonmade]) + +### Fixed +- [`named`] now properly ignores the source module if a name is re-exported from + an ignored file (i.e. `node_modules`). Also improved the reported error. (thanks to [@jimbolla] for reporting) +- [`no-named-as-default-member`] had a crash on destructuring in loops (thanks for heads up from [@lemonmade]) + +## [1.5.0] - 2016-04-18 + +### Added +- report resolver errors at the top of the linted file +- add [`no-namespace`] rule ([#239], thanks [@singles]) +- add [`no-named-as-default-member`] rule ([#243], thanks [@dmnd]) + +### Changed +- Rearranged rule groups in README in preparation for more style guide rules + +### Removed +- support for Node 0.10, via `es6-*` ponyfills. Using native Map/Set/Symbol. + +## [1.4.0] - 2016-03-25 + +### Added +- Resolver plugin interface v2: more explicit response format that more clearly covers the found-but-core-module case, where there is no path. + Still backwards-compatible with the original version of the resolver spec. +- [Resolver documentation](./resolvers/README.md) + +### Changed +- using `package.json/files` instead of `.npmignore` for package file inclusion ([#228], thanks [@mathieudutour]) +- using `es6-*` ponyfills instead of `babel-runtime` + +## [1.3.0] - 2016-03-20 + +Major perf improvements. Between parsing only once and ignoring gigantic, non-module `node_modules`, +there is very little added time. + +My test project takes 17s to lint completely, down from 55s, when using the +memoizing parser, and takes only 27s with naked `babel-eslint` (thus, reparsing local modules). + +### Added +- This change log ([#216]) +- Experimental memoizing [parser](./memo-parser/README.md) + +### Fixed +- Huge reduction in execution time by _only_ ignoring [`import/ignore` setting] if + something that looks like an `export` is detected in the module content. + +## [1.2.0] - 2016-03-19 + +Thanks [@lencioni] for identifying a huge amount of rework in resolve and kicking +off a bunch of memoization. + +I'm seeing 62% improvement over my normal test codebase when executing only +[`no-unresolved`] in isolation, and ~35% total reduction in lint time. + +### Changed +- added caching to core/resolve via [#214], configured via [`import/cache` setting] + +## [1.1.0] - 2016-03-15 + +### Added +- Added an [`ignore`](./docs/rules/no-unresolved.md#ignore) option to [`no-unresolved`] for those pesky files that no resolver can find. (still prefer enhancing the Webpack and Node resolvers to using it, though). See [#89] for details. + +## [1.0.4] - 2016-03-11 + +### Changed +- respect hoisting for deep namespaces ([`namespace`]/[`no-deprecated`]) ([#211]) + +### Fixed +- don't crash on self references ([#210]) +- correct cache behavior in `eslint_d` for deep namespaces ([#200]) + +## [1.0.3] - 2016-02-26 + +### Changed +- no-deprecated follows deep namespaces ([#191]) + +### Fixed +- [`namespace`] no longer flags modules with only a default export as having no names. (ns.default is valid ES6) + +## [1.0.2] - 2016-02-26 + +### Fixed +- don't parse imports with no specifiers ([#192]) + +## [1.0.1] - 2016-02-25 + +### Fixed +- export `stage-0` shared config +- documented [`no-deprecated`] +- deep namespaces are traversed regardless of how they get imported ([#189]) + +## [1.0.0] - 2016-02-24 + +### Added +- [`no-deprecated`]: WIP rule to let you know at lint time if you're using deprecated functions, constants, classes, or modules. + +### Changed +- [`namespace`]: support deep namespaces ([#119] via [#157]) + +## [1.0.0-beta.0] - 2016-02-13 + +### Changed +- support for (only) ESLint 2.x +- no longer needs/refers to `import/parser` or `import/parse-options`. Instead, ESLint provides the configured parser + options to the rules, and they use that to parse dependencies. + +### Removed + +- `babylon` as default import parser (see Breaking) + +## [0.13.0] - 2016-02-08 + +### Added +- [`no-commonjs`] rule +- [`no-amd`] rule + +### Removed +- Removed vestigial `no-require` rule. [`no-commonjs`] is more complete. + +## [0.12.2] - 2016-02-06 [YANKED] + +Unpublished from npm and re-released as 0.13.0. See [#170]. + +## [0.12.1] - 2015-12-17 + +### Changed +- Broke docs for rules out into individual files. + +## [0.12.0] - 2015-12-14 + +### Changed +- Ignore [`import/ignore` setting] if exports are actually found in the parsed module. Does this to support use of `jsnext:main` in `node_modules` without the pain of managing an allow list or a nuanced deny list. + +## [0.11.0] - 2015-11-27 + +### Added +- Resolver plugins. Now the linter can read Webpack config, properly follow aliases and ignore externals, dismisses inline loaders, etc. etc.! + +## Earlier releases (0.10.1 and younger) +See [GitHub release notes](https://github.com/import-js/eslint-plugin-import/releases?after=v0.11.0) +for info on changes for earlier releases. + + +[`import/cache` setting]: ./README.md#importcache +[`import/ignore` setting]: ./README.md#importignore +[`import/extensions` setting]: ./README.md#importextensions +[`import/parsers` setting]: ./README.md#importparsers +[`import/core-modules` setting]: ./README.md#importcore-modules +[`import/external-module-folders` setting]: ./README.md#importexternal-module-folders +[`internal-regex` setting]: ./README.md#importinternal-regex +[`import/node-version` setting]: ./README.md#importnode-version + +[`consistent-type-specifier-style`]: ./docs/rules/consistent-type-specifier-style.md +[`default`]: ./docs/rules/default.md +[`dynamic-import-chunkname`]: ./docs/rules/dynamic-import-chunkname.md +[`enforce-node-protocol-usage`]: ./docs/rules/enforce-node-protocol-usage.md +[`export`]: ./docs/rules/export.md +[`exports-last`]: ./docs/rules/exports-last.md +[`extensions`]: ./docs/rules/extensions.md +[`first`]: ./docs/rules/first.md +[`group-exports`]: ./docs/rules/group-exports.md +[`imports-first`]: ./docs/rules/first.md +[`max-dependencies`]: ./docs/rules/max-dependencies.md +[`named`]: ./docs/rules/named.md +[`namespace`]: ./docs/rules/namespace.md +[`newline-after-import`]: ./docs/rules/newline-after-import.md +[`no-absolute-path`]: ./docs/rules/no-absolute-path.md +[`no-amd`]: ./docs/rules/no-amd.md +[`no-anonymous-default-export`]: ./docs/rules/no-anonymous-default-export.md +[`no-commonjs`]: ./docs/rules/no-commonjs.md +[`no-cycle`]: ./docs/rules/no-cycle.md +[`no-default-export`]: ./docs/rules/no-default-export.md +[`no-deprecated`]: ./docs/rules/no-deprecated.md +[`no-duplicates`]: ./docs/rules/no-duplicates.md +[`no-dynamic-require`]: ./docs/rules/no-dynamic-require.md +[`no-empty-named-blocks`]: ./docs/rules/no-empty-named-blocks.md +[`no-extraneous-dependencies`]: ./docs/rules/no-extraneous-dependencies.md +[`no-import-module-exports`]: ./docs/rules/no-import-module-exports.md +[`no-internal-modules`]: ./docs/rules/no-internal-modules.md +[`no-mutable-exports`]: ./docs/rules/no-mutable-exports.md +[`no-named-as-default-member`]: ./docs/rules/no-named-as-default-member.md +[`no-named-as-default`]: ./docs/rules/no-named-as-default.md +[`no-named-default`]: ./docs/rules/no-named-default.md +[`no-named-export`]: ./docs/rules/no-named-export.md +[`no-namespace`]: ./docs/rules/no-namespace.md +[`no-nodejs-modules`]: ./docs/rules/no-nodejs-modules.md +[`no-relative-packages`]: ./docs/rules/no-relative-packages.md +[`no-relative-parent-imports`]: ./docs/rules/no-relative-parent-imports.md +[`no-restricted-paths`]: ./docs/rules/no-restricted-paths.md +[`no-self-import`]: ./docs/rules/no-self-import.md +[`no-unassigned-import`]: ./docs/rules/no-unassigned-import.md +[`no-unresolved`]: ./docs/rules/no-unresolved.md +[`no-unused-modules`]: ./docs/rules/no-unused-modules.md +[`no-useless-path-segments`]: ./docs/rules/no-useless-path-segments.md +[`no-webpack-loader-syntax`]: ./docs/rules/no-webpack-loader-syntax.md +[`order`]: ./docs/rules/order.md +[`prefer-default-export`]: ./docs/rules/prefer-default-export.md +[`unambiguous`]: ./docs/rules/unambiguous.md + +[`memo-parser`]: ./memo-parser/README.md + +[#3191]: https://github.com/import-js/eslint-plugin-import/pull/3191 +[#3173]: https://github.com/import-js/eslint-plugin-import/pull/3173 +[#3172]: https://github.com/import-js/eslint-plugin-import/pull/3172 +[#3167]: https://github.com/import-js/eslint-plugin-import/pull/3167 +[#3166]: https://github.com/import-js/eslint-plugin-import/pull/3166 +[#3152]: https://github.com/import-js/eslint-plugin-import/pull/3152 +[#3151]: https://github.com/import-js/eslint-plugin-import/pull/3151 +[#3138]: https://github.com/import-js/eslint-plugin-import/pull/3138 +[#3129]: https://github.com/import-js/eslint-plugin-import/pull/3129 +[#3128]: https://github.com/import-js/eslint-plugin-import/pull/3128 +[#3127]: https://github.com/import-js/eslint-plugin-import/pull/3127 +[#3125]: https://github.com/import-js/eslint-plugin-import/pull/3125 +[#3122]: https://github.com/import-js/eslint-plugin-import/pull/3122 +[#3116]: https://github.com/import-js/eslint-plugin-import/pull/3116 +[#3106]: https://github.com/import-js/eslint-plugin-import/pull/3106 +[#3105]: https://github.com/import-js/eslint-plugin-import/pull/3105 +[#3104]: https://github.com/import-js/eslint-plugin-import/pull/3104 +[#3097]: https://github.com/import-js/eslint-plugin-import/pull/3097 +[#3073]: https://github.com/import-js/eslint-plugin-import/pull/3073 +[#3072]: https://github.com/import-js/eslint-plugin-import/pull/3072 +[#3071]: https://github.com/import-js/eslint-plugin-import/pull/3071 +[#3070]: https://github.com/import-js/eslint-plugin-import/pull/3070 +[#3068]: https://github.com/import-js/eslint-plugin-import/pull/3068 +[#3066]: https://github.com/import-js/eslint-plugin-import/pull/3066 +[#3065]: https://github.com/import-js/eslint-plugin-import/pull/3065 +[#3062]: https://github.com/import-js/eslint-plugin-import/pull/3062 +[#3052]: https://github.com/import-js/eslint-plugin-import/pull/3052 +[#3043]: https://github.com/import-js/eslint-plugin-import/pull/3043 +[#3036]: https://github.com/import-js/eslint-plugin-import/pull/3036 +[#3033]: https://github.com/import-js/eslint-plugin-import/pull/3033 +[#3032]: https://github.com/import-js/eslint-plugin-import/pull/3032 +[#3024]: https://github.com/import-js/eslint-plugin-import/pull/3024 +[#3018]: https://github.com/import-js/eslint-plugin-import/pull/3018 +[#3012]: https://github.com/import-js/eslint-plugin-import/pull/3012 +[#3011]: https://github.com/import-js/eslint-plugin-import/pull/3011 +[#3004]: https://github.com/import-js/eslint-plugin-import/pull/3004 +[#2998]: https://github.com/import-js/eslint-plugin-import/pull/2998 +[#2996]: https://github.com/import-js/eslint-plugin-import/pull/2996 +[#2993]: https://github.com/import-js/eslint-plugin-import/pull/2993 +[#2991]: https://github.com/import-js/eslint-plugin-import/pull/2991 +[#2989]: https://github.com/import-js/eslint-plugin-import/pull/2989 +[#2987]: https://github.com/import-js/eslint-plugin-import/pull/2987 +[#2985]: https://github.com/import-js/eslint-plugin-import/pull/2985 +[#2982]: https://github.com/import-js/eslint-plugin-import/pull/2982 +[#2952]: https://github.com/import-js/eslint-plugin-import/pull/2952 +[#2944]: https://github.com/import-js/eslint-plugin-import/pull/2944 +[#2942]: https://github.com/import-js/eslint-plugin-import/pull/2942 +[#2919]: https://github.com/import-js/eslint-plugin-import/pull/2919 +[#2885]: https://github.com/import-js/eslint-plugin-import/pull/2885 +[#2884]: https://github.com/import-js/eslint-plugin-import/pull/2884 +[#2866]: https://github.com/import-js/eslint-plugin-import/pull/2866 +[#2854]: https://github.com/import-js/eslint-plugin-import/pull/2854 +[#2851]: https://github.com/import-js/eslint-plugin-import/pull/2851 +[#2850]: https://github.com/import-js/eslint-plugin-import/pull/2850 +[#2842]: https://github.com/import-js/eslint-plugin-import/pull/2842 +[#2835]: https://github.com/import-js/eslint-plugin-import/pull/2835 +[#2832]: https://github.com/import-js/eslint-plugin-import/pull/2832 +[#2817]: https://github.com/import-js/eslint-plugin-import/pull/2817 +[#2778]: https://github.com/import-js/eslint-plugin-import/pull/2778 +[#2756]: https://github.com/import-js/eslint-plugin-import/pull/2756 +[#2754]: https://github.com/import-js/eslint-plugin-import/pull/2754 +[#2748]: https://github.com/import-js/eslint-plugin-import/pull/2748 +[#2735]: https://github.com/import-js/eslint-plugin-import/pull/2735 +[#2699]: https://github.com/import-js/eslint-plugin-import/pull/2699 +[#2664]: https://github.com/import-js/eslint-plugin-import/pull/2664 +[#2640]: https://github.com/import-js/eslint-plugin-import/pull/2640 +[#2613]: https://github.com/import-js/eslint-plugin-import/pull/2613 +[#2608]: https://github.com/import-js/eslint-plugin-import/pull/2608 +[#2605]: https://github.com/import-js/eslint-plugin-import/pull/2605 +[#2602]: https://github.com/import-js/eslint-plugin-import/pull/2602 +[#2598]: https://github.com/import-js/eslint-plugin-import/pull/2598 +[#2589]: https://github.com/import-js/eslint-plugin-import/pull/2589 +[#2588]: https://github.com/import-js/eslint-plugin-import/pull/2588 +[#2582]: https://github.com/import-js/eslint-plugin-import/pull/2582 +[#2570]: https://github.com/import-js/eslint-plugin-import/pull/2570 +[#2568]: https://github.com/import-js/eslint-plugin-import/pull/2568 +[#2546]: https://github.com/import-js/eslint-plugin-import/pull/2546 +[#2541]: https://github.com/import-js/eslint-plugin-import/pull/2541 +[#2531]: https://github.com/import-js/eslint-plugin-import/pull/2531 +[#2511]: https://github.com/import-js/eslint-plugin-import/pull/2511 +[#2506]: https://github.com/import-js/eslint-plugin-import/pull/2506 +[#2503]: https://github.com/import-js/eslint-plugin-import/pull/2503 +[#2490]: https://github.com/import-js/eslint-plugin-import/pull/2490 +[#2475]: https://github.com/import-js/eslint-plugin-import/pull/2475 +[#2473]: https://github.com/import-js/eslint-plugin-import/pull/2473 +[#2466]: https://github.com/import-js/eslint-plugin-import/pull/2466 +[#2459]: https://github.com/import-js/eslint-plugin-import/pull/2459 +[#2440]: https://github.com/import-js/eslint-plugin-import/pull/2440 +[#2438]: https://github.com/import-js/eslint-plugin-import/pull/2438 +[#2436]: https://github.com/import-js/eslint-plugin-import/pull/2436 +[#2427]: https://github.com/import-js/eslint-plugin-import/pull/2427 +[#2424]: https://github.com/import-js/eslint-plugin-import/pull/2424 +[#2419]: https://github.com/import-js/eslint-plugin-import/pull/2419 +[#2417]: https://github.com/import-js/eslint-plugin-import/pull/2417 +[#2411]: https://github.com/import-js/eslint-plugin-import/pull/2411 +[#2399]: https://github.com/import-js/eslint-plugin-import/pull/2399 +[#2396]: https://github.com/import-js/eslint-plugin-import/pull/2396 +[#2395]: https://github.com/import-js/eslint-plugin-import/pull/2395 +[#2393]: https://github.com/import-js/eslint-plugin-import/pull/2393 +[#2388]: https://github.com/import-js/eslint-plugin-import/pull/2388 +[#2387]: https://github.com/import-js/eslint-plugin-import/pull/2387 +[#2381]: https://github.com/import-js/eslint-plugin-import/pull/2381 +[#2378]: https://github.com/import-js/eslint-plugin-import/pull/2378 +[#2374]: https://github.com/import-js/eslint-plugin-import/pull/2374 +[#2371]: https://github.com/import-js/eslint-plugin-import/pull/2371 +[#2367]: https://github.com/import-js/eslint-plugin-import/pull/2367 +[#2358]: https://github.com/import-js/eslint-plugin-import/pull/2358 +[#2341]: https://github.com/import-js/eslint-plugin-import/pull/2341 +[#2332]: https://github.com/import-js/eslint-plugin-import/pull/2332 +[#2334]: https://github.com/import-js/eslint-plugin-import/pull/2334 +[#2330]: https://github.com/import-js/eslint-plugin-import/pull/2330 +[#2315]: https://github.com/import-js/eslint-plugin-import/pull/2315 +[#2305]: https://github.com/import-js/eslint-plugin-import/pull/2305 +[#2299]: https://github.com/import-js/eslint-plugin-import/pull/2299 +[#2297]: https://github.com/import-js/eslint-plugin-import/pull/2297 +[#2287]: https://github.com/import-js/eslint-plugin-import/pull/2287 +[#2282]: https://github.com/import-js/eslint-plugin-import/pull/2282 +[#2280]: https://github.com/import-js/eslint-plugin-import/pull/2280 +[#2279]: https://github.com/import-js/eslint-plugin-import/pull/2279 +[#2272]: https://github.com/import-js/eslint-plugin-import/pull/2272 +[#2271]: https://github.com/import-js/eslint-plugin-import/pull/2271 +[#2270]: https://github.com/import-js/eslint-plugin-import/pull/2270 +[#2240]: https://github.com/import-js/eslint-plugin-import/pull/2240 +[#2233]: https://github.com/import-js/eslint-plugin-import/pull/2233 +[#2226]: https://github.com/import-js/eslint-plugin-import/pull/2226 +[#2220]: https://github.com/import-js/eslint-plugin-import/pull/2220 +[#2219]: https://github.com/import-js/eslint-plugin-import/pull/2219 +[#2212]: https://github.com/import-js/eslint-plugin-import/pull/2212 +[#2196]: https://github.com/import-js/eslint-plugin-import/pull/2196 +[#2194]: https://github.com/import-js/eslint-plugin-import/pull/2194 +[#2191]: https://github.com/import-js/eslint-plugin-import/pull/2191 +[#2184]: https://github.com/import-js/eslint-plugin-import/pull/2184 +[#2179]: https://github.com/import-js/eslint-plugin-import/pull/2179 +[#2160]: https://github.com/import-js/eslint-plugin-import/pull/2160 +[#2158]: https://github.com/import-js/eslint-plugin-import/pull/2158 +[#2156]: https://github.com/import-js/eslint-plugin-import/pull/2156 +[#2149]: https://github.com/import-js/eslint-plugin-import/pull/2149 +[#2146]: https://github.com/import-js/eslint-plugin-import/pull/2146 +[#2140]: https://github.com/import-js/eslint-plugin-import/pull/2140 +[#2138]: https://github.com/import-js/eslint-plugin-import/pull/2138 +[#2121]: https://github.com/import-js/eslint-plugin-import/pull/2121 +[#2112]: https://github.com/import-js/eslint-plugin-import/pull/2112 +[#2099]: https://github.com/import-js/eslint-plugin-import/pull/2099 +[#2097]: https://github.com/import-js/eslint-plugin-import/pull/2097 +[#2090]: https://github.com/import-js/eslint-plugin-import/pull/2090 +[#2087]: https://github.com/import-js/eslint-plugin-import/pull/2087 +[#2083]: https://github.com/import-js/eslint-plugin-import/pull/2083 +[#2075]: https://github.com/import-js/eslint-plugin-import/pull/2075 +[#2071]: https://github.com/import-js/eslint-plugin-import/pull/2071 +[#2047]: https://github.com/import-js/eslint-plugin-import/pull/2047 +[#2034]: https://github.com/import-js/eslint-plugin-import/pull/2034 +[#2028]: https://github.com/import-js/eslint-plugin-import/pull/2028 +[#2026]: https://github.com/import-js/eslint-plugin-import/pull/2026 +[#2022]: https://github.com/import-js/eslint-plugin-import/pull/2022 +[#2021]: https://github.com/import-js/eslint-plugin-import/pull/2021 +[#2012]: https://github.com/import-js/eslint-plugin-import/pull/2012 +[#1997]: https://github.com/import-js/eslint-plugin-import/pull/1997 +[#1993]: https://github.com/import-js/eslint-plugin-import/pull/1993 +[#1990]: https://github.com/import-js/eslint-plugin-import/pull/1990 +[#1985]: https://github.com/import-js/eslint-plugin-import/pull/1985 +[#1983]: https://github.com/import-js/eslint-plugin-import/pull/1983 +[#1974]: https://github.com/import-js/eslint-plugin-import/pull/1974 +[#1958]: https://github.com/import-js/eslint-plugin-import/pull/1958 +[#1948]: https://github.com/import-js/eslint-plugin-import/pull/1948 +[#1947]: https://github.com/import-js/eslint-plugin-import/pull/1947 +[#1944]: https://github.com/import-js/eslint-plugin-import/pull/1944 +[#1940]: https://github.com/import-js/eslint-plugin-import/pull/1940 +[#1897]: https://github.com/import-js/eslint-plugin-import/pull/1897 +[#1889]: https://github.com/import-js/eslint-plugin-import/pull/1889 +[#1878]: https://github.com/import-js/eslint-plugin-import/pull/1878 +[#1860]: https://github.com/import-js/eslint-plugin-import/pull/1860 +[#1848]: https://github.com/import-js/eslint-plugin-import/pull/1848 +[#1847]: https://github.com/import-js/eslint-plugin-import/pull/1847 +[#1846]: https://github.com/import-js/eslint-plugin-import/pull/1846 +[#1836]: https://github.com/import-js/eslint-plugin-import/pull/1836 +[#1835]: https://github.com/import-js/eslint-plugin-import/pull/1835 +[#1833]: https://github.com/import-js/eslint-plugin-import/pull/1833 +[#1831]: https://github.com/import-js/eslint-plugin-import/pull/1831 +[#1830]: https://github.com/import-js/eslint-plugin-import/pull/1830 +[#1824]: https://github.com/import-js/eslint-plugin-import/pull/1824 +[#1823]: https://github.com/import-js/eslint-plugin-import/pull/1823 +[#1822]: https://github.com/import-js/eslint-plugin-import/pull/1822 +[#1820]: https://github.com/import-js/eslint-plugin-import/pull/1820 +[#1819]: https://github.com/import-js/eslint-plugin-import/pull/1819 +[#1802]: https://github.com/import-js/eslint-plugin-import/pull/1802 +[#1788]: https://github.com/import-js/eslint-plugin-import/pull/1788 +[#1786]: https://github.com/import-js/eslint-plugin-import/pull/1786 +[#1785]: https://github.com/import-js/eslint-plugin-import/pull/1785 +[#1776]: https://github.com/import-js/eslint-plugin-import/pull/1776 +[#1770]: https://github.com/import-js/eslint-plugin-import/pull/1770 +[#1764]: https://github.com/import-js/eslint-plugin-import/pull/1764 +[#1763]: https://github.com/import-js/eslint-plugin-import/pull/1763 +[#1751]: https://github.com/import-js/eslint-plugin-import/pull/1751 +[#1744]: https://github.com/import-js/eslint-plugin-import/pull/1744 +[#1736]: https://github.com/import-js/eslint-plugin-import/pull/1736 +[#1735]: https://github.com/import-js/eslint-plugin-import/pull/1735 +[#1726]: https://github.com/import-js/eslint-plugin-import/pull/1726 +[#1724]: https://github.com/import-js/eslint-plugin-import/pull/1724 +[#1719]: https://github.com/import-js/eslint-plugin-import/pull/1719 +[#1696]: https://github.com/import-js/eslint-plugin-import/pull/1696 +[#1691]: https://github.com/import-js/eslint-plugin-import/pull/1691 +[#1690]: https://github.com/import-js/eslint-plugin-import/pull/1690 +[#1689]: https://github.com/import-js/eslint-plugin-import/pull/1689 +[#1681]: https://github.com/import-js/eslint-plugin-import/pull/1681 +[#1676]: https://github.com/import-js/eslint-plugin-import/pull/1676 +[#1666]: https://github.com/import-js/eslint-plugin-import/pull/1666 +[#1664]: https://github.com/import-js/eslint-plugin-import/pull/1664 +[#1660]: https://github.com/import-js/eslint-plugin-import/pull/1660 +[#1658]: https://github.com/import-js/eslint-plugin-import/pull/1658 +[#1651]: https://github.com/import-js/eslint-plugin-import/pull/1651 +[#1626]: https://github.com/import-js/eslint-plugin-import/pull/1626 +[#1620]: https://github.com/import-js/eslint-plugin-import/pull/1620 +[#1619]: https://github.com/import-js/eslint-plugin-import/pull/1619 +[#1612]: https://github.com/import-js/eslint-plugin-import/pull/1612 +[#1611]: https://github.com/import-js/eslint-plugin-import/pull/1611 +[#1605]: https://github.com/import-js/eslint-plugin-import/pull/1605 +[#1586]: https://github.com/import-js/eslint-plugin-import/pull/1586 +[#1572]: https://github.com/import-js/eslint-plugin-import/pull/1572 +[#1569]: https://github.com/import-js/eslint-plugin-import/pull/1569 +[#1563]: https://github.com/import-js/eslint-plugin-import/pull/1563 +[#1560]: https://github.com/import-js/eslint-plugin-import/pull/1560 +[#1551]: https://github.com/import-js/eslint-plugin-import/pull/1551 +[#1542]: https://github.com/import-js/eslint-plugin-import/pull/1542 +[#1534]: https://github.com/import-js/eslint-plugin-import/pull/1534 +[#1528]: https://github.com/import-js/eslint-plugin-import/pull/1528 +[#1526]: https://github.com/import-js/eslint-plugin-import/pull/1526 +[#1521]: https://github.com/import-js/eslint-plugin-import/pull/1521 +[#1519]: https://github.com/import-js/eslint-plugin-import/pull/1519 +[#1517]: https://github.com/import-js/eslint-plugin-import/pull/1517 +[#1507]: https://github.com/import-js/eslint-plugin-import/pull/1507 +[#1506]: https://github.com/import-js/eslint-plugin-import/pull/1506 +[#1496]: https://github.com/import-js/eslint-plugin-import/pull/1496 +[#1495]: https://github.com/import-js/eslint-plugin-import/pull/1495 +[#1494]: https://github.com/import-js/eslint-plugin-import/pull/1494 +[#1493]: https://github.com/import-js/eslint-plugin-import/pull/1493 +[#1491]: https://github.com/import-js/eslint-plugin-import/pull/1491 +[#1472]: https://github.com/import-js/eslint-plugin-import/pull/1472 +[#1470]: https://github.com/import-js/eslint-plugin-import/pull/1470 +[#1447]: https://github.com/import-js/eslint-plugin-import/pull/1447 +[#1439]: https://github.com/import-js/eslint-plugin-import/pull/1439 +[#1436]: https://github.com/import-js/eslint-plugin-import/pull/1436 +[#1435]: https://github.com/import-js/eslint-plugin-import/pull/1435 +[#1425]: https://github.com/import-js/eslint-plugin-import/pull/1425 +[#1419]: https://github.com/import-js/eslint-plugin-import/pull/1419 +[#1412]: https://github.com/import-js/eslint-plugin-import/pull/1412 +[#1409]: https://github.com/import-js/eslint-plugin-import/pull/1409 +[#1404]: https://github.com/import-js/eslint-plugin-import/pull/1404 +[#1401]: https://github.com/import-js/eslint-plugin-import/pull/1401 +[#1393]: https://github.com/import-js/eslint-plugin-import/pull/1393 +[#1389]: https://github.com/import-js/eslint-plugin-import/pull/1389 +[#1386]: https://github.com/import-js/eslint-plugin-import/pull/1386 +[#1377]: https://github.com/import-js/eslint-plugin-import/pull/1377 +[#1375]: https://github.com/import-js/eslint-plugin-import/pull/1375 +[#1372]: https://github.com/import-js/eslint-plugin-import/pull/1372 +[#1371]: https://github.com/import-js/eslint-plugin-import/pull/1371 +[#1370]: https://github.com/import-js/eslint-plugin-import/pull/1370 +[#1363]: https://github.com/import-js/eslint-plugin-import/pull/1363 +[#1360]: https://github.com/import-js/eslint-plugin-import/pull/1360 +[#1358]: https://github.com/import-js/eslint-plugin-import/pull/1358 +[#1356]: https://github.com/import-js/eslint-plugin-import/pull/1356 +[#1354]: https://github.com/import-js/eslint-plugin-import/pull/1354 +[#1352]: https://github.com/import-js/eslint-plugin-import/pull/1352 +[#1347]: https://github.com/import-js/eslint-plugin-import/pull/1347 +[#1345]: https://github.com/import-js/eslint-plugin-import/pull/1345 +[#1342]: https://github.com/import-js/eslint-plugin-import/pull/1342 +[#1340]: https://github.com/import-js/eslint-plugin-import/pull/1340 +[#1333]: https://github.com/import-js/eslint-plugin-import/pull/1333 +[#1331]: https://github.com/import-js/eslint-plugin-import/pull/1331 +[#1330]: https://github.com/import-js/eslint-plugin-import/pull/1330 +[#1320]: https://github.com/import-js/eslint-plugin-import/pull/1320 +[#1319]: https://github.com/import-js/eslint-plugin-import/pull/1319 +[#1312]: https://github.com/import-js/eslint-plugin-import/pull/1312 +[#1308]: https://github.com/import-js/eslint-plugin-import/pull/1308 +[#1304]: https://github.com/import-js/eslint-plugin-import/pull/1304 +[#1297]: https://github.com/import-js/eslint-plugin-import/pull/1297 +[#1295]: https://github.com/import-js/eslint-plugin-import/pull/1295 +[#1294]: https://github.com/import-js/eslint-plugin-import/pull/1294 +[#1290]: https://github.com/import-js/eslint-plugin-import/pull/1290 +[#1277]: https://github.com/import-js/eslint-plugin-import/pull/1277 +[#1262]: https://github.com/import-js/eslint-plugin-import/pull/1262 +[#1257]: https://github.com/import-js/eslint-plugin-import/pull/1257 +[#1253]: https://github.com/import-js/eslint-plugin-import/pull/1253 +[#1248]: https://github.com/import-js/eslint-plugin-import/pull/1248 +[#1238]: https://github.com/import-js/eslint-plugin-import/pull/1238 +[#1237]: https://github.com/import-js/eslint-plugin-import/pull/1237 +[#1235]: https://github.com/import-js/eslint-plugin-import/pull/1235 +[#1234]: https://github.com/import-js/eslint-plugin-import/pull/1234 +[#1232]: https://github.com/import-js/eslint-plugin-import/pull/1232 +[#1223]: https://github.com/import-js/eslint-plugin-import/pull/1223 +[#1222]: https://github.com/import-js/eslint-plugin-import/pull/1222 +[#1218]: https://github.com/import-js/eslint-plugin-import/pull/1218 +[#1176]: https://github.com/import-js/eslint-plugin-import/pull/1176 +[#1163]: https://github.com/import-js/eslint-plugin-import/pull/1163 +[#1157]: https://github.com/import-js/eslint-plugin-import/pull/1157 +[#1151]: https://github.com/import-js/eslint-plugin-import/pull/1151 +[#1142]: https://github.com/import-js/eslint-plugin-import/pull/1142 +[#1139]: https://github.com/import-js/eslint-plugin-import/pull/1139 +[#1137]: https://github.com/import-js/eslint-plugin-import/pull/1137 +[#1135]: https://github.com/import-js/eslint-plugin-import/pull/1135 +[#1128]: https://github.com/import-js/eslint-plugin-import/pull/1128 +[#1126]: https://github.com/import-js/eslint-plugin-import/pull/1126 +[#1122]: https://github.com/import-js/eslint-plugin-import/pull/1122 +[#1112]: https://github.com/import-js/eslint-plugin-import/pull/1112 +[#1107]: https://github.com/import-js/eslint-plugin-import/pull/1107 +[#1106]: https://github.com/import-js/eslint-plugin-import/pull/1106 +[#1105]: https://github.com/import-js/eslint-plugin-import/pull/1105 +[#1093]: https://github.com/import-js/eslint-plugin-import/pull/1093 +[#1085]: https://github.com/import-js/eslint-plugin-import/pull/1085 +[#1068]: https://github.com/import-js/eslint-plugin-import/pull/1068 +[#1049]: https://github.com/import-js/eslint-plugin-import/pull/1049 +[#1046]: https://github.com/import-js/eslint-plugin-import/pull/1046 +[#966]: https://github.com/import-js/eslint-plugin-import/pull/966 +[#944]: https://github.com/import-js/eslint-plugin-import/pull/944 +[#912]: https://github.com/import-js/eslint-plugin-import/pull/912 +[#908]: https://github.com/import-js/eslint-plugin-import/pull/908 +[#891]: https://github.com/import-js/eslint-plugin-import/pull/891 +[#889]: https://github.com/import-js/eslint-plugin-import/pull/889 +[#880]: https://github.com/import-js/eslint-plugin-import/pull/880 +[#871]: https://github.com/import-js/eslint-plugin-import/pull/871 +[#858]: https://github.com/import-js/eslint-plugin-import/pull/858 +[#843]: https://github.com/import-js/eslint-plugin-import/pull/843 +[#804]: https://github.com/import-js/eslint-plugin-import/pull/804 +[#797]: https://github.com/import-js/eslint-plugin-import/pull/797 +[#794]: https://github.com/import-js/eslint-plugin-import/pull/794 +[#744]: https://github.com/import-js/eslint-plugin-import/pull/744 +[#742]: https://github.com/import-js/eslint-plugin-import/pull/742 +[#737]: https://github.com/import-js/eslint-plugin-import/pull/737 +[#727]: https://github.com/import-js/eslint-plugin-import/pull/727 +[#721]: https://github.com/import-js/eslint-plugin-import/pull/721 +[#712]: https://github.com/import-js/eslint-plugin-import/pull/712 +[#696]: https://github.com/import-js/eslint-plugin-import/pull/696 +[#685]: https://github.com/import-js/eslint-plugin-import/pull/685 +[#680]: https://github.com/import-js/eslint-plugin-import/pull/680 +[#654]: https://github.com/import-js/eslint-plugin-import/pull/654 +[#639]: https://github.com/import-js/eslint-plugin-import/pull/639 +[#632]: https://github.com/import-js/eslint-plugin-import/pull/632 +[#630]: https://github.com/import-js/eslint-plugin-import/pull/630 +[#629]: https://github.com/import-js/eslint-plugin-import/pull/629 +[#628]: https://github.com/import-js/eslint-plugin-import/pull/628 +[#596]: https://github.com/import-js/eslint-plugin-import/pull/596 +[#586]: https://github.com/import-js/eslint-plugin-import/pull/586 +[#578]: https://github.com/import-js/eslint-plugin-import/pull/578 +[#568]: https://github.com/import-js/eslint-plugin-import/pull/568 +[#555]: https://github.com/import-js/eslint-plugin-import/pull/555 +[#538]: https://github.com/import-js/eslint-plugin-import/pull/538 +[#527]: https://github.com/import-js/eslint-plugin-import/pull/527 +[#518]: https://github.com/import-js/eslint-plugin-import/pull/518 +[#509]: https://github.com/import-js/eslint-plugin-import/pull/509 +[#508]: https://github.com/import-js/eslint-plugin-import/pull/508 +[#503]: https://github.com/import-js/eslint-plugin-import/pull/503 +[#499]: https://github.com/import-js/eslint-plugin-import/pull/499 +[#489]: https://github.com/import-js/eslint-plugin-import/pull/489 +[#485]: https://github.com/import-js/eslint-plugin-import/pull/485 +[#461]: https://github.com/import-js/eslint-plugin-import/pull/461 +[#449]: https://github.com/import-js/eslint-plugin-import/pull/449 +[#444]: https://github.com/import-js/eslint-plugin-import/pull/444 +[#428]: https://github.com/import-js/eslint-plugin-import/pull/428 +[#395]: https://github.com/import-js/eslint-plugin-import/pull/395 +[#371]: https://github.com/import-js/eslint-plugin-import/pull/371 +[#365]: https://github.com/import-js/eslint-plugin-import/pull/365 +[#359]: https://github.com/import-js/eslint-plugin-import/pull/359 +[#343]: https://github.com/import-js/eslint-plugin-import/pull/343 +[#332]: https://github.com/import-js/eslint-plugin-import/pull/332 +[#322]: https://github.com/import-js/eslint-plugin-import/pull/322 +[#321]: https://github.com/import-js/eslint-plugin-import/pull/321 +[#316]: https://github.com/import-js/eslint-plugin-import/pull/316 +[#314]: https://github.com/import-js/eslint-plugin-import/pull/314 +[#308]: https://github.com/import-js/eslint-plugin-import/pull/308 +[#298]: https://github.com/import-js/eslint-plugin-import/pull/298 +[#297]: https://github.com/import-js/eslint-plugin-import/pull/297 +[#296]: https://github.com/import-js/eslint-plugin-import/pull/296 +[#290]: https://github.com/import-js/eslint-plugin-import/pull/290 +[#288]: https://github.com/import-js/eslint-plugin-import/pull/288 +[#261]: https://github.com/import-js/eslint-plugin-import/pull/261 +[#256]: https://github.com/import-js/eslint-plugin-import/pull/256 +[#254]: https://github.com/import-js/eslint-plugin-import/pull/254 +[#250]: https://github.com/import-js/eslint-plugin-import/pull/250 +[#247]: https://github.com/import-js/eslint-plugin-import/pull/247 +[#245]: https://github.com/import-js/eslint-plugin-import/pull/245 +[#243]: https://github.com/import-js/eslint-plugin-import/pull/243 +[#241]: https://github.com/import-js/eslint-plugin-import/pull/241 +[#239]: https://github.com/import-js/eslint-plugin-import/pull/239 +[#228]: https://github.com/import-js/eslint-plugin-import/pull/228 +[#211]: https://github.com/import-js/eslint-plugin-import/pull/211 +[#157]: https://github.com/import-js/eslint-plugin-import/pull/157 + +[ljharb#37]: https://github.com/ljharb/eslint-plugin-import/pull/37 + +[#2930]: https://github.com/import-js/eslint-plugin-import/issues/2930 +[#2687]: https://github.com/import-js/eslint-plugin-import/issues/2687 +[#2684]: https://github.com/import-js/eslint-plugin-import/issues/2684 +[#2682]: https://github.com/import-js/eslint-plugin-import/issues/2682 +[#2674]: https://github.com/import-js/eslint-plugin-import/issues/2674 +[#2668]: https://github.com/import-js/eslint-plugin-import/issues/2668 +[#2666]: https://github.com/import-js/eslint-plugin-import/issues/2666 +[#2665]: https://github.com/import-js/eslint-plugin-import/issues/2665 +[#2577]: https://github.com/import-js/eslint-plugin-import/issues/2577 +[#2447]: https://github.com/import-js/eslint-plugin-import/issues/2447 +[#2444]: https://github.com/import-js/eslint-plugin-import/issues/2444 +[#2412]: https://github.com/import-js/eslint-plugin-import/issues/2412 +[#2392]: https://github.com/import-js/eslint-plugin-import/issues/2392 +[#2340]: https://github.com/import-js/eslint-plugin-import/issues/2340 +[#2255]: https://github.com/import-js/eslint-plugin-import/issues/2255 +[#2210]: https://github.com/import-js/eslint-plugin-import/issues/2210 +[#2201]: https://github.com/import-js/eslint-plugin-import/issues/2201 +[#2199]: https://github.com/import-js/eslint-plugin-import/issues/2199 +[#2161]: https://github.com/import-js/eslint-plugin-import/issues/2161 +[#2118]: https://github.com/import-js/eslint-plugin-import/issues/2118 +[#2067]: https://github.com/import-js/eslint-plugin-import/issues/2067 +[#2063]: https://github.com/import-js/eslint-plugin-import/issues/2063 +[#2056]: https://github.com/import-js/eslint-plugin-import/issues/2056 +[#1998]: https://github.com/import-js/eslint-plugin-import/issues/1998 +[#1965]: https://github.com/import-js/eslint-plugin-import/issues/1965 +[#1924]: https://github.com/import-js/eslint-plugin-import/issues/1924 +[#1854]: https://github.com/import-js/eslint-plugin-import/issues/1854 +[#1841]: https://github.com/import-js/eslint-plugin-import/issues/1841 +[#1834]: https://github.com/import-js/eslint-plugin-import/issues/1834 +[#1814]: https://github.com/import-js/eslint-plugin-import/issues/1814 +[#1811]: https://github.com/import-js/eslint-plugin-import/issues/1811 +[#1808]: https://github.com/import-js/eslint-plugin-import/issues/1808 +[#1805]: https://github.com/import-js/eslint-plugin-import/issues/1805 +[#1801]: https://github.com/import-js/eslint-plugin-import/issues/1801 +[#1722]: https://github.com/import-js/eslint-plugin-import/issues/1722 +[#1704]: https://github.com/import-js/eslint-plugin-import/issues/1704 +[#1702]: https://github.com/import-js/eslint-plugin-import/issues/1702 +[#1635]: https://github.com/import-js/eslint-plugin-import/issues/1635 +[#1631]: https://github.com/import-js/eslint-plugin-import/issues/1631 +[#1616]: https://github.com/import-js/eslint-plugin-import/issues/1616 +[#1613]: https://github.com/import-js/eslint-plugin-import/issues/1613 +[#1590]: https://github.com/import-js/eslint-plugin-import/issues/1590 +[#1589]: https://github.com/import-js/eslint-plugin-import/issues/1589 +[#1565]: https://github.com/import-js/eslint-plugin-import/issues/1565 +[#1366]: https://github.com/import-js/eslint-plugin-import/issues/1366 +[#1334]: https://github.com/import-js/eslint-plugin-import/issues/1334 +[#1323]: https://github.com/import-js/eslint-plugin-import/issues/1323 +[#1322]: https://github.com/import-js/eslint-plugin-import/issues/1322 +[#1300]: https://github.com/import-js/eslint-plugin-import/issues/1300 +[#1293]: https://github.com/import-js/eslint-plugin-import/issues/1293 +[#1266]: https://github.com/import-js/eslint-plugin-import/issues/1266 +[#1256]: https://github.com/import-js/eslint-plugin-import/issues/1256 +[#1233]: https://github.com/import-js/eslint-plugin-import/issues/1233 +[#1175]: https://github.com/import-js/eslint-plugin-import/issues/1175 +[#1166]: https://github.com/import-js/eslint-plugin-import/issues/1166 +[#1144]: https://github.com/import-js/eslint-plugin-import/issues/1144 +[#1058]: https://github.com/import-js/eslint-plugin-import/issues/1058 +[#1035]: https://github.com/import-js/eslint-plugin-import/issues/1035 +[#931]: https://github.com/import-js/eslint-plugin-import/issues/931 +[#886]: https://github.com/import-js/eslint-plugin-import/issues/886 +[#863]: https://github.com/import-js/eslint-plugin-import/issues/863 +[#842]: https://github.com/import-js/eslint-plugin-import/issues/842 +[#839]: https://github.com/import-js/eslint-plugin-import/issues/839 +[#795]: https://github.com/import-js/eslint-plugin-import/issues/795 +[#793]: https://github.com/import-js/eslint-plugin-import/issues/793 +[#720]: https://github.com/import-js/eslint-plugin-import/issues/720 +[#717]: https://github.com/import-js/eslint-plugin-import/issues/717 +[#686]: https://github.com/import-js/eslint-plugin-import/issues/686 +[#671]: https://github.com/import-js/eslint-plugin-import/issues/671 +[#660]: https://github.com/import-js/eslint-plugin-import/issues/660 +[#653]: https://github.com/import-js/eslint-plugin-import/issues/653 +[#627]: https://github.com/import-js/eslint-plugin-import/issues/627 +[#620]: https://github.com/import-js/eslint-plugin-import/issues/620 +[#609]: https://github.com/import-js/eslint-plugin-import/issues/609 +[#604]: https://github.com/import-js/eslint-plugin-import/issues/604 +[#602]: https://github.com/import-js/eslint-plugin-import/issues/602 +[#601]: https://github.com/import-js/eslint-plugin-import/issues/601 +[#592]: https://github.com/import-js/eslint-plugin-import/issues/592 +[#577]: https://github.com/import-js/eslint-plugin-import/issues/577 +[#570]: https://github.com/import-js/eslint-plugin-import/issues/570 +[#567]: https://github.com/import-js/eslint-plugin-import/issues/567 +[#566]: https://github.com/import-js/eslint-plugin-import/issues/566 +[#545]: https://github.com/import-js/eslint-plugin-import/issues/545 +[#530]: https://github.com/import-js/eslint-plugin-import/issues/530 +[#529]: https://github.com/import-js/eslint-plugin-import/issues/529 +[#519]: https://github.com/import-js/eslint-plugin-import/issues/519 +[#507]: https://github.com/import-js/eslint-plugin-import/issues/507 +[#484]: https://github.com/import-js/eslint-plugin-import/issues/484 +[#478]: https://github.com/import-js/eslint-plugin-import/issues/478 +[#456]: https://github.com/import-js/eslint-plugin-import/issues/456 +[#453]: https://github.com/import-js/eslint-plugin-import/issues/453 +[#452]: https://github.com/import-js/eslint-plugin-import/issues/452 +[#447]: https://github.com/import-js/eslint-plugin-import/issues/447 +[#441]: https://github.com/import-js/eslint-plugin-import/issues/441 +[#423]: https://github.com/import-js/eslint-plugin-import/issues/423 +[#416]: https://github.com/import-js/eslint-plugin-import/issues/416 +[#415]: https://github.com/import-js/eslint-plugin-import/issues/415 +[#402]: https://github.com/import-js/eslint-plugin-import/issues/402 +[#386]: https://github.com/import-js/eslint-plugin-import/issues/386 +[#373]: https://github.com/import-js/eslint-plugin-import/issues/373 +[#370]: https://github.com/import-js/eslint-plugin-import/issues/370 +[#348]: https://github.com/import-js/eslint-plugin-import/issues/348 +[#342]: https://github.com/import-js/eslint-plugin-import/issues/342 +[#328]: https://github.com/import-js/eslint-plugin-import/issues/328 +[#317]: https://github.com/import-js/eslint-plugin-import/issues/317 +[#313]: https://github.com/import-js/eslint-plugin-import/issues/313 +[#311]: https://github.com/import-js/eslint-plugin-import/issues/311 +[#306]: https://github.com/import-js/eslint-plugin-import/issues/306 +[#283]: https://github.com/import-js/eslint-plugin-import/issues/283 +[#281]: https://github.com/import-js/eslint-plugin-import/issues/281 +[#275]: https://github.com/import-js/eslint-plugin-import/issues/275 +[#272]: https://github.com/import-js/eslint-plugin-import/issues/272 +[#270]: https://github.com/import-js/eslint-plugin-import/issues/270 +[#267]: https://github.com/import-js/eslint-plugin-import/issues/267 +[#266]: https://github.com/import-js/eslint-plugin-import/issues/266 +[#216]: https://github.com/import-js/eslint-plugin-import/issues/216 +[#214]: https://github.com/import-js/eslint-plugin-import/issues/214 +[#210]: https://github.com/import-js/eslint-plugin-import/issues/210 +[#200]: https://github.com/import-js/eslint-plugin-import/issues/200 +[#192]: https://github.com/import-js/eslint-plugin-import/issues/192 +[#191]: https://github.com/import-js/eslint-plugin-import/issues/191 +[#189]: https://github.com/import-js/eslint-plugin-import/issues/189 +[#170]: https://github.com/import-js/eslint-plugin-import/issues/170 +[#155]: https://github.com/import-js/eslint-plugin-import/issues/155 +[#119]: https://github.com/import-js/eslint-plugin-import/issues/119 +[#89]: https://github.com/import-js/eslint-plugin-import/issues/89 + +[Unreleased]: https://github.com/import-js/eslint-plugin-import/compare/v2.32.0...HEAD +[2.32.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.31.0...v2.32.0 +[2.31.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.30.0...v2.31.0 +[2.30.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.29.1...v2.30.0 +[2.29.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.29.0...v2.29.1 +[2.29.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.28.1...v2.29.0 +[2.28.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.28.0...v2.28.1 +[2.28.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.27.5...v2.28.0 +[2.27.5]: https://github.com/import-js/eslint-plugin-import/compare/v2.27.4...v2.27.5 +[2.27.4]: https://github.com/import-js/eslint-plugin-import/compare/v2.27.3...v2.27.4 +[2.27.3]: https://github.com/import-js/eslint-plugin-import/compare/v2.27.2...v2.27.3 +[2.27.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.27.1...v2.27.2 +[2.27.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.27.0...v2.27.1 +[2.27.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.26.0...v2.27.0 +[2.26.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.25.4...v2.26.0 +[2.25.4]: https://github.com/import-js/eslint-plugin-import/compare/v2.25.3...v2.25.4 +[2.25.3]: https://github.com/import-js/eslint-plugin-import/compare/v2.25.2...v2.25.3 +[2.25.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.25.1...v2.25.2 +[2.25.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.25.0...v2.25.1 +[2.25.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.24.2...v2.25.0 +[2.24.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.24.1...v2.24.2 +[2.24.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.24.0...v2.24.1 +[2.24.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.23.4...v2.24.0 +[2.23.4]: https://github.com/import-js/eslint-plugin-import/compare/v2.23.3...v2.23.4 +[2.23.3]: https://github.com/import-js/eslint-plugin-import/compare/v2.23.2...v2.23.3 +[2.23.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.23.1...v2.23.2 +[2.23.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.23.0...v2.23.1 +[2.23.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.22.1...v2.23.0 +[2.22.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.22.0...v2.22.1 +[2.22.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.21.1...v2.22.0 +[2.21.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.21.1...v2.21.2 +[2.21.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.21.0...v2.21.1 +[2.21.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.20.1...v2.21.0 +[2.20.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.20.0...v2.20.1 +[2.20.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.19.1...v2.20.0 +[2.19.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.19.0...v2.19.1 +[2.19.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.18.2...v2.19.0 +[2.18.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.18.1...v2.18.2 +[2.18.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.18.0...v2.18.1 +[2.18.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.17.3...v2.18.0 +[2.17.3]: https://github.com/import-js/eslint-plugin-import/compare/v2.17.2...v2.17.3 +[2.17.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.17.1...v2.17.2 +[2.17.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.17.0...v2.17.1 +[2.17.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.16.0...v2.17.0 +[2.16.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.15.0...v2.16.0 +[2.15.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.14.0...v2.15.0 +[2.14.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.13.0...v2.14.0 +[2.13.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.12.0...v2.13.0 +[2.12.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.11.0...v2.12.0 +[2.11.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.10.0...v2.11.0 +[2.10.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.9.0...v2.10.0 +[2.9.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.8.0...v2.9.0 +[2.8.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.7.0...v2.8.0 +[2.7.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.6.1...v2.7.0 +[2.6.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.6.0...v2.6.1 +[2.6.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.5.0...v2.6.0 +[2.5.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.4.0...v2.5.0 +[2.4.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.3.0...v2.4.0 +[2.3.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.2.0...v2.3.0 +[2.2.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.1.0...v2.2.0 +[2.1.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.0.1...v2.1.0 +[2.0.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.16.0...v2.0.0 +[1.16.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.15.0...v1.16.0 +[1.15.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.14.0...v1.15.0 +[1.14.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.13.0...v1.14.0 +[1.13.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.12.0...v1.13.0 +[1.12.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.11.1...v1.12.0 +[1.11.1]: https://github.com/import-js/eslint-plugin-import/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.10.3...v1.11.0 +[1.10.3]: https://github.com/import-js/eslint-plugin-import/compare/v1.10.2...v1.10.3 +[1.10.2]: https://github.com/import-js/eslint-plugin-import/compare/v1.10.1...v1.10.2 +[1.10.1]: https://github.com/import-js/eslint-plugin-import/compare/v1.10.0...v1.10.1 +[1.10.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.9.2...v1.10.0 +[1.9.2]: https://github.com/import-js/eslint-plugin-import/compare/v1.9.1...v1.9.2 +[1.9.1]: https://github.com/import-js/eslint-plugin-import/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.8.1...v1.9.0 +[1.8.1]: https://github.com/import-js/eslint-plugin-import/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.7.0...v1.8.0 +[1.7.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.6.1...v1.7.0 +[1.6.1]: https://github.com/import-js/eslint-plugin-import/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.5.0...1.6.0 +[1.5.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.0.4...v1.1.0 +[1.0.4]: https://github.com/import-js/eslint-plugin-import/compare/v1.0.3...v1.0.4 +[1.0.3]: https://github.com/import-js/eslint-plugin-import/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/import-js/eslint-plugin-import/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/import-js/eslint-plugin-import/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/import-js/eslint-plugin-import/compare/v1.0.0-beta.0...v1.0.0 +[1.0.0-beta.0]: https://github.com/import-js/eslint-plugin-import/compare/v0.13.0...v1.0.0-beta.0 +[0.13.0]: https://github.com/import-js/eslint-plugin-import/compare/v0.12.1...v0.13.0 +[0.12.2]: https://github.com/import-js/eslint-plugin-import/compare/v0.12.1...v0.12.2 +[0.12.1]: https://github.com/import-js/eslint-plugin-import/compare/v0.12.0...v0.12.1 +[0.12.0]: https://github.com/import-js/eslint-plugin-import/compare/v0.11.0...v0.12.0 +[0.11.0]: https://github.com/import-js/eslint-plugin-import/compare/v0.10.1...v0.11.0 + +[@1pete]: https://github.com/1pete +[@3nuc]: https://github.com/3nuc +[@aamulumi]: https://github.com/aamulumi +[@aberezkin]: https://github.com/aberezkin +[@adamborowski]: https://github.com/adamborowski +[@adjerbetian]: https://github.com/adjerbetian +[@AdriAt360]: https://github.com/AdriAt360 +[@ai]: https://github.com/ai +[@aks-]: https://github.com/aks- +[@akwodkiewicz]: https://github.com/akwodkiewicz +[@aladdin-add]: https://github.com/aladdin-add +[@albertpastrana]: https://github.com/albertpastrana +[@alex-page]: https://github.com/alex-page +[@alexgorbatchev]: https://github.com/alexgorbatchev +[@amsardesai]: https://github.com/amsardesai +[@andreubotella]: https://github.com/andreubotella +[@AndrewLeedham]: https://github.com/AndrewLeedham +[@andyogo]: https://github.com/andyogo +[@aravindet]: https://github.com/aravindet +[@arvigeus]: https://github.com/arvigeus +[@asapach]: https://github.com/asapach +[@astorije]: https://github.com/astorije +[@atav32]: https://github.com/atav32 +[@atikenny]: https://github.com/atikenny +[@atos1990]: https://github.com/atos1990 +[@azyzz228]: https://github.com/azyzz228 +[@barbogast]: https://github.com/barbogast +[@BarryThePenguin]: https://github.com/BarryThePenguin +[@be5invis]: https://github.com/be5invis +[@beatrizrezener]: https://github.com/beatrizrezener +[@benasher44]: https://github.com/benasher44 +[@benkrejci]: https://github.com/benkrejci +[@benmosher]: https://github.com/benmosher +[@benmunro]: https://github.com/benmunro +[@BenoitZugmeyer]: https://github.com/BenoitZugmeyer +[@bertyhell]: https://github.com/bertyhell +[@bicstone]: https://github.com/bicstone +[@Blasz]: https://github.com/Blasz +[@bmish]: https://github.com/bmish +[@borisyankov]: https://github.com/borisyankov +[@bradennapier]: https://github.com/bradennapier +[@bradzacher]: https://github.com/bradzacher +[@brendo]: https://github.com/brendo +[@brettz9]: https://github.com/brettz9 +[@chabb]: https://github.com/chabb +[@Chamion]: https://github.com/Chamion +[@charlessuh]: https://github.com/charlessuh +[@charpeni]: https://github.com/charpeni +[@cherryblossom000]: https://github.com/cherryblossom000 +[@chrislloyd]: https://github.com/chrislloyd +[@christianvuerings]: https://github.com/christianvuerings +[@christophercurrie]: https://github.com/christophercurrie +[@cristobal]: https://github.com/cristobal +[@DamienCassou]: https://github.com/DamienCassou +[@danny-andrews]: https://github.com/dany-andrews +[@darkartur]: https://github.com/darkartur +[@davidbonnet]: https://github.com/davidbonnet +[@dbrewer5]: https://github.com/dbrewer5 +[@developer-bandi]: https://github.com/developer-bandi +[@devinrhode2]: https://github.com/devinrhode2 +[@devongovett]: https://github.com/devongovett +[@dmnd]: https://github.com/dmnd +[@domdomegg]: https://github.com/domdomegg +[@duncanbeevers]: https://github.com/duncanbeevers +[@dwardu]: https://github.com/dwardu +[@echenley]: https://github.com/echenley +[@edemaine]: https://github.com/edemaine +[@eelyafi]: https://github.com/eelyafi +[@Ephem]: https://github.com/Ephem +[@ephys]: https://github.com/ephys +[@eps1lon]: https://github.com/eps1lon +[@ernestostifano]: https://github.com/ernestostifano +[@ertrzyiks]: https://github.com/ertrzyiks +[@fa93hws]: https://github.com/fa93hws +[@Fdawgs]: https://github.com/Fdawgs +[@fengkfengk]: https://github.com/fengkfengk +[@fernandopasik]: https://github.com/fernandopasik +[@feychenie]: https://github.com/feychenie +[@fisker]: https://github.com/fisker +[@FloEdelmann]: https://github.com/FloEdelmann +[@fooloomanzoo]: https://github.com/fooloomanzoo +[@foray1010]: https://github.com/foray1010 +[@forivall]: https://github.com/forivall +[@fsmaia]: https://github.com/fsmaia +[@fson]: https://github.com/fson +[@futpib]: https://github.com/futpib +[@G-Rath]: https://github.com/G-Rath +[@gajus]: https://github.com/gajus +[@gausie]: https://github.com/gausie +[@gavriguy]: https://github.com/gavriguy +[@georeith]: https://github.com/georeith +[@giodamelio]: https://github.com/giodamelio +[@gnprice]: https://github.com/gnprice +[@GoldStrikeArch]: https://github.com/GoldStrikeArch +[@golergka]: https://github.com/golergka +[@golopot]: https://github.com/golopot +[@GoodForOneFare]: https://github.com/GoodForOneFare +[@graingert]: https://github.com/graingert +[@greim]: https://github.com/greim +[@grit96]: https://github.com/grit96 +[@guilhermelimak]: https://github.com/guilhermelimak +[@guillaumewuip]: https://github.com/guillaumewuip +[@hayes]: https://github.com/hayes +[@himynameisdave]: https://github.com/himynameisdave +[@hulkish]: https://github.com/hulkish +[@hyperupcall]: https://github.com/hyperupcall +[@Hypnosphi]: https://github.com/Hypnosphi +[@intellix]: https://github.com/intellix +[@isiahmeadows]: https://github.com/isiahmeadows +[@IvanGoncharov]: https://github.com/IvanGoncharov +[@ivo-stefchev]: https://github.com/ivo-stefchev +[@jablko]: https://github.com/jablko +[@jakubsta]: https://github.com/jakubsta +[@jeffshaver]: https://github.com/jeffshaver +[@jf248]: https://github.com/jf248 +[@jfmengels]: https://github.com/jfmengels +[@JiangWeixian]: https://github.com/JiangWeixian +[@jimbolla]: https://github.com/jimbolla +[@jkimbo]: https://github.com/jkimbo +[@joaovieira]: https://github.com/joaovieira +[@joe-matsec]: https://github.com/joe-matsec +[@joeyguerra]: https://github.com/joeyguerra +[@johndevedu]: https://github.com/johndevedu +[@johnthagen]: https://github.com/johnthagen +[@jonboiser]: https://github.com/jonboiser +[@josh]: https://github.com/josh +[@joshuaobrien]: https://github.com/joshuaobrien +[@JounQin]: https://github.com/JounQin +[@jquense]: https://github.com/jquense +[@jseminck]: https://github.com/jseminck +[@julien1619]: https://github.com/julien1619 +[@justinanastos]: https://github.com/justinanastos +[@jwbth]: https://github.com/jwbth +[@k15a]: https://github.com/k15a +[@kentcdodds]: https://github.com/kentcdodds +[@kevin940726]: https://github.com/kevin940726 +[@kgregory]: https://github.com/kgregory +[@kinland]: https://github.com/kinland +[@kirill-konshin]: https://github.com/kirill-konshin +[@kiwka]: https://github.com/kiwka +[@klimashkin]: https://github.com/klimashkin +[@kmui2]: https://github.com/kmui2 +[@knpwrs]: https://github.com/knpwrs +[@KostyaZgara]: https://github.com/KostyaZgara +[@kylemh]: https://github.com/kylemh +[@laurens-dg]: https://github.com/laurens-dg +[@laysent]: https://github.com/laysent +[@le0nik]: https://github.com/le0nik +[@leipert]: https://github.com/leipert +[@lemonmade]: https://github.com/lemonmade +[@lencioni]: https://github.com/lencioni +[@leonardodino]: https://github.com/leonardodino +[@Librazy]: https://github.com/Librazy +[@liby]: https://github.com/liby +[@lilling]: https://github.com/lilling +[@liuxingbaoyu]: https://github.com/liuxingbaoyu +[@ljharb]: https://github.com/ljharb +[@ljqx]: https://github.com/ljqx +[@lnuvy]: https://github.com/lnuvy +[@lo1tuma]: https://github.com/lo1tuma +[@loganfsmyth]: https://github.com/loganfsmyth +[@luczsoma]: https://github.com/luczsoma +[@ludofischer]: https://github.com/ludofischer +[@Lukas-Kullmann]: https://github.com/Lukas-Kullmann +[@lukeapage]: https://github.com/lukeapage +[@lydell]: https://github.com/lydell +[@magarcia]: https://github.com/magarcia +[@Mairu]: https://github.com/Mairu +[@malykhinvi]: https://github.com/malykhinvi +[@manovotny]: https://github.com/manovotny +[@manuth]: https://github.com/manuth +[@marcusdarmstrong]: https://github.com/marcusdarmstrong +[@mastilver]: https://github.com/mastilver +[@mathieudutour]: https://github.com/mathieudutour +[@MatthiasKunnen]: https://github.com/MatthiasKunnen +[@mattijsbliek]: https://github.com/mattijsbliek +[@Maxim-Mazurok]: https://github.com/Maxim-Mazurok +[@maxkomarychev]: https://github.com/maxkomarychev +[@maxmalov]: https://github.com/maxmalov +[@meowtec]: https://github.com/meowtec +[@mgwalker]: https://github.com/mgwalker +[@mhmadhamster]: https://github.com/MhMadHamster +[@michaelfaith]: https://github.com/michaelfaith +[@mihkeleidast]: https://github.com/mihkeleidast +[@MikeyBeLike]: https://github.com/MikeyBeLike +[@minervabot]: https://github.com/minervabot +[@mpint]: https://github.com/mpint +[@mplewis]: https://github.com/mplewis +[@mrmckeb]: https://github.com/mrmckeb +[@msvab]: https://github.com/msvab +[@mulztob]: https://github.com/mulztob +[@mx-bernhard]: https://github.com/mx-bernhard +[@Nfinished]: https://github.com/Nfinished +[@nickofthyme]: https://github.com/nickofthyme +[@nicolashenry]: https://github.com/nicolashenry +[@NishargShah]: https://github.com/NishargShah +[@noelebrun]: https://github.com/noelebrun +[@ntdb]: https://github.com/ntdb +[@nwalters512]: https://github.com/nwalters512 +[@ombene]: https://github.com/ombene +[@ota-meshi]: https://github.com/ota-meshi +[@OutdatedVersion]: https://github.com/OutdatedVersion +[@Pandemic1617]: https://github.com/Pandemic1617 +[@panrafal]: https://github.com/panrafal +[@paztis]: https://github.com/paztis +[@pcorpet]: https://github.com/pcorpet +[@Pearce-Ropion]: https://github.com/Pearce-Ropion +[@Pessimistress]: https://github.com/Pessimistress +[@phryneas]: https://github.com/phryneas +[@pmcelhaney]: https://github.com/pmcelhaney +[@preco21]: https://github.com/preco21 +[@pri1311]: https://github.com/pri1311 +[@ProdigySim]: https://github.com/ProdigySim +[@pzhine]: https://github.com/pzhine +[@ramasilveyra]: https://github.com/ramasilveyra +[@randallreedjr]: https://github.com/randallreedjr +[@redbugz]: https://github.com/redbugz +[@remcohaszing]: https://github.com/remcohaszing +[@rfermann]: https://github.com/rfermann +[@rhettlivingston]: https://github.com/rhettlivingston +[@rhys-vdw]: https://github.com/rhys-vdw +[@richardxia]: https://github.com/richardxia +[@robertrossmann]: https://github.com/robertrossmann +[@rosswarren]: https://github.com/rosswarren +[@rperello]: https://github.com/rperello +[@rsolomon]: https://github.com/rsolomon +[@RyanGst]: https://github.com/ +[@s-h-a-d-o-w]: https://github.com/s-h-a-d-o-w +[@saschanaz]: https://github.com/saschanaz +[@schmidsi]: https://github.com/schmidsi +[@schmod]: https://github.com/schmod +[@Schweinepriester]: https://github.com/Schweinepriester +[@scottnonnenberg]: https://github.com/scottnonnenberg +[@sergei-startsev]: https://github.com/sergei-startsev +[@sevenc-nanashi]: https://github.com/sevenc-nanashi +[@sharmilajesupaul]: https://github.com/sharmilajesupaul +[@sheepsteak]: https://github.com/sheepsteak +[@silverwind]: https://github.com/silverwind +[@silviogutierrez]: https://github.com/silviogutierrez +[@SimenB]: https://github.com/SimenB +[@simmo]: https://github.com/simmo +[@sindresorhus]: https://github.com/sindresorhus +[@singles]: https://github.com/singles +[@skozin]: https://github.com/skozin +[@skyrpex]: https://github.com/skyrpex +[@snewcomer]: https://github.com/snewcomer +[@sompylasar]: https://github.com/sompylasar +[@soryy708]: https://github.com/soryy708 +[@sosukesuzuki]: https://github.com/sosukesuzuki +[@spalger]: https://github.com/spalger +[@st-sloth]: https://github.com/st-sloth +[@stekycz]: https://github.com/stekycz +[@stenin-nikita]: https://github.com/stenin-nikita +[@stephtr]: https://github.com/stephtr +[@straub]: https://github.com/straub +[@strawbrary]: https://github.com/strawbrary +[@stropho]: https://github.com/stropho +[@sveyret]: https://github.com/sveyret +[@swernerx]: https://github.com/swernerx +[@syymza]: https://github.com/syymza +[@TakeScoop]: https://github.com/TakeScoop +[@tapayne88]: https://github.com/tapayne88 +[@Taranys]: https://github.com/Taranys +[@taye]: https://github.com/taye +[@TheCrueltySage]: https://github.com/TheCrueltySage +[@TheJaredWilcurt]: https://github.com/TheJaredWilcurt +[@tihonove]: https://github.com/tihonove +[@timkraut]: https://github.com/timkraut +[@tizmagik]: https://github.com/tizmagik +[@tomprats]: https://github.com/tomprats +[@TrevorBurnham]: https://github.com/TrevorBurnham +[@ttmarek]: https://github.com/ttmarek +[@unbeauvoyage]: https://github.com/unbeauvoyage +[@vikr01]: https://github.com/vikr01 +[@wenfangdu]: https://github.com/wenfangdu +[@wKich]: https://github.com/wKich +[@wschurman]: https://github.com/wschurman +[@wtgtybhertgeghgtwtg]: https://github.com/wtgtybhertgeghgtwtg +[@xM8WVqaG]: https://github.com/xM8WVqaG +[@xpl]: https://github.com/xpl +[@Xunnamius]: https://github.com/Xunnamius +[@yesl-kim]: https://github.com/yesl-kim +[@yndajas]: https://github.com/yndajas +[@yordis]: https://github.com/yordis +[@Zamiell]: https://github.com/Zamiell +[@zloirock]: https://github.com/zloirock diff --git a/node_modules/eslint-plugin-import/LICENSE b/node_modules/eslint-plugin-import/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c6ade2a433a2d64efb01cb1289b895357dd03cf9 --- /dev/null +++ b/node_modules/eslint-plugin-import/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +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/node_modules/eslint-plugin-import/README.md b/node_modules/eslint-plugin-import/README.md new file mode 100644 index 0000000000000000000000000000000000000000..885f34873cdf4792675c4549565f1e08b3e053fc --- /dev/null +++ b/node_modules/eslint-plugin-import/README.md @@ -0,0 +1,612 @@ +# eslint-plugin-import + +[![github actions][actions-image]][actions-url] +[![travis-ci](https://travis-ci.org/import-js/eslint-plugin-import.svg?branch=main)](https://travis-ci.org/import-js/eslint-plugin-import) +[![coverage][codecov-image]][codecov-url] +[![win32 build status](https://ci.appveyor.com/api/projects/status/3mw2fifalmjlqf56/branch/main?svg=true)](https://ci.appveyor.com/project/import-js/eslint-plugin-import/branch/main) +[![npm](https://img.shields.io/npm/v/eslint-plugin-import.svg)](https://www.npmjs.com/package/eslint-plugin-import) +[![npm downloads](https://img.shields.io/npm/dt/eslint-plugin-import.svg?maxAge=2592000)](https://www.npmtrends.com/eslint-plugin-import) + +This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to provide, marked up in your editor. + +**IF YOU ARE USING THIS WITH SUBLIME**: see the [bottom section](#sublimelinter-eslint) for important info. + +## Rules + + + +💼 Configurations enabled in.\ +⚠️ Configurations set to warn in.\ +🚫 Configurations disabled in.\ +❗ Set in the `errors` configuration.\ +☑️ Set in the `recommended` configuration.\ +⌨️ Set in the `typescript` configuration.\ +🚸 Set in the `warnings` configuration.\ +🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ +💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\ +❌ Deprecated. + +### Helpful warnings + +| Name                       | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | ❌ | +| :--------------------------------------------------------------------- | :------------------------------------------------------------------------------------ | :--- | :---- | :- | :- | :- | :- | +| [export](docs/rules/export.md) | Forbid any invalid exports, i.e. re-export of the same name. | ❗ ☑️ | | | | | | +| [no-deprecated](docs/rules/no-deprecated.md) | Forbid imported names marked with `@deprecated` documentation tag. | | | | | | | +| [no-empty-named-blocks](docs/rules/no-empty-named-blocks.md) | Forbid empty named import blocks. | | | | 🔧 | 💡 | | +| [no-extraneous-dependencies](docs/rules/no-extraneous-dependencies.md) | Forbid the use of extraneous packages. | | | | | | | +| [no-mutable-exports](docs/rules/no-mutable-exports.md) | Forbid the use of mutable exports with `var` or `let`. | | | | | | | +| [no-named-as-default](docs/rules/no-named-as-default.md) | Forbid use of exported name as identifier of default export. | | ☑️ 🚸 | | | | | +| [no-named-as-default-member](docs/rules/no-named-as-default-member.md) | Forbid use of exported name as property of default export. | | ☑️ 🚸 | | | | | +| [no-unused-modules](docs/rules/no-unused-modules.md) | Forbid modules without exports, or exports without matching import in another module. | | | | | | | + +### Module systems + +| Name                     | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | ❌ | +| :----------------------------------------------------------------- | :------------------------------------------------------------------- | :- | :- | :- | :- | :- | :- | +| [no-amd](docs/rules/no-amd.md) | Forbid AMD `require` and `define` calls. | | | | | | | +| [no-commonjs](docs/rules/no-commonjs.md) | Forbid CommonJS `require` calls and `module.exports` or `exports.*`. | | | | | | | +| [no-import-module-exports](docs/rules/no-import-module-exports.md) | Forbid import statements with CommonJS module.exports. | | | | 🔧 | | | +| [no-nodejs-modules](docs/rules/no-nodejs-modules.md) | Forbid Node.js builtin modules. | | | | | | | +| [unambiguous](docs/rules/unambiguous.md) | Forbid potentially ambiguous parse goal (`script` vs. `module`). | | | | | | | + +### Static analysis + +| Name                        | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | ❌ | +| :----------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :--- | :- | :- | :- | :- | :- | +| [default](docs/rules/default.md) | Ensure a default export is present, given a default import. | ❗ ☑️ | | | | | | +| [enforce-node-protocol-usage](docs/rules/enforce-node-protocol-usage.md) | Enforce either using, or omitting, the `node:` protocol when importing Node.js builtin modules. | | | | 🔧 | | | +| [named](docs/rules/named.md) | Ensure named imports correspond to a named export in the remote file. | ❗ ☑️ | | ⌨️ | | | | +| [namespace](docs/rules/namespace.md) | Ensure imported namespaces contain dereferenced properties as they are dereferenced. | ❗ ☑️ | | | | | | +| [no-absolute-path](docs/rules/no-absolute-path.md) | Forbid import of modules using absolute paths. | | | | 🔧 | | | +| [no-cycle](docs/rules/no-cycle.md) | Forbid a module from importing a module with a dependency path back to itself. | | | | | | | +| [no-dynamic-require](docs/rules/no-dynamic-require.md) | Forbid `require()` calls with expressions. | | | | | | | +| [no-internal-modules](docs/rules/no-internal-modules.md) | Forbid importing the submodules of other modules. | | | | | | | +| [no-relative-packages](docs/rules/no-relative-packages.md) | Forbid importing packages through relative paths. | | | | 🔧 | | | +| [no-relative-parent-imports](docs/rules/no-relative-parent-imports.md) | Forbid importing modules from parent directories. | | | | | | | +| [no-restricted-paths](docs/rules/no-restricted-paths.md) | Enforce which files can be imported in a given folder. | | | | | | | +| [no-self-import](docs/rules/no-self-import.md) | Forbid a module from importing itself. | | | | | | | +| [no-unresolved](docs/rules/no-unresolved.md) | Ensure imports point to a file/module that can be resolved. | ❗ ☑️ | | | | | | +| [no-useless-path-segments](docs/rules/no-useless-path-segments.md) | Forbid unnecessary path segments in import and require statements. | | | | 🔧 | | | +| [no-webpack-loader-syntax](docs/rules/no-webpack-loader-syntax.md) | Forbid webpack loader syntax in imports. | | | | | | | + +### Style guide + +| Name                            | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | ❌ | +| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------- | :- | :---- | :- | :- | :- | :- | +| [consistent-type-specifier-style](docs/rules/consistent-type-specifier-style.md) | Enforce or ban the use of inline type-only markers for named imports. | | | | 🔧 | | | +| [dynamic-import-chunkname](docs/rules/dynamic-import-chunkname.md) | Enforce a leading comment with the webpackChunkName for dynamic imports. | | | | | 💡 | | +| [exports-last](docs/rules/exports-last.md) | Ensure all exports appear after other statements. | | | | | | | +| [extensions](docs/rules/extensions.md) | Ensure consistent use of file extension within the import path. | | | | | | | +| [first](docs/rules/first.md) | Ensure all imports appear before other statements. | | | | 🔧 | | | +| [group-exports](docs/rules/group-exports.md) | Prefer named exports to be grouped together in a single export declaration | | | | | | | +| [imports-first](docs/rules/imports-first.md) | Replaced by `import/first`. | | | | 🔧 | | ❌ | +| [max-dependencies](docs/rules/max-dependencies.md) | Enforce the maximum number of dependencies a module can have. | | | | | | | +| [newline-after-import](docs/rules/newline-after-import.md) | Enforce a newline after import statements. | | | | 🔧 | | | +| [no-anonymous-default-export](docs/rules/no-anonymous-default-export.md) | Forbid anonymous values as default exports. | | | | | | | +| [no-default-export](docs/rules/no-default-export.md) | Forbid default exports. | | | | | | | +| [no-duplicates](docs/rules/no-duplicates.md) | Forbid repeated import of the same module in multiple places. | | ☑️ 🚸 | | 🔧 | | | +| [no-named-default](docs/rules/no-named-default.md) | Forbid named default exports. | | | | | | | +| [no-named-export](docs/rules/no-named-export.md) | Forbid named exports. | | | | | | | +| [no-namespace](docs/rules/no-namespace.md) | Forbid namespace (a.k.a. "wildcard" `*`) imports. | | | | 🔧 | | | +| [no-unassigned-import](docs/rules/no-unassigned-import.md) | Forbid unassigned imports | | | | | | | +| [order](docs/rules/order.md) | Enforce a convention in module import order. | | | | 🔧 | | | +| [prefer-default-export](docs/rules/prefer-default-export.md) | Prefer a default export if module exports a single name or multiple names. | | | | | | | + + + +## `eslint-plugin-import` for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `eslint-plugin-import` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-eslint-plugin-import?utm_source=npm-eslint-plugin-import&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Installation + +```sh +# inside your project's working tree +npm install eslint-plugin-import --save-dev +``` + +### Config - Legacy (`.eslintrc`) + +All rules are off by default. However, you may extend one of the preset configs, or configure them manually in your `.eslintrc.(yml|json|js)`. + + - Extending a preset config: + +```jsonc +{ + "extends": [ + "eslint:recommended", + "plugin:import/recommended", + ], +} +``` + + - Configuring manually: + +```jsonc +{ + "rules": { + "import/no-unresolved": ["error", { "commonjs": true, "amd": true }], + "import/named": "error", + "import/namespace": "error", + "import/default": "error", + "import/export": "error", + // etc... + }, +}, +``` + +### Config - Flat (`eslint.config.js`) + +All rules are off by default. However, you may configure them manually in your `eslint.config.(js|cjs|mjs)`, or extend one of the preset configs: + +```js +import importPlugin from 'eslint-plugin-import'; +import js from '@eslint/js'; + +export default [ + js.configs.recommended, + importPlugin.flatConfigs.recommended, + { + files: ['**/*.{js,mjs,cjs}'], + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + rules: { + 'no-unused-vars': 'off', + 'import/no-dynamic-require': 'warn', + 'import/no-nodejs-modules': 'warn', + }, + }, +]; +``` + +## TypeScript + +You may use the following snippet or assemble your own config using the granular settings described below it. + +Make sure you have installed [`@typescript-eslint/parser`] and [`eslint-import-resolver-typescript`] which are used in the following configuration. + +```jsonc +{ + "extends": [ + "eslint:recommended", + "plugin:import/recommended", +// the following lines do the trick + "plugin:import/typescript", + ], + "settings": { + "import/resolver": { + // You will also need to install and configure the TypeScript resolver + // See also https://github.com/import-js/eslint-import-resolver-typescript#configuration + "typescript": true, + "node": true, + }, + }, +} +``` + +[`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser +[`eslint-import-resolver-typescript`]: https://github.com/import-js/eslint-import-resolver-typescript + +### Config - Flat with `config()` in `typescript-eslint` + +If you are using the `config` method from [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint), ensure that the `flatConfig` is included within the `extends` array. + +```js +import tseslint from 'typescript-eslint'; +import importPlugin from 'eslint-plugin-import'; +import js from '@eslint/js'; + +export default tseslint.config( + js.configs.recommended, + // other configs... + { + files: ['**/*.{ts,tsx}'], + extends: [importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.typescript], + // other configs... + } +); +``` + +## Resolvers + +With the advent of module bundlers and the current state of modules and module +syntax specs, it's not always obvious where `import x from 'module'` should look +to find the file behind `module`. + +Up through v0.10ish, this plugin has directly used substack's [`resolve`] plugin, +which implements Node's import behavior. This works pretty well in most cases. + +However, webpack allows a number of things in import module source strings that +Node does not, such as loaders (`import 'file!./whatever'`) and a number of +aliasing schemes, such as [`externals`]: mapping a module id to a global name at +runtime (allowing some modules to be included more traditionally via script tags). + +In the interest of supporting both of these, v0.11 introduces resolvers. + +Currently [Node] and [webpack] resolution have been implemented, but the +resolvers are just npm packages, so [third party packages are supported](https://github.com/import-js/eslint-plugin-import/wiki/Resolvers) (and encouraged!). + +You can reference resolvers in several ways (in order of precedence): + + - as a conventional `eslint-import-resolver` name, like `eslint-import-resolver-foo`: + + ```jsonc +// .eslintrc +{ + "settings": { + // uses 'eslint-import-resolver-foo': + "import/resolver": "foo", + }, +} +``` + +```yaml +# .eslintrc.yml +settings: + # uses 'eslint-import-resolver-foo': + import/resolver: foo +``` + +```js +// .eslintrc.js +module.exports = { + settings: { + 'import/resolver': { + foo: { someConfig: value } + } + } +} +``` + + - with a full npm module name, like `my-awesome-npm-module`: + +```jsonc +// .eslintrc +{ + "settings": { + "import/resolver": "my-awesome-npm-module", + }, +} +``` + +```yaml +# .eslintrc.yml +settings: + import/resolver: 'my-awesome-npm-module' +``` + +```js +// .eslintrc.js +module.exports = { + settings: { + 'import/resolver': { + 'my-awesome-npm-module': { someConfig: value } + } + } +} +``` + + - with a filesystem path to resolver, defined in this example as a `computed property` name: + +```js +// .eslintrc.js +module.exports = { + settings: { + 'import/resolver': { + [path.resolve('../../../my-resolver')]: { someConfig: value } + } + } +} +``` + +Relative paths will be resolved relative to the source's nearest `package.json` or +the process's current working directory if no `package.json` is found. + +If you are interesting in writing a resolver, see the [spec](./resolvers/README.md) for more details. + +[`resolve`]: https://www.npmjs.com/package/resolve +[`externals`]: https://webpack.github.io/docs/library-and-externals.html + +[Node]: https://www.npmjs.com/package/eslint-import-resolver-node +[webpack]: https://www.npmjs.com/package/eslint-import-resolver-webpack + +## Settings + +You may set the following settings in your `.eslintrc`: + +### `import/extensions` + +A list of file extensions that will be parsed as modules and inspected for +`export`s. + +This defaults to `['.js']`, unless you are using the `react` shared config, +in which case it is specified as `['.js', '.jsx']`. Despite the default, +if you are using TypeScript (without the `plugin:import/typescript` config +described above) you must specify the new extensions (`.ts`, and also `.tsx` +if using React). + +```js +"settings": { + "import/extensions": [ + ".js", + ".jsx" + ] +} +``` + +If you require more granular extension definitions, you can use: + +```js +"settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx" + ] + } + } +} +``` + +Note that this is different from (and likely a subset of) any `import/resolver` +extensions settings, which may include `.json`, `.coffee`, etc. which will still +factor into the `no-unresolved` rule. + +Also, the following `import/ignore` patterns will overrule this list. + +### `import/ignore` + +A list of regex strings that, if matched by a path, will +not report the matching module if no `export`s are found. +In practice, this means rules other than [`no-unresolved`](./docs/rules/no-unresolved.md#ignore) will not report on any +`import`s with (absolute filesystem) paths matching this pattern. + +`no-unresolved` has its own [`ignore`](./docs/rules/no-unresolved.md#ignore) setting. + +```jsonc +{ + "settings": { + "import/ignore": [ + "\.coffee$", // fraught with parse errors + "\.(scss|less|css)$", // can't parse unprocessed CSS modules, either + ], + }, +} +``` + +### `import/core-modules` + +An array of additional modules to consider as "core" modules--modules that should +be considered resolved but have no path on the filesystem. Your resolver may +already define some of these (for example, the Node resolver knows about `fs` and +`path`), so you need not redefine those. + +For example, Electron exposes an `electron` module: + +```js +import 'electron' // without extra config, will be flagged as unresolved! +``` + +that would otherwise be unresolved. To avoid this, you may provide `electron` as a +core module: + +```jsonc +// .eslintrc +{ + "settings": { + "import/core-modules": ["electron"], + }, +} +``` + +In Electron's specific case, there is a shared config named `electron` +that specifies this for you. + +Contribution of more such shared configs for other platforms are welcome! + +### `import/external-module-folders` + +An array of folders. Resolved modules only from those folders will be considered as "external". By default - `["node_modules"]`. Makes sense if you have configured your path or webpack to handle your internal paths differently and want to consider modules from some folders, for example `bower_components` or `jspm_modules`, as "external". + +This option is also useful in a monorepo setup: list here all directories that contain monorepo's packages and they will be treated as external ones no matter which resolver is used. + +If you are using `yarn` PnP as your package manager, add the `.yarn` folder and all your installed dependencies will be considered as `external`, instead of `internal`. + +Each item in this array is either a folder's name, its subpath, or its absolute prefix path: + + - `jspm_modules` will match any file or folder named `jspm_modules` or which has a direct or non-direct parent named `jspm_modules`, e.g. `/home/me/project/jspm_modules` or `/home/me/project/jspm_modules/some-pkg/index.js`. + + - `packages/core` will match any path that contains these two segments, for example `/home/me/project/packages/core/src/utils.js`. + + - `/home/me/project/packages` will only match files and directories inside this directory, and the directory itself. + +Please note that incomplete names are not allowed here so `components` won't match `bower_components` and `packages/ui` won't match `packages/ui-utils` (but will match `packages/ui/utils`). + +### `import/parsers` + +A map from parsers to file extension arrays. If a file extension is matched, the +dependency parser will require and use the map key as the parser instead of the +configured ESLint parser. This is useful if you're inter-op-ing with TypeScript +directly using webpack, for example: + +```jsonc +// .eslintrc +{ + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"], + }, + }, +} +``` + +In this case, [`@typescript-eslint/parser`](https://www.npmjs.com/package/@typescript-eslint/parser) +must be installed and require-able from the running `eslint` module's location +(i.e., install it as a peer of ESLint). + +This is currently only tested with `@typescript-eslint/parser` (and its predecessor, +`typescript-eslint-parser`) but should theoretically work with any moderately +ESTree-compliant parser. + +It's difficult to say how well various plugin features will be supported, too, +depending on how far down the rabbit hole goes. Submit an issue if you find strange +behavior beyond here, but steel your heart against the likely outcome of closing +with `wontfix`. + +### `import/resolver` + +See [resolvers](#resolvers). + +### `import/cache` + +Settings for cache behavior. Memoization is used at various levels to avoid the copious amount of `fs.statSync`/module parse calls required to correctly report errors. + +For normal `eslint` console runs, the cache lifetime is irrelevant, as we can strongly assume that files should not be changing during the lifetime of the linter process (and thus, the cache in memory) + +For long-lasting processes, like [`eslint_d`] or [`eslint-loader`], however, it's important that there be some notion of staleness. + +If you never use [`eslint_d`] or [`eslint-loader`], you may set the cache lifetime to `Infinity` and everything should be fine: + +```jsonc +// .eslintrc +{ + "settings": { + "import/cache": { + "lifetime": "∞", // or Infinity, in a JS config + }, + }, +} +``` + +Otherwise, set some integer, and cache entries will be evicted after that many seconds have elapsed: + +```jsonc +// .eslintrc +{ + "settings": { + "import/cache": { + "lifetime": 5, // 30 is the default + }, + }, +} +``` + +[`eslint_d`]: https://www.npmjs.com/package/eslint_d +[`eslint-loader`]: https://www.npmjs.com/package/eslint-loader + +### `import/internal-regex` + +A regex for packages should be treated as internal. Useful when you are utilizing a monorepo setup or developing a set of packages that depend on each other. + +By default, any package referenced from [`import/external-module-folders`](#importexternal-module-folders) will be considered as "external", including packages in a monorepo like yarn workspace or lerna environment. If you want to mark these packages as "internal" this will be useful. + +For example, if your packages in a monorepo are all in `@scope`, you can configure `import/internal-regex` like this + +```jsonc +// .eslintrc +{ + "settings": { + "import/internal-regex": "^@scope/", + }, +} +``` + +### `import/node-version` + +A string that represents the version of Node.js that you are using. +A falsy value will imply the version of Node.js that you are running ESLint with. + +```jsonc +// .eslintrc +{ + "settings": { + "import/node-version": "22.3.4", + }, +} +``` + +## SublimeLinter-eslint + +SublimeLinter-eslint introduced a change to support `.eslintignore` files +which altered the way file paths are passed to ESLint when linting during editing. +This change sends a relative path instead of the absolute path to the file (as ESLint +normally provides), which can make it impossible for this plugin to resolve dependencies +on the filesystem. + +This workaround should no longer be necessary with the release of ESLint 2.0, when +`.eslintignore` will be updated to work more like a `.gitignore`, which should +support proper ignoring of absolute paths via `--stdin-filename`. + +In the meantime, see [roadhump/SublimeLinter-eslint#58](https://github.com/roadhump/SublimeLinter-eslint/issues/58) +for more details and discussion, but essentially, you may find you need to add the following +`SublimeLinter` config to your Sublime project file: + +```json +{ + "folders": + [ + { + "path": "code" + } + ], + "SublimeLinter": + { + "linters": + { + "eslint": + { + "chdir": "${project}/code" + } + } + } +} +``` + +Note that `${project}/code` matches the `code` provided at `folders[0].path`. + +The purpose of the `chdir` setting, in this case, is to set the working directory +from which ESLint is executed to be the same as the directory on which SublimeLinter-eslint +bases the relative path it provides. + +See the SublimeLinter docs on [`chdir`](https://www.sublimelinter.com/en/latest/linter_settings.html#chdir) +for more information, in case this does not work with your project. + +If you are not using `.eslintignore`, or don't have a Sublime project file, you can also +do the following via a `.sublimelinterrc` file in some ancestor directory of your +code: + +```json +{ + "linters": { + "eslint": { + "args": ["--stdin-filename", "@"] + } + } +} +``` + +I also found that I needed to set `rc_search_limit` to `null`, which removes the file +hierarchy search limit when looking up the directory tree for `.sublimelinterrc`: + +In Package Settings / SublimeLinter / User Settings: + +```json +{ + "user": { + "rc_search_limit": null + } +} +``` + +I believe this defaults to `3`, so you may not need to alter it depending on your +project folder max depth. + +[codecov-image]: https://codecov.io/gh/import-js/eslint-plugin-import/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/import-js/eslint-plugin-import/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/import-js/eslint-plugin-import +[actions-url]: https://github.com/import-js/eslint-plugin-import diff --git a/node_modules/eslint-plugin-import/SECURITY.md b/node_modules/eslint-plugin-import/SECURITY.md new file mode 100644 index 0000000000000000000000000000000000000000..b155f54d5904464f8ce1621b75d3490aae7eeec9 --- /dev/null +++ b/node_modules/eslint-plugin-import/SECURITY.md @@ -0,0 +1,11 @@ +# Security Policy + +## Supported Versions + +Latest major/minor version is supported only for security updates. + +## Reporting a Vulnerability + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/node_modules/eslint-plugin-import/config/electron.js b/node_modules/eslint-plugin-import/config/electron.js new file mode 100644 index 0000000000000000000000000000000000000000..f98ff0614bdb4cf603a39f537651c532f4344a3c --- /dev/null +++ b/node_modules/eslint-plugin-import/config/electron.js @@ -0,0 +1,8 @@ +/** + * Default settings for Electron applications. + */ +module.exports = { + settings: { + 'import/core-modules': ['electron'], + }, +}; diff --git a/node_modules/eslint-plugin-import/config/errors.js b/node_modules/eslint-plugin-import/config/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..127c29a0cca94138b39843b8c34e688a1053f232 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/errors.js @@ -0,0 +1,14 @@ +/** + * unopinionated config. just the things that are necessarily runtime errors + * waiting to happen. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + rules: { 'import/no-unresolved': 2, + 'import/named': 2, + 'import/namespace': 2, + 'import/default': 2, + 'import/export': 2, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/flat/errors.js b/node_modules/eslint-plugin-import/config/flat/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..98c19f824d012826f58d3e7ef2d65007148019d9 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/flat/errors.js @@ -0,0 +1,14 @@ +/** + * unopinionated config. just the things that are necessarily runtime errors + * waiting to happen. + * @type {Object} + */ +module.exports = { + rules: { + 'import/no-unresolved': 2, + 'import/named': 2, + 'import/namespace': 2, + 'import/default': 2, + 'import/export': 2, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/flat/react.js b/node_modules/eslint-plugin-import/config/flat/react.js new file mode 100644 index 0000000000000000000000000000000000000000..08674714227bfbf5e954aa79d6d966b5dbe517c4 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/flat/react.js @@ -0,0 +1,19 @@ +/** + * Adds `.jsx` as an extension, and enables JSX parsing. + * + * Even if _you_ aren't using JSX (or .jsx) directly, if your dependencies + * define jsnext:main and have JSX internally, you may run into problems + * if you don't enable these settings at the top level. + */ +module.exports = { + settings: { + 'import/extensions': ['.js', '.jsx', '.mjs', '.cjs'], + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/flat/recommended.js b/node_modules/eslint-plugin-import/config/flat/recommended.js new file mode 100644 index 0000000000000000000000000000000000000000..11bc1f52a4b06733a958c13162fac6421d9da99a --- /dev/null +++ b/node_modules/eslint-plugin-import/config/flat/recommended.js @@ -0,0 +1,26 @@ +/** + * The basics. + * @type {Object} + */ +module.exports = { + rules: { + // analysis/correctness + 'import/no-unresolved': 'error', + 'import/named': 'error', + 'import/namespace': 'error', + 'import/default': 'error', + 'import/export': 'error', + + // red flags (thus, warnings) + 'import/no-named-as-default': 'warn', + 'import/no-named-as-default-member': 'warn', + 'import/no-duplicates': 'warn', + }, + + // need all these for parsing dependencies (even if _your_ code doesn't need + // all of them) + languageOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, +}; diff --git a/node_modules/eslint-plugin-import/config/flat/warnings.js b/node_modules/eslint-plugin-import/config/flat/warnings.js new file mode 100644 index 0000000000000000000000000000000000000000..e788ff9cdea456069facec67fc57b5c2156f3798 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/flat/warnings.js @@ -0,0 +1,11 @@ +/** + * more opinionated config. + * @type {Object} + */ +module.exports = { + rules: { + 'import/no-named-as-default': 1, + 'import/no-named-as-default-member': 1, + 'import/no-duplicates': 1, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/react-native.js b/node_modules/eslint-plugin-import/config/react-native.js new file mode 100644 index 0000000000000000000000000000000000000000..a1aa0ee5659ccdb5ca8eaba714d411e4f0fbbb6f --- /dev/null +++ b/node_modules/eslint-plugin-import/config/react-native.js @@ -0,0 +1,13 @@ +/** + * - adds platform extensions to Node resolver + */ +module.exports = { + settings: { + 'import/resolver': { + node: { + // Note: will not complain if only _one_ of these files exists. + extensions: ['.js', '.web.js', '.ios.js', '.android.js'], + }, + }, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/react.js b/node_modules/eslint-plugin-import/config/react.js new file mode 100644 index 0000000000000000000000000000000000000000..1ae8e1a51a44c240445c6af77330c72b5fdf2c87 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/react.js @@ -0,0 +1,16 @@ +/** + * Adds `.jsx` as an extension, and enables JSX parsing. + * + * Even if _you_ aren't using JSX (or .jsx) directly, if your dependencies + * define jsnext:main and have JSX internally, you may run into problems + * if you don't enable these settings at the top level. + */ +module.exports = { + settings: { + 'import/extensions': ['.js', '.jsx'], + }, + + parserOptions: { + ecmaFeatures: { jsx: true }, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/recommended.js b/node_modules/eslint-plugin-import/config/recommended.js new file mode 100644 index 0000000000000000000000000000000000000000..8e7ca9fd05d3e43eddd5d571353f6a8f90b4f080 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/recommended.js @@ -0,0 +1,28 @@ +/** + * The basics. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + + rules: { + // analysis/correctness + 'import/no-unresolved': 'error', + 'import/named': 'error', + 'import/namespace': 'error', + 'import/default': 'error', + 'import/export': 'error', + + // red flags (thus, warnings) + 'import/no-named-as-default': 'warn', + 'import/no-named-as-default-member': 'warn', + 'import/no-duplicates': 'warn', + }, + + // need all these for parsing dependencies (even if _your_ code doesn't need + // all of them) + parserOptions: { + sourceType: 'module', + ecmaVersion: 2018, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/stage-0.js b/node_modules/eslint-plugin-import/config/stage-0.js new file mode 100644 index 0000000000000000000000000000000000000000..42419123f0f349f8a68a0379470aad8de3e5fbeb --- /dev/null +++ b/node_modules/eslint-plugin-import/config/stage-0.js @@ -0,0 +1,12 @@ +/** + * Rules in progress. + * + * Do not expect these to adhere to semver across releases. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + rules: { + 'import/no-deprecated': 1, + }, +}; diff --git a/node_modules/eslint-plugin-import/config/typescript.js b/node_modules/eslint-plugin-import/config/typescript.js new file mode 100644 index 0000000000000000000000000000000000000000..d5eb57a4658d0514059c19641aa42c4be0a6b5e6 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/typescript.js @@ -0,0 +1,34 @@ +/** + * This config: + * 1) adds `.jsx`, `.ts`, `.cts`, `.mts`, and `.tsx` as an extension + * 2) enables JSX/TSX parsing + */ + +// Omit `.d.ts` because 1) TypeScript compilation already confirms that +// types are resolved, and 2) it would mask an unresolved +// `.ts`/`.tsx`/`.js`/`.jsx` implementation. +const typeScriptExtensions = ['.ts', '.cts', '.mts', '.tsx']; + +const allExtensions = [...typeScriptExtensions, '.js', '.jsx', '.mjs', '.cjs']; + +module.exports = { + settings: { + 'import/extensions': allExtensions, + 'import/external-module-folders': ['node_modules', 'node_modules/@types'], + 'import/parsers': { + '@typescript-eslint/parser': typeScriptExtensions, + }, + 'import/resolver': { + node: { + extensions: allExtensions, + }, + }, + }, + + rules: { + // analysis/correctness + + // TypeScript compilation already ensures that named imports exist in the referenced module + 'import/named': 'off', + }, +}; diff --git a/node_modules/eslint-plugin-import/config/warnings.js b/node_modules/eslint-plugin-import/config/warnings.js new file mode 100644 index 0000000000000000000000000000000000000000..5d74143b28df249258d9621fbf533a085b29cf24 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/warnings.js @@ -0,0 +1,12 @@ +/** + * more opinionated config. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + rules: { + 'import/no-named-as-default': 1, + 'import/no-named-as-default-member': 1, + 'import/no-duplicates': 1, + }, +}; diff --git a/node_modules/eslint-plugin-import/docs/rules/consistent-type-specifier-style.md b/node_modules/eslint-plugin-import/docs/rules/consistent-type-specifier-style.md new file mode 100644 index 0000000000000000000000000000000000000000..41d98e4e1f4b3f61e179b58347ab2d8373bf2d17 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/consistent-type-specifier-style.md @@ -0,0 +1,91 @@ +# import/consistent-type-specifier-style + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +In both Flow and TypeScript you can mark an import as a type-only import by adding a "kind" marker to the import. Both languages support two positions for marker. + +**At the top-level** which marks all names in the import as type-only and applies to named, default, and namespace (for TypeScript) specifiers: + +```ts +import type Foo from 'Foo'; +import type {Bar} from 'Bar'; +// ts only +import type * as Bam from 'Bam'; +// flow only +import typeof Baz from 'Baz'; +``` + +**Inline** with to the named import, which marks just the specific name in the import as type-only. An inline specifier is only valid for named specifiers, and not for default or namespace specifiers: + +```ts +import {type Foo} from 'Foo'; +// flow only +import {typeof Bar} from 'Bar'; +``` + +## Rule Details + +This rule either enforces or bans the use of inline type-only markers for named imports. + +This rule includes a fixer that will automatically convert your specifiers to the correct form - however the fixer will not respect your preferences around de-duplicating imports. If this is important to you, consider using the [`import/no-duplicates`] rule. + +[`import/no-duplicates`]: ./no-duplicates.md + +## Options + +The rule accepts a single string option which may be one of: + + - `'prefer-inline'` - enforces that named type-only specifiers are only ever written with an inline marker; and never as part of a top-level, type-only import. + - `'prefer-top-level'` - enforces that named type-only specifiers only ever written as part of a top-level, type-only import; and never with an inline marker. + +By default the rule will use the `prefer-inline` option. + +## Examples + +### `prefer-top-level` + +❌ Invalid with `["error", "prefer-top-level"]` + +```ts +import {type Foo} from 'Foo'; +import Foo, {type Bar} from 'Foo'; +// flow only +import {typeof Foo} from 'Foo'; +``` + +✅ Valid with `["error", "prefer-top-level"]` + +```ts +import type {Foo} from 'Foo'; +import type Foo, {Bar} from 'Foo'; +// flow only +import typeof {Foo} from 'Foo'; +``` + +### `prefer-inline` + +❌ Invalid with `["error", "prefer-inline"]` + +```ts +import type {Foo} from 'Foo'; +import type Foo, {Bar} from 'Foo'; +// flow only +import typeof {Foo} from 'Foo'; +``` + +✅ Valid with `["error", "prefer-inline"]` + +```ts +import {type Foo} from 'Foo'; +import Foo, {type Bar} from 'Foo'; +// flow only +import {typeof Foo} from 'Foo'; +``` + +## When Not To Use It + +If you aren't using Flow or TypeScript 4.5+, then this rule does not apply and need not be used. + +If you don't care about, and don't want to standardize how named specifiers are imported then you should not use this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/default.md b/node_modules/eslint-plugin-import/docs/rules/default.md new file mode 100644 index 0000000000000000000000000000000000000000..9f8c919bf38d4420b68dca7a1a1b82b5eac36e34 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/default.md @@ -0,0 +1,72 @@ +# import/default + +💼 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`. + + + +If a default import is requested, this rule will report if there is no default +export in the imported module. + +For [ES7], reports if a default is named and exported but is not found in the +referenced module. + +Note: for packages, the plugin will find exported names +from [`jsnext:main`], if present in `package.json`. +Redux's npm module includes this key, and thereby is lintable, for example. + +A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. + +[ignored]: ../README.md#importignore +[unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar + +## Rule Details + +Given: + +```js +// ./foo.js +export default function () { return 42 } + +// ./bar.js +export function bar() { return null } + +// ./baz.js +module.exports = function () { /* ... */ } + +// node_modules/some-module/index.js +exports.sharedFunction = function shared() { /* ... */ } +``` + +The following is considered valid: + +```js +import foo from './foo' + +// assuming 'node_modules' are ignored (true by default) +import someModule from 'some-module' +``` + +...and the following cases are reported: + +```js +import bar from './bar' // no default export found in ./bar +import baz from './baz' // no default export found in ./baz +``` + +## When Not To Use It + +If you are using CommonJS and/or modifying the exported namespace of any module at +runtime, you will likely see false positives with this rule. + +This rule currently does not interpret `module.exports = ...` as a `default` export, +either, so such a situation will be reported in the importing module. + +## Further Reading + + - Lee Byron's [ES7] export proposal + - [`import/ignore`] setting + - [`jsnext:main`] (Rollup) + +[ES7]: https://github.com/leebyron/ecmascript-more-export-from +[`import/ignore`]: ../../README.md#importignore +[`jsnext:main`]: https://github.com/rollup/rollup/wiki/jsnext:main diff --git a/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md b/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md new file mode 100644 index 0000000000000000000000000000000000000000..d9ee8d15e2d9a82082f223df2c561a56742a9e58 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md @@ -0,0 +1,134 @@ +# import/dynamic-import-chunkname + +💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). + + + +This rule reports any dynamic imports without a webpackChunkName specified in a leading block comment in the proper format. + +This rule enforces naming of webpack chunks in dynamic imports. When you don't explicitly name chunks, webpack will autogenerate chunk names that are not consistent across builds, which prevents long-term browser caching. + +## Rule Details + +This rule runs against `import()` by default, but can be configured to also run against an alternative dynamic-import function, e.g. 'dynamicImport.' +You can also configure the regex format you'd like to accept for the webpackChunkName - for example, if we don't want the number 6 to show up in our chunk names: + + ```javascript +{ + "import/dynamic-import-chunkname": [2, { + importFunctions: ["dynamicImport"], + webpackChunknameFormat: "[a-zA-Z0-57-9-/_]+", + allowEmpty: false + }] +} +``` + +### invalid + +The following patterns are invalid: + +```javascript +// no leading comment +import('someModule'); + +// incorrectly formatted comment +import( + /*webpackChunkName:"someModule"*/ + 'someModule', +); +import( + /* webpackChunkName : "someModule" */ + 'someModule', +); + +// chunkname contains a 6 (forbidden by rule config) +import( + /* webpackChunkName: "someModule6" */ + 'someModule', +); + +// invalid syntax for webpack comment +import( + /* totally not webpackChunkName: "someModule" */ + 'someModule', +); + +// single-line comment, not a block-style comment +import( + // webpackChunkName: "someModule" + 'someModule', +); + +// chunk names are disallowed when eager mode is set +import( + /* webpackMode: "eager" */ + /* webpackChunkName: "someModule" */ + 'someModule', +) +``` + +### valid + +The following patterns are valid: + +```javascript + import( + /* webpackChunkName: "someModule" */ + 'someModule', + ); + import( + /* webpackChunkName: "someOtherModule12345789" */ + 'someModule', + ); + import( + /* webpackChunkName: "someModule" */ + /* webpackPrefetch: true */ + 'someModule', + ); + import( + /* webpackChunkName: "someModule", webpackPrefetch: true */ + 'someModule', + ); + + // using single quotes instead of double quotes + import( + /* webpackChunkName: 'someModule' */ + 'someModule', + ); +``` + +### `allowEmpty: true` + +If you want to allow dynamic imports without a webpackChunkName, you can set `allowEmpty: true` in the rule config. This will allow dynamic imports without a leading comment, or with a leading comment that does not contain a webpackChunkName. + +Given `{ "allowEmpty": true }`: + + +### valid + +The following patterns are valid: + +```javascript +import('someModule'); + +import( + /* webpackChunkName: "someModule" */ + 'someModule', +); +``` + +### invalid + +The following patterns are invalid: + +```javascript +// incorrectly formatted comment +import( + /*webpackChunkName:"someModule"*/ + 'someModule', +); +``` + +## When Not To Use It + +If you don't care that webpack will autogenerate chunk names and may blow up browser caches and bundle size reports. diff --git a/node_modules/eslint-plugin-import/docs/rules/enforce-node-protocol-usage.md b/node_modules/eslint-plugin-import/docs/rules/enforce-node-protocol-usage.md new file mode 100644 index 0000000000000000000000000000000000000000..8d023b4e9ca9a516bc95a726fce6530f2ffda558 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/enforce-node-protocol-usage.md @@ -0,0 +1,81 @@ +# import/enforce-node-protocol-usage + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Enforce either using, or omitting, the `node:` protocol when importing Node.js builtin modules. + +## Rule Details + +This rule enforces that builtins node imports are using, or omitting, the `node:` protocol. + +Determining whether a specifier is a core module depends on the node version being used to run `eslint`. +This version can be specified in the configuration with the [`import/node-version` setting](../../README.md#importnode-version). + +Reasons to prefer using the protocol include: + + - the code is more explicitly and clearly referencing a Node.js built-in module + +Reasons to prefer omitting the protocol include: + + - some tools don't support the `node:` protocol + - the code is more portable, because import maps and automatic polyfilling can be used + +## Options + +The rule requires a single string option which may be one of: + + - `'always'` - enforces that builtins node imports are using the `node:` protocol. + - `'never'` - enforces that builtins node imports are not using the `node:` protocol. + +## Examples + +### `'always'` + +❌ Invalid + +```js +import fs from 'fs'; +export { promises } from 'fs'; +// require +const fs = require('fs/promises'); +``` + +✅ Valid + +```js +import fs from 'node:fs'; +export { promises } from 'node:fs'; +import * as test from 'node:test'; +// require +const fs = require('node:fs/promises'); +``` + +### `'never'` + +❌ Invalid + +```js +import fs from 'node:fs'; +export { promises } from 'node:fs'; +// require +const fs = require('node:fs/promises'); +``` + +✅ Valid + +```js +import fs from 'fs'; +export { promises } from 'fs'; + +// require +const fs = require('fs/promises'); + +// This rule will not enforce not using `node:` protocol when the module is only available under the `node:` protocol. +import * as test from 'node:test'; +``` + +## When Not To Use It + +If you don't want to consistently enforce using, or omitting, the `node:` protocol when importing Node.js builtin modules. diff --git a/node_modules/eslint-plugin-import/docs/rules/export.md b/node_modules/eslint-plugin-import/docs/rules/export.md new file mode 100644 index 0000000000000000000000000000000000000000..54a8a39cf33250d3450f4743b9302dc756977e71 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/export.md @@ -0,0 +1,37 @@ +# import/export + +💼 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`. + + + +Reports funny business with exports, like repeated exports of names or defaults. + +## Rule Details + +```js +export default class MyClass { /*...*/ } // Multiple default exports. + +function makeClass() { return new MyClass(...arguments) } + +export default makeClass // Multiple default exports. +``` + +or + +```js +export const foo = function () { /*...*/ } // Multiple exports of name 'foo'. + +function bar() { /*...*/ } +export { bar as foo } // Multiple exports of name 'foo'. +``` + +In the case of named/default re-export, all `n` re-exports will be reported, +as at least `n-1` of them are clearly mistakes, but it is not clear which one +(if any) is intended. Could be the result of copy/paste, code duplication with +intent to rename, etc. + +## Further Reading + + - Lee Byron's [ES7] export proposal + +[ES7]: https://github.com/leebyron/ecmascript-more-export-from diff --git a/node_modules/eslint-plugin-import/docs/rules/exports-last.md b/node_modules/eslint-plugin-import/docs/rules/exports-last.md new file mode 100644 index 0000000000000000000000000000000000000000..56e947e94bde0e7f2cc76d477669c803393119a7 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/exports-last.md @@ -0,0 +1,51 @@ +# import/exports-last + + + +This rule enforces that all exports are declared at the bottom of the file. This rule will report any export declarations that comes before any non-export statements. + +## This will be reported + +```JS + +const bool = true + +export default bool + +const str = 'foo' + +``` + +```JS + +export const bool = true + +const str = 'foo' + +``` + +## This will not be reported + +```JS +const arr = ['bar'] + +export const bool = true + +export default bool + +export function func() { + console.log('Hello World 🌍') +} + +export const str = 'foo' +``` + +## When Not To Use It + +If you don't mind exports being sprinkled throughout a file, you may not want to enable this rule. + +### ES6 exports only + +The exports-last rule is currently only working on ES6 exports. You may not want to enable this rule if you're using CommonJS exports. + +If you need CommonJS support feel free to open an issue or create a PR. diff --git a/node_modules/eslint-plugin-import/docs/rules/extensions.md b/node_modules/eslint-plugin-import/docs/rules/extensions.md new file mode 100644 index 0000000000000000000000000000000000000000..bd9f3f35844205ecacce91f8a01a69c18369152c --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/extensions.md @@ -0,0 +1,239 @@ +# import/extensions + + + +Some file resolve algorithms allow you to omit the file extension within the import source path. For example the `node` resolver (which does not yet support ESM/`import`) can resolve `./foo/bar` to the absolute path `/User/someone/foo/bar.js` because the `.js` extension is resolved automatically by default in CJS. Depending on the resolver you can configure more extensions to get resolved automatically. + +In order to provide a consistent use of file extensions across your code base, this rule can enforce or disallow the use of certain file extensions. + +## Rule Details + +This rule either takes one string option, one object option, or a string and an object option. If it is the string `"never"` (the default value), then the rule forbids the use for any extension. If it is the string `"always"`, then the rule enforces the use of extensions for all import statements. If it is the string `"ignorePackages"`, then the rule enforces the use of extensions for all import statements except package imports. + +```jsonc +"import/extensions": [, "never" | "always" | "ignorePackages"] +``` + +By providing an object you can configure each extension separately. + +```jsonc +"import/extensions": [, { + : "never" | "always" | "ignorePackages" +}] +``` + + For example `{ "js": "always", "json": "never" }` would always enforce the use of the `.js` extension but never allow the use of the `.json` extension. + +By providing both a string and an object, the string will set the default setting for all extensions, and the object can be used to set granular overrides for specific extensions. + +```jsonc +"import/extensions": [ + , + "never" | "always" | "ignorePackages", + { + : "never" | "always" | "ignorePackages" + } +] +``` + +For example, `["error", "never", { "svg": "always" }]` would require that all extensions are omitted, except for "svg". + +`ignorePackages` can be set as a separate boolean option like this: + +```jsonc +"import/extensions": [ + , + "never" | "always" | "ignorePackages", + { + ignorePackages: true | false, + pattern: { + : "never" | "always" | "ignorePackages" + } + } +] +``` + +In that case, if you still want to specify extensions, you can do so inside the **pattern** property. +Default value of `ignorePackages` is `false`. + +By default, `import type` and `export type` style imports/exports are ignored. If you want to check them as well, you can set the `checkTypeImports` option to `true`. + +Unfortunately, in more advanced linting setups, such as when employing custom specifier aliases (e.g. you're using `eslint-import-resolver-alias`, `paths` in `tsconfig.json`, etc), this rule can be too coarse-grained when determining which imports to ignore and on which to enforce the config. +This is especially troublesome if you have import specifiers that [look like externals or builtins](./order.md#how-imports-are-grouped). + +Set `pathGroupOverrides` to force this rule to always ignore certain imports and never ignore others. +`pathGroupOverrides` accepts an array of one or more [`PathGroupOverride`](#pathgroupoverride) objects. + +For example: + +```jsonc +"import/extensions": [ + , + "never" | "always" | "ignorePackages", + { + ignorePackages: true | false, + pattern: { + : "never" | "always" | "ignorePackages" + }, + pathGroupOverrides: [ + { + pattern: "package-name-to-ignore", + action: "ignore", + }, + { + pattern: "bespoke+alias:{*,*/**}", + action: "enforce", + } + ] + } +] +``` + +> \[!NOTE] +> +> `pathGroupOverrides` is inspired by [`pathGroups` in `'import/order'`](./order.md#pathgroups) and shares a similar interface. +> If you're using `pathGroups` already, you may find `pathGroupOverrides` very useful. + +### `PathGroupOverride` + +| property | required | type | description | +| :--------------: | :------: | :---------------------: | --------------------------------------------------------------- | +| `pattern` | ☑️ | `string` | [Minimatch pattern][16] for specifier matching | +| `patternOptions` | | `object` | [Minimatch options][17]; default: `{nocomment: true}` | +| `action` | ☑️ | `"enforce" \| "ignore"` | What action to take on imports whose specifiers match `pattern` | + +### Exception + +When disallowing the use of certain extensions this rule makes an exception and allows the use of extension when the file would not be resolvable without extension. + +For example, given the following folder structure: + +```pt +├── foo +│   ├── bar.js +│   ├── bar.json +``` + +and this import statement: + +```js +import bar from './foo/bar.json'; +``` + +then the extension can’t be omitted because it would then resolve to `./foo/bar.js`. + +### Examples + +The following patterns are considered problems when configuration set to "never": + +```js +import foo from './foo.js'; + +import bar from './bar.json'; + +import Component from './Component.jsx'; + +import express from 'express/index.js'; +``` + +The following patterns are not considered problems when configuration set to "never": + +```js +import foo from './foo'; + +import bar from './bar'; + +import Component from './Component'; + +import express from 'express/index'; + +import * as path from 'path'; +``` + +The following patterns are considered problems when the configuration is set to "never" and the option "checkTypeImports" is set to `true`: + +```js +import type { Foo } from './foo.ts'; + +export type { Foo } from './foo.ts'; +``` + +The following patterns are considered problems when configuration set to "always": + +```js +import foo from './foo'; + +import bar from './bar'; + +import Component from './Component'; + +import foo from '@/foo'; +``` + +The following patterns are not considered problems when configuration set to "always": + +```js +import foo from './foo.js'; + +import bar from './bar.json'; + +import Component from './Component.jsx'; + +import * as path from 'path'; + +import foo from '@/foo.js'; +``` + +The following patterns are considered problems when configuration set to "ignorePackages": + +```js +import foo from './foo'; + +import bar from './bar'; + +import Component from './Component'; + +``` + +The following patterns are not considered problems when configuration set to "ignorePackages": + +```js +import foo from './foo.js'; + +import bar from './bar.json'; + +import Component from './Component.jsx'; + +import express from 'express'; + +import foo from '@/foo' +``` + +The following patterns are not considered problems when configuration set to `['error', 'always', {ignorePackages: true} ]`: + +```js +import Component from './Component.jsx'; + +import baz from 'foo/baz.js'; + +import express from 'express'; + +import foo from '@/foo'; +``` + +The following patterns are considered problems when the configuration is set to "always" and the option "checkTypeImports" is set to `true`: + +```js +import type { Foo } from './foo'; + +export type { Foo } from './foo'; +``` + +## When Not To Use It + +If you are not concerned about a consistent usage of file extension. + +In the future, when this rule supports native node ESM resolution, and the plugin is configured to use native rather than transpiled ESM (a config option that is not yet available) - setting this to `always` will have no effect. + +[16]: https://www.npmjs.com/package/minimatch#features +[17]: https://www.npmjs.com/package/minimatch#options diff --git a/node_modules/eslint-plugin-import/docs/rules/first.md b/node_modules/eslint-plugin-import/docs/rules/first.md new file mode 100644 index 0000000000000000000000000000000000000000..c765a29739408b545a4319c79651647e1e7b61c4 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/first.md @@ -0,0 +1,75 @@ +# import/first + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +This rule reports any imports that come after non-import +statements. + +## Rule Details + +```js +import foo from './foo' + +// some module-level initializer +initWith(foo) + +import bar from './bar' // <- reported +``` + +Providing `absolute-first` as an option will report any absolute imports (i.e. +packages) that come after any relative imports: + +```js +import foo from 'foo' +import bar from './bar' + +import * as _ from 'lodash' // <- reported +``` + +If you really want import type ordering, check out [`import/order`]. + +Notably, `import`s are hoisted, which means the imported modules will be evaluated +before any of the statements interspersed between them. Keeping all `import`s together +at the top of the file may prevent surprises resulting from this part of the spec. + +### On directives + +Directives are allowed as long as they occur strictly before any `import` declarations, +as follows: + +```js +'use super-mega-strict' + +import { suchFoo } from 'lame-fake-module-name' // no report here +``` + +A directive in this case is assumed to be a single statement that contains only +a literal string-valued expression. + +`'use strict'` would be a good example, except that [modules are always in strict +mode](https://262.ecma-international.org/6.0/#sec-strict-mode-code) so it would be surprising to see a `'use strict'` sharing a file with `import`s and +`export`s. + +Given that, see [#255] for the reasoning. + +### With Fixer + +This rule contains a fixer to reorder in-body import to top, the following criteria applied: + +1. Never re-order relative to each other, even if `absolute-first` is set. +2. If an import creates an identifier, and that identifier is referenced at module level *before* the import itself, that won't be re-ordered. + +## When Not To Use It + +If you don't mind imports being sprinkled throughout, you may not want to +enable this rule. + +## Further Reading + + - [`import/order`]: a major step up from `absolute-first` + - Issue [#255] + +[`import/order`]: ./order.md +[#255]: https://github.com/import-js/eslint-plugin-import/issues/255 diff --git a/node_modules/eslint-plugin-import/docs/rules/group-exports.md b/node_modules/eslint-plugin-import/docs/rules/group-exports.md new file mode 100644 index 0000000000000000000000000000000000000000..9fb212de6a24bdf833d4a1ec15247fcd6d76d24f --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/group-exports.md @@ -0,0 +1,118 @@ +# import/group-exports + + + +Reports when named exports are not grouped together in a single `export` declaration or when multiple assignments to CommonJS `module.exports` or `exports` object are present in a single file. + +**Rationale:** An `export` declaration or `module.exports` assignment can appear anywhere in the code. By requiring a single export declaration all your exports will remain at one place, making it easier to see what exports a module provides. + +## Rule Details + +This rule warns whenever a single file contains multiple named export declarations or multiple assignments to `module.exports` (or `exports`). + +### Valid + +```js +// A single named export declaration -> ok +export const valid = true +``` + +```js +const first = true +const second = true + +// A single named export declaration -> ok +export { + first, + second, +} +``` + +```js +// Aggregating exports -> ok +export { default as module1 } from 'module-1' +export { default as module2 } from 'module-2' +``` + +```js +// A single exports assignment -> ok +module.exports = { + first: true, + second: true +} +``` + +```js +const first = true +const second = true + +// A single exports assignment -> ok +module.exports = { + first, + second, +} +``` + +```js +function test() {} +test.property = true +test.another = true + +// A single exports assignment -> ok +module.exports = test +``` + +```ts +const first = true; +type firstType = boolean + +// A single named export declaration (type exports handled separately) -> ok +export {first} +export type {firstType} +``` + +### Invalid + +```js +// Multiple named export statements -> not ok! +export const first = true +export const second = true +``` + +```js +// Aggregating exports from the same module -> not ok! +export { module1 } from 'module-1' +export { module2 } from 'module-1' +``` + +```js +// Multiple exports assignments -> not ok! +exports.first = true +exports.second = true +``` + +```js +// Multiple exports assignments -> not ok! +module.exports = {} +module.exports.first = true +``` + +```js +// Multiple exports assignments -> not ok! +module.exports = () => {} +module.exports.first = true +module.exports.second = true +``` + +```ts +type firstType = boolean +type secondType = any + +// Multiple named type export statements -> not ok! +export type {firstType} +export type {secondType} +``` + +## When Not To Use It + +If you do not mind having your exports spread across the file, you can safely turn this rule off. diff --git a/node_modules/eslint-plugin-import/docs/rules/imports-first.md b/node_modules/eslint-plugin-import/docs/rules/imports-first.md new file mode 100644 index 0000000000000000000000000000000000000000..278e4c472508174038a32a9dade911fe051a792e --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/imports-first.md @@ -0,0 +1,9 @@ +# import/imports-first + +❌ This rule is deprecated. + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +This rule was **deprecated** in eslint-plugin-import v2.0.0. Please use the corresponding rule [`first`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/first.md). diff --git a/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md b/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md new file mode 100644 index 0000000000000000000000000000000000000000..1ecbca64d3241bc699c34449c5a52929ab34c973 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md @@ -0,0 +1,70 @@ +# import/max-dependencies + + + +Forbid modules to have too many dependencies (`import` or `require` statements). + +This is a useful rule because a module with too many dependencies is a code smell, and usually indicates the module is doing too much and/or should be broken up into smaller modules. + +Importing multiple named exports from a single module will only count once (e.g. `import {x, y, z} from './foo'` will only count as a single dependency). + +## Options + +This rule has the following options, with these defaults: + +```js +"import/max-dependencies": ["error", { + "max": 10, + "ignoreTypeImports": false, +}] +``` + +### `max` + +This option sets the maximum number of dependencies allowed. Anything over will trigger the rule. **Default is 10** if the rule is enabled and no `max` is specified. + +Given a max value of `{"max": 2}`: + +### Fail + +```js +import a from './a'; // 1 +const b = require('./b'); // 2 +import c from './c'; // 3 - exceeds max! +``` + +### Pass + +```js +import a from './a'; // 1 +const anotherA = require('./a'); // still 1 +import {x, y, z} from './foo'; // 2 +``` + +### `ignoreTypeImports` + +Ignores `type` imports. Type imports are a feature released in TypeScript 3.8, you can [read more here](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export). Defaults to `false`. + +Given `{"max": 2, "ignoreTypeImports": true}`: + + +### Fail + +```ts +import a from './a'; +import b from './b'; +import c from './c'; +``` + + +### Pass + +```ts +import a from './a'; +import b from './b'; +import type c from './c'; // Doesn't count against max +``` + +## When Not To Use It + +If you don't care how many dependencies a module has. diff --git a/node_modules/eslint-plugin-import/docs/rules/named.md b/node_modules/eslint-plugin-import/docs/rules/named.md new file mode 100644 index 0000000000000000000000000000000000000000..44f8dc65849da42c3d08d0199c23c6b4e18cf617 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/named.md @@ -0,0 +1,102 @@ +# import/named + +💼🚫 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`. This rule is _disabled_ in the ⌨️ `typescript` config. + + + +Verifies that all named imports are part of the set of named exports in the referenced module. + +For `export`, verifies that all named exports exist in the referenced module. + +Note: for packages, the plugin will find exported names +from [`jsnext:main`] (deprecated) or `module`, if present in `package.json`. +Redux's npm module includes this key, and thereby is lintable, for example. + +A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. Note that type imports and exports, as used by [Flow], are always ignored. + +[ignored]: ../../README.md#importignore +[unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar +[Flow]: https://flow.org/ + +## Rule Details + +Given: + +```js +// ./foo.js +export const foo = "I'm so foo" +``` + +The following is considered valid: + +```js +// ./bar.js +import { foo } from './foo' + +// ES7 proposal +export { foo as bar } from './foo' + +// node_modules without jsnext:main are not analyzed by default +// (import/ignore setting) +import { SomeNonsenseThatDoesntExist } from 'react' +``` + +...and the following are reported: + +```js +// ./baz.js +import { notFoo } from './foo' + +// ES7 proposal +export { notFoo as defNotBar } from './foo' + +// will follow 'jsnext:main', if available +import { dontCreateStore } from 'redux' +``` + +### Settings + +[`import/ignore`] can be provided as a setting to ignore certain modules (node_modules, +CoffeeScript, CSS if using Webpack, etc.). + +Given: + +```yaml +# .eslintrc (YAML) +--- +settings: + import/ignore: + - node_modules # included by default, but replaced if explicitly configured + - *.coffee$ # can't parse CoffeeScript (unless a custom polyglot parser was configured) +``` + +and + +```coffeescript +# ./whatever.coffee +exports.whatever = (foo) -> console.log foo +``` + +then the following is not reported: + +```js +// ./foo.js + +// can't be analyzed, and ignored, so not reported +import { notWhatever } from './whatever' +``` + +## When Not To Use It + +If you are using CommonJS and/or modifying the exported namespace of any module at +runtime, you will likely see false positives with this rule. + +## Further Reading + + - [`import/ignore`] setting + - [`jsnext:main`] deprecation + - [`pkg.module`] (Rollup) + +[`jsnext:main`]: https://github.com/jsforum/jsforum/issues/5 +[`pkg.module`]: https://github.com/rollup/rollup/wiki/pkg.module +[`import/ignore`]: ../../README.md#importignore diff --git a/node_modules/eslint-plugin-import/docs/rules/namespace.md b/node_modules/eslint-plugin-import/docs/rules/namespace.md new file mode 100644 index 0000000000000000000000000000000000000000..1a177f58199cfac30f4338b2ae938ed523efd10a --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/namespace.md @@ -0,0 +1,106 @@ +# import/namespace + +💼 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`. + + + +Enforces names exist at the time they are dereferenced, when imported as a full namespace (i.e. `import * as foo from './foo'; foo.bar();` will report if `bar` is not exported by `./foo`.). + +Will report at the import declaration if there are _no_ exported names found. + +Also, will report for computed references (i.e. `foo["bar"]()`). + +Reports on assignment to a member of an imported namespace. + +Note: for packages, the plugin will find exported names +from [`jsnext:main`], if present in `package.json`. +Redux's npm module includes this key, and thereby is lintable, for example. + +A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. + +[ignored]: ../README.md#importignore +[unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar + +## Rule Details + +Currently, this rule does not check for possible +redefinition of the namespace in an intermediate scope. Adherence to the ESLint +`no-shadow` rule for namespaces will prevent this from being a problem. + +For [ES7], reports if an exported namespace would be empty (no names exported from the referenced module.) + +Given: + +```js +// @module ./named-exports +export const a = 1 +const b = 2 +export { b } + +const c = 3 +export { c as d } + +export class ExportedClass { } + +// ES7 +export * as deep from './deep' +``` + +and: + +```js +// @module ./deep +export const e = "MC2" +``` + +See what is valid and reported: + +```js +// @module ./foo +import * as names from './named-exports' + +function great() { + return names.a + names.b // so great https://youtu.be/ei7mb8UxEl8 +} + +function notGreat() { + doSomethingWith(names.c) // Reported: 'c' not found in imported namespace 'names'. + + const { a, b, c } = names // also reported, only for 'c' +} + +// also tunnels through re-exported namespaces! +function deepTrouble() { + doSomethingWith(names.deep.e) // fine + doSomethingWith(names.deep.f) // Reported: 'f' not found in deeply imported namespace 'names.deep'. +} + +``` + +### Options + +#### `allowComputed` + +Defaults to `false`. When false, will report the following: + +```js +/*eslint import/namespace: [2, { allowComputed: false }]*/ +import * as a from './a' + +function f(x) { + return a[x] // Unable to validate computed reference to imported namespace 'a'. +} +``` + +When set to `true`, the above computed namespace member reference is allowed, but +still can't be statically analyzed any further. + +## Further Reading + + - Lee Byron's [ES7] export proposal + - [`import/ignore`] setting + - [`jsnext:main`](Rollup) + +[ES7]: https://github.com/leebyron/ecmascript-more-export-from +[`import/ignore`]: ../../README.md#importignore +[`jsnext:main`]: https://github.com/rollup/rollup/wiki/jsnext:main diff --git a/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md b/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md new file mode 100644 index 0000000000000000000000000000000000000000..ef5aeed76705da841bd7d41f4c6ca1bee4388a0f --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md @@ -0,0 +1,167 @@ +# import/newline-after-import + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Enforces having one or more empty lines after the last top-level import statement or require call. + +## Rule Details + +This rule supports the following options: + + - `count` which sets the number of newlines that are enforced after the last top-level import statement or require call. This option defaults to `1`. + + - `exactCount` which enforce the exact numbers of newlines that is mentioned in `count`. This option defaults to `false`. + + - `considerComments` which enforces the rule on comments after the last import-statement as well when set to true. This option defaults to `false`. + +Valid: + +```js +import defaultExport from './foo'; + +const FOO = 'BAR'; +``` + +```js +import defaultExport from './foo'; +import { bar } from 'bar-lib'; + +const FOO = 'BAR'; +``` + +```js +const FOO = require('./foo'); +const BAR = require('./bar'); + +const BAZ = 1; +``` + +Invalid: + +```js +import * as foo from 'foo' +const FOO = 'BAR'; +``` + +```js +import * as foo from 'foo'; +const FOO = 'BAR'; + +import { bar } from 'bar-lib'; +``` + +```js +const FOO = require('./foo'); +const BAZ = 1; +const BAR = require('./bar'); +``` + +With `count` set to `2` this will be considered valid: + +```js +import defaultExport from './foo'; + + +const FOO = 'BAR'; +``` + +```js +import defaultExport from './foo'; + + + +const FOO = 'BAR'; +``` + +With `count` set to `2` these will be considered invalid: + +```js +import defaultExport from './foo'; +const FOO = 'BAR'; +``` + +```js +import defaultExport from './foo'; + +const FOO = 'BAR'; +``` + +With `count` set to `2` and `exactCount` set to `true` this will be considered valid: + +```js +import defaultExport from './foo'; + + +const FOO = 'BAR'; +``` + +With `count` set to `2` and `exactCount` set to `true` these will be considered invalid: + +```js +import defaultExport from './foo'; +const FOO = 'BAR'; +``` + +```js +import defaultExport from './foo'; + +const FOO = 'BAR'; +``` + +```js +import defaultExport from './foo'; + + + +const FOO = 'BAR'; +``` + +```js +import defaultExport from './foo'; + + + + +const FOO = 'BAR'; +``` + +With `considerComments` set to `false` this will be considered valid: + +```js +import defaultExport from './foo' +// some comment here. +const FOO = 'BAR' +``` + +With `considerComments` set to `true` this will be considered valid: + +```js +import defaultExport from './foo' + +// some comment here. +const FOO = 'BAR' +``` + +With `considerComments` set to `true` this will be considered invalid: + +```js +import defaultExport from './foo' +// some comment here. +const FOO = 'BAR' +``` + +## Example options usage + +```json +{ + "rules": { + "import/newline-after-import": ["error", { "count": 2 }] + } +} +``` + +## When Not To Use It + +If you like to visually group module imports with its usage, you don't want to use this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md b/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md new file mode 100644 index 0000000000000000000000000000000000000000..48fb9532bda8cbbd7429a35b344e7793ad80ec6f --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md @@ -0,0 +1,54 @@ +# import/no-absolute-path + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Node.js allows the import of modules using an absolute path such as `/home/xyz/file.js`. That is a bad practice as it ties the code using it to your computer, and therefore makes it unusable in packages distributed on `npm` for instance. + +This rule forbids the import of modules using absolute paths. + +## Rule Details + +### Fail + +```js +import f from '/foo'; +import f from '/some/path'; + +var f = require('/foo'); +var f = require('/some/path'); +``` + +### Pass + +```js +import _ from 'lodash'; +import foo from 'foo'; +import foo from './foo'; + +var _ = require('lodash'); +var foo = require('foo'); +var foo = require('./foo'); +``` + +### Options + +By default, only ES6 imports and CommonJS `require` calls will have this rule enforced. + +You may provide an options object providing true/false for any of + + - `esmodule`: defaults to `true` + - `commonjs`: defaults to `true` + - `amd`: defaults to `false` + +If `{ amd: true }` is provided, dependency paths for AMD-style `define` and `require` +calls will be resolved: + +```js +/*eslint import/no-absolute-path: [2, { commonjs: false, amd: true }]*/ +define(['/foo'], function (foo) { /*...*/ }) // reported +require(['/foo'], function (foo) { /*...*/ }) // reported + +const foo = require('/foo') // ignored because of explicit `commonjs: false` +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-amd.md b/node_modules/eslint-plugin-import/docs/rules/no-amd.md new file mode 100644 index 0000000000000000000000000000000000000000..6e592ba75850b9c81364f5aaf4dbb76de7ebcf61 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-amd.md @@ -0,0 +1,37 @@ +# import/no-amd + + + +Reports `require([array], ...)` and `define([array], ...)` function calls at the +module scope. Will not report if !=2 arguments, or first argument is not a literal array. + +Intended for temporary use when migrating to pure ES6 modules. + +## Rule Details + +This will be reported: + +```js +define(["a", "b"], function (a, b) { /* ... */ }) + +require(["b", "c"], function (b, c) { /* ... */ }) +``` + +CommonJS `require` is still valid. + +## When Not To Use It + +If you don't mind mixing module systems (sometimes this is useful), you probably +don't want this rule. + +It is also fairly noisy if you have a larger codebase that is being transitioned +from AMD to ES6 modules. + +## Contributors + +Special thanks to @xjamundx for donating his no-define rule as a start to this. + +## Further Reading + + - [`no-commonjs`](./no-commonjs.md): report CommonJS `require` and `exports` + - Source: diff --git a/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md b/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md new file mode 100644 index 0000000000000000000000000000000000000000..70efb84501c355ab08475077fd28aba59dbfd7aa --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md @@ -0,0 +1,83 @@ +# import/no-anonymous-default-export + + + +Reports if a module's default export is unnamed. This includes several types of unnamed data types; literals, object expressions, arrays, anonymous functions, arrow functions, and anonymous class declarations. + +Ensuring that default exports are named helps improve the grepability of the codebase by encouraging the re-use of the same identifier for the module's default export at its declaration site and at its import sites. + +## Options + +By default, all types of anonymous default exports are forbidden, but any types can be selectively allowed by toggling them on in the options. + +The complete default configuration looks like this. + +```js +"import/no-anonymous-default-export": ["error", { + "allowArray": false, + "allowArrowFunction": false, + "allowAnonymousClass": false, + "allowAnonymousFunction": false, + "allowCallExpression": true, // The true value here is for backward compatibility + "allowNew": false, + "allowLiteral": false, + "allowObject": false +}] +``` + +## Rule Details + +### Fail + +```js +export default [] + +export default () => {} + +export default class {} + +export default function () {} + +/* eslint import/no-anonymous-default-export: [2, {"allowCallExpression": false}] */ +export default foo(bar) + +export default 123 + +export default {} + +export default new Foo() +``` + +### Pass + +```js +const foo = 123 +export default foo + +export default class MyClass() {} + +export default function foo() {} + +/* eslint import/no-anonymous-default-export: [2, {"allowArray": true}] */ +export default [] + +/* eslint import/no-anonymous-default-export: [2, {"allowArrowFunction": true}] */ +export default () => {} + +/* eslint import/no-anonymous-default-export: [2, {"allowAnonymousClass": true}] */ +export default class {} + +/* eslint import/no-anonymous-default-export: [2, {"allowAnonymousFunction": true}] */ +export default function () {} + +export default foo(bar) + +/* eslint import/no-anonymous-default-export: [2, {"allowLiteral": true}] */ +export default 123 + +/* eslint import/no-anonymous-default-export: [2, {"allowObject": true}] */ +export default {} + +/* eslint import/no-anonymous-default-export: [2, {"allowNew": true}] */ +export default new Foo() +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md b/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md new file mode 100644 index 0000000000000000000000000000000000000000..4dc9c8c5d90b45cc324d4cba9e92db932ee52bd4 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md @@ -0,0 +1,96 @@ +# import/no-commonjs + + + +Reports `require([string])` function calls. Will not report if >1 argument, +or single argument is not a literal string. + +Reports `module.exports` or `exports.*`, also. + +Intended for temporary use when migrating to pure ES6 modules. + +## Rule Details + +This will be reported: + +```js +var mod = require('./mod') + , common = require('./common') + , fs = require('fs') + , whateverModule = require('./not-found') + +module.exports = { a: "b" } +exports.c = "d" +``` + +### Allow require + +If `allowRequire` option is set to `true`, `require` calls are valid: + +```js +/*eslint no-commonjs: [2, { allowRequire: true }]*/ +var mod = require('./mod'); +``` + +but `module.exports` is reported as usual. + +### Allow conditional require + +By default, conditional requires are allowed: + +```js +var a = b && require("c") + +if (typeof window !== "undefined") { + require('that-ugly-thing'); +} + +var fs = null; +try { + fs = require("fs") +} catch (error) {} +``` + +If the `allowConditionalRequire` option is set to `false`, they will be reported. + +If you don't rely on synchronous module loading, check out [dynamic import](https://github.com/airbnb/babel-plugin-dynamic-import-node). + +### Allow primitive modules + +If `allowPrimitiveModules` option is set to `true`, the following is valid: + +```js +/*eslint no-commonjs: [2, { allowPrimitiveModules: true }]*/ + +module.exports = "foo" +module.exports = function rule(context) { return { /* ... */ } } +``` + +but this is still reported: + +```js +/*eslint no-commonjs: [2, { allowPrimitiveModules: true }]*/ + +module.exports = { x: "y" } +exports.z = function boop() { /* ... */ } +``` + +This is useful for things like ESLint rule modules, which must export a function as +the module. + +## When Not To Use It + +If you don't mind mixing module systems (sometimes this is useful), you probably +don't want this rule. + +It is also fairly noisy if you have a larger codebase that is being transitioned +from CommonJS to ES6 modules. + +## Contributors + +Special thanks to @xjamundx for donating the module.exports and exports.* bits. + +## Further Reading + + - [`no-amd`](./no-amd.md): report on AMD `require`, `define` + - Source: diff --git a/node_modules/eslint-plugin-import/docs/rules/no-cycle.md b/node_modules/eslint-plugin-import/docs/rules/no-cycle.md new file mode 100644 index 0000000000000000000000000000000000000000..898b75330e34f6bf53c249e70d6cdb0fb01f3d96 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-cycle.md @@ -0,0 +1,119 @@ +# import/no-cycle + + + +Ensures that there is no resolvable path back to this module via its dependencies. + +This includes cycles of depth 1 (imported module imports me) to `"∞"` (or `Infinity`), if the +[`maxDepth`](#maxdepth) option is not set. + +```js +// dep-b.js +import './dep-a.js' + +export function b() { /* ... */ } +``` + +```js +// dep-a.js +import { b } from './dep-b.js' // reported: Dependency cycle detected. +``` + +This rule does _not_ detect imports that resolve directly to the linted module; +for that, see [`no-self-import`]. + +This rule ignores type-only imports in Flow and TypeScript syntax (`import type` and `import typeof`), which have no runtime effect. + +## Rule Details + +### Options + +By default, this rule only detects cycles for ES6 imports, but see the [`no-unresolved` options](./no-unresolved.md#options) as this rule also supports the same `commonjs` and `amd` flags. However, these flags only impact which import types are _linted_; the +import/export infrastructure only registers `import` statements in dependencies, so +cycles created by `require` within imported modules may not be detected. + +#### `maxDepth` + +There is a `maxDepth` option available to prevent full expansion of very deep dependency trees: + +```js +/*eslint import/no-cycle: [2, { maxDepth: 1 }]*/ + +// dep-c.js +import './dep-a.js' +``` + +```js +// dep-b.js +import './dep-c.js' + +export function b() { /* ... */ } +``` + +```js +// dep-a.js +import { b } from './dep-b.js' // not reported as the cycle is at depth 2 +``` + +This is not necessarily recommended, but available as a cost/benefit tradeoff mechanism +for reducing total project lint time, if needed. + +#### `ignoreExternal` + +An `ignoreExternal` option is available to prevent the cycle detection to expand to external modules: + +```js +/*eslint import/no-cycle: [2, { ignoreExternal: true }]*/ + +// dep-a.js +import 'module-b/dep-b.js' + +export function a() { /* ... */ } +``` + +```js +// node_modules/module-b/dep-b.js +import { a } from './dep-a.js' // not reported as this module is external +``` + +Its value is `false` by default, but can be set to `true` for reducing total project lint time, if needed. + +#### `allowUnsafeDynamicCyclicDependency` + +This option disable reporting of errors if a cycle is detected with at least one dynamic import. + +```js +// bar.js +import { foo } from './foo'; +export const bar = foo; + +// foo.js +export const foo = 'Foo'; +export function getBar() { return import('./bar'); } +``` + +> Cyclic dependency are **always** a dangerous anti-pattern as discussed extensively in [#2265](https://github.com/import-js/eslint-plugin-import/issues/2265). Please be extra careful about using this option. + +#### `disableScc` + +This option disables a pre-processing step that calculates [Strongly Connected Components](https://en.wikipedia.org/wiki/Strongly_connected_component), which are used for avoiding unnecessary work checking files in different SCCs for cycles. + +However, under some configurations, this pre-processing may be more expensive than the time it saves. + +When this option is `true`, we don't calculate any SCC graph, and check all files for cycles (leading to higher time-complexity). Default is `false`. + +## When Not To Use It + +This rule is comparatively computationally expensive. If you are pressed for lint +time, or don't think you have an issue with dependency cycles, you may not want +this rule enabled. + +## Further Reading + + - [Original inspiring issue](https://github.com/import-js/eslint-plugin-import/issues/941) + - Rule to detect that module imports itself: [`no-self-import`] + - [`import/external-module-folders`] setting + +[`no-self-import`]: ./no-self-import.md + +[`import/external-module-folders`]: ../../README.md#importexternal-module-folders diff --git a/node_modules/eslint-plugin-import/docs/rules/no-default-export.md b/node_modules/eslint-plugin-import/docs/rules/no-default-export.md new file mode 100644 index 0000000000000000000000000000000000000000..586d5e74511f5f5543a30ca77b017d1ba3cc8163 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-default-export.md @@ -0,0 +1,65 @@ +# import/no-default-export + + + +Prohibit default exports. Mostly an inverse of [`prefer-default-export`]. + +[`prefer-default-export`]: ./prefer-default-export.md + +## Rule Details + +The following patterns are considered warnings: + +```javascript +// bad1.js + +// There is a default export. +export const foo = 'foo'; +const bar = 'bar'; +export default 'bar'; +``` + +```javascript +// bad2.js + +// There is a default export. +const foo = 'foo'; +export { foo as default } +``` + +The following patterns are not warnings: + +```javascript +// good1.js + +// There is only a single module export and it's a named export. +export const foo = 'foo'; +``` + +```javascript +// good2.js + +// There is more than one named export in the module. +export const foo = 'foo'; +export const bar = 'bar'; +``` + +```javascript +// good3.js + +// There is more than one named export in the module +const foo = 'foo'; +const bar = 'bar'; +export { foo, bar } +``` + +```javascript +// export-star.js + +// Any batch export will disable this rule. The remote module is not inspected. +export * from './other-module' +``` + +## When Not To Use It + +If you don't care if default imports are used, or if you prefer default imports over named imports. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md b/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md new file mode 100644 index 0000000000000000000000000000000000000000..a647d77ad54bafb118a93eec92afe572fd1d71c1 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md @@ -0,0 +1,62 @@ +# import/no-deprecated + + + +Reports use of a deprecated name, as indicated by a JSDoc block with a `@deprecated` +tag or TomDoc `Deprecated:` comment. + +using a JSDoc `@deprecated` tag: + +```js +// @file: ./answer.js + +/** + * this is what you get when you trust a mouse talk show + * @deprecated need to restart the experiment + * @returns {Number} nonsense + */ +export function multiply(six, nine) { + return 42 +} +``` + +will report as such: + +```js +import { multiply } from './answer' // Deprecated: need to restart the experiment + +function whatever(y, z) { + return multiply(y, z) // Deprecated: need to restart the experiment +} +``` + +or using the TomDoc equivalent: + +```js +// Deprecated: This is what you get when you trust a mouse talk show, need to +// restart the experiment. +// +// Returns a Number nonsense +export function multiply(six, nine) { + return 42 +} +``` + +Only JSDoc is enabled by default. Other documentation styles can be enabled with +the `import/docstyle` setting. + +```yaml +# .eslintrc.yml +settings: + import/docstyle: ['jsdoc', 'tomdoc'] +``` + +## Worklist + + - [x] report explicit imports on the import node + - [x] support namespaces + - [x] should bubble up through deep namespaces (#157) + - [x] report explicit imports at reference time (at the identifier) similar to namespace + - [x] mark module deprecated if file JSDoc has a @deprecated tag? + - [ ] don't flag redeclaration of imported, deprecated names + - [ ] flag destructuring diff --git a/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md b/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md new file mode 100644 index 0000000000000000000000000000000000000000..29c16f15d166fae4f52413402c490c19d548d16b --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md @@ -0,0 +1,109 @@ +# import/no-duplicates + +⚠️ This rule _warns_ in the following configs: ☑️ `recommended`, 🚸 `warnings`. + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Reports if a resolved path is imported more than once. + +ESLint core has a similar rule ([`no-duplicate-imports`](https://eslint.org/docs/rules/no-duplicate-imports)), but this version +is different in two key ways: + +1. the paths in the source code don't have to exactly match, they just have to point to the same module on the filesystem. (i.e. `./foo` and `./foo.js`) +2. this version distinguishes Flow `type` imports from standard imports. ([#334](https://github.com/import-js/eslint-plugin-import/pull/334)) + +## Rule Details + +Valid: + +```js +import SomeDefaultClass, * as names from './mod' +// Flow `type` import from same module is fine +import type SomeType from './mod' +``` + +...whereas here, both `./mod` imports will be reported: + +```js +import SomeDefaultClass from './mod' + +// oops, some other import separated these lines +import foo from './some-other-mod' + +import * as names from './mod' + +// will catch this too, assuming it is the same target module +import { something } from './mod.js' +``` + +The motivation is that this is likely a result of two developers importing different +names from the same module at different times (and potentially largely different +locations in the file.) This rule brings both (or n-many) to attention. + +### Query Strings + +By default, this rule ignores query strings (i.e. paths followed by a question mark), and thus imports from `./mod?a` and `./mod?b` will be considered as duplicates. However you can use the option `considerQueryString` to handle them as different (primarily because browsers will resolve those imports differently). + +Config: + +```json +"import/no-duplicates": ["error", {"considerQueryString": true}] +``` + +And then the following code becomes valid: + +```js +import minifiedMod from './mod?minify' +import noCommentsMod from './mod?comments=0' +import originalMod from './mod' +``` + +It will still catch duplicates when using the same module and the exact same query string: + +```js +import SomeDefaultClass from './mod?minify' + +// This is invalid, assuming `./mod` and `./mod.js` are the same target: +import * from './mod.js?minify' +``` + +### Inline Type imports + +TypeScript 4.5 introduced a new [feature](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/#type-on-import-names) that allows mixing of named value and type imports. In order to support fixing to an inline type import when duplicate imports are detected, `prefer-inline` can be set to true. + +Config: + +```json +"import/no-duplicates": ["error", {"prefer-inline": true}] +``` + + + +❌ Invalid `["error", {"prefer-inline": true}]` + +```js +import { AValue, type AType } from './mama-mia' +import type { BType } from './mama-mia' + +import { CValue } from './papa-mia' +import type { CType } from './papa-mia' +``` + +✅ Valid with `["error", {"prefer-inline": true}]` + +```js +import { AValue, type AType, type BType } from './mama-mia' + +import { CValue, type CType } from './papa-mia' +``` + + + +## When Not To Use It + +If the core ESLint version is good enough (i.e. you're _not_ using Flow and you _are_ using [`import/extensions`](./extensions.md)), keep it and don't use this. + +If you like to split up imports across lines or may need to import a default and a namespace, +you may not want to enable this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md b/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md new file mode 100644 index 0000000000000000000000000000000000000000..292055fcdc20b5f225f42cd883c2dc6ed5e71590 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md @@ -0,0 +1,25 @@ +# import/no-dynamic-require + + + +The `require` method from CommonJS is used to import modules from different files. Unlike the ES6 `import` syntax, it can be given expressions that will be resolved at runtime. While this is sometimes necessary and useful, in most cases it isn't. Using expressions (for instance, concatenating a path and variable) as the argument makes it harder for tools to do static code analysis, or to find where in the codebase a module is used. + +This rule forbids every call to `require()` that uses expressions for the module name argument. + +## Rule Details + +### Fail + +```js +require(name); +require('../' + name); +require(`../${name}`); +require(name()); +``` + +### Pass + +```js +require('../name'); +require(`../name`); +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-empty-named-blocks.md b/node_modules/eslint-plugin-import/docs/rules/no-empty-named-blocks.md new file mode 100644 index 0000000000000000000000000000000000000000..ad83c535f8e9c31c8fce927a5e3bcd8323289890 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-empty-named-blocks.md @@ -0,0 +1,49 @@ +# import/no-empty-named-blocks + +🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). + + + +Reports the use of empty named import blocks. + +## Rule Details + +### Valid + +```js +import { mod } from 'mod' +import Default, { mod } from 'mod' +``` + +When using typescript + +```js +import type { mod } from 'mod' +``` + +When using flow + +```js +import typeof { mod } from 'mod' +``` + +### Invalid + +```js +import {} from 'mod' +import Default, {} from 'mod' +``` + +When using typescript + +```js +import type Default, {} from 'mod' +import type {} from 'mod' +``` + +When using flow + +```js +import typeof {} from 'mod' +import typeof Default, {} from 'mod' +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md b/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md new file mode 100644 index 0000000000000000000000000000000000000000..848d5bb0da5c1c584c2de62426e6c83c089417f1 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md @@ -0,0 +1,139 @@ +# import/no-extraneous-dependencies + + + +Forbid the import of external modules that are not declared in the `package.json`'s `dependencies`, `devDependencies`, `optionalDependencies`, `peerDependencies`, or `bundledDependencies`. +The closest parent `package.json` will be used. If no `package.json` is found, the rule will not lint anything. This behavior can be changed with the rule option `packageDir`. Normally ignores imports of modules marked internal, but this can be changed with the rule option `includeInternal`. Type imports can be verified by specifying `includeTypes`. + +Modules have to be installed for this rule to work. + +## Options + +This rule supports the following options: + +`devDependencies`: If set to `false`, then the rule will show an error when `devDependencies` are imported. Defaults to `true`. +Type imports are ignored by default. + +`optionalDependencies`: If set to `false`, then the rule will show an error when `optionalDependencies` are imported. Defaults to `true`. + +`peerDependencies`: If set to `false`, then the rule will show an error when `peerDependencies` are imported. Defaults to `true`. + +`bundledDependencies`: If set to `false`, then the rule will show an error when `bundledDependencies` are imported. Defaults to `true`. + +You can set the options like this: + +```js +"import/no-extraneous-dependencies": ["error", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}] +``` + +You can also use an array of globs instead of literal booleans: + +```js +"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js"]}] +``` + +When using an array of globs, the setting will be set to `true` (no errors reported) if the name of the file being linted (i.e. not the imported file/module) matches a single glob in the array, and `false` otherwise. + +There are 2 boolean options to opt into checking extra imports that are normally ignored: `includeInternal`, which enables the checking of internal modules, and `includeTypes`, which enables checking of type imports in TypeScript. + +```js +"import/no-extraneous-dependencies": ["error", {"includeInternal": true, "includeTypes": true}] +``` + +Also there is one more option called `packageDir`, this option is to specify the path to the folder containing package.json. + +If provided as a relative path string, will be computed relative to the current working directory at linter execution time. If this is not ideal (does not work with some editor integrations), consider using `__dirname` to provide a path relative to your configuration. + +```js +"import/no-extraneous-dependencies": ["error", {"packageDir": './some-dir/'}] +// or +"import/no-extraneous-dependencies": ["error", {"packageDir": path.join(__dirname, 'some-dir')}] +``` + +It may also be an array of multiple paths, to support monorepos or other novel project +folder layouts: + +```js +"import/no-extraneous-dependencies": ["error", {"packageDir": ['./some-dir/', './root-pkg']}] +``` + +## Rule Details + +Given the following `package.json`: + +```json +{ + "name": "my-project", + "...": "...", + "dependencies": { + "builtin-modules": "^1.1.1", + "lodash.cond": "^4.2.0", + "lodash.find": "^4.2.0", + "pkg-up": "^1.0.0" + }, + "devDependencies": { + "ava": "^0.13.0", + "eslint": "^2.4.0", + "eslint-plugin-ava": "^1.3.0", + "xo": "^0.13.0" + }, + "optionalDependencies": { + "lodash.isarray": "^4.0.0" + }, + "peerDependencies": { + "react": ">=15.0.0 <16.0.0" + }, + "bundledDependencies": [ + "@generated/foo", + ] +} +``` + +## Fail + +```js +var _ = require('lodash'); +import _ from 'lodash'; + +import react from 'react'; + +/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": false}] */ +import test from 'ava'; +var test = require('ava'); + +/* eslint import/no-extraneous-dependencies: ["error", {"optionalDependencies": false}] */ +import isArray from 'lodash.isarray'; +var isArray = require('lodash.isarray'); + +/* eslint import/no-extraneous-dependencies: ["error", {"bundledDependencies": false}] */ +import foo from '"@generated/foo"'; +var foo = require('"@generated/foo"'); + +/* eslint import/no-extraneous-dependencies: ["error", {"includeInternal": true}] */ +import foo from './foo'; +var foo = require('./foo'); + +/* eslint import/no-extraneous-dependencies: ["error", {"includeTypes": true}] */ +import type { MyType } from 'foo'; +``` + +## Pass + +```js +// Builtin and internal modules are fine +var path = require('path'); +var foo = require('./foo'); + +import test from 'ava'; +import find from 'lodash.find'; +import isArray from 'lodash.isarray'; +import foo from '"@generated/foo"'; +import type { MyType } from 'foo'; + +/* eslint import/no-extraneous-dependencies: ["error", {"peerDependencies": true}] */ +import react from 'react'; +``` + +## When Not To Use It + +If you do not have a `package.json` file in your project. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-import-module-exports.md b/node_modules/eslint-plugin-import/docs/rules/no-import-module-exports.md new file mode 100644 index 0000000000000000000000000000000000000000..1c572264959f2a3c87e3ec1c6434ff1b55719669 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-import-module-exports.md @@ -0,0 +1,81 @@ +# import/no-import-module-exports + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Reports the use of import declarations with CommonJS exports in any module +except for the [main module](https://docs.npmjs.com/files/package.json#main). + +If you have multiple entry points or are using `js:next` this rule includes an +`exceptions` option which you can use to exclude those files from the rule. + +## Options + +### `exceptions` + + - An array of globs. The rule will be omitted from any file that matches a glob + in the options array. For example, the following setting will omit the rule + in the `some-file.js` file. + +```json +"import/no-import-module-exports": ["error", { + "exceptions": ["**/*/some-file.js"] +}] +``` + +## Rule Details + +### Fail + +```js +import { stuff } from 'starwars' +module.exports = thing + +import * as allThings from 'starwars' +exports.bar = thing + +import thing from 'other-thing' +exports.foo = bar + +import thing from 'starwars' +const baz = module.exports = thing +console.log(baz) +``` + +### Pass + +Given the following package.json: + +```json +{ + "main": "lib/index.js", +} +``` + +```js +import thing from 'other-thing' +export default thing + +const thing = require('thing') +module.exports = thing + +const thing = require('thing') +exports.foo = bar + +import thing from 'otherthing' +console.log(thing.module.exports) + +// in lib/index.js +import foo from 'path'; +module.exports = foo; + +// in some-file.js +// eslint import/no-import-module-exports: ["error", {"exceptions": ["**/*/some-file.js"]}] +import foo from 'path'; +module.exports = foo; +``` + +### Further Reading + + - [webpack issue #4039](https://github.com/webpack/webpack/issues/4039) diff --git a/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md b/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md new file mode 100644 index 0000000000000000000000000000000000000000..433b55140d8493bb8f80f4c3befc7b1704af8ff9 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md @@ -0,0 +1,136 @@ +# import/no-internal-modules + + + +Use this rule to prevent importing the submodules of other modules. + +## Rule Details + +This rule has two mutally exclusive options that are arrays of [minimatch/glob patterns](https://github.com/isaacs/node-glob#glob-primer) patterns: + + - `allow` that include paths and import statements that can be imported with reaching. + - `forbid` that exclude paths and import statements that can be imported with reaching. + +### Examples + +Given the following folder structure: + +```pt +my-project +├── actions +│ └── getUser.js +│ └── updateUser.js +├── reducer +│ └── index.js +│ └── user.js +├── redux +│ └── index.js +│ └── configureStore.js +└── app +│ └── index.js +│ └── settings.js +└── entry.js +``` + +And the .eslintrc file: + +```json +{ + ... + "rules": { + "import/no-internal-modules": [ "error", { + "allow": [ "**/actions/*", "source-map-support/*" ], + } ] + } +} +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/entry.js + */ + +import { settings } from './app/index'; // Reaching to "./app/index" is not allowed +import userReducer from './reducer/user'; // Reaching to "./reducer/user" is not allowed +import configureStore from './redux/configureStore'; // Reaching to "./redux/configureStore" is not allowed + +export { settings } from './app/index'; // Reaching to "./app/index" is not allowed +export * from './reducer/user'; // Reaching to "./reducer/user" is not allowed +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/entry.js + */ + +import 'source-map-support/register'; +import { settings } from '../app'; +import getUser from '../actions/getUser'; + +export * from 'source-map-support/register'; +export { settings } from '../app'; +``` + +Given the following folder structure: + +```pt +my-project +├── actions +│ └── getUser.js +│ └── updateUser.js +├── reducer +│ └── index.js +│ └── user.js +├── redux +│ └── index.js +│ └── configureStore.js +└── app +│ └── index.js +│ └── settings.js +└── entry.js +``` + +And the .eslintrc file: + +```json +{ + ... + "rules": { + "import/no-internal-modules": [ "error", { + "forbid": [ "**/actions/*", "source-map-support/*" ], + } ] + } +} +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/entry.js + */ + +import 'source-map-support/register'; +import getUser from '../actions/getUser'; + +export * from 'source-map-support/register'; +export getUser from '../actions/getUser'; +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/entry.js + */ + +import 'source-map-support'; +import { getUser } from '../actions'; + +export * from 'source-map-support'; +export { getUser } from '../actions'; +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md b/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md new file mode 100644 index 0000000000000000000000000000000000000000..ce51627858cc544ca1e629652f7d26c509ac186f --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md @@ -0,0 +1,54 @@ +# import/no-mutable-exports + + + +Forbids the use of mutable exports with `var` or `let`. + +## Rule Details + +Valid: + +```js +export const count = 1 +export function getCount() {} +export class Counter {} +``` + +...whereas here exports will be reported: + +```js +export let count = 2 +export var count = 3 + +let count = 4 +export { count } // reported here +``` + +## Functions/Classes + +Note that exported function/class declaration identifiers may be reassigned, +but are not flagged by this rule at this time. They may be in the future, if a +reassignment is detected, i.e. + +```js +// possible future behavior! +export class Counter {} // reported here: exported class is reassigned on line [x]. +Counter = KitchenSink // not reported here unless you enable no-class-assign + +// this pre-declaration reassignment is valid on account of function hoisting +getCount = function getDuke() {} // not reported here without no-func-assign +export function getCount() {} // reported here: exported function is reassigned on line [x]. +``` + +To prevent general reassignment of these identifiers, exported or not, you may +want to enable the following core ESLint rules: + + - [no-func-assign] + - [no-class-assign] + +[no-func-assign]: https://eslint.org/docs/rules/no-func-assign +[no-class-assign]: https://eslint.org/docs/rules/no-class-assign + +## When Not To Use It + +If your environment correctly implements mutable export bindings. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md new file mode 100644 index 0000000000000000000000000000000000000000..e8935fb7df4111b3ed08f9bf4fbc58b95a7f8dd4 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md @@ -0,0 +1,52 @@ +# import/no-named-as-default-member + +⚠️ This rule _warns_ in the following configs: ☑️ `recommended`, 🚸 `warnings`. + + + +Reports use of an exported name as a property on the default export. + +Rationale: Accessing a property that has a name that is shared by an exported +name from the same module is likely to be a mistake. + +Named import syntax looks very similar to destructuring assignment. It's easy to +make the (incorrect) assumption that named exports are also accessible as +properties of the default export. + +Furthermore, [in Babel 5 this is actually how things worked][blog]. This was +fixed in Babel 6. Before upgrading an existing codebase to Babel 6, it can be +useful to run this lint rule. + +[blog]: https://kentcdodds.com/blog/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution + +## Rule Details + +Given: + +```js +// foo.js +export default 'foo'; +export const bar = 'baz'; +``` + +...this would be valid: + +```js +import foo, {bar} from './foo.js'; +``` + +...and the following would be reported: + +```js +// Caution: `foo` also has a named export `bar`. +// Check if you meant to write `import {bar} from './foo.js'` instead. +import foo from './foo.js'; +const bar = foo.bar; +``` + +```js +// Caution: `foo` also has a named export `bar`. +// Check if you meant to write `import {bar} from './foo.js'` instead. +import foo from './foo.js'; +const {bar} = foo; +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md new file mode 100644 index 0000000000000000000000000000000000000000..043d6994241b31fda7e37731703675b56c2ec1e6 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md @@ -0,0 +1,53 @@ +# import/no-named-as-default + +⚠️ This rule _warns_ in the following configs: ☑️ `recommended`, 🚸 `warnings`. + + + +Reports use of an exported name as the locally imported name of a default export. + +Rationale: using an exported name as the name of the default export is likely... + + - _misleading_: others familiar with `foo.js` probably expect the name to be `foo` + - _a mistake_: only needed to import `bar` and forgot the brackets (the case that is prompting this) + +## Rule Details + +Given: + +```js +// foo.js +export default 'foo'; +export const bar = 'baz'; +``` + +...this would be valid: + +```js +import foo from './foo.js'; +``` + +...and this would be reported: + +```js +// message: Using exported name 'bar' as identifier for default export. +import bar from './foo.js'; +``` + +For post-ES2015 `export` extensions, this also prevents exporting the default from a referenced module as a name within that module, for the same reasons: + +```js +// valid: +export foo from './foo.js'; + +// message: Using exported name 'bar' as identifier for default export. +export bar from './foo.js'; +``` + +## Further Reading + + - ECMAScript Proposal: [export ns from] + - ECMAScript Proposal: [export default from] + +[export ns from]: https://github.com/leebyron/ecmascript-export-ns-from +[export default from]: https://github.com/leebyron/ecmascript-export-default-from diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-default.md b/node_modules/eslint-plugin-import/docs/rules/no-named-default.md new file mode 100644 index 0000000000000000000000000000000000000000..05860cde1e0fde2f3bfefcab8ea42261e4518820 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-default.md @@ -0,0 +1,36 @@ +# import/no-named-default + + + +Reports use of a default export as a locally named import. + +Rationale: the syntax exists to import default exports expressively, let's use it. + +Note that type imports, as used by [Flow], are always ignored. + +[Flow]: https://flow.org/ + +## Rule Details + +Given: + +```js +// foo.js +export default 'foo'; +export const bar = 'baz'; +``` + +...these would be valid: + +```js +import foo from './foo.js'; +import foo, { bar } from './foo.js'; +``` + +...and these would be reported: + +```js +// message: Using exported name 'bar' as identifier for default export. +import { default as foo } from './foo.js'; +import { default as foo, bar } from './foo.js'; +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-export.md b/node_modules/eslint-plugin-import/docs/rules/no-named-export.md new file mode 100644 index 0000000000000000000000000000000000000000..13ea63ad739de4b68dc574e8c46934b6b69d67bc --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-export.md @@ -0,0 +1,79 @@ +# import/no-named-export + + + +Prohibit named exports. Mostly an inverse of [`no-default-export`]. + +[`no-default-export`]: ./no-default-export.md + +## Rule Details + +The following patterns are considered warnings: + +```javascript +// bad1.js + +// There is only a single module export and it's a named export. +export const foo = 'foo'; +``` + +```javascript +// bad2.js + +// There is more than one named export in the module. +export const foo = 'foo'; +export const bar = 'bar'; +``` + +```javascript +// bad3.js + +// There is more than one named export in the module. +const foo = 'foo'; +const bar = 'bar'; +export { foo, bar } +``` + +```javascript +// bad4.js + +// There is more than one named export in the module. +export * from './other-module' +``` + +```javascript +// bad5.js + +// There is a default and a named export. +export const foo = 'foo'; +const bar = 'bar'; +export default 'bar'; +``` + +The following patterns are not warnings: + +```javascript +// good1.js + +// There is only a single module export and it's a default export. +export default 'bar'; +``` + +```javascript +// good2.js + +// There is only a single module export and it's a default export. +const foo = 'foo'; +export { foo as default } +``` + +```javascript +// good3.js + +// There is only a single module export and it's a default export. +export default from './other-module'; +``` + +## When Not To Use It + +If you don't care if named imports are used, or if you prefer named imports over default imports. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-namespace.md b/node_modules/eslint-plugin-import/docs/rules/no-namespace.md new file mode 100644 index 0000000000000000000000000000000000000000..c7346515a509ad5dbe1906893fca71b27b95d5a2 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-namespace.md @@ -0,0 +1,44 @@ +# import/no-namespace + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Enforce a convention of not using namespace (a.k.a. "wildcard" `*`) imports. + +The rule is auto-fixable when the namespace object is only used for direct member access, e.g. `namespace.a`. + +## Options + +This rule supports the following options: + + - `ignore`: array of glob strings for modules that should be ignored by the rule. + +## Rule Details + +Valid: + +```js +import defaultExport from './foo' +import { a, b } from './bar' +import defaultExport, { a, b } from './foobar' +``` + +```js +/* eslint import/no-namespace: ["error", {ignore: ['*.ext']}] */ +import * as bar from './ignored-module.ext'; +``` + +Invalid: + +```js +import * as foo from 'foo'; +``` + +```js +import defaultExport, * as foo from 'foo'; +``` + +## When Not To Use It + +If you want to use namespaces, you don't want to use this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md b/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md new file mode 100644 index 0000000000000000000000000000000000000000..5cbc907286820a446da662ffb6294b3f3788e560 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md @@ -0,0 +1,42 @@ +# import/no-nodejs-modules + + + +Forbid the use of Node.js builtin modules. Can be useful for client-side web projects that do not have access to those modules. + +## Options + +This rule supports the following options: + + - `allow`: Array of names of allowed modules. Defaults to an empty array. + +## Rule Details + +### Fail + +```js +import fs from 'fs'; +import path from 'path'; + +var fs = require('fs'); +var path = require('path'); +``` + +### Pass + +```js +import _ from 'lodash'; +import foo from 'foo'; +import foo from './foo'; + +var _ = require('lodash'); +var foo = require('foo'); +var foo = require('./foo'); + +/* eslint import/no-nodejs-modules: ["error", {"allow": ["path"]}] */ +import path from 'path'; +``` + +## When Not To Use It + +If you have a project that is run mainly or partially using Node.js. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-relative-packages.md b/node_modules/eslint-plugin-import/docs/rules/no-relative-packages.md new file mode 100644 index 0000000000000000000000000000000000000000..ed724a9ebe17eb3b87903373208bc6041c0720e2 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-relative-packages.md @@ -0,0 +1,69 @@ +# import/no-relative-packages + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Use this rule to prevent importing packages through relative paths. + +It's useful in Yarn/Lerna workspaces, where it's possible to import a sibling package using `../package` relative path, while direct `package` is the correct one. + +## Examples + +Given the following folder structure: + +```pt +my-project +├── packages +│ ├── foo +│ │ ├── index.js +│ │ └── package.json +│ └── bar +│ ├── index.js +│ └── package.json +└── entry.js +``` + +And the .eslintrc file: + +```json +{ + ... + "rules": { + "import/no-relative-packages": "error" + } +} +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/packages/foo.js + */ + +import bar from '../bar'; // Import sibling package using relative path +import entry from '../../entry.js'; // Import from parent package using relative path + +/** + * in my-project/entry.js + */ + +import bar from './packages/bar'; // Import child package using relative path +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/packages/foo.js + */ + +import bar from 'bar'; // Import sibling package using package name + +/** + * in my-project/entry.js + */ + +import bar from 'bar'; // Import sibling package using package name +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md b/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md new file mode 100644 index 0000000000000000000000000000000000000000..c1f978487197e9c26cbb156bcea10dc11440fa98 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md @@ -0,0 +1,123 @@ +# import/no-relative-parent-imports + + + +Use this rule to prevent imports to folders in relative parent paths. + +This rule is useful for enforcing tree-like folder structures instead of complex graph-like folder structures. While this restriction might be a departure from Node's default resolution style, it can lead large, complex codebases to be easier to maintain. If you've ever had debates over "where to put files" this rule is for you. + +To fix violations of this rule there are three general strategies. Given this example: + +```pt +numbers +└── three.js +add.js +``` + +```js +// ./add.js +export default function (numbers) { + return numbers.reduce((sum, n) => sum + n, 0); +} + +// ./numbers/three.js +import add from '../add'; // violates import/no-relative-parent-imports + +export default function three() { + return add([1, 2]); +} +``` + +You can, + +1. Move the file to be in a sibling folder (or higher) of the dependency. + + `three.js` could be be in the same folder as `add.js`: + + ```pt + three.js + add.js + ``` + + or since `add` doesn't have any imports, it could be in it's own directory (namespace): + + ```pt + math + └── add.js + three.js + ``` + +2. Pass the dependency as an argument at runtime (dependency injection) + + ```js + // three.js + export default function three(add) { + return add([1, 2]); + } + + // somewhere else when you use `three.js`: + import add from './add'; + import three from './numbers/three'; + console.log(three(add)); + ``` + +3. Make the dependency a package so it's globally available to all files in your project: + + ```js + import add from 'add'; // from https://www.npmjs.com/package/add + export default function three() { + return add([1,2]); + } + ``` + +These are (respectively) static, dynamic & global solutions to graph-like dependency resolution. + +## Examples + +Given the following folder structure: + +```pt +my-project +├── lib +│ ├── a.js +│ └── b.js +└── main.js +``` + +And the .eslintrc file: + +```json +{ + ... + "rules": { + "import/no-relative-parent-imports": "error" + } +} +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/lib/a.js + */ + +import bar from '../main'; // Import parent file using a relative path +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/main.js + */ + +import foo from 'foo'; // Import package using module path +import a from './lib/a'; // Import child file using relative path + +/** + * in my-project/lib/a.js + */ + +import b from './b'; // Import sibling file using relative path +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md b/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md new file mode 100644 index 0000000000000000000000000000000000000000..5ba4b393e305ec8deaf945fbd5e665c734fe5a29 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md @@ -0,0 +1,220 @@ +# import/no-restricted-paths + + + +Some projects contain files which are not always meant to be executed in the same environment. +For example consider a web application that contains specific code for the server and some specific code for the browser/client. In this case you don’t want to import server-only files in your client code. + +In order to prevent such scenarios this rule allows you to define restricted zones where you can forbid files from being imported if they match a specific path. + +## Rule Details + +This rule has one option, which is an object containing all `zones` where restrictions will be applied, plus an optional `basePath` used to resolve relative paths within each zone. +The default for `basePath` is the current working directory. + +Each zone consists of a `target`, a `from`, and optional `except` and `message` attributes. + + - `target` - Identifies which files are part of the zone. It can be expressed as: + - A simple directory path, matching all files contained recursively within it + - A glob pattern + - An array of any of the two types above + - *Example: `target: './client'` - this zone consists of all files under the 'client' dir* + - `from` - Identifies folders from which the zone is not allowed to import. It can be expressed as: + - A simple directory path, matching all files contained recursively within it + - A glob pattern + - An array of only simple directories, or of only glob patterns (mixing both types within the array is not allowed) + - *Example: `from: './server'` - this zone is not allowed to import anything from the 'server' dir* + - `except` - Optional. Allows exceptions that would otherwise violate the related `from`. Note that it does not alter the behaviour of `target` in any way. + - If `from` is an array of glob patterns, `except` must be an array of glob patterns as well. + - If `from` is an array of simple directories, `except` is relative to `from` and cannot backtrack to a parent directory. + - *Example: `except: './server/config'` this zone is allowed to import server config, even if it can't import other server code* + - `message` - Optional. Displayed in case of rule violation. + +*Note: The `from` attribute is NOT matched literally against the import path string as it appears in the code. Instead, it's matched against the path to the imported file after it's been resolved against `basePath`.* + +### Examples + +Given this folder structure: + +```pt +. +├── client +│ ├── foo.js +│ └── baz.js +└── server + └── bar.js +``` + +And this configuration: + +```json +{ + "zones": [ + { + "target": "./client", + "from": "./server" + } + ] +} +``` + +:x: The following is considered incorrect: + +```js +// client/foo.js +import bar from '../server/bar'; +``` + +:white_check_mark: The following is considered correct: + +```js +// server/bar.js +import baz from '../client/baz'; +``` + +--------------- + +Given this folder structure: + +```pt +. +├── client +│ └── ... +└── server + ├── one + │ ├── a.js + │ └── b.js + └── two + └── a.js +``` + +And this configuration: + +```json +{ + "zones": [ + { + "target": "./server/one", + "from": "./server", + "except": ["./one"] + } + ] +} +``` + +:x: The following is considered incorrect: + +```js +// server/one/a.js +import a from '../two/a' +``` + +:white_check_mark: The following is considered correct: + +```js +// server/one/a.js +import b from './b' +``` + +--------------- + +Given this folder structure: + +```pt +. +└── client + ├── foo.js + └── sub-module + ├── bar.js + └── baz.js +``` + +And this configuration: + +```json +{ + "zones": [ + { + "target": "./client/!(sub-module)/**/*", + "from": "./client/sub-module/**/*", + } + ] +} +``` + +:x: The following is considered incorrect: + +```js +// client/foo.js +import a from './sub-module/baz' +``` + +:white_check_mark: The following is considered correct: + +```js +// client/sub-module/bar.js +import b from './baz' +``` + +--------------- + +Given this folder structure: + +```pt +. +├── one +│ ├── a.js +│ └── b.js +├── two +│ ├── a.js +│ └── b.js +└── three + ├── a.js + └── b.js +``` + +And this configuration: + +```json +{ + "zones": [ + { + "target": [ + "./two/*", + "./three/*" + ], + "from": [ + "./one", + "./three" + ] + } + ] +} +``` + +:white_check_mark: The following is considered correct: + +```js +// one/b.js +import a from '../three/a' +import a from './a' +``` + +```js +// two/b.js +import a from './a' +``` + +:x: The following is considered incorrect: + +```js +// two/a.js +import a from '../one/a' +import a from '../three/a' +``` + +```js +// three/b.js +import a from '../one/a' +import a from './a' +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-self-import.md b/node_modules/eslint-plugin-import/docs/rules/no-self-import.md new file mode 100644 index 0000000000000000000000000000000000000000..8d8491c508289272813c6d60cd7b273874be1a00 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-self-import.md @@ -0,0 +1,32 @@ +# import/no-self-import + + + +Forbid a module from importing itself. This can sometimes happen during refactoring. + +## Rule Details + +### Fail + +```js +// foo.js +import foo from './foo'; + +const foo = require('./foo'); +``` + +```js +// index.js +import index from '.'; + +const index = require('.'); +``` + +### Pass + +```js +// foo.js +import bar from './bar'; + +const bar = require('./bar'); +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md b/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md new file mode 100644 index 0000000000000000000000000000000000000000..617395e2c38e67abcaf0bdc88605207c5ab231a2 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md @@ -0,0 +1,60 @@ +# import/no-unassigned-import + + + +With both CommonJS' `require` and the ES6 modules' `import` syntax, it is possible to import a module but not to use its result. This can be done explicitly by not assigning the module to as variable. Doing so can mean either of the following things: + + - The module is imported but not used + - The module has side-effects (like [`should`](https://www.npmjs.com/package/should)). Having side-effects, makes it hard to know whether the module is actually used or can be removed. It can also make it harder to test or mock parts of your application. + +This rule aims to remove modules with side-effects by reporting when a module is imported but not assigned. + +## Options + +This rule supports the following option: + +`allow`: An Array of globs. The files that match any of these patterns would be ignored/allowed by the linter. This can be useful for some build environments (e.g. css-loader in webpack). + +Note that the globs start from the where the linter is executed (usually project root), but not from each file that includes the source. Learn more in both the pass and fail examples below. + +## Fail + +```js +import 'should' +require('should') + +// In /src/app.js +import '../styles/app.css' +// {"allow": ["styles/*.css"]} +``` + +## Pass + +```js +import _ from 'foo' +import _, {foo} from 'foo' +import _, {foo as bar} from 'foo' +import {foo as bar} from 'foo' +import * as _ from 'foo' + +const _ = require('foo') +const {foo} = require('foo') +const {foo: bar} = require('foo') +const [a, b] = require('foo') +const _ = require('foo') + +// Module is not assigned, but it is used +bar(require('foo')) +require('foo').bar +require('foo').bar() +require('foo')() + +// With allow option set +import './style.css' // {"allow": ["**/*.css"]} +import 'babel-register' // {"allow": ["babel-register"]} + +// In /src/app.js +import './styles/app.css' +import '../scripts/register.js' +// {"allow": ["src/styles/**", "**/scripts/*.js"]} +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md b/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md new file mode 100644 index 0000000000000000000000000000000000000000..ca1da39c007f6b042a7b28b9d0627c3dbbc3ca8a --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md @@ -0,0 +1,110 @@ +# import/no-unresolved + +💼 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`. + + + +Ensures an imported module can be resolved to a module on the local filesystem, +as defined by standard Node `require.resolve` behavior. + +See [settings](../../README.md#settings) for customization options for the resolution (i.e. +additional filetypes, `NODE_PATH`, etc.) + +This rule can also optionally report on unresolved modules in CommonJS `require('./foo')` calls and AMD `require(['./foo'], function (foo) {...})` and `define(['./foo'], function (foo) {...})`. + +To enable this, send `{ commonjs: true/false, amd: true/false }` as a rule option. +Both are disabled by default. + +If you are using Webpack, see the section on [resolvers](../../README.md#resolvers). + +## Rule Details + +### Options + +By default, only ES6 imports will be resolved: + +```js +/*eslint import/no-unresolved: 2*/ +import x from './foo' // reports if './foo' cannot be resolved on the filesystem +``` + +If `{commonjs: true}` is provided, single-argument `require` calls will be resolved: + +```js +/*eslint import/no-unresolved: [2, { commonjs: true }]*/ +const { default: x } = require('./foo') // reported if './foo' is not found + +require(0) // ignored +require(['x', 'y'], function (x, y) { /*...*/ }) // ignored +``` + +Similarly, if `{ amd: true }` is provided, dependency paths for `define` and `require` +calls will be resolved: + +```js +/*eslint import/no-unresolved: [2, { amd: true }]*/ +define(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found +require(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found + +const { default: x } = require('./foo') // ignored +``` + +Both may be provided, too: + +```js +/*eslint import/no-unresolved: [2, { commonjs: true, amd: true }]*/ +const { default: x } = require('./foo') // reported if './foo' is not found +define(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found +require(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found +``` + +#### `ignore` + +This rule has its own ignore list, separate from [`import/ignore`]. This is because you may want to know whether a module can be located, regardless of whether it can be parsed for exports: `node_modules`, CoffeeScript files, etc. are all good to resolve properly, but will not be parsed if configured as such via [`import/ignore`]. + +To suppress errors from files that may not be properly resolved by your [resolver settings](../../README.md#resolver-plugins), you may add an `ignore` key with an array of `RegExp` pattern strings: + +```js +/*eslint import/no-unresolved: [2, { ignore: ['\\.img$'] }]*/ + +import { x } from './mod' // may be reported, if not resolved to a module + +import coolImg from '../../img/coolImg.img' // will not be reported, even if not found +``` + +#### `caseSensitive` + +By default, this rule will report paths whose case do not match the underlying filesystem path, if the FS is not case-sensitive. To disable this behavior, set the `caseSensitive` option to `false`. + +```js +/*eslint import/no-unresolved: [2, { caseSensitive: true (default) | false }]*/ +const { default: x } = require('./foo') // reported if './foo' is actually './Foo' and caseSensitive: true +``` + +#### `caseSensitiveStrict` + +The `caseSensitive` option does not detect case for the current working directory. The `caseSensitiveStrict` option allows checking `cwd` in resolved path. By default, the option is disabled. + +```js +/*eslint import/no-unresolved: [2, { caseSensitiveStrict: true }]*/ + +// Absolute paths +import Foo from `/Users/fOo/bar/file.js` // reported, /Users/foo/bar/file.js +import Foo from `d:/fOo/bar/file.js` // reported, d:/foo/bar/file.js + +// Relative paths, cwd is Users/foo/ +import Foo from `./../fOo/bar/file.js` // reported +``` + +## When Not To Use It + +If you're using a module bundler other than Node or Webpack, you may end up with a lot of false positive reports of missing dependencies. + +## Further Reading + + - [Resolver plugins](../../README.md#resolvers) + - [Node resolver](https://npmjs.com/package/eslint-import-resolver-node) (default) + - [Webpack resolver](https://npmjs.com/package/eslint-import-resolver-webpack) + - [`import/ignore`] global setting + +[`import/ignore`]: ../../README.md#importignore diff --git a/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md b/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md new file mode 100644 index 0000000000000000000000000000000000000000..8d6398e5113217d344e60a1c5a24779801ecfc28 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md @@ -0,0 +1,136 @@ +# import/no-unused-modules + + + +Reports: + + - modules without any exports + - individual exports not being statically `import`ed or `require`ed from other modules in the same project + - dynamic imports are supported if argument is a literal string + +## Rule Details + +### Usage + +In order for this plugin to work, at least one of the options `missingExports` or `unusedExports` must be enabled (see "Options" section below). In the future, these options will be enabled by default (see ) + +Example: + +```json +"rules": { + ...otherRules, + "import/no-unused-modules": [1, {"unusedExports": true}] +} +``` + +### Options + +This rule takes the following option: + + - **`missingExports`**: if `true`, files without any exports are reported (defaults to `false`) + - **`unusedExports`**: if `true`, exports without any static usage within other modules are reported (defaults to `false`) + - **`ignoreUnusedTypeExports`**: if `true`, TypeScript type exports without any static usage within other modules are reported (defaults to `false` and has no effect unless `unusedExports` is `true`) + - **`src`**: an array with files/paths to be analyzed. It only applies to unused exports. Defaults to `process.cwd()`, if not provided + - **`ignoreExports`**: an array with files/paths for which unused exports will not be reported (e.g module entry points in a published package) + +### Example for missing exports + +#### The following will be reported + +```js +const class MyClass { /*...*/ } + +function makeClass() { return new MyClass(...arguments) } +``` + +#### The following will not be reported + +```js +export default function () { /*...*/ } +``` + +```js +export const foo = function () { /*...*/ } +``` + +```js +export { foo, bar } +``` + +```js +export { foo as bar } +``` + +### Example for unused exports + +given file-f: + +```js +import { e } from 'file-a' +import { f } from 'file-b' +import * as fileC from 'file-c' +export { default, i0 } from 'file-d' // both will be reported + +export const j = 99 // will be reported +``` + +and file-d: + +```js +export const i0 = 9 // will not be reported +export const i1 = 9 // will be reported +export default () => {} // will not be reported +``` + +and file-c: + +```js +export const h = 8 // will not be reported +export default () => {} // will be reported, as export * only considers named exports and ignores default exports +``` + +and file-b: + +```js +import two, { b, c, doAnything } from 'file-a' + +export const f = 6 // will not be reported +``` + +and file-a: + +```js +const b = 2 +const c = 3 +const d = 4 + +export const a = 1 // will be reported + +export { b, c } // will not be reported + +export { d as e } // will not be reported + +export function doAnything() { + // some code +} // will not be reported + +export default 5 // will not be reported +``` + +### Unused exports with `ignoreUnusedTypeExports` set to `true` + +The following will not be reported: + +```ts +export type Foo = {}; // will not be reported +export interface Foo = {}; // will not be reported +export enum Foo {}; // will not be reported +``` + +#### Important Note + +Exports from files listed as a main file (`main`, `browser`, or `bin` fields in `package.json`) will be ignored by default. This only applies if the `package.json` is not set to `private: true` + +## When not to use + +If you don't mind having unused files or dead code within your codebase, you can disable this rule diff --git a/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md b/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md new file mode 100644 index 0000000000000000000000000000000000000000..22c4bf965b223215ed029ac64089e3048d56d472 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md @@ -0,0 +1,85 @@ +# import/no-useless-path-segments + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Use this rule to prevent unnecessary path segments in import and require statements. + +## Rule Details + +Given the following folder structure: + +```pt +my-project +├── app.js +├── footer.js +├── header.js +└── helpers.js +└── helpers + └── index.js +├── index.js +└── pages + ├── about.js + ├── contact.js + └── index.js +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/app.js + */ + +import "./../my-project/pages/about.js"; // should be "./pages/about.js" +import "./../my-project/pages/about"; // should be "./pages/about" +import "../my-project/pages/about.js"; // should be "./pages/about.js" +import "../my-project/pages/about"; // should be "./pages/about" +import "./pages//about"; // should be "./pages/about" +import "./pages/"; // should be "./pages" +import "./pages/index"; // should be "./pages" (except if there is a ./pages.js file) +import "./pages/index.js"; // should be "./pages" (except if there is a ./pages.js file) +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/app.js + */ + +import "./header.js"; +import "./pages"; +import "./pages/about"; +import "."; +import ".."; +import fs from "fs"; +``` + +## Options + +### noUselessIndex + +If you want to detect unnecessary `/index` or `/index.js` (depending on the specified file extensions, see below) imports in your paths, you can enable the option `noUselessIndex`. By default it is set to `false`: + +```js +"import/no-useless-path-segments": ["error", { + noUselessIndex: true, +}] +``` + +Additionally to the patterns described above, the following imports are considered problems if `noUselessIndex` is enabled: + +```js +// in my-project/app.js +import "./helpers/index"; // should be "./helpers/" (not auto-fixable to `./helpers` because this would lead to an ambiguous import of `./helpers.js` and `./helpers/index.js`) +import "./pages/index"; // should be "./pages" (auto-fixable) +import "./pages/index.js"; // should be "./pages" (auto-fixable) +``` + +Note: `noUselessIndex` only avoids ambiguous imports for `.js` files if you haven't specified other resolved file extensions. See [Settings: import/extensions](https://github.com/import-js/eslint-plugin-import#importextensions) for details. + +### commonjs + +When set to `true`, this rule checks CommonJS imports. Default to `false`. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md b/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md new file mode 100644 index 0000000000000000000000000000000000000000..291b1c058a57e282be5cd34c93a2f45888ccf84e --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md @@ -0,0 +1,39 @@ +# import/no-webpack-loader-syntax + + + +Forbid Webpack loader syntax in imports. + +[Webpack](https://webpack.js.org) allows specifying the [loaders](https://webpack.js.org/concepts/loaders/) to use in the import source string using a special syntax like this: + +```js +var moduleWithOneLoader = require("my-loader!./my-awesome-module"); +``` + +This syntax is non-standard, so it couples the code to Webpack. The recommended way to specify Webpack loader configuration is in a [Webpack configuration file](https://webpack.js.org/concepts/loaders/#configuration). + +## Rule Details + +### Fail + +```js +import myModule from 'my-loader!my-module'; +import theme from 'style!css!./theme.css'; + +var myModule = require('my-loader!./my-module'); +var theme = require('style!css!./theme.css'); +``` + +### Pass + +```js +import myModule from 'my-module'; +import theme from './theme.css'; + +var myModule = require('my-module'); +var theme = require('./theme.css'); +``` + +## When Not To Use It + +If you have a project that doesn't use Webpack you can safely disable this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/order.md b/node_modules/eslint-plugin-import/docs/rules/order.md new file mode 100644 index 0000000000000000000000000000000000000000..4a52b823e1cf6a6f46b9b61370d8491f46c7b629 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/order.md @@ -0,0 +1,1024 @@ +# import/order + +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + +Enforce a convention in the order of `require()` / `import` statements. + +With the [`groups`][18] option set to `["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"]` the order is as shown in the following example: + +```ts +// 1. node "builtin" modules +import fs from 'fs'; +import path from 'path'; +// 2. "external" modules +import _ from 'lodash'; +import chalk from 'chalk'; +// 3. "internal" modules +// (if you have configured your path or webpack to handle your internal paths differently) +import foo from 'src/foo'; +// 4. modules from a "parent" directory +import foo from '../foo'; +import qux from '../../foo/qux'; +// 5. "sibling" modules from the same or a sibling's directory +import bar from './bar'; +import baz from './bar/baz'; +// 6. "index" of the current directory +import main from './'; +// 7. "object"-imports (only available in TypeScript) +import log = console.log; +// 8. "type" imports (only available in Flow and TypeScript) +import type { Foo } from 'foo'; +``` + +See [here][3] for further details on how imports are grouped. + +## Fail + +```ts +import _ from 'lodash'; +import path from 'path'; // `path` import should occur before import of `lodash` + +// ----- + +var _ = require('lodash'); +var path = require('path'); // `path` import should occur before import of `lodash` + +// ----- + +var path = require('path'); +import foo from './foo'; // `import` statements must be before `require` statement +``` + +## Pass + +```ts +import path from 'path'; +import _ from 'lodash'; + +// ----- + +var path = require('path'); +var _ = require('lodash'); + +// ----- + +// Allowed as ̀`babel-register` is not assigned. +require('babel-register'); +var path = require('path'); + +// ----- + +// Allowed as `import` must be before `require` +import foo from './foo'; +var path = require('path'); +``` + +## Limitations of `--fix` + +Unbound imports are assumed to have side effects, and will never be moved/reordered. This can cause other imports to get "stuck" around them, and the fix to fail. + +```javascript +import b from 'b' +import 'format.css'; // This will prevent --fix from working. +import a from 'a' +``` + +As a workaround, move unbound imports to be entirely above or below bound ones. + +```javascript +import 'format1.css'; // OK +import b from 'b' +import a from 'a' +import 'format2.css'; // OK +``` + +## Options + +This rule supports the following options (none of which are required): + + - [`groups`][18] + - [`pathGroups`][8] + - [`pathGroupsExcludedImportTypes`][9] + - [`distinctGroup`][32] + - [`newlines-between`][20] + - [`alphabetize`][30] + - [`named`][33] + - [`warnOnUnassignedImports`][5] + - [`sortTypesGroup`][7] + - [`newlines-between-types`][27] + - [`consolidateIslands`][25] + +--- + +### `groups` + +Valid values: `("builtin" | "external" | "internal" | "unknown" | "parent" | "sibling" | "index" | "object" | "type")[]` \ +Default: `["builtin", "external", "parent", "sibling", "index"]` + +Determines which imports are subject to ordering, and how to order +them. The predefined groups are: `"builtin"`, `"external"`, `"internal"`, +`"unknown"`, `"parent"`, `"sibling"`, `"index"`, `"object"`, and `"type"`. + +The import order enforced by this rule is the same as the order of each group +in `groups`. Imports belonging to groups omitted from `groups` are lumped +together at the end. + +#### Example + +```jsonc +{ + "import/order": ["error", { + "groups": [ + // Imports of builtins are first + "builtin", + // Then sibling and parent imports. They can be mingled together + ["sibling", "parent"], + // Then index file imports + "index", + // Then any arcane TypeScript imports + "object", + // Then the omitted imports: internal, external, type, unknown + ], + }], +} +``` + +#### How Imports Are Grouped + +An import (a `ImportDeclaration`, `TSImportEqualsDeclaration`, or `require()` `CallExpression`) is grouped by its type (`"require"` vs `"import"`), its [specifier][4], and any corresponding identifiers. + +```ts +import { identifier1, identifier2 } from 'specifier1'; +import type { MyType } from 'specifier2'; +const identifier3 = require('specifier3'); +``` + +Roughly speaking, the grouping algorithm is as follows: + +1. If the import has no corresponding identifiers (e.g. `import './my/thing.js'`), is otherwise "unassigned," or is an unsupported use of `require()`, and [`warnOnUnassignedImports`][5] is disabled, it will be ignored entirely since the order of these imports may be important for their [side-effects][31] +2. If the import is part of an arcane TypeScript declaration (e.g. `import log = console.log`), it will be considered **object**. However, note that external module references (e.g. `import x = require('z')`) are treated as normal `require()`s and import-exports (e.g. `export import w = y;`) are ignored entirely +3. If the import is [type-only][6], `"type"` is in `groups`, and [`sortTypesGroup`][7] is disabled, it will be considered **type** (with additional implications if using [`pathGroups`][8] and `"type"` is in [`pathGroupsExcludedImportTypes`][9]) +4. If the import's specifier matches [`import/internal-regex`][28], it will be considered **internal** +5. If the import's specifier is an absolute path, it will be considered **unknown** +6. If the import's specifier has the name of a Node.js core module (using [is-core-module][10]), it will be considered **builtin** +7. If the import's specifier matches [`import/core-modules`][11], it will be considered **builtin** +8. If the import's specifier is a path relative to the parent directory of its containing file (e.g. starts with `../`), it will be considered **parent** +9. If the import's specifier is one of `['.', './', './index', './index.js']`, it will be considered **index** +10. If the import's specifier is a path relative to its containing file (e.g. starts with `./`), it will be considered **sibling** +11. If the import's specifier is a path pointing to a file outside the current package's root directory (determined using [package-up][12]), it will be considered **external** +12. If the import's specifier matches [`import/external-module-folders`][29] (defaults to matching anything pointing to files within the current package's `node_modules` directory), it will be considered **external** +13. If the import's specifier is a path pointing to a file within the current package's root directory (determined using [package-up][12]), it will be considered **internal** +14. If the import's specifier has a name that looks like a scoped package (e.g. `@scoped/package-name`), it will be considered **external** +15. If the import's specifier has a name that starts with a word character, it will be considered **external** +16. If this point is reached, the import will be ignored entirely + +At the end of the process, if they co-exist in the same file, all top-level `require()` statements that haven't been ignored are shifted (with respect to their order) below any ES6 `import` or similar declarations. Finally, any type-only declarations are potentially reorganized according to [`sortTypesGroup`][7]. + +### `pathGroups` + +Valid values: `PathGroup[]` \ +Default: `[]` + +Sometimes [the predefined groups][18] are not fine-grained enough, especially when using import aliases. +`pathGroups` defines one or more [`PathGroup`][13]s relative to a predefined group. +Imports are associated with a [`PathGroup`][13] based on path matching against the import specifier (using [minimatch][14]). + +> [!IMPORTANT] +> +> Note that, by default, imports grouped as `"builtin"`, `"external"`, or `"object"` will not be considered for further `pathGroups` matching unless they are removed from [`pathGroupsExcludedImportTypes`][9]. + +#### `PathGroup` + +| property | required | type | description | +| :--------------: | :------: | :--------------------: | ------------------------------------------------------------------------------------------------------------------------------- | +| `pattern` | ☑️ | `string` | [Minimatch pattern][16] for specifier matching | +| `patternOptions` | | `object` | [Minimatch options][17]; default: `{nocomment: true}` | +| `group` | ☑️ | [predefined group][18] | One of the [predefined groups][18] to which matching imports will be positioned relatively | +| `position` | | `"after" \| "before"` | Where, in relation to `group`, matching imports will be positioned; default: same position as `group` (neither before or after) | + +#### Example + +```jsonc +{ + "import/order": ["error", { + "pathGroups": [ + { + // Minimatch pattern used to match against specifiers + "pattern": "~/**", + // The predefined group this PathGroup is defined in relation to + "group": "external", + // How matching imports will be positioned relative to "group" + "position": "after" + } + ] + }] +} +``` + +### `pathGroupsExcludedImportTypes` + +Valid values: `("builtin" | "external" | "internal" | "unknown" | "parent" | "sibling" | "index" | "object" | "type")[]` \ +Default: `["builtin", "external", "object"]` + +By default, imports in certain [groups][18] are excluded from being matched against [`pathGroups`][8] to prevent overeager sorting. +Use `pathGroupsExcludedImportTypes` to modify which groups are excluded. + +> [!TIP] +> +> If using imports with custom specifier aliases (e.g. +> you're using `eslint-import-resolver-alias`, `paths` in `tsconfig.json`, etc) that [end up +> grouped][3] as `"builtin"` or `"external"` imports, +> remove them from `pathGroupsExcludedImportTypes` to ensure they are ordered +> correctly. + +#### Example + +```jsonc +{ + "import/order": ["error", { + "pathGroups": [ + { + "pattern": "@app/**", + "group": "external", + "position": "after" + } + ], + "pathGroupsExcludedImportTypes": ["builtin"] + }] +} +``` + +### `distinctGroup` + +Valid values: `boolean` \ +Default: `true` + +> [!CAUTION] +> +> Currently, `distinctGroup` defaults to `true`. However, in a later update, the +> default will change to `false`. + +This changes how [`PathGroup.position`][13] affects grouping, and is most useful when [`newlines-between`][20] is set to `always` and at least one [`PathGroup`][13] has a `position` property set. + +When [`newlines-between`][20] is set to `always` and an import matching a specific [`PathGroup.pattern`][13] is encountered, that import is added to a sort of "sub-group" associated with that [`PathGroup`][13]. Thanks to [`newlines-between`][20], imports in this "sub-group" will have a new line separating them from the rest of the imports in [`PathGroup.group`][13]. + +This behavior can be undesirable when using [`PathGroup.position`][13] to order imports _within_ [`PathGroup.group`][13] instead of creating a distinct "sub-group". Set `distinctGroup` to `false` to disable the creation of these "sub-groups". + +#### Example + +```jsonc +{ + "import/order": ["error", { + "distinctGroup": false, + "newlines-between": "always", + "pathGroups": [ + { + "pattern": "@app/**", + "group": "external", + "position": "after" + } + ] + }] +} +``` + +### `newlines-between` + +Valid values: `"ignore" | "always" | "always-and-inside-groups" | "never"` \ +Default: `"ignore"` + +Enforces or forbids new lines between import groups. + + - If set to `ignore`, no errors related to new lines between import groups will be reported + + - If set to `always`, at least one new line between each group will be enforced, and new lines inside a group will be forbidden + + > [!TIP] + > + > To prevent multiple lines between imports, the [`no-multiple-empty-lines` rule][21], or a tool like [Prettier][22], can be used. + + - If set to `always-and-inside-groups`, it will act like `always` except new lines are allowed inside import groups + + - If set to `never`, no new lines are allowed in the entire import section + +#### Example + +With the default [`groups`][18] setting, the following will fail the rule check: + +```ts +/* eslint import/order: ["error", {"newlines-between": "always"}] */ +import fs from 'fs'; +import path from 'path'; +import sibling from './foo'; +import index from './'; +``` + +```ts +/* eslint import/order: ["error", {"newlines-between": "always-and-inside-groups"}] */ +import fs from 'fs'; + +import path from 'path'; +import sibling from './foo'; +import index from './'; +``` + +```ts +/* eslint import/order: ["error", {"newlines-between": "never"}] */ +import fs from 'fs'; +import path from 'path'; + +import sibling from './foo'; + +import index from './'; +``` + +While this will pass: + +```ts +/* eslint import/order: ["error", {"newlines-between": "always"}] */ +import fs from 'fs'; +import path from 'path'; + +import sibling from './foo'; + +import index from './'; +``` + +```ts +/* eslint import/order: ["error", {"newlines-between": "always-and-inside-groups"}] */ +import fs from 'fs'; + +import path from 'path'; + +import sibling from './foo'; + +import index from './'; +``` + +```ts +/* eslint import/order: ["error", {"newlines-between": "never"}] */ +import fs from 'fs'; +import path from 'path'; +import sibling from './foo'; +import index from './'; +``` + +### `alphabetize` + +Valid values: `{ order?: "asc" | "desc" | "ignore", orderImportKind?: "asc" | "desc" | "ignore", caseInsensitive?: boolean }` \ +Default: `{ order: "ignore", orderImportKind: "ignore", caseInsensitive: false }` + +Determine the sort order of imports within each [predefined group][18] or [`PathGroup`][8] alphabetically based on specifier. + +> [!NOTE] +> +> Imports will be alphabetized based on their _specifiers_, not by their +> identifiers. For example, `const a = require('z');` will come _after_ `const z = require('a');` when `alphabetize` is set to `{ order: "asc" }`. + +Valid properties and their values include: + + - **`order`**: use `"asc"` to sort in ascending order, `"desc"` to sort in descending order, or "ignore" to prevent sorting + + - **`orderImportKind`**: use `"asc"` to sort various _import kinds_, e.g. [type-only and typeof imports][6], in ascending order, `"desc"` to sort them in descending order, or "ignore" to prevent sorting + + - **`caseInsensitive`**: use `true` to ignore case and `false` to consider case when sorting + +#### Example + +Given the following settings: + +```jsonc +{ + "import/order": ["error", { + "alphabetize": { + "order": "asc", + "caseInsensitive": true + } + }] +} +``` + +This will fail the rule check: + +```ts +import React, { PureComponent } from 'react'; +import aTypes from 'prop-types'; +import { compose, apply } from 'xcompose'; +import * as classnames from 'classnames'; +import blist from 'BList'; +``` + +While this will pass: + +```ts +import blist from 'BList'; +import * as classnames from 'classnames'; +import aTypes from 'prop-types'; +import React, { PureComponent } from 'react'; +import { compose, apply } from 'xcompose'; +``` + +### `named` + +Valid values: `boolean | { enabled: boolean, import?: boolean, export?: boolean, require?: boolean, cjsExports?: boolean, types?: "mixed" | "types-first" | "types-last" }` \ +Default: `false` + +Enforce ordering of names within imports and exports. + +If set to `true` or `{ enabled: true }`, _all_ named imports must be ordered according to [`alphabetize`][30]. +If set to `false` or `{ enabled: false }`, named imports can occur in any order. + +If set to `{ enabled: true, ... }`, and any of the properties `import`, `export`, `require`, or `cjsExports` are set to `false`, named ordering is disabled with respect to the following kind of expressions: + + - `import`: + + ```ts + import { Readline } from "readline"; + ``` + + - `export`: + + ```ts + export { Readline }; + // and + export { Readline } from "readline"; + ``` + + - `require`: + + ```ts + const { Readline } = require("readline"); + ``` + + - `cjsExports`: + + ```ts + module.exports.Readline = Readline; + // and + module.exports = { Readline }; + ``` + +Further, the `named.types` option allows you to specify the order of [import identifiers with inline type qualifiers][23] (or "type-only" identifiers/names), e.g. `import { type TypeIdentifier1, normalIdentifier2 } from 'specifier';`. + +`named.types` accepts the following values: + + - `types-first`: forces type-only identifiers to occur first + - `types-last`: forces type-only identifiers to occur last + - `mixed`: sorts all identifiers in alphabetical order + +#### Example + +Given the following settings: + +```jsonc +{ + "import/order": ["error", { + "named": true, + "alphabetize": { + "order": "asc" + } + }] +} +``` + +This will fail the rule check: + +```ts +import { compose, apply } from 'xcompose'; +``` + +While this will pass: + +```ts +import { apply, compose } from 'xcompose'; +``` + +### `warnOnUnassignedImports` + +Valid values: `boolean` \ +Default: `false` + +Warn when "unassigned" imports are out of order. +Unassigned imports are imports with no corresponding identifiers (e.g. `import './my/thing.js'` or `require('./side-effects.js')`). + +> [!NOTE] +> +> These warnings are not fixable with `--fix` since unassigned imports might be used for their [side-effects][31], +> and changing the order of such imports cannot be done safely. + +#### Example + +Given the following settings: + +```jsonc +{ + "import/order": ["error", { + "warnOnUnassignedImports": true + }] +} +``` + +This will fail the rule check: + +```ts +import fs from 'fs'; +import './styles.css'; +import path from 'path'; +``` + +While this will pass: + +```ts +import fs from 'fs'; +import path from 'path'; +import './styles.css'; +``` + +### `sortTypesGroup` + +Valid values: `boolean` \ +Default: `false` + +> [!NOTE] +> +> This setting is only meaningful when `"type"` is included in [`groups`][18]. + +Sort [type-only imports][6] separately from normal non-type imports. + +When enabled, the intragroup sort order of [type-only imports][6] will mirror the intergroup ordering of normal imports as defined by [`groups`][18], [`pathGroups`][8], etc. + +#### Example + +Given the following settings: + +```jsonc +{ + "import/order": ["error", { + "groups": ["type", "builtin", "parent", "sibling", "index"], + "alphabetize": { "order": "asc" } + }] +} +``` + +This will fail the rule check even though it's logically ordered as we expect (builtins come before parents, parents come before siblings, siblings come before indices), the only difference is we separated type-only imports from normal imports: + +```ts +import type A from "fs"; +import type B from "path"; +import type C from "../foo.js"; +import type D from "./bar.js"; +import type E from './'; + +import a from "fs"; +import b from "path"; +import c from "../foo.js"; +import d from "./bar.js"; +import e from "./"; +``` + +This happens because [type-only imports][6] are considered part of one global +[`"type"` group](#how-imports-are-grouped) by default. However, if we set +`sortTypesGroup` to `true`: + +```jsonc +{ + "import/order": ["error", { + "groups": ["type", "builtin", "parent", "sibling", "index"], + "alphabetize": { "order": "asc" }, + "sortTypesGroup": true + }] +} +``` + +The same example will pass. + +### `newlines-between-types` + +Valid values: `"ignore" | "always" | "always-and-inside-groups" | "never"` \ +Default: the value of [`newlines-between`][20] + +> [!NOTE] +> +> This setting is only meaningful when [`sortTypesGroup`][7] is enabled. + +`newlines-between-types` is functionally identical to [`newlines-between`][20] except it only enforces or forbids new lines between _[type-only][6] import groups_, which exist only when [`sortTypesGroup`][7] is enabled. + +In addition, when determining if a new line is enforceable or forbidden between the type-only imports and the normal imports, `newlines-between-types` takes precedence over [`newlines-between`][20]. + +#### Example + +Given the following settings: + +```jsonc +{ + "import/order": ["error", { + "groups": ["type", "builtin", "parent", "sibling", "index"], + "sortTypesGroup": true, + "newlines-between": "always" + }] +} +``` + +This will fail the rule check: + +```ts +import type A from "fs"; +import type B from "path"; +import type C from "../foo.js"; +import type D from "./bar.js"; +import type E from './'; + +import a from "fs"; +import b from "path"; + +import c from "../foo.js"; + +import d from "./bar.js"; + +import e from "./"; +``` + +However, if we set `newlines-between-types` to `"ignore"`: + +```jsonc +{ + "import/order": ["error", { + "groups": ["type", "builtin", "parent", "sibling", "index"], + "sortTypesGroup": true, + "newlines-between": "always", + "newlines-between-types": "ignore" + }] +} +``` + +The same example will pass. + +Note the new line after `import type E from './';` but before `import a from "fs";`. This new line separates the type-only imports from the normal imports. Its existence is governed by [`newlines-between-types`][27] and _not `newlines-between`_. + +> [!IMPORTANT] +> +> In certain situations, [`consolidateIslands: true`][25] will take precedence over `newlines-between-types: "never"`, if used, when it comes to the new line separating type-only imports from normal imports. + +The next example will pass even though there's a new line preceding the normal import and [`newlines-between`][20] is set to `"never"`: + +```jsonc +{ + "import/order": ["error", { + "groups": ["type", "builtin", "parent", "sibling", "index"], + "sortTypesGroup": true, + "newlines-between": "never", + "newlines-between-types": "always" + }] +} +``` + +```ts +import type A from "fs"; + +import type B from "path"; + +import type C from "../foo.js"; + +import type D from "./bar.js"; + +import type E from './'; + +import a from "fs"; +import b from "path"; +import c from "../foo.js"; +import d from "./bar.js"; +import e from "./"; +``` + +While the following fails due to the new line between the last type import and the first normal import: + +```jsonc +{ + "import/order": ["error", { + "groups": ["type", "builtin", "parent", "sibling", "index"], + "sortTypesGroup": true, + "newlines-between": "always", + "newlines-between-types": "never" + }] +} +``` + +```ts +import type A from "fs"; +import type B from "path"; +import type C from "../foo.js"; +import type D from "./bar.js"; +import type E from './'; + +import a from "fs"; + +import b from "path"; + +import c from "../foo.js"; + +import d from "./bar.js"; + +import e from "./"; +``` + +### `consolidateIslands` + +Valid values: `"inside-groups" | "never"` \ +Default: `"never"` + +> [!NOTE] +> +> This setting is only meaningful when [`newlines-between`][20] and/or [`newlines-between-types`][27] is set to `"always-and-inside-groups"`. + +When set to `"inside-groups"`, this ensures imports spanning multiple lines are separated from other imports with a new line while single-line imports are grouped together (and the space between them consolidated) if they belong to the same [group][18] or [`pathGroups`][8]. + +> [!IMPORTANT] +> +> When all of the following are true: +> +> - [`sortTypesGroup`][7] is set to `true` +> - `consolidateIslands` is set to `"inside-groups"` +> - [`newlines-between`][20] is set to `"always-and-inside-groups"` when [`newlines-between-types`][27] is set to `"never"` (or vice-versa) +> +> Then [`newlines-between`][20]/[`newlines-between-types`][27] will yield to +> `consolidateIslands` and allow new lines to separate multi-line imports +> regardless of the `"never"` setting. +> +> This configuration is useful, for instance, to keep single-line type-only +> imports stacked tightly together at the bottom of your import block to +> preserve space while still logically organizing normal imports for quick and +> pleasant reference. + +#### Example + +Given the following settings: + +```jsonc +{ + "import/order": ["error", { + "newlines-between": "always-and-inside-groups", + "consolidateIslands": "inside-groups" + }] +} +``` + +This will fail the rule check: + +```ts +var fs = require('fs'); +var path = require('path'); +var { util1, util2, util3 } = require('util'); +var async = require('async'); +var relParent1 = require('../foo'); +var { + relParent21, + relParent22, + relParent23, + relParent24, +} = require('../'); +var relParent3 = require('../bar'); +var { sibling1, + sibling2, sibling3 } = require('./foo'); +var sibling2 = require('./bar'); +var sibling3 = require('./foobar'); +``` + +While this will succeed (and is what `--fix` would yield): + +```ts +var fs = require('fs'); +var path = require('path'); +var { util1, util2, util3 } = require('util'); + +var async = require('async'); + +var relParent1 = require('../foo'); + +var { + relParent21, + relParent22, + relParent23, + relParent24, +} = require('../'); + +var relParent3 = require('../bar'); + +var { sibling1, + sibling2, sibling3 } = require('./foo'); + +var sibling2 = require('./bar'); +var sibling3 = require('./foobar'); +``` + +Note the intragroup "islands" of grouped single-line imports, as well as multi-line imports, are surrounded by new lines. At the same time, note the typical new lines separating different groups are still maintained thanks to [`newlines-between`][20]. + +The same holds true for the next example; when given the following settings: + +```jsonc +{ + "import/order": ["error", { + "alphabetize": { "order": "asc" }, + "groups": ["external", "internal", "index", "type"], + "pathGroups": [ + { + "pattern": "dirA/**", + "group": "internal", + "position": "after" + }, + { + "pattern": "dirB/**", + "group": "internal", + "position": "before" + }, + { + "pattern": "dirC/**", + "group": "internal" + } + ], + "newlines-between": "always-and-inside-groups", + "newlines-between-types": "never", + "pathGroupsExcludedImportTypes": [], + "sortTypesGroup": true, + "consolidateIslands": "inside-groups" + }] +} +``` + +> [!IMPORTANT] +> +> **Pay special attention to the value of [`pathGroupsExcludedImportTypes`][9]** in this example's settings. +> Without it, the successful example below would fail. +> This is because the imports with specifiers starting with "dirA/", "dirB/", and "dirC/" are all [considered part of the `"external"` group](#how-imports-are-grouped), and imports in that group are excluded from [`pathGroups`][8] matching by default. +> +> The fix is to remove `"external"` (and, in this example, the others) from [`pathGroupsExcludedImportTypes`][9]. + +This will fail the rule check: + +```ts +import c from 'Bar'; +import d from 'bar'; +import { + aa, + bb, + cc, + dd, + ee, + ff, + gg +} from 'baz'; +import { + hh, + ii, + jj, + kk, + ll, + mm, + nn +} from 'fizz'; +import a from 'foo'; +import b from 'dirA/bar'; +import index from './'; +import type { AA, + BB, CC } from 'abc'; +import type { Z } from 'fizz'; +import type { + A, + B +} from 'foo'; +import type { C2 } from 'dirB/Bar'; +import type { + D2, + X2, + Y2 +} from 'dirB/bar'; +import type { E2 } from 'dirB/baz'; +import type { C3 } from 'dirC/Bar'; +import type { + D3, + X3, + Y3 +} from 'dirC/bar'; +import type { E3 } from 'dirC/baz'; +import type { F3 } from 'dirC/caz'; +import type { C1 } from 'dirA/Bar'; +import type { + D1, + X1, + Y1 +} from 'dirA/bar'; +import type { E1 } from 'dirA/baz'; +import type { F } from './index.js'; +import type { G } from './aaa.js'; +import type { H } from './bbb'; +``` + +While this will succeed (and is what `--fix` would yield): + +```ts +import c from 'Bar'; +import d from 'bar'; + +import { + aa, + bb, + cc, + dd, + ee, + ff, + gg +} from 'baz'; + +import { + hh, + ii, + jj, + kk, + ll, + mm, + nn +} from 'fizz'; + +import a from 'foo'; + +import b from 'dirA/bar'; + +import index from './'; + +import type { AA, + BB, CC } from 'abc'; + +import type { Z } from 'fizz'; + +import type { + A, + B +} from 'foo'; + +import type { C2 } from 'dirB/Bar'; + +import type { + D2, + X2, + Y2 +} from 'dirB/bar'; + +import type { E2 } from 'dirB/baz'; +import type { C3 } from 'dirC/Bar'; + +import type { + D3, + X3, + Y3 +} from 'dirC/bar'; + +import type { E3 } from 'dirC/baz'; +import type { F3 } from 'dirC/caz'; +import type { C1 } from 'dirA/Bar'; + +import type { + D1, + X1, + Y1 +} from 'dirA/bar'; + +import type { E1 } from 'dirA/baz'; +import type { F } from './index.js'; +import type { G } from './aaa.js'; +import type { H } from './bbb'; +``` + +## Related + + - [`import/external-module-folders`][29] + - [`import/internal-regex`][28] + - [`import/core-modules`][11] + +[3]: #how-imports-are-grouped +[4]: https://nodejs.org/api/esm.html#terminology +[5]: #warnonunassignedimports +[6]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export +[7]: #sorttypesgroup +[8]: #pathgroups +[9]: #pathgroupsexcludedimporttypes +[10]: https://www.npmjs.com/package/is-core-module +[11]: ../../README.md#importcore-modules +[12]: https://www.npmjs.com/package/package-up +[13]: #pathgroup +[14]: https://www.npmjs.com/package/minimatch +[16]: https://www.npmjs.com/package/minimatch#features +[17]: https://www.npmjs.com/package/minimatch#options +[18]: #groups +[20]: #newlines-between +[21]: https://eslint.org/docs/latest/rules/no-multiple-empty-lines +[22]: https://prettier.io +[23]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names +[25]: #consolidateislands +[27]: #newlines-between-types +[28]: ../../README.md#importinternal-regex +[29]: ../../README.md#importexternal-module-folders +[30]: #alphabetize +[31]: https://webpack.js.org/guides/tree-shaking#mark-the-file-as-side-effect-free +[32]: #distinctgroup +[33]: #named diff --git a/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md b/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md new file mode 100644 index 0000000000000000000000000000000000000000..e2a7bacd7399da93962e2317dd89a774a0e8c380 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md @@ -0,0 +1,185 @@ +# import/prefer-default-export + + + +In exporting files, this rule checks if there is default export or not. + +## Rule Details + +### rule schema + +```javascript +"import/prefer-default-export": [ + ( "off" | "warn" | "error" ), + { "target": "single" | "any" } // default is "single" +] +``` + +### Config Options + +There are two options available: `single` and `any`. By default, if you do not specify the option, rule will assume it is `single`. + +#### single + +**Definition**: When there is only a single export from a module, prefer using default export over named export. + +How to setup config file for this rule: + +```javascript +// you can manually specify it +"rules": { + "import/prefer-default-export": [ + ( "off" | "warn" | "error" ), + { "target": "single" } + ] +} + +// config setup below will also work +"rules": { + "import/prefer-default-export": "off" | "warn" | "error" +} +``` + +The following patterns are considered warnings: + +```javascript +// bad.js + +// There is only a single module export and it's a named export. +export const foo = 'foo'; + +``` + +The following patterns are not warnings: + +```javascript +// good1.js + +// There is a default export. +export const foo = 'foo'; +const bar = 'bar'; +export default bar; +``` + +```javascript +// good2.js + +// There is more than one named export in the module. +export const foo = 'foo'; +export const bar = 'bar'; +``` + +```javascript +// good3.js + +// There is more than one named export in the module +const foo = 'foo'; +const bar = 'bar'; +export { foo, bar } +``` + +```javascript +// good4.js + +// There is a default export. +const foo = 'foo'; +export { foo as default } +``` + +```javascript +// export-star.js + +// Any batch export will disable this rule. The remote module is not inspected. +export * from './other-module' +``` + +#### any + +**Definition**: any exporting file must contain a default export. + +How to setup config file for this rule: + +```javascript +// you have to manually specify it +"rules": { + "import/prefer-default-export": [ + ( "off" | "warn" | "error" ), + { "target": "any" } + ] +} +``` + +The following patterns are *not* considered warnings: + +```javascript +// good1.js + +//has default export +export default function bar() {}; +``` + +```javascript +// good2.js + +// has default export +let foo; +export { foo as default } +``` + +```javascript +// good3.js + +//contains multiple exports AND default export +export const a = 5; +export function bar(){}; +let foo; +export { foo as default } +``` + +```javascript +// good4.js + +// does not contain any exports => file is not checked by the rule +import * as foo from './foo'; +``` + +```javascript +// export-star.js + +// Any batch export will disable this rule. The remote module is not inspected. +export * from './other-module' +``` + +The following patterns are considered warnings: + +```javascript +// bad1.js + +//has 2 named exports, but no default export +export const foo = 'foo'; +export const bar = 'bar'; +``` + +```javascript +// bad2.js + +// does not have default export +let foo, bar; +export { foo, bar } +``` + +```javascript +// bad3.js + +// does not have default export +export { a, b } from "foo.js" +``` + +```javascript +// bad4.js + +// does not have default export +let item; +export const foo = item; +export { item }; +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/unambiguous.md b/node_modules/eslint-plugin-import/docs/rules/unambiguous.md new file mode 100644 index 0000000000000000000000000000000000000000..e9e5bf73da90949a8c073799418e358f5bc00b4c --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/unambiguous.md @@ -0,0 +1,57 @@ +# import/unambiguous + + + +Warn if a `module` could be mistakenly parsed as a `script` by a consumer leveraging +[Unambiguous JavaScript Grammar] to determine correct parsing goal. + +Will respect the [`parserOptions.sourceType`] from ESLint config, i.e. files parsed +as `script` per that setting will not be reported. + +This plugin uses [Unambiguous JavaScript Grammar] internally to decide whether +dependencies should be parsed as modules and searched for exports matching the +`import`ed names, so it may be beneficial to keep this rule on even if your application +will run in an explicit `module`-only environment. + +## Rule Details + +For files parsed as `module` by ESLint, the following are valid: + +```js +import 'foo' +function x() { return 42 } +``` + +```js +export function x() { return 42 } +``` + +```js +(function x() { return 42 })() +export {} // simple way to mark side-effects-only file as 'module' without any imports/exports +``` + +...whereas the following file would be reported: + +```js +(function x() { return 42 })() +``` + +## When Not To Use It + +If your application environment will always know via [some other means](https://github.com/nodejs/node-eps/issues/13) +how to parse, regardless of syntax, you may not need this rule. + +Remember, though, that this plugin uses this strategy internally, so if you were +to `import` from a module with no `import`s or `export`s, this plugin would not +report it as it would not be clear whether it should be considered a `script` or +a `module`. + +## Further Reading + + - [Unambiguous JavaScript Grammar] + - [`parserOptions.sourceType`] + - [node-eps#13](https://github.com/nodejs/node-eps/issues/13) + +[`parserOptions.sourceType`]: https://eslint.org/docs/user-guide/configuring#specifying-parser-options +[Unambiguous JavaScript Grammar]: https://github.com/nodejs/node-eps/blob/HEAD/002-es-modules.md#32-determining-if-source-is-an-es-module diff --git a/node_modules/eslint-plugin-import/index.d.ts b/node_modules/eslint-plugin-import/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2bef94ec2b997226fbf4bba0555050ee6cc0329a --- /dev/null +++ b/node_modules/eslint-plugin-import/index.d.ts @@ -0,0 +1,33 @@ +import { ESLint, Linter, Rule } from 'eslint'; + +declare const plugin: ESLint.Plugin & { + meta: { + name: string; + version: string; + }; + configs: { + 'recommended': Linter.LegacyConfig; + 'errors': Linter.LegacyConfig; + 'warnings': Linter.LegacyConfig; + 'stage-0': Linter.LegacyConfig; + 'react': Linter.LegacyConfig; + 'react-native': Linter.LegacyConfig; + 'electron': Linter.LegacyConfig; + 'typescript': Linter.LegacyConfig; + }; + flatConfigs: { + 'recommended': Linter.FlatConfig; + 'errors': Linter.FlatConfig; + 'warnings': Linter.FlatConfig; + 'stage-0': Linter.FlatConfig; + 'react': Linter.FlatConfig; + 'react-native': Linter.FlatConfig; + 'electron': Linter.FlatConfig; + 'typescript': Linter.FlatConfig; + }; + rules: { + [key: string]: Rule.RuleModule; + }; +}; + +export = plugin; diff --git a/node_modules/eslint-plugin-import/lib/core/importType.js b/node_modules/eslint-plugin-import/lib/core/importType.js new file mode 100644 index 0000000000000000000000000000000000000000..fd76a546385ac34031902af22d3a2015fa8a63fb --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/core/importType.js @@ -0,0 +1,128 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();exports. + + + + + + +isScoped = isScoped;exports. + + + + + + + + + + + + + + + + + +isAbsolute = isAbsolute;exports. + + + + +isBuiltIn = isBuiltIn;exports. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +isExternalModule = isExternalModule;exports. + + + + + + +isExternalModuleMain = isExternalModuleMain;exports. + + + + + + + +isScopedMain = isScopedMain;exports['default'] = + + + +resolveImportType;var _path = require('path');var _isCoreModule = require('is-core-module');var _isCoreModule2 = _interopRequireDefault(_isCoreModule);var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);var _packagePath = require('./packagePath');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}var scopedRegExp = /^@[^/]+\/?[^/]+/;function isScoped(name) {return name && scopedRegExp.test(name);}function baseModule(name) {if (isScoped(name)) {var _name$split = name.split('/'),_name$split2 = _slicedToArray(_name$split, 2),scope = _name$split2[0],_pkg = _name$split2[1];return String(scope) + '/' + String(_pkg);}var _name$split3 = name.split('/'),_name$split4 = _slicedToArray(_name$split3, 1),pkg = _name$split4[0];return pkg;}function isInternalRegexMatch(name, settings) {var internalScope = settings && settings['import/internal-regex'];return internalScope && new RegExp(internalScope).test(name);}function isAbsolute(name) {return typeof name === 'string' && (0, _path.isAbsolute)(name);} // path is defined only when a resolver resolves to a non-standard path +function isBuiltIn(name, settings, path) {if (path || !name) {return false;}var base = baseModule(name);var extras = settings && settings['import/core-modules'] || [];return (0, _isCoreModule2['default'])(base) || extras.indexOf(base) > -1;}var moduleRegExp = /^\w/;function isModule(name) {return name && moduleRegExp.test(name);}var moduleMainRegExp = /^[\w]((?!\/).)*$/;function isModuleMain(name) {return name && moduleMainRegExp.test(name);}function isRelativeToParent(name) {return (/^\.\.$|^\.\.[\\/]/.test(name));}var indexFiles = ['.', './', './index', './index.js'];function isIndex(name) {return indexFiles.indexOf(name) !== -1;}function isRelativeToSibling(name) {return (/^\.[\\/]/.test(name));}function isExternalPath(path, context) {if (!path) {return false;}var settings = context.settings;var packagePath = (0, _packagePath.getContextPackagePath)(context);if ((0, _path.relative)(packagePath, path).startsWith('..')) {return true;}var folders = settings && settings['import/external-module-folders'] || ['node_modules'];return folders.some(function (folder) {var folderPath = (0, _path.resolve)(packagePath, folder);var relativePath = (0, _path.relative)(folderPath, path);return !relativePath.startsWith('..');});}function isInternalPath(path, context) {if (!path) {return false;}var packagePath = (0, _packagePath.getContextPackagePath)(context);return !(0, _path.relative)(packagePath, path).startsWith('../');}function isExternalLookingName(name) {return isModule(name) || isScoped(name);}function typeTest(name, context, path) {var settings = context.settings;if (isInternalRegexMatch(name, settings)) {return 'internal';}if (isAbsolute(name, settings, path)) {return 'absolute';}if (isBuiltIn(name, settings, path)) {return 'builtin';}if (isRelativeToParent(name, settings, path)) {return 'parent';}if (isIndex(name, settings, path)) {return 'index';}if (isRelativeToSibling(name, settings, path)) {return 'sibling';}if (isExternalPath(path, context)) {return 'external';}if (isInternalPath(path, context)) {return 'internal';}if (isExternalLookingName(name)) {return 'external';}return 'unknown';}function isExternalModule(name, path, context) {if (arguments.length < 3) {throw new TypeError('isExternalModule: name, path, and context are all required');}return (isModule(name) || isScoped(name)) && typeTest(name, context, path) === 'external';}function isExternalModuleMain(name, path, context) {if (arguments.length < 3) {throw new TypeError('isExternalModule: name, path, and context are all required');}return isModuleMain(name) && typeTest(name, context, path) === 'external';}var scopedMainRegExp = /^@[^/]+\/?[^/]+$/;function isScopedMain(name) {return name && scopedMainRegExp.test(name);}function resolveImportType(name, context) {return typeTest(name, context, (0, _resolve2['default'])(name, context)); +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL2ltcG9ydFR5cGUuanMiXSwibmFtZXMiOlsiaXNTY29wZWQiLCJpc0Fic29sdXRlIiwiaXNCdWlsdEluIiwiaXNFeHRlcm5hbE1vZHVsZSIsImlzRXh0ZXJuYWxNb2R1bGVNYWluIiwiaXNTY29wZWRNYWluIiwicmVzb2x2ZUltcG9ydFR5cGUiLCJzY29wZWRSZWdFeHAiLCJuYW1lIiwidGVzdCIsImJhc2VNb2R1bGUiLCJzcGxpdCIsInNjb3BlIiwicGtnIiwiaXNJbnRlcm5hbFJlZ2V4TWF0Y2giLCJzZXR0aW5ncyIsImludGVybmFsU2NvcGUiLCJSZWdFeHAiLCJwYXRoIiwiYmFzZSIsImV4dHJhcyIsImluZGV4T2YiLCJtb2R1bGVSZWdFeHAiLCJpc01vZHVsZSIsIm1vZHVsZU1haW5SZWdFeHAiLCJpc01vZHVsZU1haW4iLCJpc1JlbGF0aXZlVG9QYXJlbnQiLCJpbmRleEZpbGVzIiwiaXNJbmRleCIsImlzUmVsYXRpdmVUb1NpYmxpbmciLCJpc0V4dGVybmFsUGF0aCIsImNvbnRleHQiLCJwYWNrYWdlUGF0aCIsInN0YXJ0c1dpdGgiLCJmb2xkZXJzIiwic29tZSIsImZvbGRlciIsImZvbGRlclBhdGgiLCJyZWxhdGl2ZVBhdGgiLCJpc0ludGVybmFsUGF0aCIsImlzRXh0ZXJuYWxMb29raW5nTmFtZSIsInR5cGVUZXN0IiwiYXJndW1lbnRzIiwibGVuZ3RoIiwiVHlwZUVycm9yIiwic2NvcGVkTWFpblJlZ0V4cCJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQU9nQkEsUSxHQUFBQSxROzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFrQkFDLFUsR0FBQUEsVTs7Ozs7QUFLQUMsUy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FpblJlZ0V4cC50ZXN0KG5hbWUpO1xufVxuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiByZXNvbHZlSW1wb3J0VHlwZShuYW1lLCBjb250ZXh0KSB7XG4gIHJldHVybiB0eXBlVGVzdChuYW1lLCBjb250ZXh0LCByZXNvbHZlKG5hbWUsIGNvbnRleHQpKTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/core/packagePath.js b/node_modules/eslint-plugin-import/lib/core/packagePath.js new file mode 100644 index 0000000000000000000000000000000000000000..df8e6c269624c51e9b59109036138d478b6e424c --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/core/packagePath.js @@ -0,0 +1,23 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports. + + + + +getFilePackagePath = getFilePackagePath;exports. + + + + +getContextPackagePath = getContextPackagePath;exports. + + + +getFilePackageName = getFilePackageName;var _path = require('path');var _contextCompat = require('eslint-module-utils/contextCompat');var _pkgUp = require('eslint-module-utils/pkgUp');var _pkgUp2 = _interopRequireDefault(_pkgUp);var _readPkgUp2 = require('eslint-module-utils/readPkgUp');var _readPkgUp3 = _interopRequireDefault(_readPkgUp2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function getFilePackagePath(filePath) {var fp = (0, _pkgUp2['default'])({ cwd: filePath });return (0, _path.dirname)(fp);}function getContextPackagePath(context) {return getFilePackagePath((0, _contextCompat.getPhysicalFilename)(context));}function getFilePackageName(filePath) {var _readPkgUp = + (0, _readPkgUp3['default'])({ cwd: filePath, normalize: false }),pkg = _readPkgUp.pkg,path = _readPkgUp.path; + if (pkg) { + // recursion in case of intermediate esm package.json without name found + return pkg.name || getFilePackageName((0, _path.dirname)((0, _path.dirname)(path))); + } + return null; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3BhY2thZ2VQYXRoLmpzIl0s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dGgnO1xuaW1wb3J0IHsgZ2V0UGh5c2ljYWxGaWxlbmFtZSB9IGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvY29udGV4dENvbXBhdCc7XG5pbXBvcnQgcGtnVXAgZnJvbSAnZXNsaW50LW1vZHVsZS11dGlscy9wa2dVcCc7XG5pbXBvcnQgcmVhZFBrZ1VwIGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvcmVhZFBrZ1VwJztcblxuZXhwb3J0IGZ1bmN0aW9uIGdldEZpbGVQYWNrYWdlUGF0aChmaWxlUGF0aCkge1xuICBjb25zdCBmcCA9IHBrZ1VwKHsgY3dkOiBmaWxlUGF0aCB9KTtcbiAgcmV0dXJuIGRpcm5hbWUoZnApO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZ2V0Q29udGV4dFBhY2thZ2VQYXRoKGNvbnRleHQpIHtcbiAgcmV0dXJuIGdldEZpbGVQYWNrYWdlUGF0aChnZXRQaHlzaWNhbEZpbGVuYW1lKGNvbnRleHQpKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEZpbGVQYWNrYWdlTmFtZShmaWxlUGF0aCkge1xuICBjb25zdCB7IHBrZywgcGF0aCB9ID0gcmVhZFBrZ1VwKHsgY3dkOiBmaWxlUGF0aCwgbm9ybWFsaXplOiBmYWxzZSB9KTtcbiAgaWYgKHBrZykge1xuICAgIC8vIHJlY3Vyc2lvbiBpbiBjYXNlIG9mIGludGVybWVkaWF0ZSBlc20gcGFja2FnZS5qc29uIHdpdGhvdXQgbmFtZSBmb3VuZFxuICAgIHJldHVybiBwa2cubmFtZSB8fCBnZXRGaWxlUGFja2FnZU5hbWUoZGlybmFtZShkaXJuYW1lKHBhdGgpKSk7XG4gIH1cbiAgcmV0dXJuIG51bGw7XG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/core/sourceType.js b/node_modules/eslint-plugin-import/lib/core/sourceType.js new file mode 100644 index 0000000000000000000000000000000000000000..fa34d3424eb7789346b185a8f50481193ea05376 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/core/sourceType.js @@ -0,0 +1,13 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] = + + + +sourceType; /** + * @param {import('eslint').Rule.RuleContext} context + * @returns 'module' | 'script' | 'commonjs' | undefined + */function sourceType(context) {if ('sourceType' in context.parserOptions) {return context.parserOptions.sourceType;} + if ('languageOptions' in context && context.languageOptions) { + return context.languageOptions.sourceType; + } +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3NvdXJjZVR5cGUuanMiXSwibmFtZXMiOlsic291cmNlVHlwZSIsImNvbnRleHQiLCJwYXJzZXJPcHRpb25zIiwibGFuZ3VhZ2VPcHRpb25zIl0sIm1hcHBpbmdzIjoiOzs7O0FBSXdCQSxVLEVBSnhCOzs7ZUFJZSxTQUFTQSxVQUFULENBQW9CQyxPQUFwQixFQUE2QixDQUMxQyxJQUFJLGdCQUFnQkEsUUFBUUMsYUFBNUIsRUFBMkMsQ0FDekMsT0FBT0QsUUFBUUMsYUFBUixDQUFzQkYsVUFBN0IsQ0FDRDtBQUNELE1BQUkscUJBQXFCQyxPQUFyQixJQUFnQ0EsUUFBUUUsZUFBNUMsRUFBNkQ7QUFDM0QsV0FBT0YsUUFBUUUsZUFBUixDQUF3QkgsVUFBL0I7QUFDRDtBQUNGIiwiZmlsZSI6InNvdXJjZVR5cGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBwYXJhbSB7aW1wb3J0KCdlc2xpbnQnKS5SdWxlLlJ1bGVDb250ZXh0fSBjb250ZXh0XG4gKiBAcmV0dXJucyAnbW9kdWxlJyB8ICdzY3JpcHQnIHwgJ2NvbW1vbmpzJyB8IHVuZGVmaW5lZFxuICovXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzb3VyY2VUeXBlKGNvbnRleHQpIHtcbiAgaWYgKCdzb3VyY2VUeXBlJyBpbiBjb250ZXh0LnBhcnNlck9wdGlvbnMpIHtcbiAgICByZXR1cm4gY29udGV4dC5wYXJzZXJPcHRpb25zLnNvdXJjZVR5cGU7XG4gIH1cbiAgaWYgKCdsYW5ndWFnZU9wdGlvbnMnIGluIGNvbnRleHQgJiYgY29udGV4dC5sYW5ndWFnZU9wdGlvbnMpIHtcbiAgICByZXR1cm4gY29udGV4dC5sYW5ndWFnZU9wdGlvbnMuc291cmNlVHlwZTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/core/staticRequire.js b/node_modules/eslint-plugin-import/lib/core/staticRequire.js new file mode 100644 index 0000000000000000000000000000000000000000..43bb282d84b4c1dbd6565a101af987a380c06e7e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/core/staticRequire.js @@ -0,0 +1,11 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] = +isStaticRequire; // todo: merge with module visitor +function isStaticRequire(node) {return node && + node.callee && + node.callee.type === 'Identifier' && + node.callee.name === 'require' && + node.arguments.length === 1 && + node.arguments[0].type === 'Literal' && + typeof node.arguments[0].value === 'string'; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3N0YXRpY1JlcXVpcmUuanMiXSwibmFtZXMiOlsiaXNTdGF0aWNSZXF1aXJlIiwibm9kZSIsImNhbGxlZSIsInR5cGUiLCJuYW1lIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7QUFDd0JBLGUsRUFEeEI7QUFDZSxTQUFTQSxlQUFULENBQXlCQyxJQUF6QixFQUErQixDQUM1QyxPQUFPQTtBQUNGQSxPQUFLQyxNQURIO0FBRUZELE9BQUtDLE1BQUwsQ0FBWUMsSUFBWixLQUFxQixZQUZuQjtBQUdGRixPQUFLQyxNQUFMLENBQVlFLElBQVosS0FBcUIsU0FIbkI7QUFJRkgsT0FBS0ksU0FBTCxDQUFlQyxNQUFmLEtBQTBCLENBSnhCO0FBS0ZMLE9BQUtJLFNBQUwsQ0FBZSxDQUFmLEVBQWtCRixJQUFsQixLQUEyQixTQUx6QjtBQU1GLFNBQU9GLEtBQUtJLFNBQUwsQ0FBZSxDQUFmLEVBQWtCRSxLQUF6QixLQUFtQyxRQU54QztBQU9EIiwiZmlsZSI6InN0YXRpY1JlcXVpcmUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0b2RvOiBtZXJnZSB3aXRoIG1vZHVsZSB2aXNpdG9yXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBpc1N0YXRpY1JlcXVpcmUobm9kZSkge1xuICByZXR1cm4gbm9kZVxuICAgICYmIG5vZGUuY2FsbGVlXG4gICAgJiYgbm9kZS5jYWxsZWUudHlwZSA9PT0gJ0lkZW50aWZpZXInXG4gICAgJiYgbm9kZS5jYWxsZWUubmFtZSA9PT0gJ3JlcXVpcmUnXG4gICAgJiYgbm9kZS5hcmd1bWVudHMubGVuZ3RoID09PSAxXG4gICAgJiYgbm9kZS5hcmd1bWVudHNbMF0udHlwZSA9PT0gJ0xpdGVyYWwnXG4gICAgJiYgdHlwZW9mIG5vZGUuYXJndW1lbnRzWzBdLnZhbHVlID09PSAnc3RyaW5nJztcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/docsUrl.js b/node_modules/eslint-plugin-import/lib/docsUrl.js new file mode 100644 index 0000000000000000000000000000000000000000..f8d6f53f6392f6317094151beb2780c775bd824f --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/docsUrl.js @@ -0,0 +1,8 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] = + + + +docsUrl;var _package = require('../package.json');var _package2 = _interopRequireDefault(_package);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}var repoUrl = 'https://github.com/import-js/eslint-plugin-import';function docsUrl(ruleName) {var commitish = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'v' + String(_package2['default'].version); + return repoUrl + '/blob/' + String(commitish) + '/docs/rules/' + String(ruleName) + '.md'; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kb2NzVXJsLmpzIl0sIm5hbWVzIjpbImRvY3NVcmwiLCJyZXBvVXJsIiwicnVsZU5hbWUiLCJjb21taXRpc2giLCJwa2ciLCJ2ZXJzaW9uIl0sIm1hcHBpbmdzIjoiOzs7O0FBSXdCQSxPLENBSnhCLDBDLGdKQUVBLElBQU1DLFVBQVUsbURBQWhCLENBRWUsU0FBU0QsT0FBVCxDQUFpQkUsUUFBakIsRUFBMEQsS0FBL0JDLFNBQStCLG9GQUFmQyxxQkFBSUMsT0FBVztBQUN2RSxTQUFVSixPQUFWLHFCQUEwQkUsU0FBMUIsNEJBQWtERCxRQUFsRDtBQUNEIiwiZmlsZSI6ImRvY3NVcmwuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgcGtnIGZyb20gJy4uL3BhY2thZ2UuanNvbic7XG5cbmNvbnN0IHJlcG9VcmwgPSAnaHR0cHM6Ly9naXRodWIuY29tL2ltcG9ydC1qcy9lc2xpbnQtcGx1Z2luLWltcG9ydCc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGRvY3NVcmwocnVsZU5hbWUsIGNvbW1pdGlzaCA9IGB2JHtwa2cudmVyc2lvbn1gKSB7XG4gIHJldHVybiBgJHtyZXBvVXJsfS9ibG9iLyR7Y29tbWl0aXNofS9kb2NzL3J1bGVzLyR7cnVsZU5hbWV9Lm1kYDtcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/builder.js b/node_modules/eslint-plugin-import/lib/exportMap/builder.js new file mode 100644 index 0000000000000000000000000000000000000000..d5366387f67336983de25fb2202084e26e1863c6 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/builder.js @@ -0,0 +1,210 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _fs = require('fs');var _fs2 = _interopRequireDefault(_fs); + +var _doctrine = require('doctrine');var _doctrine2 = _interopRequireDefault(_doctrine); + +var _debug = require('debug');var _debug2 = _interopRequireDefault(_debug); + +var _parse2 = require('eslint-module-utils/parse');var _parse3 = _interopRequireDefault(_parse2); +var _visit = require('eslint-module-utils/visit');var _visit2 = _interopRequireDefault(_visit); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _ignore = require('eslint-module-utils/ignore');var _ignore2 = _interopRequireDefault(_ignore); + +var _hash = require('eslint-module-utils/hash'); +var _unambiguous = require('eslint-module-utils/unambiguous');var unambiguous = _interopRequireWildcard(_unambiguous); + +var _ = require('.');var _2 = _interopRequireDefault(_); +var _childContext = require('./childContext');var _childContext2 = _interopRequireDefault(_childContext); +var _typescript = require('./typescript'); +var _remotePath = require('./remotePath'); +var _visitor = require('./visitor');var _visitor2 = _interopRequireDefault(_visitor);function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj['default'] = obj;return newObj;}}function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}} + +var log = (0, _debug2['default'])('eslint-plugin-import:ExportMap'); + +var exportCache = new Map(); + +/** + * The creation of this closure is isolated from other scopes + * to avoid over-retention of unrelated variables, which has + * caused memory leaks. See #1266. + */ +function thunkFor(p, context) { + // eslint-disable-next-line no-use-before-define + return function () {return ExportMapBuilder['for']((0, _childContext2['default'])(p, context));}; +}var + +ExportMapBuilder = function () {function ExportMapBuilder() {_classCallCheck(this, ExportMapBuilder);}_createClass(ExportMapBuilder, null, [{ key: 'get', value: function () {function get( + source, context) { + var path = (0, _resolve2['default'])(source, context); + if (path == null) {return null;} + + return ExportMapBuilder['for']((0, _childContext2['default'])(path, context)); + }return get;}() }, { key: 'for', value: function () {function _for( + + context) {var + path = context.path; + + var cacheKey = context.cacheKey || (0, _hash.hashObject)(context).digest('hex'); + var exportMap = exportCache.get(cacheKey); + + // return cached ignore + if (exportMap === null) {return null;} + + var stats = _fs2['default'].statSync(path); + if (exportMap != null) { + // date equality check + if (exportMap.mtime - stats.mtime === 0) { + return exportMap; + } + // future: check content equality? + } + + // check valid extensions first + if (!(0, _ignore.hasValidExtension)(path, context)) { + exportCache.set(cacheKey, null); + return null; + } + + // check for and cache ignore + if ((0, _ignore2['default'])(path, context)) { + log('ignored path due to ignore settings:', path); + exportCache.set(cacheKey, null); + return null; + } + + var content = _fs2['default'].readFileSync(path, { encoding: 'utf8' }); + + // check for and cache unambiguous modules + if (!unambiguous.test(content)) { + log('ignored path due to unambiguous regex:', path); + exportCache.set(cacheKey, null); + return null; + } + + log('cache miss', cacheKey, 'for path', path); + exportMap = ExportMapBuilder.parse(path, content, context); + + // ambiguous modules return null + if (exportMap == null) { + log('ignored path due to ambiguous parse:', path); + exportCache.set(cacheKey, null); + return null; + } + + exportMap.mtime = stats.mtime; + + // If the visitor keys were not populated, then we shouldn't save anything to the cache, + // since the parse results may not be reliable. + if (exportMap.visitorKeys) { + exportCache.set(cacheKey, exportMap); + } + return exportMap; + }return _for;}() }, { key: 'parse', value: function () {function parse( + + path, content, context) { + var exportMap = new _2['default'](path); + var isEsModuleInteropTrue = (0, _typescript.isEsModuleInterop)(context); + + var ast = void 0; + var visitorKeys = void 0; + try { + var result = (0, _parse3['default'])(path, content, context); + ast = result.ast; + visitorKeys = result.visitorKeys; + } catch (err) { + exportMap.errors.push(err); + return exportMap; // can't continue + } + + exportMap.visitorKeys = visitorKeys; + + var hasDynamicImports = false; + + var remotePathResolver = new _remotePath.RemotePath(path, context); + + function processDynamicImport(source) { + hasDynamicImports = true; + if (source.type !== 'Literal') { + return null; + } + var p = remotePathResolver.resolve(source.value); + if (p == null) { + return null; + } + var importedSpecifiers = new Set(); + importedSpecifiers.add('ImportNamespaceSpecifier'); + var getter = thunkFor(p, context); + exportMap.imports.set(p, { + getter: getter, + declarations: new Set([{ + source: { + // capturing actual node reference holds full AST in memory! + value: source.value, + loc: source.loc }, + + importedSpecifiers: importedSpecifiers, + dynamic: true }]) }); + + + } + + (0, _visit2['default'])(ast, visitorKeys, { + ImportExpression: function () {function ImportExpression(node) { + processDynamicImport(node.source); + }return ImportExpression;}(), + CallExpression: function () {function CallExpression(node) { + if (node.callee.type === 'Import') { + processDynamicImport(node.arguments[0]); + } + }return CallExpression;}() }); + + + var unambiguouslyESM = unambiguous.isModule(ast); + if (!unambiguouslyESM && !hasDynamicImports) {return null;} + + // attempt to collect module doc + if (ast.comments) { + ast.comments.some(function (c) { + if (c.type !== 'Block') {return false;} + try { + var doc = _doctrine2['default'].parse(c.value, { unwrap: true }); + if (doc.tags.some(function (t) {return t.title === 'module';})) { + exportMap.doc = doc; + return true; + } + } catch (err) {/* ignore */} + return false; + }); + } + + var visitorBuilder = new _visitor2['default']( + path, + context, + exportMap, + ExportMapBuilder, + content, + ast, + isEsModuleInteropTrue, + thunkFor); + + ast.body.forEach(function (astNode) { + var visitor = visitorBuilder.build(astNode); + + if (visitor[astNode.type]) { + visitor[astNode.type].call(visitorBuilder); + } + }); + + if ( + isEsModuleInteropTrue // esModuleInterop is on in tsconfig + && exportMap.namespace.size > 0 // anything is exported + && !exportMap.namespace.has('default') // and default isn't added already + ) { + exportMap.namespace.set('default', {}); // add default export + } + + if (unambiguouslyESM) { + exportMap.parseGoal = 'Module'; + } + return exportMap; + }return parse;}() }]);return ExportMapBuilder;}();exports['default'] = ExportMapBuilder; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvYnVpbGRlci5qcyJdLCJuYW1lcyI6WyJ1bmFtYmlndW91cyIsImxvZyIsImV4cG9ydENhY2hlIiwiTWFwIiwidGh1bmtGb3IiLCJwIiwiY29udGV4dCIsIkV4cG9ydE1hcEJ1aWxkZXIiLCJzb3VyY2UiLCJwYXRoIiwiY2FjaGVLZXkiLCJkaWdlc3QiLCJleHBvcnRNYXAiLCJnZXQiLCJzdGF0cyIsImZzIiwic3RhdFN5bmMiLCJtdGltZSIsInNldCIsImNvbnRlbnQiLCJyZWFkRmlsZVN5bmMiLCJlbmNvZGluZyIsInRlc3QiLCJwYXJzZSIsInZpc2l0b3JLZXlzIiwiRXhwb3J0TWFwIiwiaXNFc01vZHVsZUludGVyb3BUcnVlIiwiYXN0IiwicmVzdWx0IiwiZXJyIiwiZXJyb3JzIiwicHVzaCIsImhhc0R5bmFtaWNJbXBvcnRzIiwicmVtb3RlUGF0aFJlc29sdmVyIiwiUmVtb3RlUGF0aCIsInByb2Nlc3NEeW5hbWljSW1wb3J0IiwidHlwZSIsInJlc29sdmUiLCJ2YWx1ZSIsImltcG9ydGVkU3BlY2lmaWVycyIsIlNldCIsImFkZCIsImdldHRlciIsImltcG9ydHMiLCJkZWNsYXJhdGlvbnMiLCJsb2MiLCJkeW5hbWljIiwiSW1wb3J0RXhwcmVzc2lvbiIsIm5vZGUiLCJDYWxsRXhwcmVzc2lvbiIsImNhbGxlZSIsImFyZ3VtZW50cyIsInVuYW1iaWd1b3VzbHlFU00iLCJpc01vZHVsZSIsImNvbW1lbnRzIiwic29tZSIsImMiL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gICAgICYmICFleHBvcnRNYXAubmFtZXNwYWNlLmhhcygnZGVmYXVsdCcpIC8vIGFuZCBkZWZhdWx0IGlzbid0IGFkZGVkIGFscmVhZHlcbiAgICApIHtcbiAgICAgIGV4cG9ydE1hcC5uYW1lc3BhY2Uuc2V0KCdkZWZhdWx0Jywge30pOyAvLyBhZGQgZGVmYXVsdCBleHBvcnRcbiAgICB9XG5cbiAgICBpZiAodW5hbWJpZ3VvdXNseUVTTSkge1xuICAgICAgZXhwb3J0TWFwLnBhcnNlR29hbCA9ICdNb2R1bGUnO1xuICAgIH1cbiAgICByZXR1cm4gZXhwb3J0TWFwO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/captureDependency.js b/node_modules/eslint-plugin-import/lib/exportMap/captureDependency.js new file mode 100644 index 0000000000000000000000000000000000000000..5a863b60d12a3505fa2971765064bb9dd20bf47b --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/captureDependency.js @@ -0,0 +1,61 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.captureDependency = captureDependency;exports. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +captureDependencyWithSpecifiers = captureDependencyWithSpecifiers;function captureDependency(_ref, isOnlyImportingTypes, remotePathResolver, exportMap, context, thunkFor) {var source = _ref.source;var importedSpecifiers = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new Set();if (source == null) {return null;}var p = remotePathResolver.resolve(source.value);if (p == null) {return null;}var declarationMetadata = { // capturing actual node reference holds full AST in memory! + source: { value: source.value, loc: source.loc }, isOnlyImportingTypes: isOnlyImportingTypes, importedSpecifiers: importedSpecifiers };var existing = exportMap.imports.get(p);if (existing != null) {existing.declarations.add(declarationMetadata);return existing.getter;}var getter = thunkFor(p, context);exportMap.imports.set(p, { getter: getter, declarations: new Set([declarationMetadata]) });return getter;}var supportedImportTypes = new Set(['ImportDefaultSpecifier', 'ImportNamespaceSpecifier']);function captureDependencyWithSpecifiers(n, +remotePathResolver, +exportMap, +context, +thunkFor) +{ + // import type { Foo } (TS and Flow); import typeof { Foo } (Flow) + var declarationIsType = n.importKind === 'type' || n.importKind === 'typeof'; + // import './foo' or import {} from './foo' (both 0 specifiers) is a side effect and + // shouldn't be considered to be just importing types + var specifiersOnlyImportingTypes = n.specifiers.length > 0; + var importedSpecifiers = new Set(); + n.specifiers.forEach(function (specifier) { + if (specifier.type === 'ImportSpecifier') { + importedSpecifiers.add(specifier.imported.name || specifier.imported.value); + } else if (supportedImportTypes.has(specifier.type)) { + importedSpecifiers.add(specifier.type); + } + + // import { type Foo } (Flow); import { typeof Foo } (Flow) + specifiersOnlyImportingTypes = specifiersOnlyImportingTypes && ( + specifier.importKind === 'type' || specifier.importKind === 'typeof'); + }); + captureDependency(n, declarationIsType || specifiersOnlyImportingTypes, remotePathResolver, exportMap, context, thunkFor, importedSpecifiers); +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvY2FwdHVyZURlcGVuZGVuY3kuanMiXSwibmFtZXMiOlsiY2FwdHVyZURlcGVuZGVuY3kiLCJjYXB0dXJlRGVwZW5kZW5jeVdpdGhTcGVjaWZpZXJzIiwiaXNPbmx5SW1wb3J0aW5nVHlwZXMiLCJyZW1vdGVQYXRoUmVzb2x2ZXIiLCJleHBvcnRNYXAiLCJjb250ZXh0IiwidGh1bmtGb3IiLCJzb3VyY2UiLCJpbXBvcnRlZFNwZWNpZmllcnMiLCJTZXQiLCJwIiwicmVzb2x2ZSIsInZhbHVlIiwiZGVjbGFyYXRpb25NZXRhZGF0YSIsImxvYyIsImV4aXN0aW5nIiwiaW1wb3J0cyIsImdldCIsImRlY2xhcmF0aW9ucyIsImFkZCIsImdldHRlciIsInNldCIsInN1cHBvcnRlZEltcG9ydFR5cGVzIiwibiIsImRlY2xhcmF0aW9uSXNUeXBlIiwiaW1wb3J0S2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gdHlwZXNcbiAgbGV0IHNwZWNpZmllcnNPbmx5SW1wb3J0aW5nVHlwZXMgPSBuLnNwZWNpZmllcnMubGVuZ3RoID4gMDtcbiAgY29uc3QgaW1wb3J0ZWRTcGVjaWZpZXJzID0gbmV3IFNldCgpO1xuICBuLnNwZWNpZmllcnMuZm9yRWFjaCgoc3BlY2lmaWVyKSA9PiB7XG4gICAgaWYgKHNwZWNpZmllci50eXBlID09PSAnSW1wb3J0U3BlY2lmaWVyJykge1xuICAgICAgaW1wb3J0ZWRTcGVjaWZpZXJzLmFkZChzcGVjaWZpZXIuaW1wb3J0ZWQubmFtZSB8fCBzcGVjaWZpZXIuaW1wb3J0ZWQudmFsdWUpO1xuICAgIH0gZWxzZSBpZiAoc3VwcG9ydGVkSW1wb3J0VHlwZXMuaGFzKHNwZWNpZmllci50eXBlKSkge1xuICAgICAgaW1wb3J0ZWRTcGVjaWZpZXJzLmFkZChzcGVjaWZpZXIudHlwZSk7XG4gICAgfVxuXG4gICAgLy8gaW1wb3J0IHsgdHlwZSBGb28gfSAoRmxvdyk7IGltcG9ydCB7IHR5cGVvZiBGb28gfSAoRmxvdylcbiAgICBzcGVjaWZpZXJzT25seUltcG9ydGluZ1R5cGVzID0gc3BlY2lmaWVyc09ubHlJbXBvcnRpbmdUeXBlc1xuICAgICAgJiYgKHNwZWNpZmllci5pbXBvcnRLaW5kID09PSAndHlwZScgfHwgc3BlY2lmaWVyLmltcG9ydEtpbmQgPT09ICd0eXBlb2YnKTtcbiAgfSk7XG4gIGNhcHR1cmVEZXBlbmRlbmN5KG4sIGRlY2xhcmF0aW9uSXNUeXBlIHx8IHNwZWNpZmllcnNPbmx5SW1wb3J0aW5nVHlwZXMsIHJlbW90ZVBhdGhSZXNvbHZlciwgZXhwb3J0TWFwLCBjb250ZXh0LCB0aHVua0ZvciwgaW1wb3J0ZWRTcGVjaWZpZXJzKTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/childContext.js b/node_modules/eslint-plugin-import/lib/exportMap/childContext.js new file mode 100644 index 0000000000000000000000000000000000000000..930a627be875ba2eba57e972253ed4b5d3fe7c12 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/childContext.js @@ -0,0 +1,57 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] = + + + + + + + + + + + + + + + + + + +childContext;var _hash = require('eslint-module-utils/hash');var optionsHash = '';var prevOptions = '';var settingsHash = '';var prevSettings = ''; // Replacer function helps us with serializing the parser nested within `languageOptions`. +function stringifyReplacerFn(_, value) {if (typeof value === 'function') {return String(value);}return value;} /** + * don't hold full context object in memory, just grab what we need. + * also calculate a cacheKey, where parts of the cacheKey hash are memoized + */function childContext(path, context) {var settings = context.settings,parserOptions = context.parserOptions,parserPath = context.parserPath,languageOptions = context.languageOptions;if (JSON.stringify(settings) !== prevSettings) {settingsHash = (0, _hash.hashObject)({ settings: settings }).digest('hex'); + prevSettings = JSON.stringify(settings); + } + + // We'll use either a combination of `parserOptions` and `parserPath` or `languageOptions` + // to construct the cache key, depending on whether this is using a flat config or not. + var optionsToken = void 0; + if (!parserPath && languageOptions) { + if (JSON.stringify(languageOptions, stringifyReplacerFn) !== prevOptions) { + optionsHash = (0, _hash.hashObject)({ languageOptions: languageOptions }).digest('hex'); + prevOptions = JSON.stringify(languageOptions, stringifyReplacerFn); + } + // For languageOptions, we're just using the hashed options as the options token + optionsToken = optionsHash; + } else { + if (JSON.stringify(parserOptions) !== prevOptions) { + optionsHash = (0, _hash.hashObject)({ parserOptions: parserOptions }).digest('hex'); + prevOptions = JSON.stringify(parserOptions); + } + // When not using flat config, we use a combination of the hashed parserOptions + // and parserPath as the token + optionsToken = String(parserPath) + optionsHash; + } + + return { + cacheKey: optionsToken + settingsHash + String(path), + settings: settings, + parserOptions: parserOptions, + parserPath: parserPath, + path: path, + languageOptions: languageOptions }; + +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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gaGFzaE9iamVjdCh7IHBhcnNlck9wdGlvbnMgfSkuZGlnZXN0KCdoZXgnKTtcbiAgICAgIHByZXZPcHRpb25zID0gSlNPTi5zdHJpbmdpZnkocGFyc2VyT3B0aW9ucyk7XG4gICAgfVxuICAgIC8vIFdoZW4gbm90IHVzaW5nIGZsYXQgY29uZmlnLCB3ZSB1c2UgYSBjb21iaW5hdGlvbiBvZiB0aGUgaGFzaGVkIHBhcnNlck9wdGlvbnNcbiAgICAvLyBhbmQgcGFyc2VyUGF0aCBhcyB0aGUgdG9rZW5cbiAgICBvcHRpb25zVG9rZW4gPSBTdHJpbmcocGFyc2VyUGF0aCkgKyBvcHRpb25zSGFzaDtcbiAgfVxuXG4gIHJldHVybiB7XG4gICAgY2FjaGVLZXk6IG9wdGlvbnNUb2tlbiArIHNldHRpbmdzSGFzaCArIFN0cmluZyhwYXRoKSxcbiAgICBzZXR0aW5ncyxcbiAgICBwYXJzZXJPcHRpb25zLFxuICAgIHBhcnNlclBhdGgsXG4gICAgcGF0aCxcbiAgICBsYW5ndWFnZU9wdGlvbnMsXG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/doc.js b/node_modules/eslint-plugin-import/lib/exportMap/doc.js new file mode 100644 index 0000000000000000000000000000000000000000..e2ceaa98a66e72933952ededa80f7c09c271972e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/doc.js @@ -0,0 +1,90 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.availableDocStyleParsers = undefined;exports. + + + + +captureDoc = captureDoc;var _doctrine = require('doctrine');var _doctrine2 = _interopRequireDefault(_doctrine);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /** + * parse docs from the first node that has leading comments + */function captureDoc(source, docStyleParsers) {var metadata = {}; + // 'some' short-circuits on first 'true' + for (var _len = arguments.length, nodes = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {nodes[_key - 2] = arguments[_key];}nodes.some(function (n) { + try { + + var leadingComments = void 0; + + // n.leadingComments is legacy `attachComments` behavior + if ('leadingComments' in n) { + leadingComments = n.leadingComments; + } else if (n.range) { + leadingComments = source.getCommentsBefore(n); + } + + if (!leadingComments || leadingComments.length === 0) {return false;} + + for (var name in docStyleParsers) { + var doc = docStyleParsers[name](leadingComments); + if (doc) { + metadata.doc = doc; + } + } + + return true; + } catch (err) { + return false; + } + }); + + return metadata; +} + +/** + * parse JSDoc from leading comments + * @param {object[]} comments + * @return {{ doc: object }} + */ +function captureJsDoc(comments) { + var doc = void 0; + + // capture XSDoc + comments.forEach(function (comment) { + // skip non-block comments + if (comment.type !== 'Block') {return;} + try { + doc = _doctrine2['default'].parse(comment.value, { unwrap: true }); + } catch (err) { + /* don't care, for now? maybe add to `errors?` */ + } + }); + + return doc; +} + +/** + * parse TomDoc section from comments + */ +function captureTomDoc(comments) { + // collect lines up to first paragraph break + var lines = []; + for (var i = 0; i < comments.length; i++) { + var comment = comments[i]; + if (comment.value.match(/^\s*$/)) {break;} + lines.push(comment.value.trim()); + } + + // return doctrine-like object + var statusMatch = lines.join(' ').match(/^(Public|Internal|Deprecated):\s*(.+)/); + if (statusMatch) { + return { + description: statusMatch[2], + tags: [{ + title: statusMatch[1].toLowerCase(), + description: statusMatch[2] }] }; + + + } +} + +var availableDocStyleParsers = exports.availableDocStyleParsers = { + jsdoc: captureJsDoc, + tomdoc: captureTomDoc }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvZG9jLmpzIl0sIm5hbWVzIjpbImNhcHR1cmVEb2MiLCJzb3VyY2UiLCJkb2NTdHlsZVBhcnNlcnMiLCJtZXRhZGF0YSIsIm5vZGVzIiwic29tZSIsIm4iLCJsZWFkaW5nQ29tbWVudHMiLCJyYW5nZSIsImdldENvbW1lbnRzQmVmb3JlIiwibGVuZ3RoIiwibmFtZ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ibGVEb2NTdHlsZVBhcnNlcnMgPSB7XG4gIGpzZG9jOiBjYXB0dXJlSnNEb2MsXG4gIHRvbWRvYzogY2FwdHVyZVRvbURvYyxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/index.js b/node_modules/eslint-plugin-import/lib/exportMap/index.js new file mode 100644 index 0000000000000000000000000000000000000000..802da1e87327c07847c3f9b5346ba56bd9d1cd05 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/index.js @@ -0,0 +1,180 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var ExportMap = function () { + function ExportMap(path) {_classCallCheck(this, ExportMap); + this.path = path; + this.namespace = new Map(); + // todo: restructure to key on path, value is resolver + map of names + this.reexports = new Map(); + /** + * star-exports + * @type {Set<() => ExportMap>} + */ + this.dependencies = new Set(); + /** + * dependencies of this module that are not explicitly re-exported + * @type {Map ExportMap>} + */ + this.imports = new Map(); + this.errors = []; + /** + * type {'ambiguous' | 'Module' | 'Script'} + */ + this.parseGoal = 'ambiguous'; + }_createClass(ExportMap, [{ key: 'has', + + + + + + + + + + + + + + + /** + * Note that this does not check explicitly re-exported names for existence + * in the base namespace, but it will expand all `export * from '...'` exports + * if not found in the explicit namespace. + * @param {string} name + * @return {boolean} true if `name` is exported by this module. + */value: function () {function has( + name) { + if (this.namespace.has(name)) {return true;} + if (this.reexports.has(name)) {return true;} + + // default exports must be explicitly re-exported (#328) + if (name !== 'default') {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = this.dependencies[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var dep = _step.value; + var innerMap = dep(); + + // todo: report as unresolved? + if (!innerMap) {continue;} + + if (innerMap.has(name)) {return true;} + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + } + + return false; + }return has;}() + + /** + * ensure that imported name fully resolves. + * @param {string} name + * @return {{ found: boolean, path: ExportMap[] }} + */ }, { key: 'hasDeep', value: function () {function hasDeep( + name) { + if (this.namespace.has(name)) {return { found: true, path: [this] };} + + if (this.reexports.has(name)) { + var reexports = this.reexports.get(name); + var imported = reexports.getImport(); + + // if import is ignored, return explicit 'null' + if (imported == null) {return { found: true, path: [this] };} + + // safeguard against cycles, only if name matches + if (imported.path === this.path && reexports.local === name) { + return { found: false, path: [this] }; + } + + var deep = imported.hasDeep(reexports.local); + deep.path.unshift(this); + + return deep; + } + + // default exports must be explicitly re-exported (#328) + if (name !== 'default') {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + for (var _iterator2 = this.dependencies[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var dep = _step2.value; + var innerMap = dep(); + if (innerMap == null) {return { found: true, path: [this] };} + // todo: report as unresolved? + if (!innerMap) {continue;} + + // safeguard against cycles + if (innerMap.path === this.path) {continue;} + + var innerValue = innerMap.hasDeep(name); + if (innerValue.found) { + innerValue.path.unshift(this); + return innerValue; + } + }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} + } + + return { found: false, path: [this] }; + }return hasDeep;}() }, { key: 'get', value: function () {function get( + + name) { + if (this.namespace.has(name)) {return this.namespace.get(name);} + + if (this.reexports.has(name)) { + var reexports = this.reexports.get(name); + var imported = reexports.getImport(); + + // if import is ignored, return explicit 'null' + if (imported == null) {return null;} + + // safeguard against cycles, only if name matches + if (imported.path === this.path && reexports.local === name) {return undefined;} + + return imported.get(reexports.local); + } + + // default exports must be explicitly re-exported (#328) + if (name !== 'default') {var _iteratorNormalCompletion3 = true;var _didIteratorError3 = false;var _iteratorError3 = undefined;try { + for (var _iterator3 = this.dependencies[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {var dep = _step3.value; + var innerMap = dep(); + // todo: report as unresolved? + if (!innerMap) {continue;} + + // safeguard against cycles + if (innerMap.path === this.path) {continue;} + + var innerValue = innerMap.get(name); + if (innerValue !== undefined) {return innerValue;} + }} catch (err) {_didIteratorError3 = true;_iteratorError3 = err;} finally {try {if (!_iteratorNormalCompletion3 && _iterator3['return']) {_iterator3['return']();}} finally {if (_didIteratorError3) {throw _iteratorError3;}}} + } + + return undefined; + }return get;}() }, { key: 'forEach', value: function () {function forEach( + + callback, thisArg) {var _this = this; + this.namespace.forEach(function (v, n) {callback.call(thisArg, v, n, _this);}); + + this.reexports.forEach(function (reexports, name) { + var reexported = reexports.getImport(); + // can't look up meta for ignored re-exports (#348) + callback.call(thisArg, reexported && reexported.get(reexports.local), name, _this); + }); + + this.dependencies.forEach(function (dep) { + var d = dep(); + // CJS / ignored dependencies won't exist (#717) + if (d == null) {return;} + + d.forEach(function (v, n) { + if (n !== 'default') { + callback.call(thisArg, v, n, _this); + } + }); + }); + }return forEach;}() + + // todo: keys, values, entries? + }, { key: 'reportErrors', value: function () {function reportErrors( + context, declaration) { + var msg = this.errors. + map(function (e) {return String(e.message) + ' (' + String(e.lineNumber) + ':' + String(e.column) + ')';}). + join(', '); + context.report({ + node: declaration.source, + message: 'Parse errors in imported module \'' + String(declaration.source.value) + '\': ' + String(msg) }); + + }return reportErrors;}() }, { key: 'hasDefault', get: function () {function get() {return this.get('default') != null;}return get;}() // stronger than this.has + }, { key: 'size', get: function () {function get() {var size = this.namespace.size + this.reexports.size;this.dependencies.forEach(function (dep) {var d = dep(); // CJS / ignored dependencies won't exist (#717) + if (d == null) {return;}size += d.size;});return size;}return get;}() }]);return ExportMap;}();exports['default'] = ExportMap; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvaW5kZXguanMiXSwibmFtZXMiOlsiRXhwb3J0TWFwIiwicGF0aCIsIm5hbWVzcGFjZSIsIk1hcCIsInJlZXhwb3J0cyIsImRlcGVuZGVuY2llcyIsIlNldCIsImltcG9ydHMiLCJlcnJvcnMiLCJwYXJzZUdvYWwiLCJuYW1lIiwiaGFzIiwiZGVwIiwiaW5uZXJNYXAiLCJmb3VuZCIsImdldCIsImltcG9ydGVkIiwiZ2V0SW1wb3J0IiwibG9jYWwiLCJkZWVwIiwiaGFzRGVlcCIsInVuc2hpZnQiLCJpbm5lclZhbHVlIiwidW5kZWZpbmVkIiwiY2FsbGJhY2siLCJ0aGlzQXJnIiwiZm9yRWFjaCIsInYiLCJuIiwiY2FsbCIsInJlZXhwb3J0ZWQiLCJkIiwiY29udGV4dCIsImRlY2xhcmF0aW9uIiwibXNnIiwibWFwIiwiZSIsIm1lc3NhZ2UiLCJsaW5lTnVtYmVyIiwiY29sdW1uIiwiam9pbiIsInJlcG9ydCIsIm5vZGUiLCJzb3VyY2UiLCJ2YWx1ZSIsInNpemUiXSwibWFwcGluZ3MiOiJ5d0JBQXFCQSxTO0FBQ25CLHFCQUFZQyxJQUFaLEVBQWtCO0FBQ2hCLFNBQUtBLElBQUwsR0FBWUEsSUFBWjtBQUNBLFNBQUtDLFNBQUwsR0FBaUIsSUFBSUMsR0FBSixFQUFqQjtBQUNBO0FBQ0EsU0FBS0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uICAgICAgaWYgKGQgPT0gbnVsbCkgeyByZXR1cm47IH1cblxuICAgICAgZC5mb3JFYWNoKCh2LCBuKSA9PiB7XG4gICAgICAgIGlmIChuICE9PSAnZGVmYXVsdCcpIHtcbiAgICAgICAgICBjYWxsYmFjay5jYWxsKHRoaXNBcmcsIHYsIG4sIHRoaXMpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxuXG4gIC8vIHRvZG86IGtleXMsIHZhbHVlcywgZW50cmllcz9cblxuICByZXBvcnRFcnJvcnMoY29udGV4dCwgZGVjbGFyYXRpb24pIHtcbiAgICBjb25zdCBtc2cgPSB0aGlzLmVycm9yc1xuICAgICAgLm1hcCgoZSkgPT4gYCR7ZS5tZXNzYWdlfSAoJHtlLmxpbmVOdW1iZXJ9OiR7ZS5jb2x1bW59KWApXG4gICAgICAuam9pbignLCAnKTtcbiAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICBub2RlOiBkZWNsYXJhdGlvbi5zb3VyY2UsXG4gICAgICBtZXNzYWdlOiBgUGFyc2UgZXJyb3JzIGluIGltcG9ydGVkIG1vZHVsZSAnJHtkZWNsYXJhdGlvbi5zb3VyY2UudmFsdWV9JzogJHttc2d9YCxcbiAgICB9KTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/namespace.js b/node_modules/eslint-plugin-import/lib/exportMap/namespace.js new file mode 100644 index 0000000000000000000000000000000000000000..0b07bdd8c1d94dbb972c43b417968c0d0ae6d12d --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/namespace.js @@ -0,0 +1,39 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _childContext = require('./childContext');var _childContext2 = _interopRequireDefault(_childContext); +var _remotePath = require('./remotePath');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var + +Namespace = function () { + function Namespace( + path, + context, + ExportMapBuilder) + {_classCallCheck(this, Namespace); + this.remotePathResolver = new _remotePath.RemotePath(path, context); + this.context = context; + this.ExportMapBuilder = ExportMapBuilder; + this.namespaces = new Map(); + }_createClass(Namespace, [{ key: 'resolveImport', value: function () {function resolveImport( + + value) { + var rp = this.remotePathResolver.resolve(value); + if (rp == null) {return null;} + return this.ExportMapBuilder['for']((0, _childContext2['default'])(rp, this.context)); + }return resolveImport;}() }, { key: 'getNamespace', value: function () {function getNamespace( + + identifier) {var _this = this; + if (!this.namespaces.has(identifier.name)) {return;} + return function () {return _this.resolveImport(_this.namespaces.get(identifier.name));}; + }return getNamespace;}() }, { key: 'add', value: function () {function add( + + object, identifier) { + var nsfn = this.getNamespace(identifier); + if (nsfn) { + Object.defineProperty(object, 'namespace', { get: nsfn }); + } + + return object; + }return add;}() }, { key: 'rawSet', value: function () {function rawSet( + + name, value) { + this.namespaces.set(name, value); + }return rawSet;}() }]);return Namespace;}();exports['default'] = Namespace; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvbmFtZXNwYWNlLmpzIl0sIm5hbWVzIjpbIk5hbWVzcGFjZSIsInBhdGgiLCJjb250ZXh0IiwiRXhwb3J0TWFwQnVpbGRlciIsInJlbW90ZVBhdGhSZXNvbHZlciIsIlJlbW90ZVBhdGgiLCJuYW1lc3BhY2VzIiwiTWFwIiwidmFsdWUiLCJycCIsInJlc29sdmUiLCJpZGVudGlmaWVyIiw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Ghpcy5FeHBvcnRNYXBCdWlsZGVyLmZvcihjaGlsZENvbnRleHQocnAsIHRoaXMuY29udGV4dCkpO1xuICB9XG5cbiAgZ2V0TmFtZXNwYWNlKGlkZW50aWZpZXIpIHtcbiAgICBpZiAoIXRoaXMubmFtZXNwYWNlcy5oYXMoaWRlbnRpZmllci5uYW1lKSkgeyByZXR1cm47IH1cbiAgICByZXR1cm4gKCkgPT4gdGhpcy5yZXNvbHZlSW1wb3J0KHRoaXMubmFtZXNwYWNlcy5nZXQoaWRlbnRpZmllci5uYW1lKSk7XG4gIH1cblxuICBhZGQob2JqZWN0LCBpZGVudGlmaWVyKSB7XG4gICAgY29uc3QgbnNmbiA9IHRoaXMuZ2V0TmFtZXNwYWNlKGlkZW50aWZpZXIpO1xuICAgIGlmIChuc2ZuKSB7XG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqZWN0LCAnbmFtZXNwYWNlJywgeyBnZXQ6IG5zZm4gfSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG9iamVjdDtcbiAgfVxuXG4gIHJhd1NldChuYW1lLCB2YWx1ZSkge1xuICAgIHRoaXMubmFtZXNwYWNlcy5zZXQobmFtZSwgdmFsdWUpO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/patternCapture.js b/node_modules/eslint-plugin-import/lib/exportMap/patternCapture.js new file mode 100644 index 0000000000000000000000000000000000000000..de0888a884190c5d6395523c62e246246794415d --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/patternCapture.js @@ -0,0 +1,41 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] = + + + + + + +recursivePatternCapture; /** + * Traverse a pattern/identifier node, calling 'callback' + * for each leaf identifier. + * @param {node} pattern + * @param {Function} callback + * @return {void} + */function recursivePatternCapture(pattern, callback) {switch (pattern.type) {case 'Identifier': // base case + callback(pattern);break;case 'ObjectPattern':pattern.properties.forEach(function (p) { + if (p.type === 'ExperimentalRestProperty' || p.type === 'RestElement') { + callback(p.argument); + return; + } + recursivePatternCapture(p.value, callback); + }); + break; + + case 'ArrayPattern': + pattern.elements.forEach(function (element) { + if (element == null) {return;} + if (element.type === 'ExperimentalRestProperty' || element.type === 'RestElement') { + callback(element.argument); + return; + } + recursivePatternCapture(element, callback); + }); + break; + + case 'AssignmentPattern': + callback(pattern.left); + break; + default:} + +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvcGF0dGVybkNhcHR1cmUuanMiXSwibmFtZXMiOlsicmVjdXJzaXZlUGF0dGVybkNhcHR1cmUiLCJwYXR0ZXJuIiwiY2FsbGJhY2siLCJ0eXBlIiwicHJvcGVydGllcyIsImZvckVhY2giLCJwIiwiYXJndW1lbnQiLCJ2YWx1ZSIsImVsZW1lbnRzIiwiZWxlbWVudCIsImxlZnQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFPd0JBLHVCLEVBUHhCOzs7Ozs7NEJBT2UsU0FBU0EsdUJBQVQsQ0FBaUNDLE9BQWpDLEVBQTBDQyxRQUExQyxFQUFvRCxDQUNqRSxRQUFRRCxRQUFRRSxJQUFoQixHQUNFLEtBQUssWUFBTCxFQUFtQjtBQUNqQkQsZUFBU0QsT0FBVCxFQUNBLE1BRUYsS0FBSyxlQUFMLENBQ0VBLFFBQVFHLFVBQVIsQ0FBbUJDLE9BQW5CLENBQTJCLFVBQUNDLENBQUQsRUFBTztBQUNoQyxZQUFJQSxFQUFFSCxJQUFGLEtBQVcsMEJBQVgsSUFBeUNHLEVBQUVILElBQUYsS0FBVyxhQUF4RCxFQUF1RTtBQUNyRUQsbUJBQVNJLEVBQUVDLFFBQVg7QUFDQTtBQUNEO0FBQ0RQLGdDQUF3Qk0sRUFBRUUsS0FBMUIsRUFBaUNOLFFBQWpDO0FBQ0QsT0FORDtBQU9BOztBQUVGLFNBQUssY0FB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J0V4cGVyaW1lbnRhbFJlc3RQcm9wZXJ0eScgfHwgcC50eXBlID09PSAnUmVzdEVsZW1lbnQnKSB7XG4gICAgICAgICAgY2FsbGJhY2socC5hcmd1bWVudCk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHJlY3Vyc2l2ZVBhdHRlcm5DYXB0dXJlKHAudmFsdWUsIGNhbGxiYWNrKTtcbiAgICAgIH0pO1xuICAgICAgYnJlYWs7XG5cbiAgICBjYXNlICdBcnJheVBhdHRlcm4nOlxuICAgICAgcGF0dGVybi5lbGVtZW50cy5mb3JFYWNoKChlbGVtZW50KSA9PiB7XG4gICAgICAgIGlmIChlbGVtZW50ID09IG51bGwpIHsgcmV0dXJuOyB9XG4gICAgICAgIGlmIChlbGVtZW50LnR5cGUgPT09ICdFeHBlcmltZW50YWxSZXN0UHJvcGVydHknIHx8IGVsZW1lbnQudHlwZSA9PT0gJ1Jlc3RFbGVtZW50Jykge1xuICAgICAgICAgIGNhbGxiYWNrKGVsZW1lbnQuYXJndW1lbnQpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICByZWN1cnNpdmVQYXR0ZXJuQ2FwdHVyZShlbGVtZW50LCBjYWxsYmFjayk7XG4gICAgICB9KTtcbiAgICAgIGJyZWFrO1xuXG4gICAgY2FzZSAnQXNzaWdubWVudFBhdHRlcm4nOlxuICAgICAgY2FsbGJhY2socGF0dGVybi5sZWZ0KTtcbiAgICAgIGJyZWFrO1xuICAgIGRlZmF1bHQ6XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/remotePath.js b/node_modules/eslint-plugin-import/lib/exportMap/remotePath.js new file mode 100644 index 0000000000000000000000000000000000000000..c9906d3cf478d359a7daeda36258244e8d340b28 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/remotePath.js @@ -0,0 +1,12 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.RemotePath = undefined;var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _resolve2 = require('eslint-module-utils/resolve');var _resolve3 = _interopRequireDefault(_resolve2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var + +RemotePath = exports.RemotePath = function () { + function RemotePath(path, context) {_classCallCheck(this, RemotePath); + this.path = path; + this.context = context; + }_createClass(RemotePath, [{ key: 'resolve', value: function () {function resolve( + + value) { + return _resolve3['default'].relative(value, this.path, this.context.settings); + }return resolve;}() }]);return RemotePath;}(); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvcmVtb3RlUGF0aC5qcyJdLCJuYW1lcyI6WyJSZW1vdGVQYXRoIiwicGF0aCIsImNvbnRleHQiLCJ2YWx1ZSIsInJlc29sdmUiLCJyZWxhdGl2ZSIsInNldHRpbmdzIl0sIm1hcHBpbmdzIjoiK29CQUFBLHVEOztBQUVhQSxVLFdBQUFBLFU7QUFDWCxzQkFBWUMsSUFBWixFQUFrQkMsT0FBbEIsRUFBMkI7QUFDekIsU0FBS0QsSUFBTCxHQUFZQSxJQUFaO0FBQ0EsU0FBS0MsT0FBTCxHQUFlQSxPQUFmO0FBQ0QsRzs7QUFFT0MsVyxFQUFPO0FBQ2IsZUFBT0MscUJBQVFDLFFBQVIsQ0FBaUJGLEtBQWpCLEVBQXdCLEtBQUtGLElBQTdCLEVBQW1DLEtBQUtDLE9BQUwsQ0FBYUksUUFBaEQsQ0FBUDtBQUNELE8iLCJmaWxlIjoicmVtb3RlUGF0aC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCByZXNvbHZlIGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvcmVzb2x2ZSc7XG5cbmV4cG9ydCBjbGFzcyBSZW1vdGVQYXRoIHtcbiAgY29uc3RydWN0b3IocGF0aCwgY29udGV4dCkge1xuICAgIHRoaXMucGF0aCA9IHBhdGg7XG4gICAgdGhpcy5jb250ZXh0ID0gY29udGV4dDtcbiAgfVxuXG4gIHJlc29sdmUodmFsdWUpIHtcbiAgICByZXR1cm4gcmVzb2x2ZS5yZWxhdGl2ZSh2YWx1ZSwgdGhpcy5wYXRoLCB0aGlzLmNvbnRleHQuc2V0dGluZ3MpO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/specifier.js b/node_modules/eslint-plugin-import/lib/exportMap/specifier.js new file mode 100644 index 0000000000000000000000000000000000000000..7670c0cde2d3af146deafea2aed2fba0ed84ede4 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/specifier.js @@ -0,0 +1,33 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] = processSpecifier;function processSpecifier(specifier, astNode, exportMap, namespace) { + var nsource = astNode.source && astNode.source.value; + var exportMeta = {}; + var local = void 0; + + switch (specifier.type) { + case 'ExportDefaultSpecifier': + if (!nsource) {return;} + local = 'default'; + break; + case 'ExportNamespaceSpecifier': + exportMap.namespace.set(specifier.exported.name, Object.defineProperty(exportMeta, 'namespace', { + get: function () {function get() {return namespace.resolveImport(nsource);}return get;}() })); + + return; + case 'ExportAllDeclaration': + exportMap.namespace.set(specifier.exported.name || specifier.exported.value, namespace.add(exportMeta, specifier.source.value)); + return; + case 'ExportSpecifier': + if (!astNode.source) { + exportMap.namespace.set(specifier.exported.name || specifier.exported.value, namespace.add(exportMeta, specifier.local)); + return; + } + // else falls through + default: + local = specifier.local.name; + break;} + + + // todo: JSDoc + exportMap.reexports.set(specifier.exported.name, { local: local, getImport: function () {function getImport() {return namespace.resolveImport(nsource);}return getImport;}() }); +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvc3BlY2lmaWVyLmpzIl0sIm5hbWVzIjpbInByb2Nlc3NTcGVjaWZpZXIiLCJzcGVjaWZpZXIiLCJhc3ROb2RlIiwiZXhwb3J0TWFwIiwibmFtZXNwYWNlIiwibnNvdXJjZSIsInNvdXJjZSIsInZhbHVlIiwiZXhwb3J0TWV0YSIsImxvY2FsIiwidHlwZSIsInNldCIsImV4cG9ydGVkIiwibmFtZSIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZ2V0IiwicmVzb2x2ZUltcG9ydCIsImFkZCIsInJlZXhwb3J0cyIsImdldEltcG9ydCJdLCJtYXBwaW5ncyI6ImdHQUF3QkEsZ0IsQ0FBVCxTQUFTQSxnQkFBVCxDQUEwQkMsU0FBMUIsRUFBcUNDLE9BQXJDLEVBQThDQyxTQUE5QyxFQUF5REMsU0FBekQsRUFBb0U7QUFDakYsTUFBTUMsVUFBVUgsUUFBUUksTUFBUixJQUFrQkosUUFBUUksTUFBUixDQUFlQyxLQUFqRDtBQUNBLE1BQU1DLGFBQWEsRUFBbkI7QUFDQSxNQUFJQyxjQUFKOztBQUVBLFVBQVFSLFVBQVVTLElBQWxCO0FBQ0UsU0FBSyx3QkFBTDtBQUNFLFVBQUksQ0FBQ0wsT0FBTCxFQUFjLENBQUUsT0FBUztBQUN6QkksY0FBUSxTQUFSO0FBQ0E7QUFDRixTQUFLLDBCQUFMO0FBQ0VOLGdCQUFVQyxTQUFWLENBQW9CTyxHQUFwQixDQUF3QlYsVUFBVVcsUUFBVixDQUFtQkMsSUFBM0MsRUFBaURDLE9BQU9DLGNBQVAsQ0FBc0JQLFVBQXRCLEVBQWtD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tZSB8fCBzcGVjaWZpZXIuZXhwb3J0ZWQudmFsdWUsIG5hbWVzcGFjZS5hZGQoZXhwb3J0TWV0YSwgc3BlY2lmaWVyLmxvY2FsKSk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAvLyBlbHNlIGZhbGxzIHRocm91Z2hcbiAgICBkZWZhdWx0OlxuICAgICAgbG9jYWwgPSBzcGVjaWZpZXIubG9jYWwubmFtZTtcbiAgICAgIGJyZWFrO1xuICB9XG5cbiAgLy8gdG9kbzogSlNEb2NcbiAgZXhwb3J0TWFwLnJlZXhwb3J0cy5zZXQoc3BlY2lmaWVyLmV4cG9ydGVkLm5hbWUsIHsgbG9jYWwsIGdldEltcG9ydDogKCkgPT4gbmFtZXNwYWNlLnJlc29sdmVJbXBvcnQobnNvdXJjZSkgfSk7XG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/typescript.js b/node_modules/eslint-plugin-import/lib/exportMap/typescript.js new file mode 100644 index 0000000000000000000000000000000000000000..5aad0ce08b103e99d335bdb397fa7b167f0cf97c --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/typescript.js @@ -0,0 +1,44 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +isEsModuleInterop = isEsModuleInterop;var _path = require('path');var _tsconfigLoader = require('tsconfig-paths/lib/tsconfig-loader');var _hash = require('eslint-module-utils/hash');var ts = void 0;var tsconfigCache = new Map();function readTsConfig(context) {var tsconfigInfo = (0, _tsconfigLoader.tsConfigLoader)({ cwd: context.parserOptions && context.parserOptions.tsconfigRootDir || process.cwd(), getEnv: function () {function getEnv(key) {return process.env[key];}return getEnv;}() });try {if (tsconfigInfo.tsConfigPath !== undefined) {// Projects not using TypeScript won't have `typescript` installed. + if (!ts) {ts = require('typescript');} // eslint-disable-line import/no-extraneous-dependencies + var configFile = ts.readConfigFile(tsconfigInfo.tsConfigPath, ts.sys.readFile);return ts.parseJsonConfigFileContent(configFile.config, ts.sys, (0, _path.dirname)(tsconfigInfo.tsConfigPath));}} catch (e) {// Catch any errors + }return null;}function isEsModuleInterop(context) {var cacheKey = (0, _hash.hashObject)({ tsconfigRootDir: context.parserOptions && context.parserOptions.tsconfigRootDir }).digest('hex'); + var tsConfig = tsconfigCache.get(cacheKey); + if (typeof tsConfig === 'undefined') { + tsConfig = readTsConfig(context); + tsconfigCache.set(cacheKey, tsConfig); + } + + return tsConfig && tsConfig.options ? tsConfig.options.esModuleInterop : false; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvdHlwZXNjcmlwdC5qcyJdLCJuYW1lcyI6WyJpc0VzTW9kdWxlSW50ZXJvcCIsInRzIiwidHNjb25maWdDYWNoZSIsIk1hcCIsInJlYWRUc0NvbmZpZyIsImNvbnRleHQiLCJ0c2NvbmZpZ0luZm8iLCJjd2QiLCJwYXJzZXJPcHRpb25zIiwidHNjb25maWdSb290RGlyIiwicHJvY2VzcyIsImdldEVudiIsImtleSIsImVudiIsInRzQ29uZmlnUGF0aCIsInVuZGVmaW5lZCIsInJlcXVpcmUiLCJjb25maWdGaWxlIiwicmVhZENvbmZpZ0ZpbGUiLCJzeXMiLCJyZWFkRmlsZSIsInBhcnNlSnNvbkNvbmZpZ0ZpbGVDb250ZW50IiwiY29uZmlnIiwiZSIsImNhY2hlS2V5IiwiZGlnZXN0IiwidHNDb25maWciLCJnZXQiLCJzZXQiLCJvcHRpb25zIiwiZXNNb2R1bGVJbnRlcm9wIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBK0JnQkEsaUIsR0FBQUEsaUIsQ0EvQmhCLDRCQUNBLG9FQUNBLGdEQUVBLElBQUlDLFdBQUosQ0FDQSxJQUFNQyxnQkFBZ0IsSUFBSUMs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0c0NvbmZpZy5vcHRpb25zLmVzTW9kdWxlSW50ZXJvcCA6IGZhbHNlO1xufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/exportMap/visitor.js b/node_modules/eslint-plugin-import/lib/exportMap/visitor.js new file mode 100644 index 0000000000000000000000000000000000000000..38f51889f1a05b8bf14d46e95220ab15f77e6797 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/exportMap/visitor.js @@ -0,0 +1,171 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes); +var _eslint = require('eslint'); +var _doc = require('./doc'); +var _namespace = require('./namespace');var _namespace2 = _interopRequireDefault(_namespace); +var _specifier = require('./specifier');var _specifier2 = _interopRequireDefault(_specifier); +var _captureDependency = require('./captureDependency'); +var _patternCapture = require('./patternCapture');var _patternCapture2 = _interopRequireDefault(_patternCapture); +var _remotePath = require('./remotePath');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}} + +/** + * sometimes legacy support isn't _that_ hard... right? + */ +function makeSourceCode(text, ast) { + if (_eslint.SourceCode.length > 1) { + // ESLint 3 + return new _eslint.SourceCode(text, ast); + } else { + // ESLint 4, 5 + return new _eslint.SourceCode({ text: text, ast: ast }); + } +}var + +ImportExportVisitorBuilder = function () { + function ImportExportVisitorBuilder( + path, + context, + exportMap, + ExportMapBuilder, + content, + ast, + isEsModuleInteropTrue, + thunkFor) + {var _this = this;_classCallCheck(this, ImportExportVisitorBuilder); + this.context = context; + this.namespace = new _namespace2['default'](path, context, ExportMapBuilder); + this.remotePathResolver = new _remotePath.RemotePath(path, context); + this.source = makeSourceCode(content, ast); + this.exportMap = exportMap; + this.ast = ast; + this.isEsModuleInteropTrue = isEsModuleInteropTrue; + this.thunkFor = thunkFor; + var docstyle = this.context.settings && this.context.settings['import/docstyle'] || ['jsdoc']; + this.docStyleParsers = {}; + docstyle.forEach(function (style) { + _this.docStyleParsers[style] = _doc.availableDocStyleParsers[style]; + }); + }_createClass(ImportExportVisitorBuilder, [{ key: 'build', value: function () {function build( + + astNode) {var _this3 = this; + return Object.assign({ + ExportDefaultDeclaration: function () {function ExportDefaultDeclaration() { + var exportMeta = (0, _doc.captureDoc)(this.source, this.docStyleParsers, astNode); + if (astNode.declaration.type === 'Identifier') { + this.namespace.add(exportMeta, astNode.declaration); + } + this.exportMap.namespace.set('default', exportMeta); + }return ExportDefaultDeclaration;}(), + ExportAllDeclaration: function () {function ExportAllDeclaration() { + var getter = (0, _captureDependency.captureDependency)(astNode, astNode.exportKind === 'type', this.remotePathResolver, this.exportMap, this.context, this.thunkFor); + if (getter) {this.exportMap.dependencies.add(getter);} + if (astNode.exported) { + (0, _specifier2['default'])(astNode, astNode.exported, this.exportMap, this.namespace); + } + }return ExportAllDeclaration;}(), + /** capture namespaces in case of later export */ + ImportDeclaration: function () {function ImportDeclaration() { + (0, _captureDependency.captureDependencyWithSpecifiers)(astNode, this.remotePathResolver, this.exportMap, this.context, this.thunkFor); + var ns = astNode.specifiers.find(function (s) {return s.type === 'ImportNamespaceSpecifier';}); + if (ns) { + this.namespace.rawSet(ns.local.name, astNode.source.value); + } + }return ImportDeclaration;}(), + ExportNamedDeclaration: function () {function ExportNamedDeclaration() {var _this2 = this; + (0, _captureDependency.captureDependencyWithSpecifiers)(astNode, this.remotePathResolver, this.exportMap, this.context, this.thunkFor); + // capture declaration + if (astNode.declaration != null) { + switch (astNode.declaration.type) { + case 'FunctionDeclaration': + case 'ClassDeclaration': + case 'TypeAlias': // flowtype with babel-eslint parser + case 'InterfaceDeclaration': + case 'DeclareFunction': + case 'TSDeclareFunction': + case 'TSEnumDeclaration': + case 'TSTypeAliasDeclaration': + case 'TSInterfaceDeclaration': + case 'TSAbstractClassDeclaration': + case 'TSModuleDeclaration': + this.exportMap.namespace.set(astNode.declaration.id.name, (0, _doc.captureDoc)(this.source, this.docStyleParsers, astNode)); + break; + case 'VariableDeclaration': + astNode.declaration.declarations.forEach(function (d) { + (0, _patternCapture2['default'])( + d.id, + function (id) {return _this2.exportMap.namespace.set(id.name, (0, _doc.captureDoc)(_this2.source, _this2.docStyleParsers, d, astNode));}); + + }); + break; + default:} + + } + astNode.specifiers.forEach(function (s) {return (0, _specifier2['default'])(s, astNode, _this2.exportMap, _this2.namespace);}); + }return ExportNamedDeclaration;}(), + TSExportAssignment: function () {function TSExportAssignment() {return _this3.typeScriptExport(astNode);}return TSExportAssignment;}() }, + this.isEsModuleInteropTrue && { TSNamespaceExportDeclaration: function () {function TSNamespaceExportDeclaration() {return _this3.typeScriptExport(astNode);}return TSNamespaceExportDeclaration;}() }); + + }return build;}() + + // This doesn't declare anything, but changes what's being exported. + }, { key: 'typeScriptExport', value: function () {function typeScriptExport(astNode) {var _this4 = this; + var exportedName = astNode.type === 'TSNamespaceExportDeclaration' ? + (astNode.id || astNode.name).name : + astNode.expression && astNode.expression.name || astNode.expression.id && astNode.expression.id.name || null; + var declTypes = [ + 'VariableDeclaration', + 'ClassDeclaration', + 'TSDeclareFunction', + 'TSEnumDeclaration', + 'TSTypeAliasDeclaration', + 'TSInterfaceDeclaration', + 'TSAbstractClassDeclaration', + 'TSModuleDeclaration']; + + var exportedDecls = this.ast.body.filter(function (_ref) {var type = _ref.type,id = _ref.id,declarations = _ref.declarations;return (0, _arrayIncludes2['default'])(declTypes, type) && ( + id && id.name === exportedName || declarations && declarations.find(function (d) {return d.id.name === exportedName;}));}); + + if (exportedDecls.length === 0) { + // Export is not referencing any local declaration, must be re-exporting + this.exportMap.namespace.set('default', (0, _doc.captureDoc)(this.source, this.docStyleParsers, astNode)); + return; + } + if ( + this.isEsModuleInteropTrue // esModuleInterop is on in tsconfig + && !this.exportMap.namespace.has('default') // and default isn't added already + ) { + this.exportMap.namespace.set('default', {}); // add default export + } + exportedDecls.forEach(function (decl) { + if (decl.type === 'TSModuleDeclaration') { + if (decl.body && decl.body.type === 'TSModuleDeclaration') { + _this4.exportMap.namespace.set(decl.body.id.name, (0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, decl.body)); + } else if (decl.body && decl.body.body) { + decl.body.body.forEach(function (moduleBlockNode) { + // Export-assignment exports all members in the namespace, + // explicitly exported or not. + var namespaceDecl = moduleBlockNode.type === 'ExportNamedDeclaration' ? + moduleBlockNode.declaration : + moduleBlockNode; + + if (!namespaceDecl) { + // TypeScript can check this for us; we needn't + } else if (namespaceDecl.type === 'VariableDeclaration') { + namespaceDecl.declarations.forEach(function (d) {return (0, _patternCapture2['default'])(d.id, function (id) {return _this4.exportMap.namespace.set( + id.name, + (0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, decl, namespaceDecl, moduleBlockNode));});}); + + + } else { + _this4.exportMap.namespace.set( + namespaceDecl.id.name, + (0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, moduleBlockNode)); + } + }); + } + } else { + // Export as default + _this4.exportMap.namespace.set('default', (0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, decl)); + } + }); + }return typeScriptExport;}() }]);return ImportExportVisitorBuilder;}();exports['default'] = ImportExportVisitorBuilder; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvdmlzaXRvci5qcyJdLCJuYW1lcyI6WyJtYWtlU291cmNlQ29kZSIsInRleHQiLCJhc3QiLCJTb3VyY2VDb2RlIiwibGVuZ3RoIiwiSW1wb3J0RXhw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25zLmZvckVhY2goKGQpID0+IHJlY3Vyc2l2ZVBhdHRlcm5DYXB0dXJlKGQuaWQsIChpZCkgPT4gdGhpcy5leHBvcnRNYXAubmFtZXNwYWNlLnNldChcbiAgICAgICAgICAgICAgICBpZC5uYW1lLFxuICAgICAgICAgICAgICAgIGNhcHR1cmVEb2ModGhpcy5zb3VyY2UsIHRoaXMuZG9jU3R5bGVQYXJzZXJzLCBkZWNsLCBuYW1lc3BhY2VEZWNsLCBtb2R1bGVCbG9ja05vZGUpLFxuICAgICAgICAgICAgICApKSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuZXhwb3J0TWFwLm5hbWVzcGFjZS5zZXQoXG4gICAgICAgICAgICAgICAgbmFtZXNwYWNlRGVjbC5pZC5uYW1lLFxuICAgICAgICAgICAgICAgIGNhcHR1cmVEb2ModGhpcy5zb3VyY2UsIHRoaXMuZG9jU3R5bGVQYXJzZXJzLCBtb2R1bGVCbG9ja05vZGUpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gRXhwb3J0IGFzIGRlZmF1bHRcbiAgICAgICAgdGhpcy5leHBvcnRNYXAubmFtZXNwYWNlLnNldCgnZGVmYXVsdCcsIGNhcHR1cmVEb2ModGhpcy5zb3VyY2UsIHRoaXMuZG9jU3R5bGVQYXJzZXJzLCBkZWNsKSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/importDeclaration.js b/node_modules/eslint-plugin-import/lib/importDeclaration.js new file mode 100644 index 0000000000000000000000000000000000000000..8afc58f96ae6e3edbbc25c562634c52d22faae46 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/importDeclaration.js @@ -0,0 +1,7 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] = + +importDeclaration;var _contextCompat = require('eslint-module-utils/contextCompat');function importDeclaration(context, node) { + var ancestors = (0, _contextCompat.getAncestors)(context, node); + return ancestors[ancestors.length - 1]; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbXBvcnREZWNsYXJhdGlvbi5qcyJdLCJuYW1lcyI6WyJpbXBvcnREZWNsYXJhdGlvbiIsImNvbnRleHQiLCJub2RlIiwiYW5jZXN0b3JzIiwibGVuZ3RoIl0sIm1hcHBpbmdzIjoiOztBQUV3QkEsaUIsQ0FGeEIsa0VBRWUsU0FBU0EsaUJBQVQsQ0FBMkJDLE9BQTNCLEVBQW9DQyxJQUFwQyxFQUEwQztBQUN2RCxNQUFNQyxZQUFZLGlDQUFhRixPQUFiLEVBQXNCQyxJQUF0QixDQUFsQjtBQUNBLFNBQU9DLFVBQVVBLFVBQVVDLE1BQVYsR0FBbUIsQ0FBN0IsQ0FBUDtBQUNEIiwiZmlsZSI6ImltcG9ydERlY2xhcmF0aW9uLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZ2V0QW5jZXN0b3JzIH0gZnJvbSAnZXNsaW50LW1vZHVsZS11dGlscy9jb250ZXh0Q29tcGF0JztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gaW1wb3J0RGVjbGFyYXRpb24oY29udGV4dCwgbm9kZSkge1xuICBjb25zdCBhbmNlc3RvcnMgPSBnZXRBbmNlc3RvcnMoY29udGV4dCwgbm9kZSk7XG4gIHJldHVybiBhbmNlc3RvcnNbYW5jZXN0b3JzLmxlbmd0aCAtIDFdO1xufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/index.js b/node_modules/eslint-plugin-import/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..74d22a4f26f811be79a37d002276480cc97b37c8 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/index.js @@ -0,0 +1,103 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.flatConfigs = exports.configs = exports.rules = undefined;var _package = require('../package.json'); + +var rules = exports.rules = { + 'no-unresolved': require('./rules/no-unresolved'), + named: require('./rules/named'), + 'default': require('./rules/default'), + namespace: require('./rules/namespace'), + 'no-namespace': require('./rules/no-namespace'), + 'export': require('./rules/export'), + 'no-mutable-exports': require('./rules/no-mutable-exports'), + extensions: require('./rules/extensions'), + 'no-restricted-paths': require('./rules/no-restricted-paths'), + 'no-internal-modules': require('./rules/no-internal-modules'), + 'group-exports': require('./rules/group-exports'), + 'no-relative-packages': require('./rules/no-relative-packages'), + 'no-relative-parent-imports': require('./rules/no-relative-parent-imports'), + 'consistent-type-specifier-style': require('./rules/consistent-type-specifier-style'), + + 'no-self-import': require('./rules/no-self-import'), + 'no-cycle': require('./rules/no-cycle'), + 'no-named-default': require('./rules/no-named-default'), + 'no-named-as-default': require('./rules/no-named-as-default'), + 'no-named-as-default-member': require('./rules/no-named-as-default-member'), + 'no-anonymous-default-export': require('./rules/no-anonymous-default-export'), + 'no-unused-modules': require('./rules/no-unused-modules'), + + 'no-commonjs': require('./rules/no-commonjs'), + 'no-amd': require('./rules/no-amd'), + 'no-duplicates': require('./rules/no-duplicates'), + first: require('./rules/first'), + 'max-dependencies': require('./rules/max-dependencies'), + 'no-extraneous-dependencies': require('./rules/no-extraneous-dependencies'), + 'no-absolute-path': require('./rules/no-absolute-path'), + 'no-nodejs-modules': require('./rules/no-nodejs-modules'), + 'no-webpack-loader-syntax': require('./rules/no-webpack-loader-syntax'), + order: require('./rules/order'), + 'newline-after-import': require('./rules/newline-after-import'), + 'prefer-default-export': require('./rules/prefer-default-export'), + 'no-default-export': require('./rules/no-default-export'), + 'no-named-export': require('./rules/no-named-export'), + 'no-dynamic-require': require('./rules/no-dynamic-require'), + unambiguous: require('./rules/unambiguous'), + 'no-unassigned-import': require('./rules/no-unassigned-import'), + 'no-useless-path-segments': require('./rules/no-useless-path-segments'), + 'dynamic-import-chunkname': require('./rules/dynamic-import-chunkname'), + 'no-import-module-exports': require('./rules/no-import-module-exports'), + 'no-empty-named-blocks': require('./rules/no-empty-named-blocks'), + 'enforce-node-protocol-usage': require('./rules/enforce-node-protocol-usage'), + + // export + 'exports-last': require('./rules/exports-last'), + + // metadata-based + 'no-deprecated': require('./rules/no-deprecated'), + + // deprecated aliases to rules + 'imports-first': require('./rules/imports-first') }; + + +var configs = exports.configs = { + recommended: require('../config/recommended'), + + errors: require('../config/errors'), + warnings: require('../config/warnings'), + + // shhhh... work in progress "secret" rules + 'stage-0': require('../config/stage-0'), + + // useful stuff for folks using various environments + react: require('../config/react'), + 'react-native': require('../config/react-native'), + electron: require('../config/electron'), + typescript: require('../config/typescript') }; + + +// Base Plugin Object +var importPlugin = { + meta: { name: _package.name, version: _package.version }, + rules: rules }; + + +// Create flat configs (Only ones that declare plugins and parser options need to be different from the legacy config) +var createFlatConfig = function createFlatConfig(baseConfig, configName) {return Object.assign({}, + baseConfig, { + name: 'import/' + String(configName), + plugins: { 'import': importPlugin } });}; + + +var flatConfigs = exports.flatConfigs = { + recommended: createFlatConfig( + require('../config/flat/recommended'), + 'recommended'), + + + errors: createFlatConfig(require('../config/flat/errors'), 'errors'), + warnings: createFlatConfig(require('../config/flat/warnings'), 'warnings'), + + // useful stuff for folks using various environments + react: createFlatConfig(require('../config/flat/react'), 'react'), + 'react-native': createFlatConfig(configs['react-native'], 'react-native'), + electron: createFlatConfig(configs.electron, 'electron'), + typescript: createFlatConfig(configs.typescript, 'typescript') }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJydWxlcyIsInJlcXVpcmUiLCJuYW1lZCIsIm5hbWVzcGFjZSIsImV4dGVuc2lvbnMiLCJmaXJzdCIsIm9yZGVyIiwidW5hbWJpZ3VvdXMiLCJjb25maWdzIiwicmVjb21tZW5kZWQ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M6IHsgaW1wb3J0OiBpbXBvcnRQbHVnaW4gfSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZmxhdENvbmZpZ3MgPSB7XG4gIHJlY29tbWVuZGVkOiBjcmVhdGVGbGF0Q29uZmlnKFxuICAgIHJlcXVpcmUoJy4uL2NvbmZpZy9mbGF0L3JlY29tbWVuZGVkJyksXG4gICAgJ3JlY29tbWVuZGVkJyxcbiAgKSxcblxuICBlcnJvcnM6IGNyZWF0ZUZsYXRDb25maWcocmVxdWlyZSgnLi4vY29uZmlnL2ZsYXQvZXJyb3JzJyksICdlcnJvcnMnKSxcbiAgd2FybmluZ3M6IGNyZWF0ZUZsYXRDb25maWcocmVxdWlyZSgnLi4vY29uZmlnL2ZsYXQvd2FybmluZ3MnKSwgJ3dhcm5pbmdzJyksXG5cbiAgLy8gdXNlZnVsIHN0dWZmIGZvciBmb2xrcyB1c2luZyB2YXJpb3VzIGVudmlyb25tZW50c1xuICByZWFjdDogY3JlYXRlRmxhdENvbmZpZyhyZXF1aXJlKCcuLi9jb25maWcvZmxhdC9yZWFjdCcpLCAncmVhY3QnKSxcbiAgJ3JlYWN0LW5hdGl2ZSc6IGNyZWF0ZUZsYXRDb25maWcoY29uZmlnc1sncmVhY3QtbmF0aXZlJ10sICdyZWFjdC1uYXRpdmUnKSxcbiAgZWxlY3Ryb246IGNyZWF0ZUZsYXRDb25maWcoY29uZmlncy5lbGVjdHJvbiwgJ2VsZWN0cm9uJyksXG4gIHR5cGVzY3JpcHQ6IGNyZWF0ZUZsYXRDb25maWcoY29uZmlncy50eXBlc2NyaXB0LCAndHlwZXNjcmlwdCcpLFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/consistent-type-specifier-style.js b/node_modules/eslint-plugin-import/lib/rules/consistent-type-specifier-style.js new file mode 100644 index 0000000000000000000000000000000000000000..13ebee958509052192a487a9e68b5623934f7e68 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/consistent-type-specifier-style.js @@ -0,0 +1,238 @@ +'use strict';var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function isComma(token) { + return token.type === 'Punctuator' && token.value === ','; +} + +/** + * @param {import('eslint').Rule.Fix[]} fixes + * @param {import('eslint').Rule.RuleFixer} fixer + * @param {import('eslint').SourceCode.SourceCode} sourceCode + * @param {(ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[]} specifiers + * */ +function removeSpecifiers(fixes, fixer, sourceCode, specifiers) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = specifiers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var specifier = _step.value; + // remove the trailing comma + var token = sourceCode.getTokenAfter(specifier); + if (token && isComma(token)) { + fixes.push(fixer.remove(token)); + } + fixes.push(fixer.remove(specifier)); + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} +} + +/** @type {(node: import('estree').Node, sourceCode: import('eslint').SourceCode.SourceCode, specifiers: (ImportSpecifier | ImportNamespaceSpecifier)[], kind: 'type' | 'typeof') => string} */ +function getImportText( +node, +sourceCode, +specifiers, +kind) +{ + var sourceString = sourceCode.getText(node.source); + if (specifiers.length === 0) { + return ''; + } + + var names = specifiers.map(function (s) { + if (s.imported.name === s.local.name) { + return s.imported.name; + } + return String(s.imported.name) + ' as ' + String(s.local.name); + }); + // insert a fresh top-level import + return 'import ' + String(kind) + ' {' + String(names.join(', ')) + '} from ' + String(sourceString) + ';'; +} + +/** @type {import('eslint').Rule.RuleModule} */ +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Enforce or ban the use of inline type-only markers for named imports.', + url: (0, _docsUrl2['default'])('consistent-type-specifier-style') }, + + fixable: 'code', + schema: [ + { + type: 'string', + 'enum': ['prefer-inline', 'prefer-top-level'], + 'default': 'prefer-inline' }] }, + + + + + create: function () {function create(context) { + var sourceCode = (0, _contextCompat.getSourceCode)(context); + + if (context.options[0] === 'prefer-inline') { + return { + ImportDeclaration: function () {function ImportDeclaration(node) { + if (node.importKind === 'value' || node.importKind == null) { + // top-level value / unknown is valid + return; + } + + if ( + // no specifiers (import type {} from '') have no specifiers to mark as inline + node.specifiers.length === 0 || + node.specifiers.length === 1 + // default imports are both "inline" and "top-level" + && ( + node.specifiers[0].type === 'ImportDefaultSpecifier' + // namespace imports are both "inline" and "top-level" + || node.specifiers[0].type === 'ImportNamespaceSpecifier')) + + { + return; + } + + context.report({ + node: node, + message: 'Prefer using inline {{kind}} specifiers instead of a top-level {{kind}}-only import.', + data: { + kind: node.importKind }, + + fix: function () {function fix(fixer) { + var kindToken = sourceCode.getFirstToken(node, { skip: 1 }); + + return [].concat( + kindToken ? fixer.remove(kindToken) : [], + node.specifiers.map(function (specifier) {return fixer.insertTextBefore(specifier, String(node.importKind) + ' ');})); + + }return fix;}() }); + + }return ImportDeclaration;}() }; + + } + + // prefer-top-level + return { + /** @param {import('estree').ImportDeclaration} node */ + ImportDeclaration: function () {function ImportDeclaration(node) { + if ( + // already top-level is valid + node.importKind === 'type' || + node.importKind === 'typeof' + // no specifiers (import {} from '') cannot have inline - so is valid + || node.specifiers.length === 0 || + node.specifiers.length === 1 + // default imports are both "inline" and "top-level" + && ( + node.specifiers[0].type === 'ImportDefaultSpecifier' + // namespace imports are both "inline" and "top-level" + || node.specifiers[0].type === 'ImportNamespaceSpecifier')) + + { + return; + } + + /** @type {typeof node.specifiers} */ + var typeSpecifiers = []; + /** @type {typeof node.specifiers} */ + var typeofSpecifiers = []; + /** @type {typeof node.specifiers} */ + var valueSpecifiers = []; + /** @type {typeof node.specifiers[number]} */ + var defaultSpecifier = null;var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + for (var _iterator2 = node.specifiers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var specifier = _step2.value; + if (specifier.type === 'ImportDefaultSpecifier') { + defaultSpecifier = specifier; + continue; + } + + if (specifier.importKind === 'type') { + typeSpecifiers.push(specifier); + } else if (specifier.importKind === 'typeof') { + typeofSpecifiers.push(specifier); + } else if (specifier.importKind === 'value' || specifier.importKind == null) { + valueSpecifiers.push(specifier); + } + }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} + + var typeImport = getImportText(node, sourceCode, typeSpecifiers, 'type'); + var typeofImport = getImportText(node, sourceCode, typeofSpecifiers, 'typeof'); + var newImports = (String(typeImport) + '\n' + String(typeofImport)).trim(); + + if (typeSpecifiers.length + typeofSpecifiers.length === node.specifiers.length) { + /** @type {('type' | 'typeof')[]} */ + // all specifiers have inline specifiers - so we replace the entire import + var kind = [].concat( + typeSpecifiers.length > 0 ? 'type' : [], + typeofSpecifiers.length > 0 ? 'typeof' : []); + + + context.report({ + node: node, + message: 'Prefer using a top-level {{kind}}-only import instead of inline {{kind}} specifiers.', + data: { + kind: kind.join('/') }, + + fix: function () {function fix(fixer) { + return fixer.replaceText(node, newImports); + }return fix;}() }); + + } else { + // remove specific specifiers and insert new imports for them + typeSpecifiers.concat(typeofSpecifiers).forEach(function (specifier) { + context.report({ + node: specifier, + message: 'Prefer using a top-level {{kind}}-only import instead of inline {{kind}} specifiers.', + data: { + kind: specifier.importKind }, + + fix: function () {function fix(fixer) { + /** @type {import('eslint').Rule.Fix[]} */ + var fixes = []; + + // if there are no value specifiers, then the other report fixer will be called, not this one + + if (valueSpecifiers.length > 0) { + // import { Value, type Type } from 'mod'; + + // we can just remove the type specifiers + removeSpecifiers(fixes, fixer, sourceCode, typeSpecifiers); + removeSpecifiers(fixes, fixer, sourceCode, typeofSpecifiers); + + // make the import nicely formatted by also removing the trailing comma after the last value import + // eg + // import { Value, type Type } from 'mod'; + // to + // import { Value } from 'mod'; + // not + // import { Value, } from 'mod'; + var maybeComma = sourceCode.getTokenAfter(valueSpecifiers[valueSpecifiers.length - 1]); + if (isComma(maybeComma)) { + fixes.push(fixer.remove(maybeComma)); + } + } else if (defaultSpecifier) { + // import Default, { type Type } from 'mod'; + + // remove the entire curly block so we don't leave an empty one behind + // NOTE - the default specifier *must* be the first specifier always! + // so a comma exists that we also have to clean up or else it's bad syntax + var comma = sourceCode.getTokenAfter(defaultSpecifier, isComma); + var closingBrace = sourceCode.getTokenAfter( + node.specifiers[node.specifiers.length - 1], + function (token) {return token.type === 'Punctuator' && token.value === '}';}); + + fixes.push(fixer.removeRange([ + comma.range[0], + closingBrace.range[1]])); + + } + + return fixes.concat( + // insert the new imports after the old declaration + fixer.insertTextAfter(node, '\n' + String(newImports))); + + }return fix;}() }); + + }); + } + }return ImportDeclaration;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9jb25zaXN0ZW50LXR5cGUtc3BlY2lmaWVyLXN0eWxlLmpzIl0sIm5hbWVzIjpbImlzQ29tbWEiLCJ0b2tlbiIsInR5cGUiLCJ2YWx1ZSIsInJlbW92ZVNwZWNpZmllcnMiLCJmaXhlcyIsImZpeGVyIiwic291cmNlQ29kZSIsInNwZWNpZmllcnMiLCJzcGVjaWZpZXIiLCJnZXRUb2tlbkFmdGVyIiwicHVzaCIsInJlbW92ZSIsImdldEltcG9ydFRleHQiLCJub2RlIiwia2luZCIsInNvdXJjZVN0cmluZyIsImdldFRleHQiLCJzb3VyY2UiLCJsZW5ndGgiLCJuYW1lcyIsIm1hcCIsInMiLCJpbXBvcnRlZCIsIm5hbWUi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IHNwZWNpZmllcnMgdG8gbWFyayBhcyBpbmxpbmVcbiAgICAgICAgICAgIG5vZGUuc3BlY2lmaWVycy5sZW5ndGggPT09IDBcbiAgICAgICAgICAgIHx8IG5vZGUuc3BlY2lmaWVycy5sZW5ndGggPT09IDFcbiAgICAgICAgICAgIC8vIGRlZmF1bHQgaW1wb3J0cyBhcmUgYm90aCBcImlubGluZVwiIGFuZCBcInRvcC1sZXZlbFwiXG4gICAgICAgICAgICAmJiAoXG4gICAgICAgICAgICAgIG5vZGUuc3BlY2lmaWVyc1swXS50eXBlID09PSAnSW1wb3J0RGVmYXVsdFNwZWNpZmllcidcbiAgICAgICAgICAgICAgLy8gbmFtZXNwYWNlIGltcG9ydHMgYXJlIGJvdGggXCJpbmxpbmVcIiBhbmQgXCJ0b3AtbGV2ZWxcIlxuICAgICAgICAgICAgICB8fCBub2RlLnNwZWNpZmllcnNbMF0udHlwZSA9PT0gJ0ltcG9ydE5hbWVzcGFjZVNwZWNpZmllcidcbiAgICAgICAgICAgIClcbiAgICAgICAgICApIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgbWVzc2FnZTogJ1ByZWZlciB1c2luZyBpbmxpbmUge3traW5kfX0gc3BlY2lmaWVycyBpbnN0ZWFkIG9mIGEgdG9wLWxldmVsIHt7a2luZH19LW9ubHkgaW1wb3J0LicsXG4gICAgICAgICAgICBkYXRhOiB7XG4gICAgICAgICAgICAgIGtpbmQ6IG5vZGUuaW1wb3J0S2luZCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmaXgoZml4ZXIpIHtcbiAgICAgICAgICAgICAgY29uc3Qga2luZFRva2VuID0gc291cmNlQ29kZS5nZXRGaXJzdFRva2VuKG5vZGUsIHsgc2tpcDogMSB9KTtcblxuICAgICAgICAgICAgICByZXR1cm4gW10uY29uY2F0KFxuICAg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WxzZSBpZiAoc3BlY2lmaWVyLmltcG9ydEtpbmQgPT09ICd0eXBlb2YnKSB7XG4gICAgICAgICAgICB0eXBlb2ZTcGVjaWZpZXJzLnB1c2goc3BlY2lmaWVyKTtcbiAgICAgICAgICB9IGVsc2UgaWYgKHNwZWNpZmllci5pbXBvcnRLaW5kID09PSAndmFsdWUnIHx8IHNwZWNpZmllci5pbXBvcnRLaW5kID09IG51bGwpIHtcbiAgICAgICAgICAgIHZhbHVlU3BlY2lmaWVycy5wdXNoKHNwZWNpZmllcik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgdHlwZUltcG9ydCA9IGdldEltcG9ydFRleHQobm9kZSwgc291cmNlQ29kZSwgdHlwZVNwZWNpZmllcnMsICd0eXBlJyk7XG4gICAgICAgIGNvbnN0IHR5cGVvZkltcG9ydCA9IGdldEltcG9ydFRleHQobm9kZSwgc291cmNlQ29kZSwgdHlwZW9mU3BlY2lmaWVycywgJ3R5cGVvZicpO1xuICAgICAgICBjb25zdCBuZXdJbXBvcnRzID0gYCR7dHlwZUltcG9ydH1cXG4ke3R5cGVvZkltcG9ydH1gLnRyaW0oKTtcblxuICAgICAgICBpZiAodHlwZVNwZWNpZmllcnMubGVuZ3RoICsgdHlwZW9mU3BlY2lmaWVycy5sZW5ndGggPT09IG5vZGUuc3BlY2lmaWVycy5sZW5ndGgpIHtcbiAgICAgICAgICAvKiogQHR5cGUgeygndHlwZScgfCAndHlwZW9mJylbXX0gKi9cbiAgICAgICAgICAvLyBhbGwgc3BlY2lmaWVycyBoYXZlIGlubGluZSBzcGVjaWZpZXJzIC0gc28gd2UgcmVwbGFjZSB0aGUgZW50aXJlIGltcG9ydFxuICAgICAgICAgIGNvbnN0IGtpbmQgPSBbXS5jb25jYXQoXG4gICAgICAgICAgICB0eXBlU3BlY2lmaWVycy5sZW5ndGggPiAwID8gJ3R5cGUnIDogW10sXG4gICAgICAgICAgICB0eXBlb2ZTcGVjaWZpZXJzLmxlbmd0aCA+IDAgPyAndHlwZW9mJyA6IFtdLFxuICAgICAgICAgICk7XG5cbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgbWVzc2FnZTogJ1ByZWZlciB1c2luZyBhIHRvcC1sZXZlbCB7e2tpbmR9fS1vbmx5IGltcG9ydCBpbnN0ZWFkIG9mIGlubGluZSB7e2tpbmR9fSBzcGVjaWZpZXJzLicsXG4gICAgICAgICAgICBkYXRhOiB7XG4gICAgICAgICAgICAgIGtpbmQ6IGtpbmQuam9pbignLycpLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZpeChmaXhlcikge1xuICAgICAgICAgICAgICByZXR1cm4gZml4ZXIucmVwbGFjZVRleHQobm9kZSwgbmV3SW1wb3J0cyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIHJlbW92ZSBzcGVjaWZpYyBzcGVjaWZpZXJzIGFuZCBpbnNlcnQgbmV3IGltcG9ydHMgZm9yIHRoZW1cbiAgICAgICAgICB0eXBlU3BlY2lmaWVycy5jb25jYXQodHlwZW9mU3BlY2lmaWVycykuZm9yRWFjaCgoc3BlY2lmaWVyKSA9PiB7XG4gICAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICAgIG5vZGU6IHNwZWNpZmllcixcbiAgICAgICAgICAgICAgbWVzc2FnZTogJ1ByZWZlciB1c2luZyBhIHRvcC1sZXZlbCB7e2tpbmR9fS1vbmx5IGltcG9ydCBpbnN0ZWFkIG9mIGlubGluZSB7e2tpbmR9fSBzcGVjaWZpZXJzLicsXG4gICAgICAgICAgICAgIGRhdGE6IHtcbiAgICAgICAgICAgICAgICBraW5kOiBzcGVjaWZpZXIuaW1wb3J0S2luZCxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgZml4KGZpeGVyKSB7XG4gICAgICAgICAg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W5BZnRlcihcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5zcGVjaWZpZXJzW25vZGUuc3BlY2lmaWVycy5sZW5ndGggLSAxXSxcbiAgICAgICAgICAgICAgICAgICAgKHRva2VuKSA9PiB0b2tlbi50eXBlID09PSAnUHVuY3R1YXRvcicgJiYgdG9rZW4udmFsdWUgPT09ICd9JyxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICBmaXhlcy5wdXNoKGZpeGVyLnJlbW92ZVJhbmdlKFtcbiAgICAgICAgICAgICAgICAgICAgY29tbWEucmFuZ2VbMF0sXG4gICAgICAgICAgICAgICAgICAgIGNsb3NpbmdCcmFjZS5yYW5nZVsxXSxcbiAgICAgICAgICAgICAgICAgIF0pKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gZml4ZXMuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgLy8gaW5zZXJ0IHRoZSBuZXcgaW1wb3J0cyBhZnRlciB0aGUgb2xkIGRlY2xhcmF0aW9uXG4gICAgICAgICAgICAgICAgICBmaXhlci5pbnNlcnRUZXh0QWZ0ZXIobm9kZSwgYFxcbiR7bmV3SW1wb3J0c31gKSxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/default.js b/node_modules/eslint-plugin-import/lib/rules/default.js new file mode 100644 index 0000000000000000000000000000000000000000..fbb4f6cbcbee42c2fc7f605bcf798b5c75eb8615 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/default.js @@ -0,0 +1,40 @@ +'use strict';var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Static analysis', + description: 'Ensure a default export is present, given a default import.', + url: (0, _docsUrl2['default'])('default') }, + + schema: [] }, + + + create: function () {function create(context) { + function checkDefault(specifierType, node) { + var defaultSpecifier = node.specifiers.find( + function (specifier) {return specifier.type === specifierType;}); + + + if (!defaultSpecifier) {return;} + var imports = _builder2['default'].get(node.source.value, context); + if (imports == null) {return;} + + if (imports.errors.length) { + imports.reportErrors(context, node); + } else if (imports.get('default') === undefined) { + context.report({ + node: defaultSpecifier, + message: 'No default export found in imported module "' + String(node.source.value) + '".' }); + + } + } + + return { + ImportDeclaration: checkDefault.bind(null, 'ImportDefaultSpecifier'), + ExportNamedDeclaration: checkDefault.bind(null, 'ExportDefaultSpecifier') }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9kZWZhdWx0LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwic2NoZW1hIiwiY3JlYXRlIiwiY29udGV4dCIsImNoZWNrRGVmYXVsdCIsInNwZWNpZmllclR5cGUiLCJub2RlIiwiZGVmYXVsdFNwZWNpZmllciIsInNwZWNpZmllcnMiLCJmaW5kIiwic3BlY2lmaWVyIiwiaW1wb3J0cyIsIkV4cG9ydE1hcEJ1aWxkZXIiLCJnZXQiLCJzb3VyY2UiLCJ2YWx1ZSIsImVycm9ycyIsImxlbmd0aCIsInJlcG9ydEVycm9ycyIsInVuZGVmaW5lZCIsInJlcG9ydCIsIm1lc3NhZ2UiLCJJbXBvcnREZWNsYXJhdGlvbiIsImJpbmQiLCJFeHBvcnROYW1lZERlY2xhcmF0aW9uIl0sIm1hcHBpbmdzIj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tcbiAgICAgIGlmIChpbXBvcnRzID09IG51bGwpIHsgcmV0dXJuOyB9XG5cbiAgICAgIGlmIChpbXBvcnRzLmVycm9ycy5sZW5ndGgpIHtcbiAgICAgICAgaW1wb3J0cy5yZXBvcnRFcnJvcnMoY29udGV4dCwgbm9kZSk7XG4gICAgICB9IGVsc2UgaWYgKGltcG9ydHMuZ2V0KCdkZWZhdWx0JykgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgbm9kZTogZGVmYXVsdFNwZWNpZmllcixcbiAgICAgICAgICBtZXNzYWdlOiBgTm8gZGVmYXVsdCBleHBvcnQgZm91bmQgaW4gaW1wb3J0ZWQgbW9kdWxlIFwiJHtub2RlLnNvdXJjZS52YWx1ZX1cIi5gLFxuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgSW1wb3J0RGVjbGFyYXRpb246IGNoZWNrRGVmYXVsdC5iaW5kKG51bGwsICdJbXBvcnREZWZhdWx0U3BlY2lmaWVyJyksXG4gICAgICBFeHBvcnROYW1lZERlY2xhcmF0aW9uOiBjaGVja0RlZmF1bHQuYmluZChudWxsLCAnRXhwb3J0RGVmYXVsdFNwZWNpZmllcicpLFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js b/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js new file mode 100644 index 0000000000000000000000000000000000000000..f79271a50c6cfc9bd70fcdb6770050b5c05112a5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js @@ -0,0 +1,172 @@ +'use strict';var _contextCompat = require('eslint-module-utils/contextCompat'); +var _vm = require('vm');var _vm2 = _interopRequireDefault(_vm); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Enforce a leading comment with the webpackChunkName for dynamic imports.', + url: (0, _docsUrl2['default'])('dynamic-import-chunkname') }, + + schema: [{ + type: 'object', + properties: { + importFunctions: { + type: 'array', + uniqueItems: true, + items: { + type: 'string' } }, + + + allowEmpty: { + type: 'boolean' }, + + webpackChunknameFormat: { + type: 'string' } } }], + + + + hasSuggestions: true }, + + + create: function () {function create(context) { + var config = context.options[0];var _ref = + config || {},_ref$importFunctions = _ref.importFunctions,importFunctions = _ref$importFunctions === undefined ? [] : _ref$importFunctions,_ref$allowEmpty = _ref.allowEmpty,allowEmpty = _ref$allowEmpty === undefined ? false : _ref$allowEmpty;var _ref2 = + config || {},_ref2$webpackChunknam = _ref2.webpackChunknameFormat,webpackChunknameFormat = _ref2$webpackChunknam === undefined ? '([0-9a-zA-Z-_/.]|\\[(request|index)\\])+' : _ref2$webpackChunknam; + + var paddedCommentRegex = /^ (\S[\s\S]+\S) $/; + var commentStyleRegex = /^( ((webpackChunkName: .+)|((webpackPrefetch|webpackPreload): (true|false|-?[0-9]+))|(webpackIgnore: (true|false))|((webpackInclude|webpackExclude): \/.*\/)|(webpackMode: ["'](lazy|lazy-once|eager|weak)["'])|(webpackExports: (['"]\w+['"]|\[(['"]\w+['"], *)+(['"]\w+['"]*)\]))),?)+ $/; + var chunkSubstrFormat = 'webpackChunkName: ["\']' + String(webpackChunknameFormat) + '["\'],? '; + var chunkSubstrRegex = new RegExp(chunkSubstrFormat); + var eagerModeFormat = 'webpackMode: ["\']eager["\'],? '; + var eagerModeRegex = new RegExp(eagerModeFormat); + + function run(node, arg) { + var sourceCode = (0, _contextCompat.getSourceCode)(context); + var leadingComments = sourceCode.getCommentsBefore ? + sourceCode.getCommentsBefore(arg) // This method is available in ESLint >= 4. + : sourceCode.getComments(arg).leading; // This method is deprecated in ESLint 7. + + if ((!leadingComments || leadingComments.length === 0) && !allowEmpty) { + context.report({ + node: node, + message: 'dynamic imports require a leading comment with the webpack chunkname' }); + + return; + } + + var isChunknamePresent = false; + var isEagerModePresent = false;var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + + for (var _iterator = leadingComments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var comment = _step.value; + if (comment.type !== 'Block') { + context.report({ + node: node, + message: 'dynamic imports require a /* foo */ style comment, not a // foo comment' }); + + return; + } + + if (!paddedCommentRegex.test(comment.value)) { + context.report({ + node: node, + message: 'dynamic imports require a block comment padded with spaces - /* foo */' }); + + return; + } + + try { + // just like webpack itself does + _vm2['default'].runInNewContext('(function() {return {' + String(comment.value) + '}})()'); + } catch (error) { + context.report({ + node: node, + message: 'dynamic imports require a "webpack" comment with valid syntax' }); + + return; + } + + if (!commentStyleRegex.test(comment.value)) { + context.report({ + node: node, + message: 'dynamic imports require a "webpack" comment with valid syntax' }); + + + return; + } + + if (eagerModeRegex.test(comment.value)) { + isEagerModePresent = true; + } + + if (chunkSubstrRegex.test(comment.value)) { + isChunknamePresent = true; + } + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + + if (isChunknamePresent && isEagerModePresent) { + context.report({ + node: node, + message: 'dynamic imports using eager mode do not need a webpackChunkName', + suggest: [ + { + desc: 'Remove webpackChunkName', + fix: function () {function fix(fixer) {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + for (var _iterator2 = leadingComments[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var _comment = _step2.value; + if (chunkSubstrRegex.test(_comment.value)) { + var replacement = _comment.value.replace(chunkSubstrRegex, '').trim().replace(/,$/, ''); + if (replacement === '') { + return fixer.remove(_comment); + } else { + return fixer.replaceText(_comment, '/* ' + String(replacement) + ' */'); + } + } + }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} + }return fix;}() }, + + { + desc: 'Remove webpackMode', + fix: function () {function fix(fixer) {var _iteratorNormalCompletion3 = true;var _didIteratorError3 = false;var _iteratorError3 = undefined;try { + for (var _iterator3 = leadingComments[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {var _comment2 = _step3.value; + if (eagerModeRegex.test(_comment2.value)) { + var replacement = _comment2.value.replace(eagerModeRegex, '').trim().replace(/,$/, ''); + if (replacement === '') { + return fixer.remove(_comment2); + } else { + return fixer.replaceText(_comment2, '/* ' + String(replacement) + ' */'); + } + } + }} catch (err) {_didIteratorError3 = true;_iteratorError3 = err;} finally {try {if (!_iteratorNormalCompletion3 && _iterator3['return']) {_iterator3['return']();}} finally {if (_didIteratorError3) {throw _iteratorError3;}}} + }return fix;}() }] }); + + + + } + + if (!isChunknamePresent && !allowEmpty && !isEagerModePresent) { + context.report({ + node: node, + message: 'dynamic imports require a leading comment in the form /*' + + chunkSubstrFormat + '*/' }); + + } + } + + return { + ImportExpression: function () {function ImportExpression(node) { + run(node, node.source); + }return ImportExpression;}(), + + CallExpression: function () {function CallExpression(node) { + if (node.callee.type !== 'Import' && importFunctions.indexOf(node.callee.name) < 0) { + return; + } + + run(node, node.arguments[0]); + }return CallExpression;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9keW5hbWljLWltcG9ydC1jaHVua25hbWUuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRp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ICAgICBub2RlLFxuICAgICAgICAgIG1lc3NhZ2U6ICdkeW5hbWljIGltcG9ydHMgcmVxdWlyZSBhIGxlYWRpbmcgY29tbWVudCB3aXRoIHRoZSB3ZWJwYWNrIGNodW5rbmFtZScsXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGxldCBpc0NodW5rbmFtZVByZXNlbnQgPSBmYWxzZTtcbiAgICAgIGxldCBpc0VhZ2VyTW9kZVByZXNlbnQgPSBmYWxzZTtcblxuICAgICAgZm9yIChjb25zdCBjb21tZW50IG9mIGxlYWRpbmdDb21tZW50cykge1xuICAgICAgICBpZiAoY29tbWVudC50eXBlICE9PSAnQmxvY2snKSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIG1lc3NhZ2U6ICdkeW5hbWljIGltcG9ydHMgcmVxdWlyZSBhIC8qIGZvbyAqLyBzdHlsZSBjb21tZW50LCBub3QgYSAvLyBmb28gY29tbWVudCcsXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFwYWRkZWRDb21tZW50UmVnZXgudGVzdChjb21tZW50LnZhbHVlKSkge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICBtZXNzYWdlOiBgZHluYW1pYyBpbXBvcnRzIHJlcXVpcmUgYSBibG9jayBjb21tZW50IHBhZGRlZCB3aXRoIHNwYWNlcyAtIC8qIGZvbyAqL2AsXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAvLyBqdXN0IGxpa2Ugd2VicGFjayBpdHNlbGYgZG9lc1xuICAgICAgICAgIHZtLnJ1bkluTmV3Q29udGV4dChgKGZ1bmN0aW9uKCkge3JldHVybiB7JHtjb21tZW50LnZhbHVlfX19KSgpYCk7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIG1lc3NhZ2U6IGBkeW5hbWljIGltcG9ydHMgcmVxdWlyZSBhIFwid2VicGFja1wiIGNvbW1lbnQgd2l0aCB2YWxpZCBzeW50YXhgLFxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghY29tbWVudFN0eWxlUmVnZXgudGVzdChjb21tZW50LnZhbHVlKSkge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICBtZXNzYWdlOlxuICAgICAgICAgICAgICBgZHluYW1pYyBpbXBvcnRzIHJlcXVpcmUgYSBcIndlYnBhY2tcIiBjb21tZW50IHdpdGggdmFsaWQgc3ludGF4YCxcbiAgICAgICAgICB9KTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZWFnZXJNb2RlUmVnZXgudGVzdChjb21tZW50LnZhbHVlKSkge1xuICAgICAgICAgIGlzRWFnZXJNb2RlUHJlc2VudCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY2h1bmtTdWJzdHJSZWdleC50ZXN0KGNvbW1lbnQudmFsdWUpKSB7XG4gICAgICAgICAgaXNDaHVua25hbWVQcmVzZW50ID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoaXNDaHVua25hbWVQcmVzZW50ICYmIGlzRWFnZXJNb2RlUHJlc2VudCkge1xuICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgbm9kZSxcbiAgICAgICAgICBtZXNzYWdlOiAnZHluYW1pYyBpbXBvcnRzIHVzaW5nIGVhZ2VyIG1vZGUgZG8gbm90IG5lZWQgYSB3ZWJwYWNrQ2h1bmtOYW1lJyxcbiAgICAgICAgICBzdWdnZXN0OiBbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRlc2M6ICdSZW1vdmUgd2VicGFja0NodW5rTmFtZScsXG4gICAgICAgICAgICAgIGZpeChmaXhlcikge1xuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgY29tbWVudCBvZiBsZWFkaW5nQ29tbWVudHMpIHtcbiAgICAgICAgICAgICAgICAgIGlmIChjaHVua1N1YnN0clJlZ2V4LnRlc3QoY29tbWVudC52YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVwbGFjZW1lbnQgPSBjb21tZW50LnZhbHVlLnJlcGxhY2UoY2h1bmtTdWJzdHJSZWdleCwgJycpLnRyaW0oKS5yZXBsYWNlKC8sJC8sICcnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcGxhY2VtZW50ID09PSAnJykge1xuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmaXhlci5yZW1vdmUoY29tbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpeGVyLnJlcGxhY2VUZXh0KGNvbW1lbnQsIGAvKiAke3JlcGxhY2VtZW50fSAqL2ApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgZGVzYzogJ1JlbW92ZSB3ZWJwYWNrTW9kZScsXG4gICAgICAgICAgICAgIGZpeChmaXhlcikge1xuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgY29tbWVudCBvZiBsZWFkaW5nQ29tbWVudHMpIHtcbiAgICAgICAgICAgICAgICAgIGlmIChlYWdlck1vZGVSZWdleC50ZXN0KGNvbW1lbnQudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlcGxhY2VtZW50ID0gY29tbWVudC52YWx1ZS5yZXBsYWNlKGVhZ2VyTW9kZVJlZ2V4LCAnJykudHJpbSgpLnJlcGxhY2UoLywkLywgJycpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVwbGFjZW1lbnQgPT09ICcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpeGVyLnJlbW92ZShjb21tZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZml4ZXIucmVwbGFjZVRleHQoY29tbWVudCwgYC8qICR7cmVwbGFjZW1lbnR9ICovYCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIF0sXG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICBpZiAoIWlzQ2h1bmtuYW1lUHJlc2VudCAmJiAhYWxsb3dFbXB0eSAmJiAhaXNFYWdlck1vZGVQcmVzZW50KSB7XG4gICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICBub2RlLFxuICAgICAgICAgIG1lc3NhZ2U6XG4gICAgICAgICAgICBgZHluYW1pYyBpbXBvcnRzIHJlcXVpcmUgYSBsZWFkaW5nIGNvbW1lbnQgaW4gdGhlIGZvcm0gLyoke2NodW5rU3Vic3RyRm9ybWF0fSovYCxcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHtcbiAgICAgIEltcG9ydEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBydW4obm9kZSwgbm9kZS5zb3VyY2UpO1xuICAgICAgfSxcblxuICAgICAgQ2FsbEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAobm9kZS5jYWxsZWUudHlwZSAhPT0gJ0ltcG9ydCcgJiYgaW1wb3J0RnVuY3Rpb25zLmluZGV4T2Yobm9kZS5jYWxsZWUubmFtZSkgPCAwKSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgcnVuKG5vZGUsIG5vZGUuYXJndW1lbnRzWzBdKTtcbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/enforce-node-protocol-usage.js b/node_modules/eslint-plugin-import/lib/rules/enforce-node-protocol-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..6cb45dcd6146eb318cccb93f1b96367326a976bf --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/enforce-node-protocol-usage.js @@ -0,0 +1,147 @@ +'use strict';var _messages;function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;} + +var isCoreModule = require('is-core-module');var _require = +require('../docsUrl'),docsUrl = _require['default']; + +var DO_PREFER_MESSAGE_ID = 'requireNodeProtocol'; +var NEVER_PREFER_MESSAGE_ID = 'forbidNodeProtocol'; +var messages = (_messages = {}, _defineProperty(_messages, +DO_PREFER_MESSAGE_ID, 'Prefer `node:{{moduleName}}` over `{{moduleName}}`.'), _defineProperty(_messages, +NEVER_PREFER_MESSAGE_ID, 'Prefer `{{moduleName}}` over `node:{{moduleName}}`.'), _messages); + + +function replaceStringLiteral( +fixer, +node, +text, +relativeRangeStart, +relativeRangeEnd) +{ + var firstCharacterIndex = node.range[0] + 1; + var start = Number.isInteger(relativeRangeEnd) ? + relativeRangeStart + firstCharacterIndex : + firstCharacterIndex; + var end = Number.isInteger(relativeRangeEnd) ? + relativeRangeEnd + firstCharacterIndex : + node.range[1] - 1; + + return fixer.replaceTextRange([start, end], text); +} + +function isStringLiteral(node) { + return node && node.type === 'Literal' && typeof node.value === 'string'; +} + +function isStaticRequireWith1Param(node) { + return !node.optional && + node.callee.type === 'Identifier' && + node.callee.name === 'require' + // check for only 1 argument + && node.arguments.length === 1 && + node.arguments[0] && + isStringLiteral(node.arguments[0]); +} + +function checkAndReport(src, context) { + // TODO use src.quasis[0].value.raw + if (!src || src.type === 'TemplateLiteral') {return;} + var moduleName = 'value' in src ? src.value : src.name; + if (typeof moduleName !== 'string') {console.log(src, moduleName);}var + settings = context.settings; + var nodeVersion = settings && settings['import/node-version']; + if ( + typeof nodeVersion !== 'undefined' && ( + + typeof nodeVersion !== 'string' || + !/^[0-9]+\.[0-9]+\.[0-9]+$/.test(nodeVersion))) + + { + throw new TypeError('`import/node-version` setting must be a string in the format "10.23.45" (a semver version, with no leading zero)'); + } + + if (context.options[0] === 'never') { + if (!moduleName.startsWith('node:')) {return;} + + var actualModuleName = moduleName.slice(5); + if (!isCoreModule(actualModuleName, nodeVersion || undefined)) {return;} + + context.report({ + node: src, + message: messages[NEVER_PREFER_MESSAGE_ID], + data: { moduleName: actualModuleName }, + /** @param {import('eslint').Rule.RuleFixer} fixer */ + fix: function () {function fix(fixer) { + return replaceStringLiteral(fixer, src, '', 0, 5); + }return fix;}() }); + + } else if (context.options[0] === 'always') { + if ( + moduleName.startsWith('node:') || + !isCoreModule(moduleName, nodeVersion || undefined) || + !isCoreModule('node:' + String(moduleName), nodeVersion || undefined)) + { + return; + } + + context.report({ + node: src, + message: messages[DO_PREFER_MESSAGE_ID], + data: { moduleName: moduleName }, + /** @param {import('eslint').Rule.RuleFixer} fixer */ + fix: function () {function fix(fixer) { + return replaceStringLiteral(fixer, src, 'node:', 0, 0); + }return fix;}() }); + + } else if (typeof context.options[0] === 'undefined') { + throw new Error('Missing option'); + } else { + throw new Error('Unexpected option: ' + String(context.options[0])); + } +} + +/** @type {import('eslint').Rule.RuleModule} */ +module.exports = { + meta: { + type: 'suggestion', + docs: { + description: 'Enforce either using, or omitting, the `node:` protocol when importing Node.js builtin modules.', + recommended: true, + category: 'Static analysis', + url: docsUrl('enforce-node-protocol-usage') }, + + fixable: 'code', + schema: { + type: 'array', + minItems: 1, + maxItems: 1, + items: [ + { + 'enum': ['always', 'never'] }] }, + + + + messages: messages }, + + create: function () {function create(context) { + return { + CallExpression: function () {function CallExpression(node) { + if (!isStaticRequireWith1Param(node)) {return;} + + var arg = node.arguments[0]; + + return checkAndReport(arg, context); + }return CallExpression;}(), + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + return checkAndReport(node.source, context); + }return ExportNamedDeclaration;}(), + ImportDeclaration: function () {function ImportDeclaration(node) { + return checkAndReport(node.source, context); + }return ImportDeclaration;}(), + ImportExpression: function () {function ImportExpression(node) { + if (!isStringLiteral(node.source)) {return;} + + return checkAndReport(node.source, context); + }return ImportExpression;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9lbmZvcmNlLW5vZGUtcHJvdG9jb2wtdXNhZ2UuanMiXSwibmFtZXMiOlsiaXNDb3JlTW9kdWxlIiwicmVxdWlyZSIsImRvY3NVcmwiLCJET19QUkVGRVJfTUVTU0FHRV9JRCIsIk5FVkVSX1BSRUZFUl9NRVNTQUdFX0lEIiwibWVzc2FnZXMiLCJyZXBsYWNlU3RyaW5nTGl0ZXJhbCIsImZpeGVyIiwibm9kZSIsInRleHQiLCJyZWxhdGl2ZVJhbmdlU3RhcnQiLCJyZWxhdGl2ZVJhbmdlRW5kIiwiZmlyc3RDaGFyYWN0ZXJJbmRleCIsInJhbmdlIiwic3RhcnQiLCJOdW1iZXIiLCJpc0ludGVnZXIiLCJlbmQiLCJyZXBsYWNlVGV4dFJhbmdlIiwiaXNTdHJpbmdMaXRlcmFsIiwidHlwZSIsInZhbHVlIiwiaXNTdGF0aWNSZXF1aXJlV2l0aDFQYXJhbSIsIm9wdGlvbmFsIiwiY2FsbGVlIiwibmFtZSIsImFyZ3VtZW50cyIsImxl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VybjsgfVxuXG4gICAgICAgIGNvbnN0IGFyZyA9IG5vZGUuYXJndW1lbnRzWzBdO1xuXG4gICAgICAgIHJldHVybiBjaGVja0FuZFJlcG9ydChhcmcsIGNvbnRleHQpO1xuICAgICAgfSxcbiAgICAgIEV4cG9ydE5hbWVkRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICByZXR1cm4gY2hlY2tBbmRSZXBvcnQobm9kZS5zb3VyY2UsIGNvbnRleHQpO1xuICAgICAgfSxcbiAgICAgIEltcG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIGNoZWNrQW5kUmVwb3J0KG5vZGUuc291cmNlLCBjb250ZXh0KTtcbiAgICAgIH0sXG4gICAgICBJbXBvcnRFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKCFpc1N0cmluZ0xpdGVyYWwobm9kZS5zb3VyY2UpKSB7IHJldHVybjsgfVxuXG4gICAgICAgIHJldHVybiBjaGVja0FuZFJlcG9ydChub2RlLnNvdXJjZSwgY29udGV4dCk7XG4gICAgICB9LFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/export.js b/node_modules/eslint-plugin-import/lib/rules/export.js new file mode 100644 index 0000000000000000000000000000000000000000..1c045d372e1f401e10835a4b1e575ab183f522e5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/export.js @@ -0,0 +1,235 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _patternCapture = require('../exportMap/patternCapture');var _patternCapture2 = _interopRequireDefault(_patternCapture); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +/* + Notes on TypeScript namespaces aka TSModuleDeclaration: + + There are two forms: + - active namespaces: namespace Foo {} / module Foo {} + - ambient modules; declare module "eslint-plugin-import" {} + + active namespaces: + - cannot contain a default export + - cannot contain an export all + - cannot contain a multi name export (export { a, b }) + - can have active namespaces nested within them + + ambient namespaces: + - can only be defined in .d.ts files + - cannot be nested within active namespaces + - have no other restrictions + */ + +var rootProgram = 'root'; +var tsTypePrefix = 'type:'; + +/** + * remove function overloads like: + * ```ts + * export function foo(a: number); + * export function foo(a: string); + * ``` + * @param {Set} nodes + */ +function removeTypescriptFunctionOverloads(nodes) { + nodes.forEach(function (node) { + var declType = node.type === 'ExportDefaultDeclaration' ? node.declaration.type : node.parent.type; + if ( + // eslint 6+ + declType === 'TSDeclareFunction' + // eslint 4-5 + || declType === 'TSEmptyBodyFunctionDeclaration') + { + nodes['delete'](node); + } + }); +} + +/** + * Detect merging Namespaces with Classes, Functions, or Enums like: + * ```ts + * export class Foo { } + * export namespace Foo { } + * ``` + * @param {Set} nodes + * @returns {boolean} + */ +function isTypescriptNamespaceMerging(nodes) { + var types = new Set(Array.from(nodes, function (node) {return node.parent.type;})); + var noNamespaceNodes = Array.from(nodes).filter(function (node) {return node.parent.type !== 'TSModuleDeclaration';}); + + return types.has('TSModuleDeclaration') && ( + + types.size === 1 + // Merging with functions + || types.size === 2 && (types.has('FunctionDeclaration') || types.has('TSDeclareFunction')) || + types.size === 3 && types.has('FunctionDeclaration') && types.has('TSDeclareFunction') + // Merging with classes or enums + || types.size === 2 && (types.has('ClassDeclaration') || types.has('TSEnumDeclaration')) && noNamespaceNodes.length === 1); + +} + +/** + * Detect if a typescript namespace node should be reported as multiple export: + * ```ts + * export class Foo { } + * export function Foo(); + * export namespace Foo { } + * ``` + * @param {Object} node + * @param {Set} nodes + * @returns {boolean} + */ +function shouldSkipTypescriptNamespace(node, nodes) { + var types = new Set(Array.from(nodes, function (node) {return node.parent.type;})); + + return !isTypescriptNamespaceMerging(nodes) && + node.parent.type === 'TSModuleDeclaration' && ( + + types.has('TSEnumDeclaration') || + types.has('ClassDeclaration') || + types.has('FunctionDeclaration') || + types.has('TSDeclareFunction')); + +} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Helpful warnings', + description: 'Forbid any invalid exports, i.e. re-export of the same name.', + url: (0, _docsUrl2['default'])('export') }, + + schema: [] }, + + + create: function () {function create(context) { + var namespace = new Map([[rootProgram, new Map()]]); + + function addNamed(name, node, parent, isType) { + if (!namespace.has(parent)) { + namespace.set(parent, new Map()); + } + var named = namespace.get(parent); + + var key = isType ? '' + tsTypePrefix + String(name) : name; + var nodes = named.get(key); + + if (nodes == null) { + nodes = new Set(); + named.set(key, nodes); + } + + nodes.add(node); + } + + function getParent(node) { + if (node.parent && node.parent.type === 'TSModuleBlock') { + return node.parent.parent; + } + + // just in case somehow a non-ts namespace export declaration isn't directly + // parented to the root Program node + return rootProgram; + } + + return { + ExportDefaultDeclaration: function () {function ExportDefaultDeclaration(node) { + addNamed('default', node, getParent(node)); + }return ExportDefaultDeclaration;}(), + + ExportSpecifier: function () {function ExportSpecifier(node) { + addNamed( + node.exported.name || node.exported.value, + node.exported, + getParent(node.parent)); + + }return ExportSpecifier;}(), + + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + if (node.declaration == null) {return;} + + var parent = getParent(node); + // support for old TypeScript versions + var isTypeVariableDecl = node.declaration.kind === 'type'; + + if (node.declaration.id != null) { + if ((0, _arrayIncludes2['default'])([ + 'TSTypeAliasDeclaration', + 'TSInterfaceDeclaration'], + node.declaration.type)) { + addNamed(node.declaration.id.name, node.declaration.id, parent, true); + } else { + addNamed(node.declaration.id.name, node.declaration.id, parent, isTypeVariableDecl); + } + } + + if (node.declaration.declarations != null) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = node.declaration.declarations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var declaration = _step.value; + (0, _patternCapture2['default'])(declaration.id, function (v) {addNamed(v.name, v, parent, isTypeVariableDecl);}); + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + } + }return ExportNamedDeclaration;}(), + + ExportAllDeclaration: function () {function ExportAllDeclaration(node) { + if (node.source == null) {return;} // not sure if this is ever true + + // `export * as X from 'path'` does not conflict + if (node.exported && node.exported.name) {return;} + + var remoteExports = _builder2['default'].get(node.source.value, context); + if (remoteExports == null) {return;} + + if (remoteExports.errors.length) { + remoteExports.reportErrors(context, node); + return; + } + + var parent = getParent(node); + + var any = false; + remoteExports.forEach(function (v, name) { + if (name !== 'default') { + any = true; // poor man's filter + addNamed(name, node, parent); + } + }); + + if (!any) { + context.report( + node.source, 'No named exports found in module \'' + String( + node.source.value) + '\'.'); + + } + }return ExportAllDeclaration;}(), + + 'Program:exit': function () {function ProgramExit() {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + for (var _iterator2 = namespace[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var _ref = _step2.value;var _ref2 = _slicedToArray(_ref, 2);var named = _ref2[1];var _iteratorNormalCompletion3 = true;var _didIteratorError3 = false;var _iteratorError3 = undefined;try { + for (var _iterator3 = named[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {var _ref3 = _step3.value;var _ref4 = _slicedToArray(_ref3, 2);var name = _ref4[0];var nodes = _ref4[1]; + removeTypescriptFunctionOverloads(nodes); + + if (nodes.size <= 1) {continue;} + + if (isTypescriptNamespaceMerging(nodes)) {continue;}var _iteratorNormalCompletion4 = true;var _didIteratorError4 = false;var _iteratorError4 = undefined;try { + + for (var _iterator4 = nodes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {var node = _step4.value; + if (shouldSkipTypescriptNamespace(node, nodes)) {continue;} + + if (name === 'default') { + context.report(node, 'Multiple default exports.'); + } else { + context.report( + node, 'Multiple exports of name \'' + String( + name.replace(tsTypePrefix, '')) + '\'.'); + + } + }} catch (err) {_didIteratorError4 = true;_iteratorError4 = err;} finally {try {if (!_iteratorNormalCompletion4 && _iterator4['return']) {_iterator4['return']();}} finally {if (_didIteratorError4) {throw _iteratorError4;}}} + }} catch (err) {_didIteratorError3 = true;_iteratorError3 = err;} finally {try {if (!_iteratorNormalCompletion3 && _iterator3['return']) {_iterator3['return']();}} finally {if (_didIteratorError3) {throw _iteratorError3;}}} + }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} + }return ProgramExit;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9leHBvcnQuanMiXSwibmFtZXMiOlsicm9vdFByb2dyYW0iLCJ0c1R5cGVQcmVmaXgiLCJyZW1vdmVUeXBlc2NyaXB0RnVuY3Rpb25PdmVybG9hZHMiLCJub2RlcyIsImZvckVhY2giLCJub2RlIiwiZGVjbFR5cGUiLCJ0eXBlIiwiZGVjbGFyYXRpb24iLCJwYXJlbnQiLCJpc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gpIHtcbiAgICAgICAgICByZW1vdGVFeHBvcnRzLnJlcG9ydEVycm9ycyhjb250ZXh0LCBub2RlKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXJlbnQgPSBnZXRQYXJlbnQobm9kZSk7XG5cbiAgICAgICAgbGV0IGFueSA9IGZhbHNlO1xuICAgICAgICByZW1vdGVFeHBvcnRzLmZvckVhY2goKHYsIG5hbWUpID0+IHtcbiAgICAgICAgICBpZiAobmFtZSAhPT0gJ2RlZmF1bHQnKSB7XG4gICAgICAgICAgICBhbnkgPSB0cnVlOyAvLyBwb29yIG1hbidzIGZpbHRlclxuICAgICAgICAgICAgYWRkTmFtZWQobmFtZSwgbm9kZSwgcGFyZW50KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmICghYW55KSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoXG4gICAgICAgICAgICBub2RlLnNvdXJjZSxcbiAgICAgICAgICAgIGBObyBuYW1lZCBleHBvcnRzIGZvdW5kIGluIG1vZHVsZSAnJHtub2RlLnNvdXJjZS52YWx1ZX0nLmAsXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgfSxcblxuICAgICAgJ1Byb2dyYW06ZXhpdCcoKSB7XG4gICAgICAgIGZvciAoY29uc3QgWywgbmFtZWRdIG9mIG5hbWVzcGFjZSkge1xuICAgICAgICAgIGZvciAoY29uc3QgW25hbWUsIG5vZGVzXSBvZiBuYW1lZCkge1xuICAgICAgICAgICAgcmVtb3ZlVHlwZXNjcmlwdEZ1bmN0aW9uT3ZlcmxvYWRzKG5vZGVzKTtcblxuICAgICAgICAgICAgaWYgKG5vZGVzLnNpemUgPD0gMSkgeyBjb250aW51ZTsgfVxuXG4gICAgICAgICAgICBpZiAoaXNUeXBlc2NyaXB0TmFtZXNwYWNlTWVyZ2luZyhub2RlcykpIHsgY29udGludWU7IH1cblxuICAgICAgICAgICAgZm9yIChjb25zdCBub2RlIG9mIG5vZGVzKSB7XG4gICAgICAgICAgICAgIGlmIChzaG91bGRTa2lwVHlwZXNjcmlwdE5hbWVzcGFjZShub2RlLCBub2RlcykpIHsgY29udGludWU7IH1cblxuICAgICAgICAgICAgICBpZiAobmFtZSA9PT0gJ2RlZmF1bHQnKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQobm9kZSwgJ011bHRpcGxlIGRlZmF1bHQgZXhwb3J0cy4nKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LnJlcG9ydChcbiAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICBgTXVsdGlwbGUgZXhwb3J0cyBvZiBuYW1lICcke25hbWUucmVwbGFjZSh0c1R5cGVQcmVmaXgsICcnKX0nLmAsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/exports-last.js b/node_modules/eslint-plugin-import/lib/rules/exports-last.js new file mode 100644 index 0000000000000000000000000000000000000000..de4a2ebdff03909ffc1fffcd52a0777d0f6dcead --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/exports-last.js @@ -0,0 +1,40 @@ +'use strict';var _arrayPrototype = require('array.prototype.findlastindex');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function isNonExportStatement(_ref) {var type = _ref.type; + return type !== 'ExportDefaultDeclaration' && + type !== 'ExportNamedDeclaration' && + type !== 'ExportAllDeclaration'; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Ensure all exports appear after other statements.', + url: (0, _docsUrl2['default'])('exports-last') }, + + schema: [] }, + + + create: function () {function create(context) { + return { + Program: function () {function Program(_ref2) {var body = _ref2.body; + var lastNonExportStatementIndex = (0, _arrayPrototype2['default'])(body, isNonExportStatement); + + if (lastNonExportStatementIndex !== -1) { + body.slice(0, lastNonExportStatementIndex).forEach(function (node) { + if (!isNonExportStatement(node)) { + context.report({ + node: node, + message: 'Export statements should appear at the end of the file' }); + + } + }); + } + }return Program;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9leHBvcnRzLWxhc3QuanMiXSwibmFtZXMiOlsiaXNOb25FeHBvcnRTdGF0ZW1lbnQiLCJ0eXBlIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJkb2NzIiwiY2F0ZWdvcnkiLCJkZXNjcmlwdGlvbiIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJQcm9ncmFtIiwiYm9keSIsImxhc3ROb25FeHBvcnRTdGF0ZW1lbnRJbmRleCIsInNsaWNlIiwiZm9yRWFjaCIsIm5vZGUiLCJyZXBvcnQiLCJtZXNzYWdlIl0sIm1hcHBpbmdzIjoiYUFBQSwrRDs7QUFFQSxxQzs7QUFFQSxTQUFTQSxvQkFBVCxPQUF3QyxLQUFSQyxJQUFRLFFBQVJBLElBQVE7QUFDdEMsU0FBT0EsU0FBUywwQkFBVDtBQUNGQSxXQUFTLHdCQURQO0FBRUZBLFdBQVMsc0JBRmQ7QUFHRDs7QUFFREMsT0FBT0MsT0FBUCxHQUFpQjtBQUNmQyxRQUFNO0FBQ0pILFVBQU0sWUFERjtBQUVKSSxVQUFNO0FBQ0pDLGdCQUFVLGFBRE47QUFFSkMsbUJBQWEsbURBRlQ7QUFHSkMsV0FBSywwQkFBUSxjQUFSLENBSEQsRUFGRjs7QUFPSkMsWUFBU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sXG4gICAgZG9jczoge1xuICAgICAgY2F0ZWdvcnk6ICdTdHlsZSBndWlkZScsXG4gICAgICBkZXNjcmlwdGlvbjogJ0Vuc3VyZSBhbGwgZXhwb3J0cyBhcHBlYXIgYWZ0ZXIgb3RoZXIgc3RhdGVtZW50cy4nLFxuICAgICAgdXJsOiBkb2NzVXJsKCdleHBvcnRzLWxhc3QnKSxcbiAgICB9LFxuICAgIHNjaGVtYTogW10sXG4gIH0sXG5cbiAgY3JlYXRlKGNvbnRleHQpIHtcbiAgICByZXR1cm4ge1xuICAgICAgUHJvZ3JhbSh7IGJvZHkgfSkge1xuICAgICAgICBjb25zdCBsYXN0Tm9uRXhwb3J0U3RhdGVtZW50SW5kZXggPSBmaW5kTGFzdEluZGV4KGJvZHksIGlzTm9uRXhwb3J0U3RhdGVtZW50KTtcblxuICAgICAgICBpZiAobGFzdE5vbkV4cG9ydFN0YXRlbWVudEluZGV4ICE9PSAtMSkge1xuICAgICAgICAgIGJvZHkuc2xpY2UoMCwgbGFzdE5vbkV4cG9ydFN0YXRlbWVudEluZGV4KS5mb3JFYWNoKChub2RlKSA9PiB7XG4gICAgICAgICAgICBpZiAoIWlzTm9uRXhwb3J0U3RhdGVtZW50KG5vZGUpKSB7XG4gICAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdFeHBvcnQgc3RhdGVtZW50cyBzaG91bGQgYXBwZWFyIGF0IHRoZSBlbmQgb2YgdGhlIGZpbGUnLFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/extensions.js b/node_modules/eslint-plugin-import/lib/rules/extensions.js new file mode 100644 index 0000000000000000000000000000000000000000..54e60e1094fd3e6dcae5d789f502984b76248e79 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/extensions.js @@ -0,0 +1,242 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); + +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _importType = require('../core/importType'); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var enumValues = { 'enum': ['always', 'ignorePackages', 'never'] }; +var patternProperties = { + type: 'object', + patternProperties: { '.*': enumValues } }; + +var properties = { + type: 'object', + properties: { + pattern: patternProperties, + checkTypeImports: { type: 'boolean' }, + ignorePackages: { type: 'boolean' }, + pathGroupOverrides: { + type: 'array', + items: { + type: 'object', + properties: { + pattern: { + type: 'string' }, + + patternOptions: { + type: 'object' }, + + action: { + type: 'string', + 'enum': ['enforce', 'ignore'] } }, + + + additionalProperties: false, + required: ['pattern', 'action'] } } } }; + + + + + +function buildProperties(context) { + + var result = { + defaultConfig: 'never', + pattern: {}, + ignorePackages: false }; + + + context.options.forEach(function (obj) { + + // If this is a string, set defaultConfig to its value + if (typeof obj === 'string') { + result.defaultConfig = obj; + return; + } + + // If this is not the new structure, transfer all props to result.pattern + if (obj.pattern === undefined && obj.ignorePackages === undefined && obj.checkTypeImports === undefined) { + Object.assign(result.pattern, obj); + return; + } + + // If pattern is provided, transfer all props + if (obj.pattern !== undefined) { + Object.assign(result.pattern, obj.pattern); + } + + // If ignorePackages is provided, transfer it to result + if (obj.ignorePackages !== undefined) { + result.ignorePackages = obj.ignorePackages; + } + + if (obj.checkTypeImports !== undefined) { + result.checkTypeImports = obj.checkTypeImports; + } + + if (obj.pathGroupOverrides !== undefined) { + result.pathGroupOverrides = obj.pathGroupOverrides; + } + }); + + if (result.defaultConfig === 'ignorePackages') { + result.defaultConfig = 'always'; + result.ignorePackages = true; + } + + return result; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Ensure consistent use of file extension within the import path.', + url: (0, _docsUrl2['default'])('extensions') }, + + + schema: { + anyOf: [ + { + type: 'array', + items: [enumValues], + additionalItems: false }, + + { + type: 'array', + items: [ + enumValues, + properties], + + additionalItems: false }, + + { + type: 'array', + items: [properties], + additionalItems: false }, + + { + type: 'array', + items: [patternProperties], + additionalItems: false }, + + { + type: 'array', + items: [ + enumValues, + patternProperties], + + additionalItems: false }] } }, + + + + + + create: function () {function create(context) { + + var props = buildProperties(context); + + function getModifier(extension) { + return props.pattern[extension] || props.defaultConfig; + } + + function isUseOfExtensionRequired(extension, isPackage) { + return getModifier(extension) === 'always' && (!props.ignorePackages || !isPackage); + } + + function isUseOfExtensionForbidden(extension) { + return getModifier(extension) === 'never'; + } + + function isResolvableWithoutExtension(file) { + var extension = _path2['default'].extname(file); + var fileWithoutExtension = file.slice(0, -extension.length); + var resolvedFileWithoutExtension = (0, _resolve2['default'])(fileWithoutExtension, context); + + return resolvedFileWithoutExtension === (0, _resolve2['default'])(file, context); + } + + function isExternalRootModule(file) { + if (file === '.' || file === '..') {return false;} + var slashCount = file.split('/').length - 1; + + if (slashCount === 0) {return true;} + if ((0, _importType.isScoped)(file) && slashCount <= 1) {return true;} + return false; + } + + function computeOverrideAction(pathGroupOverrides, path) { + for (var i = 0, l = pathGroupOverrides.length; i < l; i++) {var _pathGroupOverrides$i = + pathGroupOverrides[i],pattern = _pathGroupOverrides$i.pattern,patternOptions = _pathGroupOverrides$i.patternOptions,action = _pathGroupOverrides$i.action; + if ((0, _minimatch2['default'])(path, pattern, patternOptions || { nocomment: true })) { + return action; + } + } + } + + function checkFileExtension(source, node) { + // bail if the declaration doesn't have a source, e.g. "export { foo };", or if it's only partially typed like in an editor + if (!source || !source.value) {return;} + + var importPathWithQueryString = source.value; + + // If not undefined, the user decided if rules are enforced on this import + var overrideAction = computeOverrideAction( + props.pathGroupOverrides || [], + importPathWithQueryString); + + + if (overrideAction === 'ignore') { + return; + } + + // don't enforce anything on builtins + if (!overrideAction && (0, _importType.isBuiltIn)(importPathWithQueryString, context.settings)) {return;} + + var importPath = importPathWithQueryString.replace(/\?(.*)$/, ''); + + // don't enforce in root external packages as they may have names with `.js`. + // Like `import Decimal from decimal.js`) + if (!overrideAction && isExternalRootModule(importPath)) {return;} + + var resolvedPath = (0, _resolve2['default'])(importPath, context); + + // get extension from resolved path, if possible. + // for unresolved, use source value. + var extension = _path2['default'].extname(resolvedPath || importPath).substring(1); + + // determine if this is a module + var isPackage = (0, _importType.isExternalModule)( + importPath, + (0, _resolve2['default'])(importPath, context), + context) || + (0, _importType.isScoped)(importPath); + + if (!extension || !importPath.endsWith('.' + String(extension))) { + // ignore type-only imports and exports + if (!props.checkTypeImports && (node.importKind === 'type' || node.exportKind === 'type')) {return;} + var extensionRequired = isUseOfExtensionRequired(extension, !overrideAction && isPackage); + var extensionForbidden = isUseOfExtensionForbidden(extension); + if (extensionRequired && !extensionForbidden) { + context.report({ + node: source, + message: 'Missing file extension ' + ( + extension ? '"' + String(extension) + '" ' : '') + 'for "' + String(importPathWithQueryString) + '"' }); + + } + } else if (extension) { + if (isUseOfExtensionForbidden(extension) && isResolvableWithoutExtension(importPath)) { + context.report({ + node: source, + message: 'Unexpected use of file extension "' + String(extension) + '" for "' + String(importPathWithQueryString) + '"' }); + + } + } + } + + return (0, _moduleVisitor2['default'])(checkFileExtension, { commonjs: true }); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9leHRlbnNpb25zLmpzIl0sIm5hbWVzIjpbImVudW1WYWx1ZXMiLCJwYXR0ZXJuUHJvcGVydGllcyIsInR5cGUiLCJwcm9wZXJ0aWVzIiwicGF0dGV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GVtczogW1xuICAgICAgICAgICAgZW51bVZhbHVlcyxcbiAgICAgICAgICAgIHByb3BlcnRpZXMsXG4gICAgICAgICAgXSxcbiAgICAgICAgICBhZGRpdGlvbmFsSXRlbXM6IGZhbHNlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICBpdGVtczogW3Byb3BlcnRpZXNdLFxuICAgICAgICAgIGFkZGl0aW9uYWxJdGVtczogZmFsc2UsXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgIGl0ZW1zOiBbcGF0dGVyblByb3BlcnRpZXNdLFxuICAgICAgICAgIGFkZGl0aW9uYWxJdGVtczogZmFsc2UsXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgIGl0ZW1zOiBbXG4gICAgICAgICAgICBlbnVtVmFsdWVzLFxuICAgICAgICAgICAgcGF0dGVyblByb3BlcnRpZXMsXG4gICAgICAgICAgXSxcbiAgICAgICAgICBhZGRpdGlvbmFsSXRlbXM6IGZhbHNlLFxuICAgICAgICB9LFxuICAgICAgXSxcbiAgICB9LFxuICB9LFxuXG4gIGNyZWF0ZShjb250ZXh0KSB7XG5cbiAgICBjb25zdCBwcm9wcyA9IGJ1aWxkUHJvcGVydGllcyhjb250ZXh0KTtcblxuICAgIGZ1bmN0aW9uIGdldE1vZGlmaWVyKGV4dGVuc2lvbikge1xuICAgICAgcmV0dXJuIHByb3BzLnBhdHRlcm5bZXh0ZW5zaW9uXSB8fCBwcm9wcy5kZWZhdWx0Q29uZmlnO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzVXNlT2ZFeHRlbnNpb25SZXF1aXJlZChleHRlbnNpb24sIGlzUGFja2FnZSkge1xuICAgICAgcmV0dXJuIGdldE1vZGlmaWVyKGV4dGVuc2lvbikgPT09ICdhbHdheXMn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lmIChleHRlbnNpb24pIHtcbiAgICAgICAgaWYgKGlzVXNlT2ZFeHRlbnNpb25Gb3JiaWRkZW4oZXh0ZW5zaW9uKSAmJiBpc1Jlc29sdmFibGVXaXRob3V0RXh0ZW5zaW9uKGltcG9ydFBhdGgpKSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgbm9kZTogc291cmNlLFxuICAgICAgICAgICAgbWVzc2FnZTogYFVuZXhwZWN0ZWQgdXNlIG9mIGZpbGUgZXh0ZW5zaW9uIFwiJHtleHRlbnNpb259XCIgZm9yIFwiJHtpbXBvcnRQYXRoV2l0aFF1ZXJ5U3RyaW5nfVwiYCxcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKGNoZWNrRmlsZUV4dGVuc2lvbiwgeyBjb21tb25qczogdHJ1ZSB9KTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/first.js b/node_modules/eslint-plugin-import/lib/rules/first.js new file mode 100644 index 0000000000000000000000000000000000000000..ef20658873073af87151c71f9c6082226f7eb9f3 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/first.js @@ -0,0 +1,146 @@ +'use strict';var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function getImportValue(node) { + return node.type === 'ImportDeclaration' ? + node.source.value : + node.moduleReference.expression.value; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Ensure all imports appear before other statements.', + url: (0, _docsUrl2['default'])('first') }, + + fixable: 'code', + schema: [ + { + type: 'string', + 'enum': ['absolute-first', 'disable-absolute-first'] }] }, + + + + + create: function () {function create(context) { + function isPossibleDirective(node) { + return node.type === 'ExpressionStatement' && + node.expression.type === 'Literal' && + typeof node.expression.value === 'string'; + } + + return { + Program: function () {function Program(n) { + var body = n.body; + if (!body) { + return; + } + var absoluteFirst = context.options[0] === 'absolute-first'; + var message = 'Import in body of module; reorder to top.'; + var sourceCode = (0, _contextCompat.getSourceCode)(context); + var originSourceCode = sourceCode.getText(); + var nonImportCount = 0; + var anyExpressions = false; + var anyRelative = false; + var lastLegalImp = null; + var errorInfos = []; + var shouldSort = true; + var lastSortNodesIndex = 0; + body.forEach(function (node, index) { + if (!anyExpressions && isPossibleDirective(node)) { + return; + } + + anyExpressions = true; + + if (node.type === 'ImportDeclaration' || node.type === 'TSImportEqualsDeclaration') { + if (absoluteFirst) { + if (/^\./.test(getImportValue(node))) { + anyRelative = true; + } else if (anyRelative) { + context.report({ + node: node.type === 'ImportDeclaration' ? node.source : node.moduleReference, + message: 'Absolute imports should come before relative imports.' }); + + } + } + if (nonImportCount > 0) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = (0, _contextCompat.getDeclaredVariables)(context, node)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var variable = _step.value; + if (!shouldSort) {break;} + var references = variable.references; + if (references.length) {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + for (var _iterator2 = references[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var reference = _step2.value; + if (reference.identifier.range[0] < node.range[1]) { + shouldSort = false; + break; + } + }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} + } + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + shouldSort && (lastSortNodesIndex = errorInfos.length); + errorInfos.push({ + node: node, + range: [body[index - 1].range[1], node.range[1]] }); + + } else { + lastLegalImp = node; + } + } else { + nonImportCount++; + } + }); + if (!errorInfos.length) {return;} + errorInfos.forEach(function (errorInfo, index) { + var node = errorInfo.node; + var infos = { + node: node, + message: message }; + + if (index < lastSortNodesIndex) { + infos.fix = function (fixer) { + return fixer.insertTextAfter(node, ''); + }; + } else if (index === lastSortNodesIndex) { + var sortNodes = errorInfos.slice(0, lastSortNodesIndex + 1); + infos.fix = function (fixer) { + var removeFixers = sortNodes.map(function (_errorInfo) { + return fixer.removeRange(_errorInfo.range); + }); + var range = [0, removeFixers[removeFixers.length - 1].range[1]]; + var insertSourceCode = sortNodes.map(function (_errorInfo) { + var nodeSourceCode = String.prototype.slice.apply( + originSourceCode, _errorInfo.range); + + if (/\S/.test(nodeSourceCode[0])) { + return '\n' + String(nodeSourceCode); + } + return nodeSourceCode; + }).join(''); + var insertFixer = null; + var replaceSourceCode = ''; + if (!lastLegalImp) { + insertSourceCode = insertSourceCode.trim() + insertSourceCode.match(/^(\s+)/)[0]; + } + insertFixer = lastLegalImp ? + fixer.insertTextAfter(lastLegalImp, insertSourceCode) : + fixer.insertTextBefore(body[0], insertSourceCode); + + var fixers = [insertFixer].concat(removeFixers); + fixers.forEach(function (computedFixer, i) { + replaceSourceCode += originSourceCode.slice( + fixers[i - 1] ? fixers[i - 1].range[1] : 0, computedFixer.range[0]) + + computedFixer.text; + }); + + return fixer.replaceTextRange(range, replaceSourceCode); + }; + } + context.report(infos); + }); + }return Program;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9maXJzdC5qcyJdLCJuYW1lcyI6WyJnZXRJbXBvcnRWYWx1ZSIsIm5vZGUiLCJ0eXBlIiwic291cmNlIiwidmFsdWUiLCJtb2R1bGVSZWZlcmVuY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1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGFueUV4cHJlc3Npb25zID0gdHJ1ZTtcblxuICAgICAgICAgIGlmIChub2RlLnR5cGUgPT09ICdJbXBvcnREZWNsYXJhdGlvbicgfHwgbm9kZS50eXBlID09PSAnVFNJbXBvcnRFcXVhbHNEZWNsYXJhdGlvbicpIHtcbiAgICAgICAgICAgIGlmIChhYnNvbHV0ZUZpcnN0KSB7XG4gICAgICAgICAgICAgIGlmICgoL15cXC4vKS50ZXN0KGdldEltcG9ydFZhbHVlKG5vZGUpKSkge1xuICAgICAgICAgICAgICAgIGFueVJlbGF0aXZlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChhbnlSZWxhdGl2ZSkge1xuICAgICAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGUudHlwZSA9PT0gJ0ltcG9ydERlY2xhcmF0aW9uJyA/IG5vZGUuc291cmNlIDogbm9kZS5tb2R1bGVSZWZlcmVuY2UsXG4gICAgICAgICAgICAgICAgICBtZXNzYWdlOiAnQWJzb2x1dGUgaW1wb3J0cyBzaG91bGQgY29tZSBiZWZvcmUgcmVsYXRpdmUgaW1wb3J0cy4nLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobm9uSW1wb3J0Q291bnQgPiAwKSB7XG4gICAgICAgICAgICAgIGZvciAoY29uc3QgdmFyaWFibGUgb2YgZ2V0RGVjbGFyZWRWYXJpYWJsZXMoY29udGV4dCwgbm9kZSkpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXNob3VsZFNvcnQpIHsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICBjb25zdCByZWZlcmVuY2VzID0gdmFyaWFibGUucmVmZXJlbmNlcztcbiAgICAgICAgICAgICAgICBpZiAocmVmZXJlbmNlcy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgcmVmZXJlbmNlIG9mIHJlZmVyZW5jZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlZmVyZW5jZS5pZGVudGlmaWVyLnJhbmdlWzBdIDwgbm9kZS5yYW5nZVsxXSkge1xuICAgICAgICAgICAgICAgICAgICAgIHNob3VsZFNvcnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBzaG91bGRTb3J0ICYmIChsYXN0U29ydE5vZGVzSW5kZXggPSBlcnJvckluZm9zLmxlbmd0aCk7XG4gICAgICAgICAgICAgIGVycm9ySW5mb3MucHVzaCh7XG4gICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICByYW5nZTogW2JvZHlbaW5kZXggLSAxXS5yYW5nZVsxXSwgbm9kZS5yYW5nZVsxXV0sXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbGFzdExlZ2FsSW1wID0gbm9kZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9uSW1wb3J0Q291bnQrKztcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoIWVycm9ySW5mb3MubGVuZ3RoKSB7IHJldHVybjsgfVxuICAgICAgICBlcnJvckluZm9zLmZvckVhY2goZnVuY3Rpb24gKGVycm9ySW5mbywgaW5kZXgpIHtcbiAgICAgICAgICBjb25zdCBub2RlID0gZXJyb3JJbmZvLm5vZGU7XG4gICAgICAgICAgY29uc3QgaW5mb3MgPSB7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgbWVzc2FnZSxcbiAgICAgICAgICB9O1xuICAgICAgICAgIGlmIChpbmRleCA8IGxhc3RTb3J0Tm9kZXNJbmRleCkge1xuICAgICAgICAgICAgaW5mb3MuZml4ID0gZnVuY3Rpb24gKGZpeGVyKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmaXhlci5pbnNlcnRUZXh0QWZ0ZXIobm9kZSwgJycpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGluZGV4ID09PSBsYXN0U29ydE5vZGVzSW5kZXgpIHtcbiAgICAgICAgICAgIGNvbnN0IHNvcnROb2RlcyA9IGVycm9ySW5mb3Muc2xpY2UoMCwgbGFzdFNvcnROb2Rlc0luZGV4ICsgMSk7XG4gICAgICAgICAgICBpbmZvcy5maXggPSBmdW5jdGlvbiAoZml4ZXIpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVtb3ZlRml4ZXJzID0gc29ydE5vZGVzLm1hcChmdW5jdGlvbiAoX2Vycm9ySW5mbykge1xuICAgICAgICAgICAgICAgIHJldHVybiBmaXhlci5yZW1vdmVSYW5nZShfZXJyb3JJbmZvLnJhbmdlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGNvbnN0IHJhbmdlID0gWzAsIHJlbW92ZUZpeGVyc1tyZW1vdmVGaXhlcnMubGVuZ3RoIC0gMV0ucmFuZ2VbMV1dO1xuICAgICAgICAgICAgICBsZXQgaW5zZXJ0U291cmNlQ29kZSA9IHNvcnROb2Rlcy5tYXAoZnVuY3Rpb24gKF9lcnJvckluZm8pIHtcbiAgICAgICAgICAgICAgICBjb25zdCBub2RlU291cmNlQ29kZSA9IFN0cmluZy5wcm90b3R5cGUuc2xpY2UuYXBwbHkoXG4gICAgICAgICAgICAgICAgICBvcmlnaW5Tb3VyY2VDb2RlLCBfZXJyb3JJbmZvLnJhbmdlLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgaWYgKCgvXFxTLykudGVzdChub2RlU291cmNlQ29kZVswXSkpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBgXFxuJHtub2RlU291cmNlQ29kZX1gO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZVNvdXJjZUNvZGU7XG4gICAgICAgICAgICAgIH0pLmpvaW4oJycpO1xuICAgICAgICAgICAgICBsZXQgaW5zZXJ0Rml4ZXIgPSBudWxsO1xuICAgICAgICAgICAgICBsZXQgcmVwbGFjZVNvdXJjZUNvZGUgPSAnJztcbiAgICAgICAgICAgICAgaWYgKCFsYXN0TGVnYWxJbXApIHtcbiAgICAgICAgICAgICAgICBpbnNlcnRTb3VyY2VDb2RlID0gaW5zZXJ0U291cmNlQ29kZS50cmltKCkgKyBpbnNlcnRTb3VyY2VDb2RlLm1hdGNoKC9eKFxccyspLylbMF07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaW5zZXJ0Rml4ZXIgPSBsYXN0TGVnYWxJbXBcbiAgICAgICAgICAgICAgICA/IGZpeGVyLmluc2VydFRleHRBZnRlcihsYXN0TGVnYWxJbXAsIGluc2VydFNvdXJjZUNvZGUpXG4gICAgICAgICAgICAgICAgOiBmaXhlci5pbnNlcnRUZXh0QmVmb3JlKGJvZHlbMF0sIGluc2VydFNvdXJjZUNvZGUpO1xuXG4gICAgICAgICAgICAgIGNvbnN0IGZpeGVycyA9IFtpbnNlcnRGaXhlcl0uY29uY2F0KHJlbW92ZUZpeGVycyk7XG4gICAgICAgICAgICAgIGZpeGVycy5mb3JFYWNoKChjb21wdXRlZEZpeGVyLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgcmVwbGFjZVNvdXJjZUNvZGUgKz0gb3JpZ2luU291cmNlQ29kZS5zbGljZShcbiAgICAgICAgICAgICAgICAgIGZpeGVyc1tpIC0gMV0gPyBmaXhlcnNbaSAtIDFdLnJhbmdlWzFdIDogMCwgY29tcHV0ZWRGaXhlci5yYW5nZVswXSxcbiAgICAgICAgICAgICAgICApICsgY29tcHV0ZWRGaXhlci50ZXh0O1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICByZXR1cm4gZml4ZXIucmVwbGFjZVRleHRSYW5nZShyYW5nZSwgcmVwbGFjZVNvdXJjZUNvZGUpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoaW5mb3MpO1xuICAgICAgICB9KTtcbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/group-exports.js b/node_modules/eslint-plugin-import/lib/rules/group-exports.js new file mode 100644 index 0000000000000000000000000000000000000000..e108fa2c4736c1628627ead4db51a5fe65ad9186 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/group-exports.js @@ -0,0 +1,155 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _object = require('object.values');var _object2 = _interopRequireDefault(_object); +var _arrayPrototype = require('array.prototype.flat');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var meta = { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Prefer named exports to be grouped together in a single export declaration', + url: (0, _docsUrl2['default'])('group-exports') } }; + + +/* eslint-disable max-len */ +var errors = { + ExportNamedDeclaration: 'Multiple named export declarations; consolidate all named exports into a single export declaration', + AssignmentExpression: 'Multiple CommonJS exports; consolidate all exports into a single assignment to `module.exports`' }; + +/* eslint-enable max-len */ + +/** + * Returns an array with names of the properties in the accessor chain for MemberExpression nodes + * + * Example: + * + * `module.exports = {}` => ['module', 'exports'] + * `module.exports.property = true` => ['module', 'exports', 'property'] + * + * @param {Node} node AST Node (MemberExpression) + * @return {Array} Array with the property names in the chain + * @private + */ +function accessorChain(node) { + var chain = []; + + do { + chain.unshift(node.property.name); + + if (node.object.type === 'Identifier') { + chain.unshift(node.object.name); + break; + } + + node = node.object; + } while (node.type === 'MemberExpression'); + + return chain; +} + +function create(context) { + var nodes = { + modules: { + set: new Set(), + sources: {} }, + + types: { + set: new Set(), + sources: {} }, + + commonjs: { + set: new Set() } }; + + + + return { + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + var target = node.exportKind === 'type' ? nodes.types : nodes.modules; + if (!node.source) { + target.set.add(node); + } else if (Array.isArray(target.sources[node.source.value])) { + target.sources[node.source.value].push(node); + } else { + target.sources[node.source.value] = [node]; + } + }return ExportNamedDeclaration;}(), + + AssignmentExpression: function () {function AssignmentExpression(node) { + if (node.left.type !== 'MemberExpression') { + return; + } + + var chain = accessorChain(node.left); + + // Assignments to module.exports + // Deeper assignments are ignored since they just modify what's already being exported + // (ie. module.exports.exported.prop = true is ignored) + if (chain[0] === 'module' && chain[1] === 'exports' && chain.length <= 3) { + nodes.commonjs.set.add(node); + return; + } + + // Assignments to exports (exports.* = *) + if (chain[0] === 'exports' && chain.length === 2) { + nodes.commonjs.set.add(node); + return; + } + }return AssignmentExpression;}(), + + 'Program:exit': function () {function onExit() { + // Report multiple `export` declarations (ES2015 modules) + if (nodes.modules.set.size > 1) { + nodes.modules.set.forEach(function (node) { + context.report({ + node: node, + message: errors[node.type] }); + + }); + } + + // Report multiple `aggregated exports` from the same module (ES2015 modules) + (0, _arrayPrototype2['default'])((0, _object2['default'])(nodes.modules.sources). + filter(function (nodesWithSource) {return Array.isArray(nodesWithSource) && nodesWithSource.length > 1;})). + forEach(function (node) { + context.report({ + node: node, + message: errors[node.type] }); + + }); + + // Report multiple `export type` declarations (FLOW ES2015 modules) + if (nodes.types.set.size > 1) { + nodes.types.set.forEach(function (node) { + context.report({ + node: node, + message: errors[node.type] }); + + }); + } + + // Report multiple `aggregated type exports` from the same module (FLOW ES2015 modules) + (0, _arrayPrototype2['default'])((0, _object2['default'])(nodes.types.sources). + filter(function (nodesWithSource) {return Array.isArray(nodesWithSource) && nodesWithSource.length > 1;})). + forEach(function (node) { + context.report({ + node: node, + message: errors[node.type] }); + + }); + + // Report multiple `module.exports` assignments (CommonJS) + if (nodes.commonjs.set.size > 1) { + nodes.commonjs.set.forEach(function (node) { + context.report({ + node: node, + message: errors[node.type] }); + + }); + } + }return onExit;}() }; + +} + +module.exports = { + meta: meta, + create: create }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9ncm91cC1leHBvcnRzLmpzIl0sIm5hbWVzIjpbIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJlcnJvcnMiLCJFeHBvcnROYW1lZERlY2xhcmF0aW9uIiwiQXNzaWdubWVudEV4cHJlc3Npb24iLCJhY2Nlc3NvckNoYWluIiwibm9kZSIsImNoYWluIiwidW5zaGlmdCIsInByb3BlcnR5IiwibmFtZSIsIm9iamVjdCIsImNyZWF0ZSIsImNvbnRleHQiLCJub2RlcyIsIm1vZHVsZXMiLCJzZXQiLCJTZXQiLCJzb3VyY2VzIiwidHlwZXMiLCJjb21tb25qcyIsInRhcmdldCIsImV4cG9ydEtpbmQiLCJzb3VyY2UiLCJhZGQiLCJBcnJheSIsImlzQXJyYXkiLCJ2YWx1ZSIsInB1c2giLCJsZWZ0IiwibGVuZ3RoIiwib25FeGl0Iiwic2l6ZSIsImZvckVhY2giLCJyZXBvcnQiLCJtZXNzYWdlIiwiZmlsdGVyIiwibm9kZXNXaXRoU291cmNlIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6ImFBQUEscUM7QUFDQSx1QztBQUNBLHNEOztBQUVBLElBQU1BLE9BQU87QUFDWEMsUUFBTSxZQURLO0FBRVhDLFFBQU07QUFDSkMsY0FBVSxhQUROO0FBRUpDLGlCQUFhLDRFQUZUO0FBR0pDLFNBQUssMEJBQVEsZUFBUixDQUhELEVBRkssRUFBYjs7O0FBUUE7QUFDQSxJQUFNQyxTQUFTO0FBQ2JDLDBCQ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KTtcbiAgICAgIH1cbiAgICB9LFxuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHtcbiAgbWV0YSxcbiAgY3JlYXRlLFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/imports-first.js b/node_modules/eslint-plugin-import/lib/rules/imports-first.js new file mode 100644 index 0000000000000000000000000000000000000000..f242ac782923257ab079422c64e20d79278a512b --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/imports-first.js @@ -0,0 +1,16 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var first = require('./first'); + +var newMeta = Object.assign({}, +first.meta, { + deprecated: true, + docs: { + category: 'Style guide', + description: 'Replaced by `import/first`.', + url: (0, _docsUrl2['default'])('imports-first', '7b25c1cb95ee18acc1531002fd343e1e6031f9ed') } }); + + + +module.exports = Object.assign({}, first, { meta: newMeta }); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9pbXBvcnRzLWZpcnN0LmpzIl0sIm5hbWVzIjpbImZpcnN0IiwicmVxdWlyZSIsIm5ld01ldGEiLCJtZXRhIiwiZGVwcmVjYXRlZCIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6ImFBQUEscUM7O0FBRUEsSUFBTUEsUUFBUUMsUUFBUSxTQUFSLENBQWQ7O0FBRUEsSUFBTUM7QUFDREYsTUFBTUcsSUFETDtBQUVKQyxjQUFZLElBRlI7QUFHSkMsUUFBTTtBQUNKQyxjQUFVLGFBRE47QUFFSkMsaUJBQWEsNkJBRlQ7QUFHSkMsU0FBSywwQkFBUSxlQUFSLEVBQXlCLDBDQUF6QixDQUhELEVBSEYsR0FBTjs7OztBQVVBQyxPQUFPQyxPQUFQLHFCQUFzQlYsS0FBdEIsSUFBNkJHLE1BQU1ELE9BQW5DIiwiZmlsZSI6ImltcG9ydHMtZmlyc3QuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgZG9jc1VybCBmcm9tICcuLi9kb2NzVXJsJztcblxuY29uc3QgZmlyc3QgPSByZXF1aXJlKCcuL2ZpcnN0Jyk7XG5cbmNvbnN0IG5ld01ldGEgPSB7XG4gIC4uLmZpcnN0Lm1ldGEsXG4gIGRlcHJlY2F0ZWQ6IHRydWUsXG4gIGRvY3M6IHtcbiAgICBjYXRlZ29yeTogJ1N0eWxlIGd1aWRlJyxcbiAgICBkZXNjcmlwdGlvbjogJ1JlcGxhY2VkIGJ5IGBpbXBvcnQvZmlyc3RgLicsXG4gICAgdXJsOiBkb2NzVXJsKCdpbXBvcnRzLWZpcnN0JywgJzdiMjVjMWNiOTVlZTE4YWNjMTUzMTAwMmZkMzQzZTFlNjAzMWY5ZWQnKSxcbiAgfSxcbn07XG5cbm1vZHVsZS5leHBvcnRzID0geyAuLi5maXJzdCwgbWV0YTogbmV3TWV0YSB9O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js b/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js new file mode 100644 index 0000000000000000000000000000000000000000..48809701092800f84b60ed0c08443ade4553e632 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js @@ -0,0 +1,60 @@ +'use strict';var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var DEFAULT_MAX = 10; +var DEFAULT_IGNORE_TYPE_IMPORTS = false; +var TYPE_IMPORT = 'type'; + +var countDependencies = function countDependencies(dependencies, lastNode, context) {var _ref = + context.options[0] || { max: DEFAULT_MAX },max = _ref.max; + + if (dependencies.size > max) { + context.report(lastNode, 'Maximum number of dependencies (' + String(max) + ') exceeded.'); + } +}; + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Enforce the maximum number of dependencies a module can have.', + url: (0, _docsUrl2['default'])('max-dependencies') }, + + + schema: [ + { + type: 'object', + properties: { + max: { type: 'number' }, + ignoreTypeImports: { type: 'boolean' } }, + + additionalProperties: false }] }, + + + + + create: function () {function create(context) {var _ref2 = + + + context.options[0] || {},_ref2$ignoreTypeImpor = _ref2.ignoreTypeImports,ignoreTypeImports = _ref2$ignoreTypeImpor === undefined ? DEFAULT_IGNORE_TYPE_IMPORTS : _ref2$ignoreTypeImpor; + + var dependencies = new Set(); // keep track of dependencies + var lastNode = void 0; // keep track of the last node to report on + + return Object.assign({ + 'Program:exit': function () {function ProgramExit() { + countDependencies(dependencies, lastNode, context); + }return ProgramExit;}() }, + (0, _moduleVisitor2['default'])( + function (source, _ref3) {var importKind = _ref3.importKind; + if (importKind !== TYPE_IMPORT || !ignoreTypeImports) { + dependencies.add(source.value); + } + lastNode = source; + }, + { commonjs: true })); + + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9tYXgtZGVwZW5kZW5jaWVzLmpzIl0sIm5hbWVzIjpbIkRFRkFVTFRfTUFYIiwiREVGQVVMVF9JR05PUkVfVFlQRV9JTVBPUlRTIiwiVFlQRV9JTVBPUlQiLCJjb3VudERlcGVuZGVuY2llcyIsImRlcGVuZGVuY2llcyIsImxhc3ROb2RlIiwiY29udGV4dCIsIm9wdGlvbnMiLCJtYXgiLCJzaXplIiwicmVwb3J0IiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1c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VuZGVuY2llcyA9IG5ldyBTZXQoKTsgLy8ga2VlcCB0cmFjayBvZiBkZXBlbmRlbmNpZXNcbiAgICBsZXQgbGFzdE5vZGU7IC8vIGtlZXAgdHJhY2sgb2YgdGhlIGxhc3Qgbm9kZSB0byByZXBvcnQgb25cblxuICAgIHJldHVybiB7XG4gICAgICAnUHJvZ3JhbTpleGl0JygpIHtcbiAgICAgICAgY291bnREZXBlbmRlbmNpZXMoZGVwZW5kZW5jaWVzLCBsYXN0Tm9kZSwgY29udGV4dCk7XG4gICAgICB9LFxuICAgICAgLi4ubW9kdWxlVmlzaXRvcihcbiAgICAgICAgKHNvdXJjZSwgeyBpbXBvcnRLaW5kIH0pID0+IHtcbiAgICAgICAgICBpZiAoaW1wb3J0S2luZCAhPT0gVFlQRV9JTVBPUlQgfHwgIWlnbm9yZVR5cGVJbXBvcnRzKSB7XG4gICAgICAgICAgICBkZXBlbmRlbmNpZXMuYWRkKHNvdXJjZS52YWx1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGxhc3ROb2RlID0gc291cmNlO1xuICAgICAgICB9LFxuICAgICAgICB7IGNvbW1vbmpzOiB0cnVlIH0sXG4gICAgICApLFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/named.js b/node_modules/eslint-plugin-import/lib/rules/named.js new file mode 100644 index 0000000000000000000000000000000000000000..6340cf3f98881ed9a18cdf3236fb1f71eb3dd134 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/named.js @@ -0,0 +1,145 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _path = require('path');var path = _interopRequireWildcard(_path); +var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj['default'] = obj;return newObj;}} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Static analysis', + description: 'Ensure named imports correspond to a named export in the remote file.', + url: (0, _docsUrl2['default'])('named') }, + + schema: [ + { + type: 'object', + properties: { + commonjs: { + type: 'boolean' } }, + + + additionalProperties: false }] }, + + + + + create: function () {function create(context) { + var options = context.options[0] || {}; + + function checkSpecifiers(key, type, node) { + // ignore local exports and type imports/exports + if ( + node.source == null || + node.importKind === 'type' || + node.importKind === 'typeof' || + node.exportKind === 'type') + { + return; + } + + if (!node.specifiers.some(function (im) {return im.type === type;})) { + return; // no named imports/exports + } + + var imports = _builder2['default'].get(node.source.value, context); + if (imports == null || imports.parseGoal === 'ambiguous') { + return; + } + + if (imports.errors.length) { + imports.reportErrors(context, node); + return; + } + + node.specifiers.forEach(function (im) { + if ( + im.type !== type + // ignore type imports + || im.importKind === 'type' || im.importKind === 'typeof') + { + return; + } + + var name = im[key].name || im[key].value; + + var deepLookup = imports.hasDeep(name); + + if (!deepLookup.found) { + if (deepLookup.path.length > 1) { + var deepPath = deepLookup.path. + map(function (i) {return path.relative(path.dirname((0, _contextCompat.getPhysicalFilename)(context)), i.path);}). + join(' -> '); + + context.report(im[key], String(name) + ' not found via ' + String(deepPath)); + } else { + context.report(im[key], String(name) + ' not found in \'' + String(node.source.value) + '\''); + } + } + }); + } + + function checkRequire(node) { + if ( + !options.commonjs || + node.type !== 'VariableDeclarator' + // return if it's not an object destructure or it's an empty object destructure + || !node.id || node.id.type !== 'ObjectPattern' || node.id.properties.length === 0 + // return if there is no call expression on the right side + || !node.init || node.init.type !== 'CallExpression') + { + return; + } + + var call = node.init;var _call$arguments = _slicedToArray( + call.arguments, 1),source = _call$arguments[0]; + var variableImports = node.id.properties; + var variableExports = _builder2['default'].get(source.value, context); + + if ( + // return if it's not a commonjs require statement + call.callee.type !== 'Identifier' || call.callee.name !== 'require' || call.arguments.length !== 1 + // return if it's not a string source + || source.type !== 'Literal' || + variableExports == null || + variableExports.parseGoal === 'ambiguous') + { + return; + } + + if (variableExports.errors.length) { + variableExports.reportErrors(context, node); + return; + } + + variableImports.forEach(function (im) { + if (im.type !== 'Property' || !im.key || im.key.type !== 'Identifier') { + return; + } + + var deepLookup = variableExports.hasDeep(im.key.name); + + if (!deepLookup.found) { + if (deepLookup.path.length > 1) { + var deepPath = deepLookup.path. + map(function (i) {return path.relative(path.dirname((0, _contextCompat.getFilename)(context)), i.path);}). + join(' -> '); + + context.report(im.key, String(im.key.name) + ' not found via ' + String(deepPath)); + } else { + context.report(im.key, String(im.key.name) + ' not found in \'' + String(source.value) + '\''); + } + } + }); + } + + return { + ImportDeclaration: checkSpecifiers.bind(null, 'imported', 'ImportSpecifier'), + + ExportNamedDeclaration: checkSpecifiers.bind(null, 'local', 'ExportSpecifier'), + + VariableDeclarator: checkRequire }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uYW1lZC5qcyJdLCJuYW1lcyI6WyJwYXRoIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJzY2hlbWEiLCJw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cmUgdHlwZSBpbXBvcnRzXG4gICAgICAgICAgfHwgaW0uaW1wb3J0S2luZCA9PT0gJ3R5cGUnIHx8IGltLmltcG9ydEtpbmQgPT09ICd0eXBlb2YnXG4gICAgICAgICkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IG5hbWUgPSBpbVtrZXldLm5hbWUgfHwgaW1ba2V5XS52YWx1ZTtcblxuICAgICAgICBjb25zdCBkZWVwTG9va3VwID0gaW1wb3J0cy5oYXNEZWVwKG5hbWUpO1xuXG4gICAgICAgIGlmICghZGVlcExvb2t1cC5mb3VuZCkge1xuICAgICAgICAgIGlmIChkZWVwTG9va3VwLnBhdGgubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgY29uc3QgZGVlcFBhdGggPSBkZWVwTG9va3VwLnBhdGhcbiAgICAgICAgICAgICAgLm1hcCgoaSkgPT4gcGF0aC5yZWxhdGl2ZShwYXRoLmRpcm5hbWUoZ2V0UGh5c2ljYWxGaWxlbmFtZShjb250ZXh0KSksIGkucGF0aCkpXG4gICAgICAgICAgICAgIC5qb2luKCcgLT4gJyk7XG5cbiAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KGltW2tleV0sIGAke25hbWV9IG5vdCBmb3VuZCB2aWEgJHtkZWVwUGF0aH1gKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoaW1ba2V5XSwgYCR7bmFtZX0gbm90IGZvdW5kIGluICcke25vZGUuc291cmNlLnZhbHVlfSdgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNoZWNrUmVxdWlyZShub2RlKSB7XG4gICAgICBpZiAoXG4gICAgICAgICFvcHRpb25zLmNvbW1vbmpzXG4gICAgICAgIHx8IG5vZGUudHlwZSAhPT0gJ1ZhcmlhYmxlRGVjbGFyYXRvcidcbiAgICAgICAgLy8g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G9ydHMgPT0gbnVsbFxuICAgICAgICB8fCB2YXJpYWJsZUV4cG9ydHMucGFyc2VHb2FsID09PSAnYW1iaWd1b3VzJ1xuICAgICAgKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgaWYgKHZhcmlhYmxlRXhwb3J0cy5lcnJvcnMubGVuZ3RoKSB7XG4gICAgICAgIHZhcmlhYmxlRXhwb3J0cy5yZXBvcnRFcnJvcnMoY29udGV4dCwgbm9kZSk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgdmFyaWFibGVJbXBvcnRzLmZvckVhY2goZnVuY3Rpb24gKGltKSB7XG4gICAgICAgIGlmIChpbS50eXBlICE9PSAnUHJvcGVydHknIHx8ICFpbS5rZXkgfHwgaW0ua2V5LnR5cGUgIT09ICdJZGVudGlmaWVyJykge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGRlZXBMb29rdXAgPSB2YXJpYWJsZUV4cG9ydHMuaGFzRGVlcChpbS5rZXkubmFtZSk7XG5cbiAgICAgICAgaWYgKCFkZWVwTG9va3VwLmZvdW5kKSB7XG4gICAgICAgICAgaWYgKGRlZXBMb29rdXAucGF0aC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICBjb25zdCBkZWVwUGF0aCA9IGRlZXBMb29rdXAucGF0aFxuICAgICAgICAgICAgICAubWFwKChpKSA9PiBwYXRoLnJlbGF0aXZlKHBhdGguZGlybmFtZShnZXRGaWxlbmFtZShjb250ZXh0KSksIGkucGF0aCkpXG4gICAgICAgICAgICAgIC5qb2luKCcgLT4gJyk7XG5cbiAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KGltLmtleSwgYCR7aW0ua2V5Lm5hbWV9IG5vdCBmb3VuZCB2aWEgJHtkZWVwUGF0aH1gKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoaW0ua2V5LCBgJHtpbS5rZXkubmFtZX0gbm90IGZvdW5kIGluICcke3NvdXJjZS52YWx1ZX0nYCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgSW1wb3J0RGVjbGFyYXRpb246IGNoZWNrU3BlY2lmaWVycy5iaW5kKG51bGwsICdpbXBvcnRlZCcsICdJbXBvcnRTcGVjaWZpZXInKSxcblxuICAgICAgRXhwb3J0TmFtZWREZWNsYXJhdGlvbjogY2hlY2tTcGVjaWZpZXJzLmJpbmQobnVsbCwgJ2xvY2FsJywgJ0V4cG9ydFNwZWNpZmllcicpLFxuXG4gICAgICBWYXJpYWJsZURlY2xhcmF0b3I6IGNoZWNrUmVxdWlyZSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/namespace.js b/node_modules/eslint-plugin-import/lib/rules/namespace.js new file mode 100644 index 0000000000000000000000000000000000000000..217c1d1b6b0fcf280f164dcbe1939820cd70c76f --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/namespace.js @@ -0,0 +1,219 @@ +'use strict';var _declaredScope = require('eslint-module-utils/declaredScope');var _declaredScope2 = _interopRequireDefault(_declaredScope); +var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _exportMap = require('../exportMap');var _exportMap2 = _interopRequireDefault(_exportMap); +var _importDeclaration = require('../importDeclaration');var _importDeclaration2 = _interopRequireDefault(_importDeclaration); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function processBodyStatement(context, namespaces, declaration) { + if (declaration.type !== 'ImportDeclaration') {return;} + + if (declaration.specifiers.length === 0) {return;} + + var imports = _builder2['default'].get(declaration.source.value, context); + if (imports == null) {return null;} + + if (imports.errors.length > 0) { + imports.reportErrors(context, declaration); + return; + } + + declaration.specifiers.forEach(function (specifier) { + switch (specifier.type) { + case 'ImportNamespaceSpecifier': + if (!imports.size) { + context.report( + specifier, 'No exported names found in module \'' + String( + declaration.source.value) + '\'.'); + + } + namespaces.set(specifier.local.name, imports); + break; + case 'ImportDefaultSpecifier': + case 'ImportSpecifier':{ + var meta = imports.get( + // default to 'default' for default https://i.imgur.com/nj6qAWy.jpg + specifier.imported ? specifier.imported.name || specifier.imported.value : 'default'); + + if (!meta || !meta.namespace) {break;} + namespaces.set(specifier.local.name, meta.namespace); + break; + } + default:} + + }); +} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Static analysis', + description: 'Ensure imported namespaces contain dereferenced properties as they are dereferenced.', + url: (0, _docsUrl2['default'])('namespace') }, + + + schema: [ + { + type: 'object', + properties: { + allowComputed: { + description: 'If `false`, will report computed (and thus, un-lintable) references to namespace members.', + type: 'boolean', + 'default': false } }, + + + additionalProperties: false }] }, + + + + + create: function () {function namespaceRule(context) { + // read options + var _ref = + + context.options[0] || {},_ref$allowComputed = _ref.allowComputed,allowComputed = _ref$allowComputed === undefined ? false : _ref$allowComputed; + + var namespaces = new Map(); + + function makeMessage(last, namepath) { + return '\'' + String(last.name) + '\' not found in ' + (namepath.length > 1 ? 'deeply ' : '') + 'imported namespace \'' + String(namepath.join('.')) + '\'.'; + } + + return { + // pick up all imports at body entry time, to properly respect hoisting + Program: function () {function Program(_ref2) {var body = _ref2.body; + body.forEach(function (x) {processBodyStatement(context, namespaces, x);}); + }return Program;}(), + + // same as above, but does not add names to local map + ExportNamespaceSpecifier: function () {function ExportNamespaceSpecifier(namespace) { + var declaration = (0, _importDeclaration2['default'])(context, namespace); + + var imports = _builder2['default'].get(declaration.source.value, context); + if (imports == null) {return null;} + + if (imports.errors.length) { + imports.reportErrors(context, declaration); + return; + } + + if (!imports.size) { + context.report( + namespace, 'No exported names found in module \'' + String( + declaration.source.value) + '\'.'); + + } + }return ExportNamespaceSpecifier;}(), + + // todo: check for possible redefinition + + MemberExpression: function () {function MemberExpression(dereference) { + if (dereference.object.type !== 'Identifier') {return;} + if (!namespaces.has(dereference.object.name)) {return;} + if ((0, _declaredScope2['default'])(context, dereference.object.name, dereference) !== 'module') {return;} + + if (dereference.parent.type === 'AssignmentExpression' && dereference.parent.left === dereference) { + context.report( + dereference.parent, 'Assignment to member of namespace \'' + String( + dereference.object.name) + '\'.'); + + } + + // go deep + var namespace = namespaces.get(dereference.object.name); + var namepath = [dereference.object.name]; + // while property is namespace and parent is member expression, keep validating + while (namespace instanceof _exportMap2['default'] && dereference.type === 'MemberExpression') { + if (dereference.computed) { + if (!allowComputed) { + context.report( + dereference.property, 'Unable to validate computed reference to imported namespace \'' + String( + dereference.object.name) + '\'.'); + + } + return; + } + + if (!namespace.has(dereference.property.name)) { + context.report( + dereference.property, + makeMessage(dereference.property, namepath)); + + break; + } + + var exported = namespace.get(dereference.property.name); + if (exported == null) {return;} + + // stash and pop + namepath.push(dereference.property.name); + namespace = exported.namespace; + dereference = dereference.parent; + } + }return MemberExpression;}(), + + VariableDeclarator: function () {function VariableDeclarator(_ref3) {var id = _ref3.id,init = _ref3.init; + if (init == null) {return;} + if (init.type !== 'Identifier') {return;} + if (!namespaces.has(init.name)) {return;} + + // check for redefinition in intermediate scopes + if ((0, _declaredScope2['default'])(context, init.name, init) !== 'module') {return;} + + // DFS traverse child namespaces + function testKey(pattern, namespace) {var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [init.name]; + if (!(namespace instanceof _exportMap2['default'])) {return;} + + if (pattern.type !== 'ObjectPattern') {return;}var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + + for (var _iterator = pattern.properties[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var property = _step.value; + if ( + property.type === 'ExperimentalRestProperty' || + property.type === 'RestElement' || + !property.key) + { + continue; + } + + if (property.key.type !== 'Identifier') { + context.report({ + node: property, + message: 'Only destructure top-level names.' }); + + continue; + } + + if (!namespace.has(property.key.name)) { + context.report({ + node: property, + message: makeMessage(property.key, path) }); + + continue; + } + + path.push(property.key.name); + var dependencyExportMap = namespace.get(property.key.name); + // could be null when ignored or ambiguous + if (dependencyExportMap !== null) { + testKey(property.value, dependencyExportMap.namespace, path); + } + path.pop(); + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + } + + testKey(id, namespaces.get(init.name)); + }return VariableDeclarator;}(), + + JSXMemberExpression: function () {function JSXMemberExpression(_ref4) {var object = _ref4.object,property = _ref4.property; + if (!namespaces.has(object.name)) {return;} + var namespace = namespaces.get(object.name); + if (!namespace.has(property.name)) { + context.report({ + node: property, + message: makeMessage(property, [object.name]) }); + + } + }return JSXMemberExpression;}() }; + + }return namespaceRule;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uYW1lc3BhY2UuanMiXSwibmFtZXMiOlsicHJvY2Vzc0JvZHlTdGF0ZW1lbnQiLCJjb250ZXh0IiwibmFtZXNwYWNlcyIsImRlY2xhcmF0aW9uIiwidHlwZSIsInNwZWNpZmllcnMiLCJsZW5ndGgiLCJpbXBvcnRzIiwiRXhwb3J0TWFwQnVpbGRlciIsImdldCIsInNvdXJjZSIsInZhbHVlIiwiZXJyb3JzIiwicmVwb3J0RXJyb3JzIiwiZm9yRWFjaCIsInNwZWNpZmllciIsInNpemUiLCJyZXBvcnQiLCJzZXQiLCJsb2NhbCIsIm5hbWUiLCJtZXRhIiwiaW1wb3J0ZWQiLCJuYW1lc3BhY2UiLCJtb2R1bGUiLCJleHBvcnRzIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiYWxsb3dDb21wdXRlZCIsImFkZGl0a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gfVxuXG4gICAgICAgIGlmIChpbXBvcnRzLmVycm9ycy5sZW5ndGgpIHtcbiAgICAgICAgICBpbXBvcnRzLnJlcG9ydEVycm9ycyhjb250ZXh0LCBkZWNsYXJhdGlvbik7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFpbXBvcnRzLnNpemUpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChcbiAgICAgICAgICAgIG5hbWVzcGFjZSxcbiAgICAgICAgICAgIGBObyBleHBvcnRlZCBuYW1lcyBmb3VuZCBpbiBtb2R1bGUgJyR7ZGVjbGFyYXRpb24uc291cmNlLnZhbHVlfScuYCxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICAvLyB0b2RvOiBjaGVjayBmb3IgcG9zc2libGUgcmVkZWZpbml0aW9uXG5cbiAgICAgIE1lbWJlckV4cHJlc3Npb24oZGVyZWZlcmVuY2UpIHtcbiAgICAgICAgaWYgKGRlcmVmZXJlbmNlLm9iamVjdC50eXBlICE9PSAnSWRlbnRpZmllcicpIHsgcmV0dXJuOyB9XG4gICAgICAgIGlmICghbmFtZXNwYWNlcy5oYXMoZGVyZWZlcmVuY2Uub2JqZWN0Lm5hbWUpKSB7IHJldHVybjsgfVxuICAgICAgICBpZiAoZGVjbGFyZWRTY29wZShjb250ZXh0LCBkZXJlZmVyZW5jZS5vYmplY3QubmFtZSwgZGVyZWZlcmVuY2UpICE9PSAnbW9kdWxlJykgeyByZXR1cm47IH1cblxuICAgICAgICBpZiAoZGVyZWZlcmVuY2UucGFyZW50LnR5cGUgPT09ICdBc3NpZ25tZW50RXhwcmVzc2lvbicgJiYgZGVyZWZlcmVuY2UucGFyZW50LmxlZnQgPT09IGRlcmVmZXJlbmNlKSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoXG4gICAgICAgICAgICBkZXJlZmVyZW5jZS5wYXJlbnQsXG4gICAgICAgICAgICBgQXNzaWdubW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ZXJuLCBuYW1lc3BhY2UsIHBhdGggPSBbaW5pdC5uYW1lXSkge1xuICAgICAgICAgIGlmICghKG5hbWVzcGFjZSBpbnN0YW5jZW9mIEV4cG9ydE1hcCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICBpZiAocGF0dGVybi50eXBlICE9PSAnT2JqZWN0UGF0dGVybicpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICBmb3IgKGNvbnN0IHByb3BlcnR5IG9mIHBhdHRlcm4ucHJvcGVydGllcykge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICBwcm9wZXJ0eS50eXBlID09PSAnRXhwZXJpbWVudGFsUmVzdFByb3BlcnR5J1xuICAgICAgICAgICAgICB8fCBwcm9wZXJ0eS50eXBlID09PSAnUmVzdEVsZW1lbnQnXG4gICAgICAgICAgICAgIHx8ICFwcm9wZXJ0eS5rZXlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHByb3BlcnR5LmtleS50eXBlICE9PSAnSWRlbnRpZmllcicpIHtcbiAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgICAgIG5vZGU6IHByb3BlcnR5LFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdPbmx5IGRlc3RydWN0dXJlIHRvcC1sZXZlbCBuYW1lcy4nLFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghbmFtZXNwYWNlLmhhcyhwcm9wZXJ0eS5rZXkubmFtZSkpIHtcbiAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgICAgIG5vZGU6IHByb3BlcnR5LFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1ha2VNZXNzYWdlKHByb3BlcnR5LmtleSwgcGF0aCksXG4gICAg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0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js b/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js new file mode 100644 index 0000000000000000000000000000000000000000..f58f55e3a06a819920ae5cdb7bce808385513259 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js @@ -0,0 +1,249 @@ +'use strict'; + + + + +var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); + +var _debug = require('debug');var _debug2 = _interopRequireDefault(_debug);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /** + * @fileoverview Rule to enforce new line after import not followed by another import. + * @author Radek Benkel + */var log = (0, _debug2['default'])('eslint-plugin-import:rules:newline-after-import'); //------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +function containsNodeOrEqual(outerNode, innerNode) { + return outerNode.range[0] <= innerNode.range[0] && outerNode.range[1] >= innerNode.range[1]; +} + +function getScopeBody(scope) { + if (scope.block.type === 'SwitchStatement') { + log('SwitchStatement scopes not supported'); + return null; + }var + + body = scope.block.body; + if (body && body.type === 'BlockStatement') { + return body.body; + } + + return body; +} + +function findNodeIndexInScopeBody(body, nodeToFind) { + return body.findIndex(function (node) {return containsNodeOrEqual(node, nodeToFind);}); +} + +function getLineDifference(node, nextNode) { + return nextNode.loc.start.line - node.loc.end.line; +} + +function isClassWithDecorator(node) { + return node.type === 'ClassDeclaration' && node.decorators && node.decorators.length; +} + +function isExportDefaultClass(node) { + return node.type === 'ExportDefaultDeclaration' && node.declaration.type === 'ClassDeclaration'; +} + +function isExportNameClass(node) { + + return node.type === 'ExportNamedDeclaration' && node.declaration && node.declaration.type === 'ClassDeclaration'; +} + +module.exports = { + meta: { + type: 'layout', + docs: { + category: 'Style guide', + description: 'Enforce a newline after import statements.', + url: (0, _docsUrl2['default'])('newline-after-import') }, + + fixable: 'whitespace', + schema: [ + { + type: 'object', + properties: { + count: { + type: 'integer', + minimum: 1 }, + + exactCount: { type: 'boolean' }, + considerComments: { type: 'boolean' } }, + + additionalProperties: false }] }, + + + + create: function () {function create(context) { + var level = 0; + var requireCalls = []; + var options = Object.assign({ + count: 1, + exactCount: false, + considerComments: false }, + context.options[0]); + + + function checkForNewLine(node, nextNode, type) { + if (isExportDefaultClass(nextNode) || isExportNameClass(nextNode)) { + var classNode = nextNode.declaration; + + if (isClassWithDecorator(classNode)) { + nextNode = classNode.decorators[0]; + } + } else if (isClassWithDecorator(nextNode)) { + nextNode = nextNode.decorators[0]; + } + + var lineDifference = getLineDifference(node, nextNode); + var EXPECTED_LINE_DIFFERENCE = options.count + 1; + + if ( + lineDifference < EXPECTED_LINE_DIFFERENCE || + options.exactCount && lineDifference !== EXPECTED_LINE_DIFFERENCE) + { + var column = node.loc.start.column; + + if (node.loc.start.line !== node.loc.end.line) { + column = 0; + } + + context.report({ + loc: { + line: node.loc.end.line, + column: column }, + + message: 'Expected ' + String(options.count) + ' empty line' + (options.count > 1 ? 's' : '') + ' after ' + String(type) + ' statement not followed by another ' + String(type) + '.', + fix: options.exactCount && EXPECTED_LINE_DIFFERENCE < lineDifference ? undefined : function (fixer) {return fixer.insertTextAfter( + node, + '\n'.repeat(EXPECTED_LINE_DIFFERENCE - lineDifference));} }); + + + } + } + + function commentAfterImport(node, nextComment, type) { + var lineDifference = getLineDifference(node, nextComment); + var EXPECTED_LINE_DIFFERENCE = options.count + 1; + + if (lineDifference < EXPECTED_LINE_DIFFERENCE) { + var column = node.loc.start.column; + + if (node.loc.start.line !== node.loc.end.line) { + column = 0; + } + + context.report({ + loc: { + line: node.loc.end.line, + column: column }, + + message: 'Expected ' + String(options.count) + ' empty line' + (options.count > 1 ? 's' : '') + ' after ' + String(type) + ' statement not followed by another ' + String(type) + '.', + fix: options.exactCount && EXPECTED_LINE_DIFFERENCE < lineDifference ? undefined : function (fixer) {return fixer.insertTextAfter( + node, + '\n'.repeat(EXPECTED_LINE_DIFFERENCE - lineDifference));} }); + + + } + } + + function incrementLevel() { + level++; + } + function decrementLevel() { + level--; + } + + function checkImport(node) {var + parent = node.parent; + + if (!parent || !parent.body) { + return; + } + + var nodePosition = parent.body.indexOf(node); + var nextNode = parent.body[nodePosition + 1]; + var endLine = node.loc.end.line; + var nextComment = void 0; + + if (typeof parent.comments !== 'undefined' && options.considerComments) { + nextComment = parent.comments.find(function (o) {return o.loc.start.line >= endLine && o.loc.start.line <= endLine + options.count + 1;}); + } + + // skip "export import"s + if (node.type === 'TSImportEqualsDeclaration' && node.isExport) { + return; + } + + if (nextComment && typeof nextComment !== 'undefined') { + commentAfterImport(node, nextComment, 'import'); + } else if (nextNode && nextNode.type !== 'ImportDeclaration' && (nextNode.type !== 'TSImportEqualsDeclaration' || nextNode.isExport)) { + checkForNewLine(node, nextNode, 'import'); + } + } + + return { + ImportDeclaration: checkImport, + TSImportEqualsDeclaration: checkImport, + CallExpression: function () {function CallExpression(node) { + if ((0, _staticRequire2['default'])(node) && level === 0) { + requireCalls.push(node); + } + }return CallExpression;}(), + 'Program:exit': function () {function ProgramExit(node) { + log('exit processing for', (0, _contextCompat.getPhysicalFilename)(context)); + var scopeBody = getScopeBody((0, _contextCompat.getScope)(context, node)); + log('got scope:', scopeBody); + + requireCalls.forEach(function (node, index) { + var nodePosition = findNodeIndexInScopeBody(scopeBody, node); + log('node position in scope:', nodePosition); + + var statementWithRequireCall = scopeBody[nodePosition]; + var nextStatement = scopeBody[nodePosition + 1]; + var nextRequireCall = requireCalls[index + 1]; + + if (nextRequireCall && containsNodeOrEqual(statementWithRequireCall, nextRequireCall)) { + return; + } + + if ( + nextStatement && ( + !nextRequireCall || + !containsNodeOrEqual(nextStatement, nextRequireCall))) + + { + var nextComment = void 0; + if (typeof statementWithRequireCall.parent.comments !== 'undefined' && options.considerComments) { + var endLine = node.loc.end.line; + nextComment = statementWithRequireCall.parent.comments.find(function (o) {return o.loc.start.line >= endLine && o.loc.start.line <= endLine + options.count + 1;}); + } + + if (nextComment && typeof nextComment !== 'undefined') { + + commentAfterImport(statementWithRequireCall, nextComment, 'require'); + } else { + checkForNewLine(statementWithRequireCall, nextStatement, 'require'); + } + } + }); + }return ProgramExit;}(), + FunctionDeclaration: incrementLevel, + FunctionExpression: incrementLevel, + ArrowFunctionExpression: incrementLevel, + BlockStatement: incrementLevel, + ObjectExpression: incrementLevel, + Decorator: incrementLevel, + 'FunctionDeclaration:exit': decrementLevel, + 'FunctionExpression:exit': decrementLevel, + 'ArrowFunctionExpression:exit': decrementLevel, + 'BlockStatement:exit': decrementLevel, + 'ObjectExpression:exit': decrementLevel, + 'Decorator:exit': decrementLevel }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uZXdsaW5lLWFmdGVyLWltcG9ydC5qcyJdLCJuYW1lcyI6WyJsb2ciLCJjb250YWluc05vZGVPckVxdWFsIiwib3V0ZXJOb2RlIiwiaW5uZXJOb2RlIiwicmFuZ2UiLCJnZXRTY29wZUJvZHkiLCJzY29wZSIsImJsb2NrIiwidHlwZSIsImJvZHkiLCJmaW5kTm9kZUluZGV4SW5TY29wZUJvZHkiLCJub2RlVG9GaW5kIiwiZmluZEluZGV4Iiwibm9kZSIsImdldExpbmVEaWZmZXJlbmNlIiwibmV4dE5vZGUiLCJsb2MiLCJzdGFydCIsImxpbmUiLCJlbmQiLCJpc0NsYXNzV2l0aERlY29yYXRvciIsImRlY29yYXRvcnMiLCJsZW5ndGgiLCJpc0V4cG9ydERlZmF1bHRDbGFzcyIsImRlY2xhcmF0aW9uIiwiaXNFeHBvcnROYW1lQ2xhc3MiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB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ICAgY29uc3QgbmV4dFJlcXVpcmVDYWxsID0gcmVxdWlyZUNhbGxzW2luZGV4ICsgMV07XG5cbiAgICAgICAgICBpZiAobmV4dFJlcXVpcmVDYWxsICYmIGNvbnRhaW5zTm9kZU9yRXF1YWwoc3RhdGVtZW50V2l0aFJlcXVpcmVDYWxsLCBuZXh0UmVxdWlyZUNhbGwpKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKFxuICAgICAgICAgICAgbmV4dFN0YXRlbWVudCAmJiAoXG4gICAgICAgICAgICAgICFuZXh0UmVxdWlyZUNhbGxcbiAgICAgICAgICAgICAgfHwgIWNvbnRhaW5zTm9kZU9yRXF1YWwobmV4dFN0YXRlbWVudCwgbmV4dFJlcXVpcmVDYWxsKVxuICAgICAgICAgICAgKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgbGV0IG5leHRDb21tZW50O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBzdGF0ZW1lbnRXaXRoUmVxdWlyZUNhbGwucGFyZW50LmNvbW1lbnRzICE9PSAndW5kZWZpbmVkJyAmJiBvcHRpb25zLmNvbnNpZGVyQ29tbWVudHMpIHtcbiAgICAgICAgICAgICAgY29uc3QgZW5kTGluZSA9IG5vZGUubG9jLmVuZC5saW5lO1xuICAgICAgICAgICAgICBuZXh0Q29tbWVudCA9IHN0YXRlbWVudFdpdGhSZXF1aXJlQ2FsbC5wYXJlbnQuY29tbWVudHMuZmluZCgobykgPT4gby5sb2Muc3RhcnQubGluZSA+PSBlbmRMaW5lICYmIG8ubG9jLnN0YXJ0LmxpbmUgPD0gZW5kTGluZSArIG9wdGlvbnMuY291bnQgKyAxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKG5leHRDb21tZW50ICYmIHR5cGVvZiBuZXh0Q29tbWVudCAhPT0gJ3VuZGVmaW5lZCcpIHtcblxuICAgICAgICAgICAgICBjb21tZW50QWZ0ZXJJbXBvcnQoc3RhdGVtZW50V2l0aFJlcXVpcmVDYWxsLCBuZXh0Q29tbWVudCwgJ3JlcXVpcmUnKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNoZWNrRm9yTmV3TGluZShzdGF0ZW1lbnRXaXRoUmVxdWlyZUNhbGwsIG5leHRTdGF0ZW1lbnQsICdyZXF1aXJlJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH0sXG4gICAgICBGdW5jdGlvbkRlY2xhcmF0aW9uOiBpbmNyZW1lbnRMZXZlbCxcbiAgICAgIEZ1bmN0aW9uRXhwcmVzc2lvbjogaW5jcmVtZW50TGV2ZWwsXG4gICAgICBBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbjogaW5jcmVtZW50TGV2ZWwsXG4gICAgICBCbG9ja1N0YXRlbWVudDogaW5jcmVtZW50TGV2ZWwsXG4gICAgICBPYmplY3RFeHByZXNzaW9uOiBpbmNyZW1lbnRMZXZlbCxcbiAgICAgIERlY29yYXRvcjogaW5jcmVtZW50TGV2ZWwsXG4gICAgICAnRnVuY3Rpb25EZWNsYXJhdGlvbjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgICAnRnVuY3Rpb25FeHByZXNzaW9uOmV4aXQnOiBkZWNyZW1lbnRMZXZlbCxcbiAgICAgICdBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgICAnQmxvY2tTdGF0ZW1lbnQ6ZXhpdCc6IGRlY3JlbWVudExldmVsLFxuICAgICAgJ09iamVjdEV4cHJlc3Npb246ZXhpdCc6IGRlY3JlbWVudExldmVsLFxuICAgICAgJ0RlY29yYXRvcjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js b/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js new file mode 100644 index 0000000000000000000000000000000000000000..294e233c7adc32a150f6faa52bb704594e8eebab --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js @@ -0,0 +1,41 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); + +var _importType = require('../core/importType'); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Static analysis', + description: 'Forbid import of modules using absolute paths.', + url: (0, _docsUrl2['default'])('no-absolute-path') }, + + fixable: 'code', + schema: [(0, _moduleVisitor.makeOptionsSchema)()] }, + + + create: function () {function create(context) { + function reportIfAbsolute(source) { + if ((0, _importType.isAbsolute)(source.value)) { + context.report({ + node: source, + message: 'Do not import modules using an absolute path', + fix: function () {function fix(fixer) { + // node.js and web imports work with posix style paths ("/") + var relativePath = _path2['default'].posix.relative(_path2['default'].dirname((0, _contextCompat.getPhysicalFilename)(context)), source.value); + if (!relativePath.startsWith('.')) { + relativePath = './' + String(relativePath); + } + return fixer.replaceText(source, JSON.stringify(relativePath)); + }return fix;}() }); + + } + } + + var options = Object.assign({ esmodule: true, commonjs: true }, context.options[0]); + return (0, _moduleVisitor2['default'])(reportIfAbsolute, options); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1hYnNvbHV0ZS1wYXRoLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwiZml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VsZTogdHJ1ZSwgY29tbW9uanM6IHRydWUsIC4uLmNvbnRleHQub3B0aW9uc1swXSB9O1xuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKHJlcG9ydElmQWJzb2x1dGUsIG9wdGlvbnMpO1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-amd.js b/node_modules/eslint-plugin-import/lib/rules/no-amd.js new file mode 100644 index 0000000000000000000000000000000000000000..8b9a70c98e5a551892e3a853f21f1b4a9f009ff5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-amd.js @@ -0,0 +1,46 @@ +'use strict'; + + + + +var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +/** + * @fileoverview Rule to prefer imports to AMD + * @author Jamund Ferguson + */module.exports = { meta: { type: 'suggestion', + docs: { + category: 'Module systems', + description: 'Forbid AMD `require` and `define` calls.', + url: (0, _docsUrl2['default'])('no-amd') }, + + schema: [] }, + + + create: function () {function create(context) { + return { + CallExpression: function () {function CallExpression(node) { + if ((0, _contextCompat.getScope)(context, node).type !== 'module') {return;} + + if (node.callee.type !== 'Identifier') {return;} + if (node.callee.name !== 'require' && node.callee.name !== 'define') {return;} + + // todo: capture define((require, module, exports) => {}) form? + if (node.arguments.length !== 2) {return;} + + var modules = node.arguments[0]; + if (modules.type !== 'ArrayExpression') {return;} + + // todo: check second arg type? (identifier or callback) + + context.report(node, 'Expected imports instead of AMD ' + String(node.callee.name) + '().'); + }return CallExpression;}() }; + + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1hbWQuanMiXSwibmFtZXMiOls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Cduby1hbWQnKSxcbiAgICB9LFxuICAgIHNjaGVtYTogW10sXG4gIH0sXG5cbiAgY3JlYXRlKGNvbnRleHQpIHtcbiAgICByZXR1cm4ge1xuICAgICAgQ2FsbEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAoZ2V0U2NvcGUoY29udGV4dCwgbm9kZSkudHlwZSAhPT0gJ21vZHVsZScpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgaWYgKG5vZGUuY2FsbGVlLnR5cGUgIT09ICdJZGVudGlmaWVyJykgeyByZXR1cm47IH1cbiAgICAgICAgaWYgKG5vZGUuY2FsbGVlLm5hbWUgIT09ICdyZXF1aXJlJyAmJiBub2RlLmNhbGxlZS5uYW1lICE9PSAnZGVmaW5lJykgeyByZXR1cm47IH1cblxuICAgICAgICAvLyB0b2RvOiBjYXB0dXJlIGRlZmluZSgocmVxdWlyZSwgbW9kdWxlLCBleHBvcnRzKSA9PiB7fSkgZm9ybT9cbiAgICAgICAgaWYgKG5vZGUuYXJndW1lbnRzLmxlbmd0aCAhPT0gMikgeyByZXR1cm47IH1cblxuICAgICAgICBjb25zdCBtb2R1bGVzID0gbm9kZS5hcmd1bWVudHNbMF07XG4gICAgICAgIGlmIChtb2R1bGVzLnR5cGUgIT09ICdBcnJheUV4cHJlc3Npb24nKSB7IHJldHVybjsgfVxuXG4gICAgICAgIC8vIHRvZG86IGNoZWNrIHNlY29uZCBhcmcgdHlwZT8gKGlkZW50aWZpZXIgb3IgY2FsbGJhY2spXG5cbiAgICAgICAgY29udGV4dC5yZXBvcnQobm9kZSwgYEV4cGVjdGVkIGltcG9ydHMgaW5zdGVhZCBvZiBBTUQgJHtub2RlLmNhbGxlZS5uYW1lfSgpLmApO1xuICAgICAgfSxcbiAgICB9O1xuXG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js b/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js new file mode 100644 index 0000000000000000000000000000000000000000..82c8303e065bee6b68675e8dbeaa4087977834b9 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js @@ -0,0 +1,103 @@ +'use strict'; + + + + +var _hasown = require('hasown');var _hasown2 = _interopRequireDefault(_hasown); +var _object = require('object.values');var _object2 = _interopRequireDefault(_object); +var _object3 = require('object.fromentries');var _object4 = _interopRequireDefault(_object3); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /** + * @fileoverview Rule to disallow anonymous default exports. + * @author Duncan Beevers + */var defs = { ArrayExpression: { + option: 'allowArray', + description: 'If `false`, will report default export of an array', + message: 'Assign array to a variable before exporting as module default' }, + + ArrowFunctionExpression: { + option: 'allowArrowFunction', + description: 'If `false`, will report default export of an arrow function', + message: 'Assign arrow function to a variable before exporting as module default' }, + + CallExpression: { + option: 'allowCallExpression', + description: 'If `false`, will report default export of a function call', + message: 'Assign call result to a variable before exporting as module default', + 'default': true }, + + ClassDeclaration: { + option: 'allowAnonymousClass', + description: 'If `false`, will report default export of an anonymous class', + message: 'Unexpected default export of anonymous class', + forbid: function () {function forbid(node) {return !node.declaration.id;}return forbid;}() }, + + FunctionDeclaration: { + option: 'allowAnonymousFunction', + description: 'If `false`, will report default export of an anonymous function', + message: 'Unexpected default export of anonymous function', + forbid: function () {function forbid(node) {return !node.declaration.id;}return forbid;}() }, + + Literal: { + option: 'allowLiteral', + description: 'If `false`, will report default export of a literal', + message: 'Assign literal to a variable before exporting as module default' }, + + ObjectExpression: { + option: 'allowObject', + description: 'If `false`, will report default export of an object expression', + message: 'Assign object to a variable before exporting as module default' }, + + TemplateLiteral: { + option: 'allowLiteral', + description: 'If `false`, will report default export of a literal', + message: 'Assign literal to a variable before exporting as module default' }, + + NewExpression: { + option: 'allowNew', + description: 'If `false`, will report default export of a class instantiation', + message: 'Assign instance to a variable before exporting as module default' } }; + + + +var schemaProperties = (0, _object4['default'])((0, _object2['default'])(defs).map(function (def) {return [def.option, { + description: def.description, + type: 'boolean' }];})); + + +var defaults = (0, _object4['default'])((0, _object2['default'])(defs).map(function (def) {return [def.option, (0, _hasown2['default'])(def, 'default') ? def['default'] : false];})); + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Forbid anonymous values as default exports.', + url: (0, _docsUrl2['default'])('no-anonymous-default-export') }, + + + schema: [ + { + type: 'object', + properties: schemaProperties, + additionalProperties: false }] }, + + + + + create: function () {function create(context) { + var options = Object.assign({}, defaults, context.options[0]); + + return { + ExportDefaultDeclaration: function () {function ExportDefaultDeclaration(node) { + var def = defs[node.declaration.type]; + + // Recognized node type and allowed by configuration, + // and has no forbid check, or forbid check return value is truthy + if (def && !options[def.option] && (!def.forbid || def.forbid(node))) { + context.report({ node: node, message: def.message }); + } + }return ExportDefaultDeclaration;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1hbm9ueW1vdXMtZGVmYXVsdC1leHBvcnQuanMiXSwibmFtZXMiOlsiZGVmcyIsIkFycmF5RXhwcmVzc2lvbiIsIm9wdGlvbiIsImRlc2NyaXB0aW9uIiwibWVzc2FnZSIsIkFycm93RnVuY3Rpb25FeHByZXNzaW9uIiwiQ2FsbEV4cHJlc3Npb24iLCJDbGFzc0RlY2xhcmF0aW9uIiwiZm9yYmlkIiwibm9kZSIsImRlY2xhcmF0aW9uIiwiaWQiLCJGdW5jdGlvbkRlY2xhcmF0aW9uIiwiTGl0ZXJhbCIsIk9iamVjdEV4cHJlc3Npb24iLCJUZW1wbGF0ZUxpdGVyYWwiLCJOZXdFeHByZXNzaW9uIiwic2NoZW1hUHJvcGVydGllcyIsIm1hcCIsImRlZiIsInR5cGUiLCJkZWZhdWx0cyIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhI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XNjcmlwdGlvbjogJ0ZvcmJpZCBhbm9ueW1vdXMgdmFsdWVzIGFzIGRlZmF1bHQgZXhwb3J0cy4nLFxuICAgICAgdXJsOiBkb2NzVXJsKCduby1hbm9ueW1vdXMtZGVmYXVsdC1leHBvcnQnKSxcbiAgICB9LFxuXG4gICAgc2NoZW1hOiBbXG4gICAgICB7XG4gICAgICAgIHR5cGU6ICdvYmplY3QnLFxuICAgICAgICBwcm9wZXJ0aWVzOiBzY2hlbWFQcm9wZXJ0aWVzLFxuICAgICAgICBhZGRpdGlvbmFsUHJvcGVydGllczogZmFsc2UsXG4gICAgICB9LFxuICAgIF0sXG4gIH0sXG5cbiAgY3JlYXRlKGNvbnRleHQpIHtcbiAgICBjb25zdCBvcHRpb25zID0geyAuLi5kZWZhdWx0cywgLi4uY29udGV4dC5vcHRpb25zWzBdIH07XG5cbiAgICByZXR1cm4ge1xuICAgICAgRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgY29uc3QgZGVmID0gZGVmc1tub2RlLmRlY2xhcmF0aW9uLnR5cGVdO1xuXG4gICAgICAgIC8vIFJlY29nbml6ZWQgbm9kZSB0eXBlIGFuZCBhbGxvd2VkIGJ5IGNvbmZpZ3VyYXRpb24sXG4gICAgICAgIC8vICAgYW5kIGhhcyBubyBmb3JiaWQgY2hlY2ssIG9yIGZvcmJpZCBjaGVjayByZXR1cm4gdmFsdWUgaXMgdHJ1dGh5XG4gICAgICAgIGlmIChkZWYgJiYgIW9wdGlvbnNbZGVmLm9wdGlvbl0gJiYgKCFkZWYuZm9yYmlkIHx8IGRlZi5mb3JiaWQobm9kZSkpKSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoeyBub2RlLCBtZXNzYWdlOiBkZWYubWVzc2FnZSB9KTtcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js b/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js new file mode 100644 index 0000000000000000000000000000000000000000..2d8656970b58d6963407eb9cbeeb2406385595bd --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js @@ -0,0 +1,143 @@ +'use strict'; + + + + +var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /** + * @fileoverview Rule to prefer ES6 to CJS + * @author Jamund Ferguson + */var EXPORT_MESSAGE = 'Expected "export" or "export default"';var IMPORT_MESSAGE = 'Expected "import" instead of "require()"'; + +function normalizeLegacyOptions(options) { + if (options.indexOf('allow-primitive-modules') >= 0) { + return { allowPrimitiveModules: true }; + } + return options[0] || {}; +} + +function allowPrimitive(node, options) { + if (!options.allowPrimitiveModules) {return false;} + if (node.parent.type !== 'AssignmentExpression') {return false;} + return node.parent.right.type !== 'ObjectExpression'; +} + +function allowRequire(node, options) { + return options.allowRequire; +} + +function allowConditionalRequire(node, options) { + return options.allowConditionalRequire !== false; +} + +function validateScope(scope) { + return scope.variableScope.type === 'module'; +} + +// https://github.com/estree/estree/blob/HEAD/es5.md +function isConditional(node) { + if ( + node.type === 'IfStatement' || + node.type === 'TryStatement' || + node.type === 'LogicalExpression' || + node.type === 'ConditionalExpression') + { + return true; + } + if (node.parent) {return isConditional(node.parent);} + return false; +} + +function isLiteralString(node) { + return node.type === 'Literal' && typeof node.value === 'string' || + node.type === 'TemplateLiteral' && node.expressions.length === 0; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +var schemaString = { 'enum': ['allow-primitive-modules'] }; +var schemaObject = { + type: 'object', + properties: { + allowPrimitiveModules: { type: 'boolean' }, + allowRequire: { type: 'boolean' }, + allowConditionalRequire: { type: 'boolean' } }, + + additionalProperties: false }; + + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Module systems', + description: 'Forbid CommonJS `require` calls and `module.exports` or `exports.*`.', + url: (0, _docsUrl2['default'])('no-commonjs') }, + + + schema: { + anyOf: [ + { + type: 'array', + items: [schemaString], + additionalItems: false }, + + { + type: 'array', + items: [schemaObject], + additionalItems: false }] } }, + + + + + + create: function () {function create(context) { + var options = normalizeLegacyOptions(context.options); + + return { + + MemberExpression: function () {function MemberExpression(node) { + + // module.exports + if (node.object.name === 'module' && node.property.name === 'exports') { + if (allowPrimitive(node, options)) {return;} + context.report({ node: node, message: EXPORT_MESSAGE }); + } + + // exports. + if (node.object.name === 'exports') { + var isInScope = (0, _contextCompat.getScope)(context, node). + variables. + some(function (variable) {return variable.name === 'exports';}); + if (!isInScope) { + context.report({ node: node, message: EXPORT_MESSAGE }); + } + } + + }return MemberExpression;}(), + CallExpression: function () {function CallExpression(call) { + if (!validateScope((0, _contextCompat.getScope)(context, call))) {return;} + + if (call.callee.type !== 'Identifier') {return;} + if (call.callee.name !== 'require') {return;} + + if (call.arguments.length !== 1) {return;} + if (!isLiteralString(call.arguments[0])) {return;} + + if (allowRequire(call, options)) {return;} + + if (allowConditionalRequire(call, options) && isConditional(call.parent)) {return;} + + // keeping it simple: all 1-string-arg `require` calls are reported + context.report({ + node: call.callee, + message: IMPORT_MESSAGE }); + + }return CallExpression;}() }; + + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1jb21tb25qcy5qcyJdLCJuYW1lcyI6WyJFWFBPUlRfTUVTU0FHRSIsIklNUE9SVF9NRVNTQUdFIiwibm9ybWFsaXplTGVnYWN5T3B0aW9ucyIsIm9wdGlvbnMiLCJpbmRleE9mIiwiYWxsb3dQcmltaXRpdmVNb2R1bGVzIiwiYWxsb3dQcmltaXRpdmUiLCJub2RlIiwicGFyZW50IiwidHlwZSIsInJpZ2h0IiwiYWxsb3dSZXF1aXJlIiwiYWx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RlLm9iamVjdC5uYW1lID09PSAnbW9kdWxlJyAmJiBub2RlLnByb3BlcnR5Lm5hbWUgPT09ICdleHBvcnRzJykge1xuICAgICAgICAgIGlmIChhbGxvd1ByaW1pdGl2ZShub2RlLCBvcHRpb25zKSkgeyByZXR1cm47IH1cbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7IG5vZGUsIG1lc3NhZ2U6IEVYUE9SVF9NRVNTQUdFIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gZXhwb3J0cy5cbiAgICAgICAgaWYgKG5vZGUub2JqZWN0Lm5hbWUgPT09ICdleHBvcnRzJykge1xuICAgICAgICAgIGNvbnN0IGlzSW5TY29wZSA9IGdldFNjb3BlKGNvbnRleHQsIG5vZGUpXG4gICAgICAgICAgICAudmFyaWFibGVzXG4gICAgICAgICAgICAuc29tZSgodmFyaWFibGUpID0+IHZhcmlhYmxlLm5hbWUgPT09ICdleHBvcnRzJyk7XG4gICAgICAgICAgaWYgKCFpc0luU2NvcGUpIHtcbiAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHsgbm9kZSwgbWVzc2FnZTogRVhQT1JUX01FU1NBR0UgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgIH0sXG4gICAgICBDYWxsRXhwcmVzc2lvbihjYWxsKSB7XG4gICAgICAgIGlmICghdmFsaWRhdGVTY29wZShnZXRTY29wZShjb250ZXh0LCBjYWxsKSkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgaWYgKGNhbGwuY2FsbGVlLnR5cGUgIT09ICdJZGVudGlmaWVyJykgeyByZXR1cm47IH1cbiAgICAgICAgaWYgKGNhbGwuY2FsbGVlLm5hbWUgIT09ICdyZXF1aXJlJykgeyByZXR1cm47IH1cblxuICAgICAgICBpZiAoY2FsbC5hcmd1bWVudHMubGVuZ3RoICE9PSAxKSB7IHJldHVybjsgfVxuICAgICAgICBpZiAoIWlzTGl0ZXJhbFN0cmluZyhjYWxsLmFyZ3VtZW50c1swXSkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgaWYgKGFsbG93UmVxdWlyZShjYWxsLCBvcHRpb25zKSkgeyByZXR1cm47IH1cblxuICAgICAgICBpZiAoYWxsb3dDb25kaXRpb25hbFJlcXVpcmUoY2FsbCwgb3B0aW9ucykgJiYgaXNDb25kaXRpb25hbChjYWxsLnBhcmVudCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgLy8ga2VlcGluZyBpdCBzaW1wbGU6IGFsbCAxLXN0cmluZy1hcmcgYHJlcXVpcmVgIGNhbGxzIGFyZSByZXBvcnRlZFxuICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgbm9kZTogY2FsbC5jYWxsZWUsXG4gICAgICAgICAgbWVzc2FnZTogSU1QT1JUX01FU1NBR0UsXG4gICAgICAgIH0pO1xuICAgICAgfSxcbiAgICB9O1xuXG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-cycle.js b/node_modules/eslint-plugin-import/lib/rules/no-cycle.js new file mode 100644 index 0000000000000000000000000000000000000000..1451dc1a47687bdb1277017bc60293ad1292f0d8 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-cycle.js @@ -0,0 +1,180 @@ +'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}(); /** + * @fileOverview Ensures that no imported module imports the linted module. + * @author Ben Mosher + */ + +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); + +var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _scc = require('../scc');var _scc2 = _interopRequireDefault(_scc); +var _importType = require('../core/importType'); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {arr2[i] = arr[i];}return arr2;} else {return Array.from(arr);}} + +var traversed = new Set(); + +function routeString(route) { + return route.map(function (s) {return String(s.value) + ':' + String(s.loc.start.line);}).join('=>'); +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Static analysis', + description: 'Forbid a module from importing a module with a dependency path back to itself.', + url: (0, _docsUrl2['default'])('no-cycle') }, + + schema: [(0, _moduleVisitor.makeOptionsSchema)({ + maxDepth: { + anyOf: [ + { + description: 'maximum dependency depth to traverse', + type: 'integer', + minimum: 1 }, + + { + 'enum': ['∞'], + type: 'string' }] }, + + + + ignoreExternal: { + description: 'ignore external modules', + type: 'boolean', + 'default': false }, + + allowUnsafeDynamicCyclicDependency: { + description: 'Allow cyclic dependency if there is at least one dynamic import in the chain', + type: 'boolean', + 'default': false }, + + disableScc: { + description: 'When true, don\'t calculate a strongly-connected-components graph. SCC is used to reduce the time-complexity of cycle detection, but adds overhead.', + type: 'boolean', + 'default': false } })] }, + + + + + create: function () {function create(context) { + var myPath = (0, _contextCompat.getPhysicalFilename)(context); + if (myPath === '') {return {};} // can't cycle-check a non-file + + var options = context.options[0] || {}; + var maxDepth = typeof options.maxDepth === 'number' ? options.maxDepth : Infinity; + var ignoreModule = function () {function ignoreModule(name) {return options.ignoreExternal && (0, _importType.isExternalModule)( + name, + (0, _resolve2['default'])(name, context), + context);}return ignoreModule;}(); + + + var scc = options.disableScc ? {} : _scc2['default'].get(myPath, context); + + function checkSourceValue(sourceNode, importer) { + if (ignoreModule(sourceNode.value)) { + return; // ignore external modules + } + if ( + options.allowUnsafeDynamicCyclicDependency && ( + // Ignore `import()` + importer.type === 'ImportExpression' + // `require()` calls are always checked (if possible) + || importer.type === 'CallExpression' && importer.callee.name !== 'require')) + + { + return; // cycle via dynamic import allowed by config + } + + if ( + importer.type === 'ImportDeclaration' && ( + // import type { Foo } (TS and Flow) + importer.importKind === 'type' + // import { type Foo } (Flow) + || importer.specifiers.every(function (_ref) {var importKind = _ref.importKind;return importKind === 'type';}))) + + { + return; // ignore type imports + } + + var imported = _builder2['default'].get(sourceNode.value, context); + + if (imported == null) { + return; // no-unresolved territory + } + + if (imported.path === myPath) { + return; // no-self-import territory + } + + /* If we're in the same Strongly Connected Component, + * Then there exists a path from each node in the SCC to every other node in the SCC, + * Then there exists at least one path from them to us and from us to them, + * Then we have a cycle between us. + */ + var hasDependencyCycle = options.disableScc || scc[myPath] === scc[imported.path]; + if (!hasDependencyCycle) { + return; + } + + var untraversed = [{ mget: function () {function mget() {return imported;}return mget;}(), route: [] }]; + function detectCycle(_ref2) {var mget = _ref2.mget,route = _ref2.route; + var m = mget(); + if (m == null) {return;} + if (traversed.has(m.path)) {return;} + traversed.add(m.path);var _loop = function () {function _loop( + + path, getter, declarations) { + // If we're in different SCCs, we can't have a circular dependency + if (!options.disableScc && scc[myPath] !== scc[path]) {return 'continue';} + + if (traversed.has(path)) {return 'continue';} + var toTraverse = [].concat(_toConsumableArray(declarations)).filter(function (_ref5) {var source = _ref5.source,isOnlyImportingTypes = _ref5.isOnlyImportingTypes;return !ignoreModule(source.value) + // Ignore only type imports + && !isOnlyImportingTypes;}); + + + /* + If cyclic dependency is allowed via dynamic import, skip checking if any module is imported dynamically + */ + if (options.allowUnsafeDynamicCyclicDependency && toTraverse.some(function (d) {return d.dynamic;})) {return { v: void 0 };} + + /* + Only report as a cycle if there are any import declarations that are considered by + the rule. For example: + a.ts: + import { foo } from './b' // should not be reported as a cycle + b.ts: + import type { Bar } from './a' + */ + + + if (path === myPath && toTraverse.length > 0) {return { v: true };} + if (route.length + 1 < maxDepth) { + toTraverse.forEach(function (_ref6) {var source = _ref6.source; + untraversed.push({ mget: getter, route: route.concat(source) }); + }); + }}return _loop;}();var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try {for (var _iterator = m.imports[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var _ref3 = _step.value;var _ref4 = _slicedToArray(_ref3, 2);var path = _ref4[0];var _ref4$ = _ref4[1];var getter = _ref4$.getter;var declarations = _ref4$.declarations;var _ret = _loop(path, getter, declarations);switch (_ret) {case 'continue':continue;default:if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;} + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + } + + while (untraversed.length > 0) { + var next = untraversed.shift(); // bfs! + if (detectCycle(next)) { + var message = next.route.length > 0 ? 'Dependency cycle via ' + String( + routeString(next.route)) : + 'Dependency cycle detected.'; + context.report(importer, message); + return; + } + } + } + + return Object.assign((0, _moduleVisitor2['default'])(checkSourceValue, context.options[0]), { + 'Program:exit': function () {function ProgramExit() { + traversed.clear(); + }return ProgramExit;}() }); + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1jeWNsZS5qcyJdLCJuYW1lcyI6WyJ0cmF2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Xh0LnJvdXRlLmxlbmd0aCA+IDBcbiAgICAgICAgICAgID8gYERlcGVuZGVuY3kgY3ljbGUgdmlhICR7cm91dGVTdHJpbmcobmV4dC5yb3V0ZSl9YFxuICAgICAgICAgICAgOiAnRGVwZW5kZW5jeSBjeWNsZSBkZXRlY3RlZC4nO1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KGltcG9ydGVyLCBtZXNzYWdlKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gT2JqZWN0LmFzc2lnbihtb2R1bGVWaXNpdG9yKGNoZWNrU291cmNlVmFsdWUsIGNvbnRleHQub3B0aW9uc1swXSksIHtcbiAgICAgICdQcm9ncmFtOmV4aXQnKCkge1xuICAgICAgICB0cmF2ZXJzZWQuY2xlYXIoKTtcbiAgICAgIH0sXG4gICAgfSk7XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-default-export.js b/node_modules/eslint-plugin-import/lib/rules/no-default-export.js new file mode 100644 index 0000000000000000000000000000000000000000..2fc8b0f950014c09cea77f5cad98b0d3007f5009 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-default-export.js @@ -0,0 +1,46 @@ +'use strict';var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _sourceType = require('../core/sourceType');var _sourceType2 = _interopRequireDefault(_sourceType);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Forbid default exports.', + url: (0, _docsUrl2['default'])('no-default-export') }, + + schema: [] }, + + + create: function () {function create(context) { + // ignore non-modules + if ((0, _sourceType2['default'])(context) !== 'module') { + return {}; + } + + var preferNamed = 'Prefer named exports.'; + var noAliasDefault = function () {function noAliasDefault(_ref) {var local = _ref.local;return 'Do not alias `' + String(local.name) + '` as `default`. Just export `' + String(local.name) + '` itself instead.';}return noAliasDefault;}(); + + return { + ExportDefaultDeclaration: function () {function ExportDefaultDeclaration(node) {var _ref2 = + (0, _contextCompat.getSourceCode)(context).getFirstTokens(node)[1] || {},loc = _ref2.loc; + context.report({ node: node, message: preferNamed, loc: loc }); + }return ExportDefaultDeclaration;}(), + + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + node.specifiers. + filter(function (specifier) {return (specifier.exported.name || specifier.exported.value) === 'default';}). + forEach(function (specifier) {var _ref3 = + (0, _contextCompat.getSourceCode)(context).getFirstTokens(node)[1] || {},loc = _ref3.loc; + if (specifier.type === 'ExportDefaultSpecifier') { + context.report({ node: node, message: preferNamed, loc: loc }); + } else if (specifier.type === 'ExportSpecifier') { + context.report({ node: node, message: noAliasDefault(specifier), loc: loc }); + } + }); + }return ExportNamedDeclaration;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1kZWZhdWx0LWV4cG9ydC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwiY2F0ZWdvcnkiLCJkZXNjcmlwdGlvbiIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJwcmVmZXJOYW1lZCIsIm5vQWxpYXNEZWZhdWx0IiwibG9jYWwiLCJuYW1lIiwiRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uIiwibm9kZSIsImdldEZpcnN0VG9rZW5zIiwibG9jIiwicmVwb3J0IiwibWVzc2FnZSIsIkV4cG9ydE5hbWVkRGVjbGFyYXRpb24iLCJzcGVjaWZpZXJzIiwiZmlsdGVyIiwic3BlY2lmaWVyIiwiZXhwb3J0ZWQiLCJ2YWx1ZSIsImZvckVhY2giXSwibWFwcGluZ3MiOiJhQUFBOzt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Mobm9kZSlbMV0gfHwge307XG4gICAgICAgICAgICBpZiAoc3BlY2lmaWVyLnR5cGUgPT09ICdFeHBvcnREZWZhdWx0U3BlY2lmaWVyJykge1xuICAgICAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7IG5vZGUsIG1lc3NhZ2U6IHByZWZlck5hbWVkLCBsb2MgfSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNwZWNpZmllci50eXBlID09PSAnRXhwb3J0U3BlY2lmaWVyJykge1xuICAgICAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7IG5vZGUsIG1lc3NhZ2U6IG5vQWxpYXNEZWZhdWx0KHNwZWNpZmllciksIGxvYyAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICB9LFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js b/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js new file mode 100644 index 0000000000000000000000000000000000000000..f103a3d957030052a5933560783b227cf5c3f80e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js @@ -0,0 +1,139 @@ +'use strict';var _declaredScope = require('eslint-module-utils/declaredScope');var _declaredScope2 = _interopRequireDefault(_declaredScope); +var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _exportMap = require('../exportMap');var _exportMap2 = _interopRequireDefault(_exportMap); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function message(deprecation) { + return 'Deprecated' + (deprecation.description ? ': ' + String(deprecation.description) : '.'); +} + +function getDeprecation(metadata) { + if (!metadata || !metadata.doc) {return;} + + return metadata.doc.tags.find(function (t) {return t.title === 'deprecated';}); +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Helpful warnings', + description: 'Forbid imported names marked with `@deprecated` documentation tag.', + url: (0, _docsUrl2['default'])('no-deprecated') }, + + schema: [] }, + + + create: function () {function create(context) { + var deprecated = new Map(); + var namespaces = new Map(); + + function checkSpecifiers(node) { + if (node.type !== 'ImportDeclaration') {return;} + if (node.source == null) {return;} // local export, ignore + + var imports = _builder2['default'].get(node.source.value, context); + if (imports == null) {return;} + + var moduleDeprecation = imports.doc && imports.doc.tags.find(function (t) {return t.title === 'deprecated';}); + if (moduleDeprecation) { + context.report({ node: node, message: message(moduleDeprecation) }); + } + + if (imports.errors.length) { + imports.reportErrors(context, node); + return; + } + + node.specifiers.forEach(function (im) { + var imported = void 0;var local = void 0; + switch (im.type) { + + case 'ImportNamespaceSpecifier':{ + if (!imports.size) {return;} + namespaces.set(im.local.name, imports); + return; + } + + case 'ImportDefaultSpecifier': + imported = 'default'; + local = im.local.name; + break; + + case 'ImportSpecifier': + imported = im.imported.name; + local = im.local.name; + break; + + default:return; // can't handle this one + } + + // unknown thing can't be deprecated + var exported = imports.get(imported); + if (exported == null) {return;} + + // capture import of deep namespace + if (exported.namespace) {namespaces.set(local, exported.namespace);} + + var deprecation = getDeprecation(imports.get(imported)); + if (!deprecation) {return;} + + context.report({ node: im, message: message(deprecation) }); + + deprecated.set(local, deprecation); + + }); + } + + return { + Program: function () {function Program(_ref) {var body = _ref.body;return body.forEach(checkSpecifiers);}return Program;}(), + + Identifier: function () {function Identifier(node) { + if (node.parent.type === 'MemberExpression' && node.parent.property === node) { + return; // handled by MemberExpression + } + + // ignore specifier identifiers + if (node.parent.type.slice(0, 6) === 'Import') {return;} + + if (!deprecated.has(node.name)) {return;} + + if ((0, _declaredScope2['default'])(context, node.name, node) !== 'module') {return;} + context.report({ + node: node, + message: message(deprecated.get(node.name)) }); + + }return Identifier;}(), + + MemberExpression: function () {function MemberExpression(dereference) { + if (dereference.object.type !== 'Identifier') {return;} + if (!namespaces.has(dereference.object.name)) {return;} + + if ((0, _declaredScope2['default'])(context, dereference.object.name, dereference) !== 'module') {return;} + + // go deep + var namespace = namespaces.get(dereference.object.name); + var namepath = [dereference.object.name]; + // while property is namespace and parent is member expression, keep validating + while (namespace instanceof _exportMap2['default'] && dereference.type === 'MemberExpression') { + // ignore computed parts for now + if (dereference.computed) {return;} + + var metadata = namespace.get(dereference.property.name); + + if (!metadata) {break;} + var deprecation = getDeprecation(metadata); + + if (deprecation) { + context.report({ node: dereference.property, message: message(deprecation) }); + } + + // stash and pop + namepath.push(dereference.property.name); + namespace = metadata.namespace; + dereference = dereference.parent; + } + }return MemberExpression;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1kZXByZWNhdGVkLmpzIl0sIm5hbWVzIjpbIm1lc3NhZ2UiLCJkZXByZWNhdGlvbiIsImRlc2NyaXB0aW9uIiwiZ2V0RGVwcmVjYXRpb24iLCJtZXRhZGF0YSIsImRvYyIsInRhZ3MiLCJmaW5kIiwidCIsInRpdGxlIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwidXJsIiwic2NoZW1hIiwiY3JlYXRlIiwiY29udGV4dCIsImRlcHJlY2F0ZWQiLCJNYXAiLCJuYW1lc3BhY2VzIiwiY2hlY2tTcGVjaWZpZXJzIiwibm9kZSIsInNvdXJjZSIsImltcG9ydHMiLCJFeHBvcnRNYXBCdWlsZGVyIiwiZ2V0IiwidmFsdWUiLCJtb2R1bGVEZXByZWNhdGlvbiIsInJlcG9ydCIsImVycm9ycyIsImxlbmd0aCIsInJlcG9ydEVycm9ycyIsInNwZWNpZmllcnMiLCJmb3JFYWNoIiwiaW0iLCJpbXBvcnRlZCIsImxvY2FsIiwic2l6ZSIsInNldCIsIm5hbWUiLCJleHBvcnRlZCIsIm5hbWVzcGFjZSIsIlByb2dyYW0iLCJib2R5IiwiSWRlbnRpZmllciIsInBhcmVudCIsInByb3BlcnR5Iiwic2x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gICAgIG5hbWVzcGFjZSA9IG1ldGFkYXRhLm5hbWVzcGFjZTtcbiAgICAgICAgICBkZXJlZmVyZW5jZSA9IGRlcmVmZXJlbmNlLnBhcmVudDtcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js b/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js new file mode 100644 index 0000000000000000000000000000000000000000..ab8010673a59de6d1f93e595c1b9561673098eca --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js @@ -0,0 +1,379 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _contextCompat = require('eslint-module-utils/contextCompat'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _semver = require('semver');var _semver2 = _interopRequireDefault(_semver); +var _arrayPrototype = require('array.prototype.flatmap');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _toArray(arr) {return Array.isArray(arr) ? arr : Array.from(arr);} + +var typescriptPkg = void 0; +try { + typescriptPkg = require('typescript/package.json'); // eslint-disable-line import/no-extraneous-dependencies +} catch (e) {/**/} + +function isPunctuator(node, value) { + return node.type === 'Punctuator' && node.value === value; +} + +// Get the name of the default import of `node`, if any. +function getDefaultImportName(node) { + var defaultSpecifier = node.specifiers. + find(function (specifier) {return specifier.type === 'ImportDefaultSpecifier';}); + return defaultSpecifier != null ? defaultSpecifier.local.name : undefined; +} + +// Checks whether `node` has a namespace import. +function hasNamespace(node) { + var specifiers = node.specifiers. + filter(function (specifier) {return specifier.type === 'ImportNamespaceSpecifier';}); + return specifiers.length > 0; +} + +// Checks whether `node` has any non-default specifiers. +function hasSpecifiers(node) { + var specifiers = node.specifiers. + filter(function (specifier) {return specifier.type === 'ImportSpecifier';}); + return specifiers.length > 0; +} + +// Checks whether `node` has a comment (that ends) on the previous line or on +// the same line as `node` (starts). +function hasCommentBefore(node, sourceCode) { + return sourceCode.getCommentsBefore(node). + some(function (comment) {return comment.loc.end.line >= node.loc.start.line - 1;}); +} + +// Checks whether `node` has a comment (that starts) on the same line as `node` +// (ends). +function hasCommentAfter(node, sourceCode) { + return sourceCode.getCommentsAfter(node). + some(function (comment) {return comment.loc.start.line === node.loc.end.line;}); +} + +// Checks whether `node` has any comments _inside,_ except inside the `{...}` +// part (if any). +function hasCommentInsideNonSpecifiers(node, sourceCode) { + var tokens = sourceCode.getTokens(node); + var openBraceIndex = tokens.findIndex(function (token) {return isPunctuator(token, '{');}); + var closeBraceIndex = tokens.findIndex(function (token) {return isPunctuator(token, '}');}); + // Slice away the first token, since we're no looking for comments _before_ + // `node` (only inside). If there's a `{...}` part, look for comments before + // the `{`, but not before the `}` (hence the `+1`s). + var someTokens = openBraceIndex >= 0 && closeBraceIndex >= 0 ? + tokens.slice(1, openBraceIndex + 1).concat(tokens.slice(closeBraceIndex + 1)) : + tokens.slice(1); + return someTokens.some(function (token) {return sourceCode.getCommentsBefore(token).length > 0;}); +} + +// It's not obvious what the user wants to do with comments associated with +// duplicate imports, so skip imports with comments when autofixing. +function hasProblematicComments(node, sourceCode) { + return ( + hasCommentBefore(node, sourceCode) || + hasCommentAfter(node, sourceCode) || + hasCommentInsideNonSpecifiers(node, sourceCode)); + +} + +/** @type {(first: import('estree').ImportDeclaration, rest: import('estree').ImportDeclaration[], sourceCode: import('eslint').SourceCode.SourceCode, context: import('eslint').Rule.RuleContext) => import('eslint').Rule.ReportFixer | undefined} */ +function getFix(first, rest, sourceCode, context) { + // Sorry ESLint <= 3 users, no autofix for you. Autofixing duplicate imports + // requires multiple `fixer.whatever()` calls in the `fix`: We both need to + // update the first one, and remove the rest. Support for multiple + // `fixer.whatever()` in a single `fix` was added in ESLint 4.1. + // `sourceCode.getCommentsBefore` was added in 4.0, so that's an easy thing to + // check for. + if (typeof sourceCode.getCommentsBefore !== 'function') { + return undefined; + } + + // Adjusting the first import might make it multiline, which could break + // `eslint-disable-next-line` comments and similar, so bail if the first + // import has comments. Also, if the first import is `import * as ns from + // './foo'` there's nothing we can do. + if (hasProblematicComments(first, sourceCode) || hasNamespace(first)) { + return undefined; + } + + var defaultImportNames = new Set( + (0, _arrayPrototype2['default'])([].concat(first, rest || []), function (x) {return getDefaultImportName(x) || [];})); + + + // Bail if there are multiple different default import names – it's up to the + // user to choose which one to keep. + if (defaultImportNames.size > 1) { + return undefined; + } + + // Leave it to the user to handle comments. Also skip `import * as ns from + // './foo'` imports, since they cannot be merged into another import. + var restWithoutComments = rest.filter(function (node) {return !hasProblematicComments(node, sourceCode) && !hasNamespace(node);}); + + var specifiers = restWithoutComments. + map(function (node) { + var tokens = sourceCode.getTokens(node); + var openBrace = tokens.find(function (token) {return isPunctuator(token, '{');}); + var closeBrace = tokens.find(function (token) {return isPunctuator(token, '}');}); + + if (openBrace == null || closeBrace == null) { + return undefined; + } + + return { + importNode: node, + identifiers: sourceCode.text.slice(openBrace.range[1], closeBrace.range[0]).split(','), // Split the text into separate identifiers (retaining any whitespace before or after) + isEmpty: !hasSpecifiers(node) }; + + }). + filter(function (x) {return !!x;}); + + var unnecessaryImports = restWithoutComments.filter(function (node) {return !hasSpecifiers(node) && + !hasNamespace(node) && + !specifiers.some(function (specifier) {return specifier.importNode === node;});}); + + + var shouldAddDefault = getDefaultImportName(first) == null && defaultImportNames.size === 1; + var shouldAddSpecifiers = specifiers.length > 0; + var shouldRemoveUnnecessary = unnecessaryImports.length > 0; + var preferInline = context.options[0] && context.options[0]['prefer-inline']; + + if (!(shouldAddDefault || shouldAddSpecifiers || shouldRemoveUnnecessary)) { + return undefined; + } + + /** @type {import('eslint').Rule.ReportFixer} */ + return function (fixer) { + var tokens = sourceCode.getTokens(first); + var openBrace = tokens.find(function (token) {return isPunctuator(token, '{');}); + var closeBrace = tokens.find(function (token) {return isPunctuator(token, '}');}); + var firstToken = sourceCode.getFirstToken(first);var _defaultImportNames = _slicedToArray( + defaultImportNames, 1),defaultImportName = _defaultImportNames[0]; + + var firstHasTrailingComma = closeBrace != null && isPunctuator(sourceCode.getTokenBefore(closeBrace), ','); + var firstIsEmpty = !hasSpecifiers(first); + var firstExistingIdentifiers = firstIsEmpty ? + new Set() : + new Set(sourceCode.text.slice(openBrace.range[1], closeBrace.range[0]). + split(','). + map(function (x) {return x.trim();}));var _specifiers$reduce = + + + specifiers.reduce( + function (_ref, specifier) {var _ref2 = _slicedToArray(_ref, 3),result = _ref2[0],needsComma = _ref2[1],existingIdentifiers = _ref2[2]; + var isTypeSpecifier = specifier.importNode.importKind === 'type'; + + // a user might set prefer-inline but not have a supporting TypeScript version. Flow does not support inline types so this should fail in that case as well. + if (preferInline && (!typescriptPkg || !_semver2['default'].satisfies(typescriptPkg.version, '>= 4.5'))) { + throw new Error('Your version of TypeScript does not support inline type imports.'); + } + + // Add *only* the new identifiers that don't already exist, and track any new identifiers so we don't add them again in the next loop + var _specifier$identifier = specifier.identifiers.reduce(function (_ref3, cur) {var _ref4 = _slicedToArray(_ref3, 2),text = _ref4[0],set = _ref4[1]; + var trimmed = cur.trim(); // Trim whitespace before/after to compare to our set of existing identifiers + var curWithType = trimmed.length > 0 && preferInline && isTypeSpecifier ? 'type ' + String(cur) : cur; + if (existingIdentifiers.has(trimmed)) { + return [text, set]; + } + return [text.length > 0 ? String(text) + ',' + String(curWithType) : curWithType, set.add(trimmed)]; + }, ['', existingIdentifiers]),_specifier$identifier2 = _slicedToArray(_specifier$identifier, 2),specifierText = _specifier$identifier2[0],updatedExistingIdentifiers = _specifier$identifier2[1]; + + return [ + needsComma && !specifier.isEmpty && specifierText.length > 0 ? String( + result) + ',' + String(specifierText) : '' + String( + result) + String(specifierText), + specifier.isEmpty ? needsComma : true, + updatedExistingIdentifiers]; + + }, + ['', !firstHasTrailingComma && !firstIsEmpty, firstExistingIdentifiers]),_specifiers$reduce2 = _slicedToArray(_specifiers$reduce, 1),specifiersText = _specifiers$reduce2[0]; + + + /** @type {import('eslint').Rule.Fix[]} */ + var fixes = []; + + if (shouldAddSpecifiers && preferInline && first.importKind === 'type') { + // `import type {a} from './foo'` → `import {type a} from './foo'` + var typeIdentifierToken = tokens.find(function (token) {return token.type === 'Identifier' && token.value === 'type';}); + fixes.push(fixer.removeRange([typeIdentifierToken.range[0], typeIdentifierToken.range[1] + 1])); + + tokens. + filter(function (token) {return firstExistingIdentifiers.has(token.value);}). + forEach(function (identifier) { + fixes.push(fixer.replaceTextRange([identifier.range[0], identifier.range[1]], 'type ' + String(identifier.value))); + }); + } + + if (shouldAddDefault && openBrace == null && shouldAddSpecifiers) { + // `import './foo'` → `import def, {...} from './foo'` + fixes.push( + fixer.insertTextAfter(firstToken, ' ' + String(defaultImportName) + ', {' + String(specifiersText) + '} from')); + + } else if (shouldAddDefault && openBrace == null && !shouldAddSpecifiers) { + // `import './foo'` → `import def from './foo'` + fixes.push(fixer.insertTextAfter(firstToken, ' ' + String(defaultImportName) + ' from')); + } else if (shouldAddDefault && openBrace != null && closeBrace != null) { + // `import {...} from './foo'` → `import def, {...} from './foo'` + fixes.push(fixer.insertTextAfter(firstToken, ' ' + String(defaultImportName) + ',')); + if (shouldAddSpecifiers) { + // `import def, {...} from './foo'` → `import def, {..., ...} from './foo'` + fixes.push(fixer.insertTextBefore(closeBrace, specifiersText)); + } + } else if (!shouldAddDefault && openBrace == null && shouldAddSpecifiers) { + if (first.specifiers.length === 0) { + // `import './foo'` → `import {...} from './foo'` + fixes.push(fixer.insertTextAfter(firstToken, ' {' + String(specifiersText) + '} from')); + } else { + // `import def from './foo'` → `import def, {...} from './foo'` + fixes.push(fixer.insertTextAfter(first.specifiers[0], ', {' + String(specifiersText) + '}')); + } + } else if (!shouldAddDefault && openBrace != null && closeBrace != null) { + // `import {...} './foo'` → `import {..., ...} from './foo'` + fixes.push(fixer.insertTextBefore(closeBrace, specifiersText)); + } + + // Remove imports whose specifiers have been moved into the first import. + specifiers.forEach(function (specifier) { + var importNode = specifier.importNode; + fixes.push(fixer.remove(importNode)); + + var charAfterImportRange = [importNode.range[1], importNode.range[1] + 1]; + var charAfterImport = sourceCode.text.substring(charAfterImportRange[0], charAfterImportRange[1]); + if (charAfterImport === '\n') { + fixes.push(fixer.removeRange(charAfterImportRange)); + } + }); + + // Remove imports whose default import has been moved to the first import, + // and side-effect-only imports that are unnecessary due to the first + // import. + unnecessaryImports.forEach(function (node) { + fixes.push(fixer.remove(node)); + + var charAfterImportRange = [node.range[1], node.range[1] + 1]; + var charAfterImport = sourceCode.text.substring(charAfterImportRange[0], charAfterImportRange[1]); + if (charAfterImport === '\n') { + fixes.push(fixer.removeRange(charAfterImportRange)); + } + }); + + return fixes; + }; +} + +/** @type {(imported: Map, context: import('eslint').Rule.RuleContext) => void} */ +function checkImports(imported, context) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = imported.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var _ref5 = _step.value;var _ref6 = _slicedToArray(_ref5, 2);var _module = _ref6[0];var nodes = _ref6[1]; + if (nodes.length > 1) {(function () { + var message = '\'' + String(_module) + '\' imported multiple times.';var _nodes = _toArray( + nodes),first = _nodes[0],rest = _nodes.slice(1); + var sourceCode = (0, _contextCompat.getSourceCode)(context); + var fix = getFix(first, rest, sourceCode, context); + + context.report({ + node: first.source, + message: message, + fix: fix // Attach the autofix (if any) to the first import. + }); + + rest.forEach(function (node) { + context.report({ + node: node.source, + message: message }); + + });})(); + } + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} +} + +/** @type {import('eslint').Rule.RuleModule} */ +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Style guide', + description: 'Forbid repeated import of the same module in multiple places.', + url: (0, _docsUrl2['default'])('no-duplicates') }, + + fixable: 'code', + schema: [ + { + type: 'object', + properties: { + considerQueryString: { + type: 'boolean' }, + + 'prefer-inline': { + type: 'boolean' } }, + + + additionalProperties: false }] }, + + + + + /** @param {import('eslint').Rule.RuleContext} context */ + create: function () {function create(context) { + /** @type {boolean} */ + // Prepare the resolver from options. + var considerQueryStringOption = context.options[0] && context.options[0].considerQueryString; + /** @type {boolean} */ + var preferInline = context.options[0] && context.options[0]['prefer-inline']; + var defaultResolver = function () {function defaultResolver(sourcePath) {return (0, _resolve2['default'])(sourcePath, context) || sourcePath;}return defaultResolver;}(); + var resolver = considerQueryStringOption ? function (sourcePath) { + var parts = sourcePath.match(/^([^?]*)\?(.*)$/); + if (!parts) { + return defaultResolver(sourcePath); + } + return String(defaultResolver(parts[1])) + '?' + String(parts[2]); + } : defaultResolver; + + /** @type {Map, nsImported: Map, defaultTypesImported: Map, namedTypesImported: Map}>} */ + var moduleMaps = new Map(); + + /** @param {import('estree').ImportDeclaration} n */ + /** @returns {typeof moduleMaps[keyof typeof moduleMaps]} */ + function getImportMap(n) { + if (!moduleMaps.has(n.parent)) { + moduleMaps.set(n.parent, /** @type {typeof moduleMaps} */{ + imported: new Map(), + nsImported: new Map(), + defaultTypesImported: new Map(), + namedTypesImported: new Map() }); + + } + var map = moduleMaps.get(n.parent); + if (!preferInline && n.importKind === 'type') { + return n.specifiers.length > 0 && n.specifiers[0].type === 'ImportDefaultSpecifier' ? map.defaultTypesImported : map.namedTypesImported; + } + if (!preferInline && n.specifiers.some(function (spec) {return spec.importKind === 'type';})) { + return map.namedTypesImported; + } + + return hasNamespace(n) ? map.nsImported : map.imported; + } + + return { + /** @param {import('estree').ImportDeclaration} n */ + ImportDeclaration: function () {function ImportDeclaration(n) { + /** @type {string} */ + // resolved path will cover aliased duplicates + var resolvedPath = resolver(n.source.value); + var importMap = getImportMap(n); + + if (importMap.has(resolvedPath)) { + importMap.get(resolvedPath).push(n); + } else { + importMap.set(resolvedPath, [n]); + } + }return ImportDeclaration;}(), + + 'Program:exit': function () {function ProgramExit() {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + for (var _iterator2 = moduleMaps.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var map = _step2.value; + checkImports(map.imported, context); + checkImports(map.nsImported, context); + checkImports(map.defaultTypesImported, context); + checkImports(map.namedTypesImported, context); + }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} + }return ProgramExit;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1kdXBsaWNhdGVzLmpzIl0sIm5hbWVzIjpbInR5cGVzY3JpcHRQa2ciLCJyZXF1aXJlIiwiZSIsImlzUHVuY3R1YXRvciIsIm5vZGUiLCJ2YWx1ZSIsInR5cGUiLCJnZXREZWZhdWx0SW1wb3J0TmFtZSIsImRlZmF1bHRTcGVjaWZpZXIiLCJzcGVjaWZpZXJzIiwiZmluZCIsInNwZWNpZmllciIsImxvY2FsIiwibmFtZSIsInVuZGVmaW5lZCIsImhhc05hbWVzcGFjZSIsImZpbHRlciIsImxlb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kdWxlTWFwcy52YWx1ZXMoKSkge1xuICAgICAgICAgIGNoZWNrSW1wb3J0cyhtYXAuaW1wb3J0ZWQsIGNvbnRleHQpO1xuICAgICAgICAgIGNoZWNrSW1wb3J0cyhtYXAubnNJbXBvcnRlZCwgY29udGV4dCk7XG4gICAgICAgICAgY2hlY2tJbXBvcnRzKG1hcC5kZWZhdWx0VHlwZXNJbXBvcnRlZCwgY29udGV4dCk7XG4gICAgICAgICAgY2hlY2tJbXBvcnRzKG1hcC5uYW1lZFR5cGVzSW1wb3J0ZWQsIGNvbnRleHQpO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js b/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js new file mode 100644 index 0000000000000000000000000000000000000000..1e30975598f9c1503b3521170a6a1761ca5aa117 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js @@ -0,0 +1,77 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function isRequire(node) { + return node && + node.callee && + node.callee.type === 'Identifier' && + node.callee.name === 'require' && + node.arguments.length >= 1; +} + +function isDynamicImport(node) { + return node && + node.callee && + node.callee.type === 'Import'; +} + +function isStaticValue(arg) { + return arg.type === 'Literal' || + arg.type === 'TemplateLiteral' && arg.expressions.length === 0; +} + +var dynamicImportErrorMessage = 'Calls to import() should use string literals'; + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Static analysis', + description: 'Forbid `require()` calls with expressions.', + url: (0, _docsUrl2['default'])('no-dynamic-require') }, + + schema: [ + { + type: 'object', + properties: { + esmodule: { + type: 'boolean' } }, + + + additionalProperties: false }] }, + + + + + create: function () {function create(context) { + var options = context.options[0] || {}; + + return { + CallExpression: function () {function CallExpression(node) { + if (!node.arguments[0] || isStaticValue(node.arguments[0])) { + return; + } + if (isRequire(node)) { + return context.report({ + node: node, + message: 'Calls to require() should use string literals' }); + + } + if (options.esmodule && isDynamicImport(node)) { + return context.report({ + node: node, + message: dynamicImportErrorMessage }); + + } + }return CallExpression;}(), + ImportExpression: function () {function ImportExpression(node) { + if (!options.esmodule || isStaticValue(node.source)) { + return; + } + return context.report({ + node: node, + message: dynamicImportErrorMessage }); + + }return ImportExpression;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1keW5hbWljLXJlcXVpcmUuanMiXSwibmFtZXMiOlsiaXNSZXF1aXJlIiwibm9kZSIsImNhbGxlZSIsInR5cGUiLCJuYW1lIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwiaXNEeW5hbWljSW1wb3J0IiwiaXNTdGF0aWNWYWx1ZSIsImFyZyIsImV4cHJlc3Npb25zIiwiZHluYW1pY0ltcG9ydEVycm9yTWVzc2FnZSIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiZXNtb2R1bGUiLCJhZGRpdGlvbmFsUHJvcGVydGllcyIsImNyZWF0ZSIsImNvbnRleHQiLCJvcHRpb25zIiwiQ2FsbEV4cHJlc3Npb24iLCJyZXBvcnQiLCJtZXNzYWdlIiwiSW1wb3J0RXhwcmVzc2lvbiIsInNvdXJjZSJdLCJtYXBwaW5ncyI6ImFBQUEscUM7O0FBRUEsU0FBU0EsU0FBVCxDQUFtQkMsSUFBbkIsRUFBeUI7QUFDdkIsU0FBT0E7QUFDRkEsT0FBS0MsTUFESDtBQUVGRCxPQUFLQyxNQUFMLENBQVlDLElBQVosS0FBcUIsWUFGbkI7QUFHRkYsT0FBS0MsTUFBTCxDQUFZ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XX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-empty-named-blocks.js b/node_modules/eslint-plugin-import/lib/rules/no-empty-named-blocks.js new file mode 100644 index 0000000000000000000000000000000000000000..6e2e67400fa8b5d84b294eb309b0a255122882d3 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-empty-named-blocks.js @@ -0,0 +1,107 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function getEmptyBlockRange(tokens, index) { + var token = tokens[index]; + var nextToken = tokens[index + 1]; + var prevToken = tokens[index - 1]; + var start = token.range[0]; + var end = nextToken.range[1]; + + // Remove block tokens and the previous comma + if (prevToken.value === ',' || prevToken.value === 'type' || prevToken.value === 'typeof') { + start = prevToken.range[0]; + } + + return [start, end]; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Helpful warnings', + description: 'Forbid empty named import blocks.', + url: (0, _docsUrl2['default'])('no-empty-named-blocks') }, + + fixable: 'code', + schema: [], + hasSuggestions: true }, + + + create: function () {function create(context) { + var importsWithoutNameds = []; + + return { + ImportDeclaration: function () {function ImportDeclaration(node) { + if (!node.specifiers.some(function (x) {return x.type === 'ImportSpecifier';})) { + importsWithoutNameds.push(node); + } + }return ImportDeclaration;}(), + + 'Program:exit': function () {function ProgramExit(program) { + var importsTokens = importsWithoutNameds.map(function (node) {return [node, program.tokens.filter(function (x) {return x.range[0] >= node.range[0] && x.range[1] <= node.range[1];})];}); + + importsTokens.forEach(function (_ref) {var _ref2 = _slicedToArray(_ref, 2),node = _ref2[0],tokens = _ref2[1]; + tokens.forEach(function (token) { + var idx = program.tokens.indexOf(token); + var nextToken = program.tokens[idx + 1]; + + if (nextToken && token.value === '{' && nextToken.value === '}') { + var hasOtherIdentifiers = tokens.some(function (token) {return token.type === 'Identifier' && + token.value !== 'from' && + token.value !== 'type' && + token.value !== 'typeof';}); + + + // If it has no other identifiers it's the only thing in the import, so we can either remove the import + // completely or transform it in a side-effects only import + if (!hasOtherIdentifiers) { + context.report({ + node: node, + message: 'Unexpected empty named import block', + suggest: [ + { + desc: 'Remove unused import', + fix: function () {function fix(fixer) { + // Remove the whole import + return fixer.remove(node); + }return fix;}() }, + + { + desc: 'Remove empty import block', + fix: function () {function fix(fixer) { + // Remove the empty block and the 'from' token, leaving the import only for its side + // effects, e.g. `import 'mod'` + var sourceCode = (0, _contextCompat.getSourceCode)(context); + var fromToken = program.tokens.find(function (t) {return t.value === 'from';}); + var importToken = program.tokens.find(function (t) {return t.value === 'import';}); + var hasSpaceAfterFrom = sourceCode.isSpaceBetween(fromToken, sourceCode.getTokenAfter(fromToken)); + var hasSpaceAfterImport = sourceCode.isSpaceBetween(importToken, sourceCode.getTokenAfter(fromToken));var _getEmptyBlockRange = + + getEmptyBlockRange(program.tokens, idx),_getEmptyBlockRange2 = _slicedToArray(_getEmptyBlockRange, 1),start = _getEmptyBlockRange2[0];var _fromToken$range = _slicedToArray( + fromToken.range, 2),end = _fromToken$range[1]; + var range = [start, hasSpaceAfterFrom ? end + 1 : end]; + + return fixer.replaceTextRange(range, hasSpaceAfterImport ? '' : ' '); + }return fix;}() }] }); + + + + } else { + context.report({ + node: node, + message: 'Unexpected empty named import block', + fix: function () {function fix(fixer) { + return fixer.removeRange(getEmptyBlockRange(program.tokens, idx)); + }return fix;}() }); + + } + } + }); + }); + }return ProgramExit;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1lbXB0eS1uYW1lZC1ibG9ja3MuanMiXSwibmFtZXMiOlsiZ2V0RW1wdHlCbG9ja1JhbmdlIiwidG9rZW5zIiwiaW5kZXgiLCJ0b2tlbiIsIm5leHRUb2tlbiIsInByZXZUb2tlbiIsInN0YXJ0IiwicmFuZ2UiLCJlbmQiLCJ2YWx1ZSIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwiZml4YWJsZSIsInNjaGVtYSIsImhhc1N1Z2dlc3Rpb25zIiwiY3JlYXRlIiwiY29udGV4dCIsImltcG9ydHNXaXRob3V0TmFtZWRzIiwiSW1wb3J0RGVjbGFyYXRpb24iLCJub2RlIiwic3BlY2lmaWVycyIsInNvbWUiLCJ4IiwicHVzaCIsInByb2dyYW0iLCJpbXBvcnRzVG9rZW5zIiwibWFwIiwiZmlsdGVyIiwiZm9yRWFjaCIsImlkeCIsImluZGV4T2YiLCJoYXNPdGhlcklkZW50aWZpZXJzIiwicmVwb3J0IiwibWVzc2FnZSIsInN1Z2dlc3QiLCJkZXNjIiwiZml4IiwiZml4ZXIiLCJyZW1vdmUiLCJzb3VyY2VDb2RlIiwiZnJvbVRva2VuIiwiZmluZCIsInQiLCJpbXBvcnRUb2tlbiIsImhhc1NwYWNlQWZ0ZXJGcm9tIiwiaXNTcGFjZUJldHdlZW4iLCJnZXRUb2tlbkFmdGVyIiwiaGFzU3BhY2VBZnRlckltcG9ydCIsInJlcGxhY2VUZXh0UmFuZ2UiLCJyZW1vdmVSYW5nZSJdLCJtYXBwaW5ncyI6InFvQkFBQTs7QUFFQSxxQzs7QUFFQSxTQUFTQ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9PT0gJ0ltcG9ydFNwZWNpZmllcicpKSB7XG4gICAgICAgICAgaW1wb3J0c1dpdGhvdXROYW1lZHMucHVzaChub2RlKTtcbiAgICAgICAgfVxuICAgICAgfSxcblxuICAgICAgJ1Byb2dyYW06ZXhpdCcocHJvZ3JhbSkge1xuICAgICAgICBjb25zdCBpbXBvcnRzVG9rZW5zID0gaW1wb3J0c1dpdGhvdXROYW1lZHMubWFwKChub2RlKSA9PiBbbm9kZSwgcHJvZ3JhbS50b2tlbnMuZmlsdGVyKCh4KSA9PiB4LnJhbmdlWzBdID49IG5vZGUucmFuZ2VbMF0gJiYgeC5yYW5nZVsxXSA8PSBub2RlLnJhbmdlWzFdKV0pO1xuXG4gICAgICAgIGltcG9ydHNUb2tlbnMuZm9yRWFjaCgoW25vZGUsIHRva2Vuc10pID0+IHtcbiAgICAgICAgICB0b2tlbnMuZm9yRWFjaCgodG9rZW4pID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGlkeCA9IHByb2dyYW0udG9rZW5zLmluZGV4T2YodG9rZW4pO1xuICAgICAgICAgICAgY29uc3QgbmV4dFRva2VuID0gcHJvZ3JhbS50b2tlbnNbaWR4ICsgMV07XG5cbiAgICAgICAgICAgIGlmIChuZXh0VG9rZW4gJiYgdG9rZW4udmFsdWUgPT09ICd7JyAmJiBuZXh0VG9rZW4udmFsdWUgPT09ICd9Jykge1xuICAgICAgICAgICAgICBjb25zdCBoYXNPdGhlcklkZW50aWZpZXJzID0gdG9rZW5zLnNvbWUoKHRva2VuKSA9PiB0b2tlbi50eXBlID09PSAnSWRlbnRpZmllcidcbiAgICAgICAgICAgICAgICAgICYmIHRva2VuLnZhbHVlICE9PSAnZnJvbSdcbiAgICAgICAgICAgICAgICAgICYmIHRva2VuLnZhbHVlICE9PSAndHlwZSdcbiAgICAgICAgICAgICAgICAgICYmIHRva2VuLnZhbHVlICE9PSAndHlwZW9mJyxcbiAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAvLyBJZiBpdCBoYXMgbm8gb3RoZXIgaWRlbnRpZmllcnMgaXQncyB0aGUgb25seSB0aGluZyBpbiB0aGUgaW1wb3J0LCBzbyB3ZSBjYW4gZWl0aGVyIHJlbW92ZSB0aGUgaW1wb3J0XG4gICAgICAgICAgICAgIC8vIGNvbXBsZXRlbHkgb3IgdHJhbnNmb3JtIGl0IGluIGEgc2lkZS1lZmZlY3RzIG9ubHkgaW1wb3J0XG4gICAgICAgICAgICAgIGlmICghaGFzT3RoZXJJZGVudGlmaWVycykge1xuICAgICAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICBtZXNzYWdlOiAnVW5leHBlY3RlZCBlbXB0eSBuYW1lZCBpbXBvcnQgYmxvY2snLFxuICAgICAgICAgICAgICAgICAgc3VnZ2VzdDogW1xuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ1JlbW92ZSB1bnVzZWQgaW1wb3J0JyxcbiAgICAgICAgICAgICAgICAgICAgICBmaXgoZml4ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlbW92ZSB0aGUgd2hvbGUgaW1wb3J0XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZml4ZXIucmVtb3ZlKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnUmVtb3ZlIGVtcHR5IGltcG9ydCBibG9jaycsXG4gICAgICAgICAgICAgICAgICAgICAgZml4KGZpeGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIGVtcHR5IGJsb2NrIGFuZCB0aGUgJ2Zyb20nIHRva2VuLCBsZWF2aW5nIHRoZSBpbXBvcnQgb25seSBmb3IgaXRzIHNpZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVmZmVjdHMsIGUuZy4gYGltcG9ydCAnbW9kJ2BcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNvdXJjZUNvZGUgPSBnZXRTb3VyY2VDb2RlKGNvbnRleHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZnJvbVRva2VuID0gcHJvZ3JhbS50b2tlbnMuZmluZCgodCkgPT4gdC52YWx1ZSA9PT0gJ2Zyb20nKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGltcG9ydFRva2VuID0gcHJvZ3JhbS50b2tlbnMuZmluZCgodCkgPT4gdC52YWx1ZSA9PT0gJ2ltcG9ydCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaGFzU3BhY2VBZnRlckZyb20gPSBzb3VyY2VDb2RlLmlzU3BhY2VCZXR3ZWVuKGZyb21Ub2tlbiwgc291cmNlQ29kZS5nZXRUb2tlbkFmdGVyKGZyb21Ub2tlbikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaGFzU3BhY2VBZnRlckltcG9ydCA9IHNvdXJjZUNvZGUuaXNTcGFjZUJldHdlZW4oaW1wb3J0VG9rZW4sIHNvdXJjZUNvZGUuZ2V0VG9rZW5BZnRlcihmcm9tVG9rZW4pKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgW3N0YXJ0XSA9IGdldEVtcHR5QmxvY2tSYW5nZShwcm9ncmFtLnRva2VucywgaWR4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFssIGVuZF0gPSBmcm9tVG9rZW4ucmFuZ2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByYW5nZSA9IFtzdGFydCwgaGFzU3BhY2VBZnRlckZyb20gPyBlbmQgKyAxIDogZW5kXTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpeGVyLnJlcGxhY2VUZXh0UmFuZ2UocmFuZ2UsIGhhc1NwYWNlQWZ0ZXJJbXBvcnQgPyAnJyA6ICcgJyk7XG4gICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdVbmV4cGVjdGVkIGVtcHR5IG5hbWVkIGltcG9ydCBibG9jaycsXG4gICAgICAgICAgICAgICAgICBmaXgoZml4ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpeGVyLnJlbW92ZVJhbmdlKGdldEVtcHR5QmxvY2tSYW5nZShwcm9ncmFtLnRva2VucywgaWR4KSk7XG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js b/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js new file mode 100644 index 0000000000000000000000000000000000000000..0dcf9d0544610dcdfa04409d438e2f82b3b4b718 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js @@ -0,0 +1,308 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _fs = require('fs');var _fs2 = _interopRequireDefault(_fs); +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _pkgUp = require('eslint-module-utils/pkgUp');var _pkgUp2 = _interopRequireDefault(_pkgUp); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); + +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _packagePath = require('../core/packagePath'); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var depFieldCache = new Map(); + +function hasKeys() {var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return Object.keys(obj).length > 0; +} + +function arrayOrKeys(arrayOrObject) { + return Array.isArray(arrayOrObject) ? arrayOrObject : Object.keys(arrayOrObject); +} + +function readJSON(jsonPath, throwException) { + try { + return JSON.parse(_fs2['default'].readFileSync(jsonPath, 'utf8')); + } catch (err) { + if (throwException) { + throw err; + } + } +} + +function extractDepFields(pkg) { + return { + dependencies: pkg.dependencies || {}, + devDependencies: pkg.devDependencies || {}, + optionalDependencies: pkg.optionalDependencies || {}, + peerDependencies: pkg.peerDependencies || {}, + // BundledDeps should be in the form of an array, but object notation is also supported by + // `npm`, so we convert it to an array if it is an object + bundledDependencies: arrayOrKeys(pkg.bundleDependencies || pkg.bundledDependencies || []) }; + +} + +function getPackageDepFields(packageJsonPath, throwAtRead) { + if (!depFieldCache.has(packageJsonPath)) { + var packageJson = readJSON(packageJsonPath, throwAtRead); + if (packageJson) { + var depFields = extractDepFields(packageJson); + depFieldCache.set(packageJsonPath, depFields); + } + } + + return depFieldCache.get(packageJsonPath); +} + +function getDependencies(context, packageDir) { + var paths = []; + try { + var packageContent = { + dependencies: {}, + devDependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + bundledDependencies: [] }; + + + if (packageDir && packageDir.length > 0) { + if (!Array.isArray(packageDir)) { + paths = [_path2['default'].resolve(packageDir)]; + } else { + paths = packageDir.map(function (dir) {return _path2['default'].resolve(dir);}); + } + } + + if (paths.length > 0) { + // use rule config to find package.json + paths.forEach(function (dir) { + var packageJsonPath = _path2['default'].join(dir, 'package.json'); + var _packageContent = getPackageDepFields(packageJsonPath, paths.length === 1); + if (_packageContent) { + Object.keys(packageContent).forEach(function (depsKey) { + Object.assign(packageContent[depsKey], _packageContent[depsKey]); + }); + } + }); + } else { + var packageJsonPath = (0, _pkgUp2['default'])({ + cwd: (0, _contextCompat.getPhysicalFilename)(context), + normalize: false }); + + + // use closest package.json + Object.assign( + packageContent, + getPackageDepFields(packageJsonPath, false)); + + } + + if (![ + packageContent.dependencies, + packageContent.devDependencies, + packageContent.optionalDependencies, + packageContent.peerDependencies, + packageContent.bundledDependencies]. + some(hasKeys)) { + return null; + } + + return packageContent; + } catch (e) { + if (paths.length > 0 && e.code === 'ENOENT') { + context.report({ + message: 'The package.json file could not be found.', + loc: { line: 0, column: 0 } }); + + } + if (e.name === 'JSONError' || e instanceof SyntaxError) { + context.report({ + message: 'The package.json file could not be parsed: ' + String(e.message), + loc: { line: 0, column: 0 } }); + + } + + return null; + } +} + +function missingErrorMessage(packageName) { + return '\'' + String(packageName) + '\' should be listed in the project\'s dependencies. Run \'npm i -S ' + String(packageName) + '\' to add it'; +} + +function devDepErrorMessage(packageName) { + return '\'' + String(packageName) + '\' should be listed in the project\'s dependencies, not devDependencies.'; +} + +function optDepErrorMessage(packageName) { + return '\'' + String(packageName) + '\' should be listed in the project\'s dependencies, not optionalDependencies.'; +} + +function getModuleOriginalName(name) {var _name$split = + name.split('/'),_name$split2 = _slicedToArray(_name$split, 2),first = _name$split2[0],second = _name$split2[1]; + return first.startsWith('@') ? String(first) + '/' + String(second) : first; +} + +function getModuleRealName(resolved) { + return (0, _packagePath.getFilePackageName)(resolved); +} + +function checkDependencyDeclaration(deps, packageName, declarationStatus) { + var newDeclarationStatus = declarationStatus || { + isInDeps: false, + isInDevDeps: false, + isInOptDeps: false, + isInPeerDeps: false, + isInBundledDeps: false }; + + + // in case of sub package.json inside a module + // check the dependencies on all hierarchy + var packageHierarchy = []; + var packageNameParts = packageName ? packageName.split('/') : []; + packageNameParts.forEach(function (namePart, index) { + if (!namePart.startsWith('@')) { + var ancestor = packageNameParts.slice(0, index + 1).join('/'); + packageHierarchy.push(ancestor); + } + }); + + return packageHierarchy.reduce(function (result, ancestorName) {return { + isInDeps: result.isInDeps || deps.dependencies[ancestorName] !== undefined, + isInDevDeps: result.isInDevDeps || deps.devDependencies[ancestorName] !== undefined, + isInOptDeps: result.isInOptDeps || deps.optionalDependencies[ancestorName] !== undefined, + isInPeerDeps: result.isInPeerDeps || deps.peerDependencies[ancestorName] !== undefined, + isInBundledDeps: + result.isInBundledDeps || deps.bundledDependencies.indexOf(ancestorName) !== -1 };}, + newDeclarationStatus); +} + +function reportIfMissing(context, deps, depsOptions, node, name) { + // Do not report when importing types unless option is enabled + if ( + !depsOptions.verifyTypeImports && ( + + node.importKind === 'type' || + node.importKind === 'typeof' || + node.exportKind === 'type' || + Array.isArray(node.specifiers) && node.specifiers.length && node.specifiers.every(function (specifier) {return specifier.importKind === 'type' || specifier.importKind === 'typeof';}))) + + { + return; + } + + var typeOfImport = (0, _importType2['default'])(name, context); + + if ( + typeOfImport !== 'external' && ( + typeOfImport !== 'internal' || !depsOptions.verifyInternalDeps)) + { + return; + } + + var resolved = (0, _resolve2['default'])(name, context); + if (!resolved) {return;} + + var importPackageName = getModuleOriginalName(name); + var declarationStatus = checkDependencyDeclaration(deps, importPackageName); + + if ( + declarationStatus.isInDeps || + depsOptions.allowDevDeps && declarationStatus.isInDevDeps || + depsOptions.allowPeerDeps && declarationStatus.isInPeerDeps || + depsOptions.allowOptDeps && declarationStatus.isInOptDeps || + depsOptions.allowBundledDeps && declarationStatus.isInBundledDeps) + { + return; + } + + // test the real name from the resolved package.json + // if not aliased imports (alias/react for example), importPackageName can be misinterpreted + var realPackageName = getModuleRealName(resolved); + if (realPackageName && realPackageName !== importPackageName) { + declarationStatus = checkDependencyDeclaration(deps, realPackageName, declarationStatus); + + if ( + declarationStatus.isInDeps || + depsOptions.allowDevDeps && declarationStatus.isInDevDeps || + depsOptions.allowPeerDeps && declarationStatus.isInPeerDeps || + depsOptions.allowOptDeps && declarationStatus.isInOptDeps || + depsOptions.allowBundledDeps && declarationStatus.isInBundledDeps) + { + return; + } + } + + if (declarationStatus.isInDevDeps && !depsOptions.allowDevDeps) { + context.report(node, devDepErrorMessage(realPackageName || importPackageName)); + return; + } + + if (declarationStatus.isInOptDeps && !depsOptions.allowOptDeps) { + context.report(node, optDepErrorMessage(realPackageName || importPackageName)); + return; + } + + context.report(node, missingErrorMessage(realPackageName || importPackageName)); +} + +function testConfig(config, filename) { + // Simplest configuration first, either a boolean or nothing. + if (typeof config === 'boolean' || typeof config === 'undefined') { + return config; + } + // Array of globs. + return config.some(function (c) {return (0, _minimatch2['default'])(filename, c) || + (0, _minimatch2['default'])(filename, _path2['default'].join(process.cwd(), c));}); + +} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Helpful warnings', + description: 'Forbid the use of extraneous packages.', + url: (0, _docsUrl2['default'])('no-extraneous-dependencies') }, + + + schema: [ + { + type: 'object', + properties: { + devDependencies: { type: ['boolean', 'array'] }, + optionalDependencies: { type: ['boolean', 'array'] }, + peerDependencies: { type: ['boolean', 'array'] }, + bundledDependencies: { type: ['boolean', 'array'] }, + packageDir: { type: ['string', 'array'] }, + includeInternal: { type: ['boolean'] }, + includeTypes: { type: ['boolean'] } }, + + additionalProperties: false }] }, + + + + + create: function () {function create(context) { + var options = context.options[0] || {}; + var filename = (0, _contextCompat.getPhysicalFilename)(context); + var deps = getDependencies(context, options.packageDir) || extractDepFields({}); + + var depsOptions = { + allowDevDeps: testConfig(options.devDependencies, filename) !== false, + allowOptDeps: testConfig(options.optionalDependencies, filename) !== false, + allowPeerDeps: testConfig(options.peerDependencies, filename) !== false, + allowBundledDeps: testConfig(options.bundledDependencies, filename) !== false, + verifyInternalDeps: !!options.includeInternal, + verifyTypeImports: !!options.includeTypes }; + + + return (0, _moduleVisitor2['default'])(function (source, node) { + reportIfMissing(context, deps, depsOptions, node, source.value); + }, { commonjs: true }); + }return create;}(), + + 'Program:exit': function () {function ProgramExit() { + depFieldCache.clear(); + }return ProgramExit;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llcy5qcyJdLCJuYW1lcyI6WyJkZXBGaWVsZENhY2hlIiwiTWFwIiwiaGFzS2V5cyIsIm9iaiIsIk9iamVjdCIsImtleXMiLCJsZW5ndGgiLCJhcnJheU9yS2V5cyIsImFycmF5T3JPYmplY3QiLCJBcnJheSIsImlzQXJyYXkiLCJyZWFkSlNPTiIsImpzb25QYXRoIiwidGhyb3dFeGNlcHRpb24iLCJKU09OIiwicGFyc2UiLCJmcyIsInJlYWRGaWxlU3luYyIsImVyciIsImV4dHJhY3REZXBGaWVsZHMiLCJwa2ciLCJkZXBlbmRlbmNpZXMiLCJkZXZEZXBlbmRlbmNpZXMiLCJvcHRpb25hbERlcGVuZGVuY2llcyIsInBlZXJEZXBlbmRlbmNpZXMiLCJidW5kbGVkRGVwZW5kZW5jaWVzIiwiYnVuZGxlRGVwZW5kZW5jaWVzIiwiZ2V0UGFja2FnZURlcEZpZWxkcyIsInBhY2thZ2VKc29uUGF0aCIsInRocm93QXRSZWFkIiwiaGFzIiwicGFja2FnZ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SB7XG4gICAgICAgIHBhdGhzID0gW3BhdGgucmVzb2x2ZShwYWNrYWdlRGlyKV07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBwYXRocyA9IHBhY2thZ2VEaXIubWFwKChkaXIpID0+IHBhdGgucmVzb2x2ZShkaXIpKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAocGF0aHMubGVuZ3RoID4gMCkge1xuICAgICAgLy8gdXNlIHJ1bGUgY29uZmlnIHRvIGZpbmQgcGFja2FnZS5qc29uXG4gICAgICBwYXRocy5mb3JFYWNoKChkaXIpID0+IHtcbiAgICAgICAgY29uc3QgcGFja2FnZUpzb25QYXRoID0gcGF0aC5qb2luKGRpciwgJ3BhY2thZ2UuanNvbicpO1xuICAgICAgICBjb25zdCBfcGFja2FnZUNvbnRlbnQgPSBnZXRQYWNrYWdlRGVwRmllbGRzKHBhY2thZ2VKc29uUGF0aCwgcGF0aHMubGVuZ3RoID09PSAxKTtcbiAgICAgICAgaWYgKF9wYWNrYWdlQ29udGVudCkge1xuICAgICAgICAgIE9iamVjdC5rZXlzKHBhY2thZ2VDb250ZW50KS5mb3JFYWNoKChkZXBzS2V5KSA9PiB7XG4gICAgICAgICAgICBPYmplY3QuYXNzaWduKHBhY2thZ2VDb250ZW50W2RlcHNLZXldLCBfcGFja2FnZUNvbnRlbnRbZGVwc0tleV0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29uc3QgcGFja2FnZUpzb25QYXRoID0gcGtnVXAoe1xuICAgICAgICBjd2Q6IGdldFBoeXNpY2FsRmlsZW5hbWUoY29udGV4dCksXG4gICAgICAgIG5vcm1hbGl6ZTogZmFsc2UsXG4gICAgICB9KTtcblxuICAgICAgLy8gdXNlIGNsb3Nlc3QgcGFja2FnZS5qc29uXG4gICAgICBPYmplY3QuYXNzaWduKFxuICAgICAgICBwYWNrYWdlQ29udGVudCxcbiAgICAgICAgZ2V0UGF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RzKHt9KTtcblxuICAgIGNvbnN0IGRlcHNPcHRpb25zID0ge1xuICAgICAgYWxsb3dEZXZEZXBzOiB0ZXN0Q29uZmlnKG9wdGlvbnMuZGV2RGVwZW5kZW5jaWVzLCBmaWxlbmFtZSkgIT09IGZhbHNlLFxuICAgICAgYWxsb3dPcHREZXBzOiB0ZXN0Q29uZmlnKG9wdGlvbnMub3B0aW9uYWxEZXBlbmRlbmNpZXMsIGZpbGVuYW1lKSAhPT0gZmFsc2UsXG4gICAgICBhbGxvd1BlZXJEZXBzOiB0ZXN0Q29uZmlnKG9wdGlvbnMucGVlckRlcGVuZGVuY2llcywgZmlsZW5hbWUpICE9PSBmYWxzZSxcbiAgICAgIGFsbG93QnVuZGxlZERlcHM6IHRlc3RDb25maWcob3B0aW9ucy5idW5kbGVkRGVwZW5kZW5jaWVzLCBmaWxlbmFtZSkgIT09IGZhbHNlLFxuICAgICAgdmVyaWZ5SW50ZXJuYWxEZXBzOiAhIW9wdGlvbnMuaW5jbHVkZUludGVybmFsLFxuICAgICAgdmVyaWZ5VHlwZUltcG9ydHM6ICEhb3B0aW9ucy5pbmNsdWRlVHlwZXMsXG4gICAgfTtcblxuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKChzb3VyY2UsIG5vZGUpID0+IHtcbiAgICAgIHJlcG9ydElmTWlzc2luZyhjb250ZXh0LCBkZXBzLCBkZXBzT3B0aW9ucywgbm9kZSwgc291cmNlLnZhbHVlKTtcbiAgICB9LCB7IGNvbW1vbmpzOiB0cnVlIH0pO1xuICB9LFxuXG4gICdQcm9ncmFtOmV4aXQnKCkge1xuICAgIGRlcEZpZWxkQ2FjaGUuY2xlYXIoKTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-import-module-exports.js b/node_modules/eslint-plugin-import/lib/rules/no-import-module-exports.js new file mode 100644 index 0000000000000000000000000000000000000000..c54dddeb5421c164b480883f3227760c4a33291d --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-import-module-exports.js @@ -0,0 +1,86 @@ +'use strict';var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _pkgUp = require('eslint-module-utils/pkgUp');var _pkgUp2 = _interopRequireDefault(_pkgUp);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function getEntryPoint(context) { + var pkgPath = (0, _pkgUp2['default'])({ cwd: (0, _contextCompat.getPhysicalFilename)(context) }); + try { + return require.resolve(_path2['default'].dirname(pkgPath)); + } catch (error) { + // Assume the package has no entrypoint (e.g. CLI packages) + // in which case require.resolve would throw. + return null; + } +} + +function findScope(context, identifier) {var _getSourceCode = + (0, _contextCompat.getSourceCode)(context),scopeManager = _getSourceCode.scopeManager; + + return scopeManager && scopeManager.scopes.slice().reverse().find(function (scope) {return scope.variables.some(function (variable) {return variable.identifiers.some(function (node) {return node.name === identifier;});});}); +} + +function findDefinition(objectScope, identifier) { + var variable = objectScope.variables.find(function (variable) {return variable.name === identifier;}); + return variable.defs.find(function (def) {return def.name.name === identifier;}); +} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Module systems', + description: 'Forbid import statements with CommonJS module.exports.', + recommended: true }, + + fixable: 'code', + schema: [ + { + type: 'object', + properties: { + exceptions: { type: 'array' } }, + + additionalProperties: false }] }, + + + + create: function () {function create(context) { + var importDeclarations = []; + var entryPoint = getEntryPoint(context); + var options = context.options[0] || {}; + var alreadyReported = false; + + function report(node) { + var fileName = (0, _contextCompat.getPhysicalFilename)(context); + var isEntryPoint = entryPoint === fileName; + var isIdentifier = node.object.type === 'Identifier'; + var hasKeywords = /^(module|exports)$/.test(node.object.name); + var objectScope = hasKeywords && findScope(context, node.object.name); + var variableDefinition = objectScope && findDefinition(objectScope, node.object.name); + var isImportBinding = variableDefinition && variableDefinition.type === 'ImportBinding'; + var hasCJSExportReference = hasKeywords && (!objectScope || objectScope.type === 'module'); + var isException = !!options.exceptions && options.exceptions.some(function (glob) {return (0, _minimatch2['default'])(fileName, glob);}); + + if (isIdentifier && hasCJSExportReference && !isEntryPoint && !isException && !isImportBinding) { + importDeclarations.forEach(function (importDeclaration) { + context.report({ + node: importDeclaration, + message: 'Cannot use import declarations in modules that export using CommonJS (module.exports = \'foo\' or exports.bar = \'hi\')' }); + + }); + alreadyReported = true; + } + } + + return { + ImportDeclaration: function () {function ImportDeclaration(node) { + importDeclarations.push(node); + }return ImportDeclaration;}(), + MemberExpression: function () {function MemberExpression(node) { + if (!alreadyReported) { + report(node); + } + }return MemberExpression;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1pbXBvcnQtbW9kdWxlLWV4cG9ydHMuanMiXSwibmFtZXMiOlsiZ2V0RW50cnlQb2ludCIsImNvbnRleHQiLCJwa2dQYXRoIiwiY3dkIiwicmVxdWlyZSIsInJlc29sdmUiLCJwYXRoIiwiZGlybmFtZSIsImVycm9yIiwiZmluZFNjb3BlIiwiaWRlbnRpZmllciIsInNjb3BlTWFuYWdlciIsInNjb3BlcyIsInNsaWNlIiwicmV2ZXJzZSIsImZpbmQiLCJzY29wZSIsInZhcmlhYmxlcyIsInNvbWUiLCJ2YXJpYWJsZSIsImlkZW50aWZpZXJzIiwibm9kZSIsIm5hbWUiLCJmaW5kRGVmaW5pdGlvbiIsIm9iamVjdFNjb3BlIiwiZGVmcyIsImRlZiIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwicmVjb21tZW5kZWQiLCJmaXhhYmxlIiwic2NoZW1hIiwicHJvcGVydGllcyIsImV4Y2VwdGlvbnMiLCJhZGRpdGlvbmFsUHJvcGVydGllcyIsImNyZWF0ZSIsImltcG9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1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBJbXBvcnREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGltcG9ydERlY2xhcmF0aW9ucy5wdXNoKG5vZGUpO1xuICAgICAgfSxcbiAgICAgIE1lbWJlckV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAoIWFscmVhZHlSZXBvcnRlZCkge1xuICAgICAgICAgIHJlcG9ydChub2RlKTtcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js b/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js new file mode 100644 index 0000000000000000000000000000000000000000..3b20616a24314b815c11561faeaa6a32ea629e4e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js @@ -0,0 +1,144 @@ +'use strict';var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); + +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Static analysis', + description: 'Forbid importing the submodules of other modules.', + url: (0, _docsUrl2['default'])('no-internal-modules') }, + + + schema: [ + { + anyOf: [ + { + type: 'object', + properties: { + allow: { + type: 'array', + items: { + type: 'string' } } }, + + + + additionalProperties: false }, + + { + type: 'object', + properties: { + forbid: { + type: 'array', + items: { + type: 'string' } } }, + + + + additionalProperties: false }] }] }, + + + + + + + create: function () {function noReachingInside(context) { + var options = context.options[0] || {}; + var allowRegexps = (options.allow || []).map(function (p) {return _minimatch2['default'].makeRe(p);}); + var forbidRegexps = (options.forbid || []).map(function (p) {return _minimatch2['default'].makeRe(p);}); + + // minimatch patterns are expected to use / path separators, like import + // statements, so normalize paths to use the same + function normalizeSep(somePath) { + return somePath.split('\\').join('/'); + } + + function toSteps(somePath) { + return normalizeSep(somePath). + split('/'). + filter(function (step) {return step && step !== '.';}). + reduce(function (acc, step) { + if (step === '..') { + return acc.slice(0, -1); + } + return acc.concat(step); + }, []); + } + + // test if reaching to this destination is allowed + function reachingAllowed(importPath) { + return allowRegexps.some(function (re) {return re.test(importPath);}); + } + + // test if reaching to this destination is forbidden + function reachingForbidden(importPath) { + return forbidRegexps.some(function (re) {return re.test(importPath);}); + } + + function isAllowViolation(importPath) { + var steps = toSteps(importPath); + + var nonScopeSteps = steps.filter(function (step) {return step.indexOf('@') !== 0;}); + if (nonScopeSteps.length <= 1) {return false;} + + // before trying to resolve, see if the raw import (with relative + // segments resolved) matches an allowed pattern + var justSteps = steps.join('/'); + if (reachingAllowed(justSteps) || reachingAllowed('/' + String(justSteps))) {return false;} + + // if the import statement doesn't match directly, try to match the + // resolved path if the import is resolvable + var resolved = (0, _resolve2['default'])(importPath, context); + if (!resolved || reachingAllowed(normalizeSep(resolved))) {return false;} + + // this import was not allowed by the allowed paths, and reaches + // so it is a violation + return true; + } + + function isForbidViolation(importPath) { + var steps = toSteps(importPath); + + // before trying to resolve, see if the raw import (with relative + // segments resolved) matches a forbidden pattern + var justSteps = steps.join('/'); + + if (reachingForbidden(justSteps) || reachingForbidden('/' + String(justSteps))) {return true;} + + // if the import statement doesn't match directly, try to match the + // resolved path if the import is resolvable + var resolved = (0, _resolve2['default'])(importPath, context); + if (resolved && reachingForbidden(normalizeSep(resolved))) {return true;} + + // this import was not forbidden by the forbidden paths so it is not a violation + return false; + } + + // find a directory that is being reached into, but which shouldn't be + var isReachViolation = options.forbid ? isForbidViolation : isAllowViolation; + + function checkImportForReaching(importPath, node) { + var potentialViolationTypes = ['parent', 'index', 'sibling', 'external', 'internal']; + if ( + potentialViolationTypes.indexOf((0, _importType2['default'])(importPath, context)) !== -1 && + isReachViolation(importPath)) + { + context.report({ + node: node, + message: 'Reaching to "' + String(importPath) + '" is not allowed.' }); + + } + } + + return (0, _moduleVisitor2['default'])( + function (source) { + checkImportForReaching(source.value, source); + }, + { commonjs: true }); + + }return noReachingInside;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1pbnRlcm5hbC1tb2R1bGVzLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwic2NoZW1hIiwiYW55T2YiLCJwcm9wZXJ0aWVzIiwiYWxsb3ciLCJpdGVtcyIsImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiwiZm9yYmlkIiwiY3JlYXRlIiwibm9SZWFjaGluZ0luc2lkZSIsImNvbnRleHQiLCJvcHRpb25zIiwiYWxsb3dSZWdleHBzIiwibWFwIiwicCIsIm1pbmltYXRjaCIsIm1ha2VSZSIsImZvcmJpZFJlZ2V4cHMiLCJub3JtYWxpemVTZXAiLCJzb21lUGF0aCIsInNwbGl0Iiwiam9pbiIsInRvU3RlcHMiLCJmaWx0ZXIiLCJzdGVwIiwicmVkdWNlIiwiYWNjIiwic2xpY2UiLCJjb25jYXQiLCJyZWFjaGluZ0FsbG93ZWQiLCJpbXBvcnRQYXRoIiwic29tZSIsInJlIiwidGVzdCIsInJlYWNoaW5nRm9yYmlkZGVuIiwiaXNBbGxvd1Zpb2xhdGlvbiIsInN0ZXBzIiwibm9uU2NvcGVTdGVwcyIsImluZGV4T2YiLCJsZW5ndGgiLCJqdXN0U3RlcHMiLCJyZXNvbHZlZCIsImlzRm9yYmlkVmlvbGF0aW9uIiwiaXNSZWFjaFZpb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pb2xhdGlvbiA6IGlzQWxsb3dWaW9sYXRpb247XG5cbiAgICBmdW5jdGlvbiBjaGVja0ltcG9ydEZvclJlYWNoaW5nKGltcG9ydFBhdGgsIG5vZGUpIHtcbiAgICAgIGNvbnN0IHBvdGVudGlhbFZpb2xhdGlvblR5cGVzID0gWydwYXJlbnQnLCAnaW5kZXgnLCAnc2libGluZycsICdleHRlcm5hbCcsICdpbnRlcm5hbCddO1xuICAgICAgaWYgKFxuICAgICAgICBwb3RlbnRpYWxWaW9sYXRpb25UeXBlcy5pbmRleE9mKGltcG9ydFR5cGUoaW1wb3J0UGF0aCwgY29udGV4dCkpICE9PSAtMVxuICAgICAgICAmJiBpc1JlYWNoVmlvbGF0aW9uKGltcG9ydFBhdGgpXG4gICAgICApIHtcbiAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgbWVzc2FnZTogYFJlYWNoaW5nIHRvIFwiJHtpbXBvcnRQYXRofVwiIGlzIG5vdCBhbGxvd2VkLmAsXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKFxuICAgICAgKHNvdXJjZSkgPT4ge1xuICAgICAgICBjaGVja0ltcG9ydEZvclJlYWNoaW5nKHNvdXJjZS52YWx1ZSwgc291cmNlKTtcbiAgICAgIH0sXG4gICAgICB7IGNvbW1vbmpzOiB0cnVlIH0sXG4gICAgKTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js b/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js new file mode 100644 index 0000000000000000000000000000000000000000..96098759beff575035fc67070ab83c1e5943af9d --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js @@ -0,0 +1,62 @@ +'use strict';var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +/** @type {import('eslint').Rule.RuleModule} */ +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Helpful warnings', + description: 'Forbid the use of mutable exports with `var` or `let`.', + url: (0, _docsUrl2['default'])('no-mutable-exports') }, + + schema: [] }, + + + create: function () {function create(context) { + function checkDeclaration(node) {var + kind = node.kind; + if (kind === 'var' || kind === 'let') { + context.report(node, 'Exporting mutable \'' + String(kind) + '\' binding, use \'const\' instead.'); + } + } + + /** @type {(scope: import('eslint').Scope.Scope, name: string) => void} */ + function checkDeclarationsInScope(_ref, name) {var variables = _ref.variables; + variables. + filter(function (variable) {return variable.name === name;}). + forEach(function (variable) { + variable.defs. + filter(function (def) {return def.type === 'Variable' && def.parent;}). + forEach(function (def) { + checkDeclaration(def.parent); + }); + }); + } + + return { + /** @param {import('estree').ExportDefaultDeclaration} node */ + ExportDefaultDeclaration: function () {function ExportDefaultDeclaration(node) { + var scope = (0, _contextCompat.getScope)(context, node); + + if ('name' in node.declaration && node.declaration.name) { + checkDeclarationsInScope(scope, node.declaration.name); + } + }return ExportDefaultDeclaration;}(), + + /** @param {import('estree').ExportNamedDeclaration} node */ + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + var scope = (0, _contextCompat.getScope)(context, node); + + if ('declaration' in node && node.declaration) { + checkDeclaration(node.declaration); + } else if (!('source' in node) || !node.source) { + node.specifiers.forEach(function (specifier) { + checkDeclarationsInScope(scope, specifier.local.name); + }); + } + }return ExportNamedDeclaration;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1tdXRhYmxlLWV4cG9ydHMuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3J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HBvcnROYW1lZERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgY29uc3Qgc2NvcGUgPSBnZXRTY29wZShjb250ZXh0LCBub2RlKTtcblxuICAgICAgICBpZiAoJ2RlY2xhcmF0aW9uJyBpbiBub2RlICYmIG5vZGUuZGVjbGFyYXRpb24pICB7XG4gICAgICAgICAgY2hlY2tEZWNsYXJhdGlvbihub2RlLmRlY2xhcmF0aW9uKTtcbiAgICAgICAgfSBlbHNlIGlmICghKCdzb3VyY2UnIGluIG5vZGUpIHx8ICFub2RlLnNvdXJjZSkge1xuICAgICAgICAgIG5vZGUuc3BlY2lmaWVycy5mb3JFYWNoKChzcGVjaWZpZXIpID0+IHtcbiAgICAgICAgICAgIGNoZWNrRGVjbGFyYXRpb25zSW5TY29wZShzY29wZSwgc3BlY2lmaWVyLmxvY2FsLm5hbWUpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js new file mode 100644 index 0000000000000000000000000000000000000000..d8cdf78c2781d5b3057f2a98906729b2464ce4e8 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js @@ -0,0 +1,96 @@ +'use strict'; + + + + + +var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _importDeclaration = require('../importDeclaration');var _importDeclaration2 = _interopRequireDefault(_importDeclaration); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Helpful warnings', + description: 'Forbid use of exported name as property of default export.', + url: (0, _docsUrl2['default'])('no-named-as-default-member') }, + + schema: [] }, + + + create: function () {function create(context) { + var fileImports = new Map(); + var allPropertyLookups = new Map(); + + function storePropertyLookup(objectName, propName, node) { + var lookups = allPropertyLookups.get(objectName) || []; + lookups.push({ node: node, propName: propName }); + allPropertyLookups.set(objectName, lookups); + } + + return { + ImportDefaultSpecifier: function () {function ImportDefaultSpecifier(node) { + var declaration = (0, _importDeclaration2['default'])(context, node); + var exportMap = _builder2['default'].get(declaration.source.value, context); + if (exportMap == null) {return;} + + if (exportMap.errors.length) { + exportMap.reportErrors(context, declaration); + return; + } + + fileImports.set(node.local.name, { + exportMap: exportMap, + sourcePath: declaration.source.value }); + + }return ImportDefaultSpecifier;}(), + + MemberExpression: function () {function MemberExpression(node) { + var objectName = node.object.name; + var propName = node.property.name; + storePropertyLookup(objectName, propName, node); + }return MemberExpression;}(), + + VariableDeclarator: function () {function VariableDeclarator(node) { + var isDestructure = node.id.type === 'ObjectPattern' && + node.init != null && + node.init.type === 'Identifier'; + if (!isDestructure) {return;} + + var objectName = node.init.name;var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = node.id.properties[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var _ref = _step.value;var key = _ref.key; + if (key == null) {continue;} // true for rest properties + storePropertyLookup(objectName, key.name, key); + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + }return VariableDeclarator;}(), + + 'Program:exit': function () {function ProgramExit() { + allPropertyLookups.forEach(function (lookups, objectName) { + var fileImport = fileImports.get(objectName); + if (fileImport == null) {return;}var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + + for (var _iterator2 = lookups[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var _ref2 = _step2.value;var propName = _ref2.propName,node = _ref2.node; + // the default import can have a "default" property + if (propName === 'default') {continue;} + if (!fileImport.exportMap.namespace.has(propName)) {continue;} + + context.report({ + node: node, + message: 'Caution: `' + String(objectName) + '` also has a named export `' + String(propName) + '`. Check if you meant to write `import {' + String(propName) + '} from \'' + String(fileImport.sourcePath) + '\'` instead.' }); + + }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} + }); + }return ProgramExit;}() }; + + }return create;}() }; /** + * @fileoverview Rule to warn about potentially confused use of name exports + * @author Desmond Brand + * @copyright 2016 Desmond Brand. All rights reserved. + * See LICENSE in root directory for full license. + */ +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1uYW1lZC1hcy1kZWZhdWx0LW1lbWJlci5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwiY2F0ZWdvcnkiLCJkZXNjcmlwdGlvbiIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJmaWxlSW1wb3J0cyIsIk1hcCIsImFsbFByb3BlcnR5TG9va3VwcyIsInN0b3JlUHJvcGVydHlMb29rdXAiLCJvYmplY3ROYW1lIiwicHJvcE5hbWUiLCJub2RlIiwibG9va3VwcyIsImdldCIsInB1c2giLCJzZXQiLCJJbXBvcnREZWZhdWx0U3BlY2lmaWVyIiwiZGVjbGFyYXRpb24iLCJleHBvcnRNYXAiLCJFeHBvcnRNYXBCdWlsZGVyIiwic291cmNlIiwidmFsdWUiLCJlcnJvcnMiLCJsZW5ndGgiLCJyZXBvcnRFcnJvcnMiLCJsb2NhbCIsIm5hbWUiLCJzb3VyY2VQYXRoIiwiTWVtYmVyRXhwcmVzc2lvbiIsIm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7XG4gICAgICAgICAgY29uc3QgZmlsZUltcG9ydCA9IGZpbGVJbXBvcnRzLmdldChvYmplY3ROYW1lKTtcbiAgICAgICAgICBpZiAoZmlsZUltcG9ydCA9PSBudWxsKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgZm9yIChjb25zdCB7IHByb3BOYW1lLCBub2RlIH0gb2YgbG9va3Vwcykge1xuICAgICAgICAgICAgLy8gdGhlIGRlZmF1bHQgaW1wb3J0IGNhbiBoYXZlIGEgXCJkZWZhdWx0XCIgcHJvcGVydHlcbiAgICAgICAgICAgIGlmIChwcm9wTmFtZSA9PT0gJ2RlZmF1bHQnKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICBpZiAoIWZpbGVJbXBvcnQuZXhwb3J0TWFwLm5hbWVzcGFjZS5oYXMocHJvcE5hbWUpKSB7IGNvbnRpbnVlOyB9XG5cbiAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgbWVzc2FnZTogYENhdXRpb246IFxcYCR7b2JqZWN0TmFtZX1cXGAgYWxzbyBoYXMgYSBuYW1lZCBleHBvcnQgXFxgJHtwcm9wTmFtZX1cXGAuIENoZWNrIGlmIHlvdSBtZWFudCB0byB3cml0ZSBcXGBpbXBvcnQgeyR7cHJvcE5hbWV9fSBmcm9tICcke2ZpbGVJbXBvcnQuc291cmNlUGF0aH0nXFxgIGluc3RlYWQuYCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js new file mode 100644 index 0000000000000000000000000000000000000000..a4368907980ee530f6cdb79b6a132e1b99c5dd4a --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js @@ -0,0 +1,88 @@ +'use strict';var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _importDeclaration = require('../importDeclaration');var _importDeclaration2 = _interopRequireDefault(_importDeclaration); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Helpful warnings', + description: 'Forbid use of exported name as identifier of default export.', + url: (0, _docsUrl2['default'])('no-named-as-default') }, + + schema: [] }, + + + create: function () {function create(context) { + function checkDefault(nameKey, defaultSpecifier) { + /** + * For ImportDefaultSpecifier we're interested in the "local" name (`foo` for `import {bar as foo} ...`) + * For ExportDefaultSpecifier we're interested in the "exported" name (`foo` for `export {bar as foo} ...`) + */ + var analyzedName = defaultSpecifier[nameKey].name; + + // #566: default is a valid specifier + if (analyzedName === 'default') {return;} + + var declaration = (0, _importDeclaration2['default'])(context, defaultSpecifier); + /** @type {import('../exportMap').default | null} */ + var importedModule = _builder2['default'].get(declaration.source.value, context); + if (importedModule == null) {return;} + + if (importedModule.errors.length > 0) { + importedModule.reportErrors(context, declaration); + return; + } + + if (!importedModule.hasDefault) { + // The rule is triggered for default imports/exports, so if the imported module has no default + // this means we're dealing with incorrect source code anyway + return; + } + + if (!importedModule.has(analyzedName)) { + // The name used locally for the default import was not even used in the imported module. + return; + } + + /** + * FIXME: We can verify if a default and a named export are pointing to the same symbol only + * if they are both `reexports`. In case one of the symbols is not a re-export, but defined + * in the file, the ExportMap structure has no info about what actually is being exported -- + * the value in the `namespace` Map is an empty object. + * + * To solve this, it would require not relying on the ExportMap, but on some other way of + * accessing the imported module and its exported values. + * + * Additionally, although `ExportMap.get` is a unified way to get info from both `reexports` + * and `namespace` maps, it does not return valid output we need here, and I think this is + * related to the "cycle safeguards" in the `get` function. + */ + + if (importedModule.reexports.has(analyzedName) && importedModule.reexports.has('default')) { + var thingImportedWithNamedImport = importedModule.reexports.get(analyzedName).getImport(); + var thingImportedWithDefaultImport = importedModule.reexports.get('default').getImport(); + + // Case: both imports point to the same file and they both refer to the same symbol in this file. + if ( + thingImportedWithNamedImport.path === thingImportedWithDefaultImport.path && + thingImportedWithNamedImport.local === thingImportedWithDefaultImport.local) + { + // #1594: the imported module exports the same thing via a default export and a named export + return; + } + } + + context.report( + defaultSpecifier, 'Using exported name \'' + String( + defaultSpecifier[nameKey].name) + '\' as identifier for default ' + (nameKey === 'local' ? 'import' : 'export') + '.'); + + + } + + return { + ImportDefaultSpecifier: checkDefault.bind(null, 'local'), + ExportDefaultSpecifier: checkDefault.bind(null, 'exported') }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1uYW1lZC1hcy1kZWZhdWx0LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwic2NoZW1hIiwiY3JlYXRlIiwiY29udGV4dCIsImNoZWNrRGVmYXVsdCIsIm5hbWVLZXkiLCJkZWZhdWx0U3BlY2lmaWVyIiwiYW5hbHl6ZWROYW1lIiwibmFtZSIsImRlY2xhcmF0aW9uIiwiaW1wb3J0ZWRNb2R1bGUiLCJFeHBvcnRNYXBCdWlsZGVyIiwiZ2V0Iiwic291cmNlIiwidmFsdWUiLCJlcnJvcnMiLCJsZW5ndGgiLCJyZXBvcnRFcnJvcnMiLCJoYXNEZWZhdWx0IiwiaGFzIiwicmVleHBvcnRzIiwidGhpbmdJbXBvcnRlZFdpdGhOYW1lZEltcG9ydCIsImdldEltcG9ydCIsInRoaW5nSW1wb3J0ZWRXaXRoRGVmYXVsdEltcG9ydCIsInBhdGgiLCJsb2NhbCIsInJlcG9ydCIsIkltcG9ydERlZmF1bHRTcGVjaWZpZXIiLCJiaW5kIiwiRXhw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gICAgY29udGV4dC5yZXBvcnQoXG4gICAgICAgIGRlZmF1bHRTcGVjaWZpZXIsXG4gICAgICAgIGBVc2luZyBleHBvcnRlZCBuYW1lICcke2RlZmF1bHRTcGVjaWZpZXJbbmFtZUtleV0ubmFtZX0nIGFzIGlkZW50aWZpZXIgZm9yIGRlZmF1bHQgJHtuYW1lS2V5ID09PSAnbG9jYWwnID8gYGltcG9ydGAgOiBgZXhwb3J0YH0uYCxcbiAgICAgICk7XG5cbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgSW1wb3J0RGVmYXVsdFNwZWNpZmllcjogY2hlY2tEZWZhdWx0LmJpbmQobnVsbCwgJ2xvY2FsJyksXG4gICAgICBFeHBvcnREZWZhdWx0U3BlY2lmaWVyOiBjaGVja0RlZmF1bHQuYmluZChudWxsLCAnZXhwb3J0ZWQnKSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-default.js b/node_modules/eslint-plugin-import/lib/rules/no-named-default.js new file mode 100644 index 0000000000000000000000000000000000000000..41e3bba366605cfc369f0977a8ff636abd7d8f7a --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-default.js @@ -0,0 +1,31 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Forbid named default exports.', + url: (0, _docsUrl2['default'])('no-named-default') }, + + schema: [] }, + + + create: function () {function create(context) { + return { + ImportDeclaration: function () {function ImportDeclaration(node) { + node.specifiers.forEach(function (im) { + if (im.importKind === 'type' || im.importKind === 'typeof') { + return; + } + + if (im.type === 'ImportSpecifier' && (im.imported.name || im.imported.value) === 'default') { + context.report({ + node: im.local, + message: 'Use default import syntax to import \'' + String(im.local.name) + '\'.' }); + } + }); + }return ImportDecla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iAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgICAgbm9kZTogaW0ubG9jYWwsXG4gICAgICAgICAgICAgIG1lc3NhZ2U6IGBVc2UgZGVmYXVsdCBpbXBvcnQgc3ludGF4IHRvIGltcG9ydCAnJHtpbS5sb2NhbC5uYW1lfScuYCB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfSxcbiAgICB9O1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-export.js b/node_modules/eslint-plugin-import/lib/rules/no-named-export.js new file mode 100644 index 0000000000000000000000000000000000000000..37c95885e96e5d840022e257303888858a253f30 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-export.js @@ -0,0 +1,40 @@ +'use strict';var _sourceType = require('../core/sourceType');var _sourceType2 = _interopRequireDefault(_sourceType); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Forbid named exports.', + url: (0, _docsUrl2['default'])('no-named-export') }, + + schema: [] }, + + + create: function () {function create(context) { + // ignore non-modules + if ((0, _sourceType2['default'])(context) !== 'module') { + return {}; + } + + var message = 'Named exports are not allowed.'; + + return { + ExportAllDeclaration: function () {function ExportAllDeclaration(node) { + context.report({ node: node, message: message }); + }return ExportAllDeclaration;}(), + + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + if (node.specifiers.length === 0) { + return context.report({ node: node, message: message }); + } + + var someNamed = node.specifiers.some(function (specifier) {return (specifier.exported.name || specifier.exported.value) !== 'default';}); + if (someNamed) { + context.report({ node: node, message: message }); + } + }return ExportNamedDeclaration;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4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G5cbiAgICBjb25zdCBtZXNzYWdlID0gJ05hbWVkIGV4cG9ydHMgYXJlIG5vdCBhbGxvd2VkLic7XG5cbiAgICByZXR1cm4ge1xuICAgICAgRXhwb3J0QWxsRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICBjb250ZXh0LnJlcG9ydCh7IG5vZGUsIG1lc3NhZ2UgfSk7XG4gICAgICB9LFxuXG4gICAgICBFeHBvcnROYW1lZERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUuc3BlY2lmaWVycy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICByZXR1cm4gY29udGV4dC5yZXBvcnQoeyBub2RlLCBtZXNzYWdlIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3Qgc29tZU5hbWVkID0gbm9kZS5zcGVjaWZpZXJzLnNvbWUoKHNwZWNpZmllcikgPT4gKHNwZWNpZmllci5leHBvcnRlZC5uYW1lIHx8IHNwZWNpZmllci5leHBvcnRlZC52YWx1ZSkgIT09ICdkZWZhdWx0Jyk7XG4gICAgICAgIGlmIChzb21lTmFtZWQpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7IG5vZGUsIG1lc3NhZ2UgfSk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-namespace.js b/node_modules/eslint-plugin-import/lib/rules/no-namespace.js new file mode 100644 index 0000000000000000000000000000000000000000..c858db0c0c3a84d1712b8f61cc69998e4c6275c2 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-namespace.js @@ -0,0 +1,172 @@ +'use strict'; + + + + +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +/** + * @param {MemberExpression} memberExpression + * @returns {string} the name of the member in the object expression, e.g. the `x` in `namespace.x` + */ +function getMemberPropertyName(memberExpression) { + return memberExpression.property.type === 'Identifier' ? + memberExpression.property.name : + memberExpression.property.value; +} + +/** + * @param {ScopeManager} scopeManager + * @param {ASTNode} node + * @return {Set} + */ /** + * @fileoverview Rule to disallow namespace import + * @author Radek Benkel + */function getVariableNamesInScope(scopeManager, node) {var currentNode = node;var scope = scopeManager.acquire(currentNode); + while (scope == null) { + currentNode = currentNode.parent; + scope = scopeManager.acquire(currentNode, true); + } + return new Set(scope.variables.concat(scope.upper.variables).map(function (variable) {return variable.name;})); +} + +/** + * + * @param {*} names + * @param {*} nameConflicts + * @param {*} namespaceName + */ +function generateLocalNames(names, nameConflicts, namespaceName) { + var localNames = {}; + names.forEach(function (name) { + var localName = void 0; + if (!nameConflicts[name].has(name)) { + localName = name; + } else if (!nameConflicts[name].has(String(namespaceName) + '_' + String(name))) { + localName = String(namespaceName) + '_' + String(name); + } else { + for (var i = 1; i < Infinity; i++) { + if (!nameConflicts[name].has(String(namespaceName) + '_' + String(name) + '_' + String(i))) { + localName = String(namespaceName) + '_' + String(name) + '_' + String(i); + break; + } + } + } + localNames[name] = localName; + }); + return localNames; +} + +/** + * @param {Identifier[]} namespaceIdentifiers + * @returns {boolean} `true` if the namespace variable is more than just a glorified constant + */ +function usesNamespaceAsObject(namespaceIdentifiers) { + return !namespaceIdentifiers.every(function (identifier) { + var parent = identifier.parent; + + // `namespace.x` or `namespace['x']` + return ( + parent && + parent.type === 'MemberExpression' && ( + parent.property.type === 'Identifier' || parent.property.type === 'Literal')); + + }); +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Forbid namespace (a.k.a. "wildcard" `*`) imports.', + url: (0, _docsUrl2['default'])('no-namespace') }, + + fixable: 'code', + schema: [{ + type: 'object', + properties: { + ignore: { + type: 'array', + items: { + type: 'string' }, + + uniqueItems: true } } }] }, + + + + + + create: function () {function create(context) { + var firstOption = context.options[0] || {}; + var ignoreGlobs = firstOption.ignore; + + return { + ImportNamespaceSpecifier: function () {function ImportNamespaceSpecifier(node) { + if (ignoreGlobs && ignoreGlobs.find(function (glob) {return (0, _minimatch2['default'])(node.parent.source.value, glob, { matchBase: true });})) { + return; + } + + var scopeVariables = (0, _contextCompat.getScope)(context, node).variables; + var namespaceVariable = scopeVariables.find(function (variable) {return variable.defs[0].node === node;}); + var namespaceReferences = namespaceVariable.references; + var namespaceIdentifiers = namespaceReferences.map(function (reference) {return reference.identifier;}); + var canFix = namespaceIdentifiers.length > 0 && !usesNamespaceAsObject(namespaceIdentifiers); + + context.report({ + node: node, + message: 'Unexpected namespace import.', + fix: canFix && function (fixer) {var _getSourceCode = + (0, _contextCompat.getSourceCode)(context),scopeManager = _getSourceCode.scopeManager; + var fixes = []; + + // Pass 1: Collect variable names that are already in scope for each reference we want + // to transform, so that we can be sure that we choose non-conflicting import names + var importNameConflicts = {}; + namespaceIdentifiers.forEach(function (identifier) { + var parent = identifier.parent; + if (parent && parent.type === 'MemberExpression') { + var importName = getMemberPropertyName(parent); + var localConflicts = getVariableNamesInScope(scopeManager, parent); + if (!importNameConflicts[importName]) { + importNameConflicts[importName] = localConflicts; + } else { + localConflicts.forEach(function (c) {return importNameConflicts[importName].add(c);}); + } + } + }); + + // Choose new names for each import + var importNames = Object.keys(importNameConflicts); + var importLocalNames = generateLocalNames( + importNames, + importNameConflicts, + namespaceVariable.name); + + + // Replace the ImportNamespaceSpecifier with a list of ImportSpecifiers + var namedImportSpecifiers = importNames.map(function (importName) {return importName === importLocalNames[importName] ? + importName : String( + importName) + ' as ' + String(importLocalNames[importName]);}); + + fixes.push(fixer.replaceText(node, '{ ' + String(namedImportSpecifiers.join(', ')) + ' }')); + + // Pass 2: Replace references to the namespace with references to the named imports + namespaceIdentifiers.forEach(function (identifier) { + var parent = identifier.parent; + if (parent && parent.type === 'MemberExpression') { + var importName = getMemberPropertyName(parent); + fixes.push(fixer.replaceText(parent, importLocalNames[importName])); + } + }); + + return fixes; + } }); + + }return ImportNamespaceSpecifier;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1uYW1lc3BhY2UuanMiXSwibmFtZXMiOlsiZ2V0TWVtYmVyUHJvcGVydHlOYW1lIiwibWVtYmVyRXhwcmVzc2lvbiIsInByb3BlcnR5IiwidHlwZSIsIm5hbWUiLCJ2YWx1ZSIsImdldFZhcmlhYmxlTmFtZXNJblNjb3BlIiwic2NvcGVNYW5hZ2VyIiwibm9kZSIsImN1cnJlbnROb2RlIiwic2NvcGUiLCJhY3F1aXJlIiwicGFyZW50IiwiU2V0IiwidmFyaWFibGVzIiwiY29uY2F0IiwidXBwZXIiLCJtYXAiLCJ2YXJpYWJsZSIsImdlbmVyYXRlTG9jYWxOYW1lcyIsIm5hbWVzIiwibmFtZUNvbmZsaWN0cyIsIm5hbWVzcGFjZU5hbWUiLCJsb2NhbE5hbWVzIiwiZm9yRWFjaCIsImxvY2FsTmFtZSIsImhhcyIsImkiLCJJbmZpbml0eSIsInVzZXNOYW1lc3BhY2VBc09iamVjdCIsIm5hbWVzcGFjZUlkZW50aWZpZXJzIiwiZXZlcnkiLCJpZGVudGlmaWVyIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJkb2NzIiwiY2F0ZWdvcnkiLCJkZXNjcmlwdGlvbiIsInVybCIsImZpeGFibGUiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiaWdub3JlIiwiaXRlbXMiLCJ1bmlxdWVJdGVtcyIsImNyZWF0ZSIsImNvbnRleHQiLCJmaXJzdE9wdGlvbiIsIm9wdGlvbnMiLCJpZ25vcmVHbG9icyIsIkltcG9ydE5hbWVzcGFjZVNwZWNpZmllciIsImZpbmQiLCJnbG9iIiwic291cmNlIiwibWF0Y2hCYXNlIiw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AgICAgY29uc3QgeyBzY29wZU1hbmFnZXIgfSA9IGdldFNvdXJjZUNvZGUoY29udGV4dCk7XG4gICAgICAgICAgICBjb25zdCBmaXhlcyA9IFtdO1xuXG4gICAgICAgICAgICAvLyBQYXNzIDE6IENvbGxlY3QgdmFyaWFibGUgbmFtZXMgdGhhdCBhcmUgYWxyZWFkeSBpbiBzY29wZSBmb3IgZWFjaCByZWZlcmVuY2Ugd2Ugd2FudFxuICAgICAgICAgICAgLy8gdG8gdHJhbnNmb3JtLCBzbyB0aGF0IHdlIGNhbiBiZSBzdXJlIHRoYXQgd2UgY2hvb3NlIG5vbi1jb25mbGljdGluZyBpbXBvcnQgbmFtZXNcbiAgICAgICAgICAgIGNvbnN0IGltcG9ydE5hbWVDb25mbGljdHMgPSB7fTtcbiAgICAgICAgICAgIG5hbWVzcGFjZUlkZW50aWZpZXJzLmZvckVhY2goKGlkZW50aWZpZXIpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgcGFyZW50ID0gaWRlbnRpZmllci5wYXJlbnQ7XG4gICAgICAgICAgICAgIGlmIChwYXJlbnQgJiYgcGFyZW50LnR5cGUgPT09ICdNZW1iZXJFeHByZXNzaW9uJykge1xuICAgICAgICAgICAgICAgIGNvbnN0IGltcG9ydE5hbWUgPSBnZXRNZW1iZXJQcm9wZXJ0eU5hbWUocGFyZW50KTtcbiAgICAgICAgICAgICAgICBjb25zdCBsb2NhbENvbmZsaWN0cyA9IGdldFZhcmlhYmxlTmFtZXNJblNjb3BlKHNjb3BlTWFuYWdlciwgcGFyZW50KTtcbiAgICAgICAgICAgICAgICBpZiAoIWltcG9ydE5hbWVDb25mbGljdHNbaW1wb3J0TmFtZV0pIHtcbiAgICAgICAgICAgICAgICAgIGltcG9ydE5hbWVDb25mbGljdHNbaW1wb3J0TmFtZV0gPSBsb2NhbENvbmZsaWN0cztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgbG9jYWxDb25mbGljdHMuZm9yRWFjaCgoYykgPT4gaW1wb3J0TmFtZUNvbmZsaWN0c1tpbXBvcnROYW1lXS5hZGQoYykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIC8vIENob29zZSBuZXcgbmFtZXMgZm9yIGVhY2ggaW1wb3J0XG4gICAgICAgICAgICBjb25zdCBpbXBvcnROYW1lcyA9IE9iamVjdC5rZXlzKGltcG9ydE5hbWVDb25mbGljdHMpO1xuICAgICAgICAgICAgY29uc3QgaW1wb3J0TG9jYWxOYW1lcyA9IGdlbmVyYXRlTG9jYWxOYW1lcyhcbiAgICAgICAgICAgICAgaW1wb3J0TmFtZXMsXG4gICAgICAgICAgICAgIGltcG9ydE5hbWVDb25mbGljdHMsXG4gICAgICAgICAgICAgIG5hbWVzcGFjZVZhcmlhYmxlLm5hbWUsXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAvLyBSZXBsYWNlIHRoZSBJbXBvcnROYW1lc3BhY2VTcGVjaWZpZXIgd2l0aCBhIGxpc3Qgb2YgSW1wb3J0U3BlY2lmaWVyc1xuICAgICAgICAgICAgY29uc3QgbmFtZWRJbXBvcnRTcGVjaWZpZXJzID0gaW1wb3J0TmFtZXMubWFwKChpbXBvcnROYW1lKSA9PiBpbXBvcnROYW1lID09PSBpbXBvcnRMb2NhbE5hbWVzW2ltcG9ydE5hbWVdXG4gICAgICAgICAgICAgID8gaW1wb3J0TmFtZVxuICAgICAgICAgICAgICA6IGAke2ltcG9ydE5hbWV9IGFzICR7aW1wb3J0TG9jYWxOYW1lc1tpbXBvcnROYW1lXX1gLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGZpeGVzLnB1c2goZml4ZXIucmVwbGFjZVRleHQobm9kZSwgYHsgJHtuYW1lZEltcG9ydFNwZWNpZmllcnMuam9pbignLCAnKX0gfWApKTtcblxuICAgICAgICAgICAgLy8gUGFzcyAyOiBSZXBsYWNlIHJlZmVyZW5jZXMgdG8gdGhlIG5hbWVzcGFjZSB3aXRoIHJlZmVyZW5jZXMgdG8gdGhlIG5hbWVkIGltcG9ydHNcbiAgICAgICAgICAgIG5hbWVzcGFjZUlkZW50aWZpZXJzLmZvckVhY2goKGlkZW50aWZpZXIpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgcGFyZW50ID0gaWRlbnRpZmllci5wYXJlbnQ7XG4gICAgICAgICAgICAgIGlmIChwYXJlbnQgJiYgcGFyZW50LnR5cGUgPT09ICdNZW1iZXJFeHByZXNzaW9uJykge1xuICAgICAgICAgICAgICAgIGNvbnN0IGltcG9ydE5hbWUgPSBnZXRNZW1iZXJQcm9wZXJ0eU5hbWUocGFyZW50KTtcbiAgICAgICAgICAgICAgICBmaXhlcy5wdXNoKGZpeGVyLnJlcGxhY2VUZXh0KHBhcmVudCwgaW1wb3J0TG9jYWxOYW1lc1tpbXBvcnROYW1lXSkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIGZpeGVzO1xuICAgICAgICAgIH0pLFxuICAgICAgICB9KTtcbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js b/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js new file mode 100644 index 0000000000000000000000000000000000000000..b25c561b3fe79d41869d29350b1d2ae025c9362d --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js @@ -0,0 +1,44 @@ +'use strict';var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function reportIfMissing(context, node, allowed, name) { + if (allowed.indexOf(name) === -1 && (0, _importType2['default'])(name, context) === 'builtin') { + context.report(node, 'Do not import Node.js builtin module "' + String(name) + '"'); + } +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Module systems', + description: 'Forbid Node.js builtin modules.', + url: (0, _docsUrl2['default'])('no-nodejs-modules') }, + + schema: [ + { + type: 'object', + properties: { + allow: { + type: 'array', + uniqueItems: true, + items: { + type: 'string' } } }, + + + + additionalProperties: false }] }, + + + + + create: function () {function create(context) { + var options = context.options[0] || {}; + var allowed = options.allow || []; + + return (0, _moduleVisitor2['default'])(function (source, node) { + reportIfMissing(context, node, allowed, source.value); + }, { commonjs: true }); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1ub2RlanMtbW9kdWxlcy5qcyJdLCJuYW1lcyI6WyJyZXBvcnRJZk1pc3NpbmciLCJjb250ZXh0Iiwibm9kZSIsImFsbG93ZWQiLCJuYW1lIiwiaW5kZXhPZiIsInJlcG9ydCIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwic2NoZW1hIiwicHJvcGVydGllcyIsImFsbG93IiwidW5pcXVlSXRlbXMiLCJpdGVtcyIsImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiwiY3JlYXRlIiwib3B0aW9ucyIsInNvdXJjZSIsInZhbHVlIiwiY29tbW9uanMiXSwibWFwcGluZ3MiOiJhQUFBLGdEO0FBQ0Esa0U7QUFDQSxxQzs7QUFFQSxTQUFTQSxlQUFULENBQXlCQyxPQUF6QixFQUFrQ0MsSUFBbEMsRUFBd0NDLE9BQXhDLEVBQWlEQyxJQUFqRCxFQUF1RDtBQUNyRCxNQUFJRCxRQUFRRSxPQUFSLENBQWdCRCxJQUFoQixNQUEwQixDQUFDLENBQTN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HNlLFxuICAgICAgfSxcbiAgICBdLFxuICB9LFxuXG4gIGNyZWF0ZShjb250ZXh0KSB7XG4gICAgY29uc3Qgb3B0aW9ucyA9IGNvbnRleHQub3B0aW9uc1swXSB8fCB7fTtcbiAgICBjb25zdCBhbGxvd2VkID0gb3B0aW9ucy5hbGxvdyB8fCBbXTtcblxuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKChzb3VyY2UsIG5vZGUpID0+IHtcbiAgICAgIHJlcG9ydElmTWlzc2luZyhjb250ZXh0LCBub2RlLCBhbGxvd2VkLCBzb3VyY2UudmFsdWUpO1xuICAgIH0sIHsgY29tbW9uanM6IHRydWUgfSk7XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-relative-packages.js b/node_modules/eslint-plugin-import/lib/rules/no-relative-packages.js new file mode 100644 index 0000000000000000000000000000000000000000..b2e70d06c1bd4dd3343b89ab7134a2c5c43ff64b --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-relative-packages.js @@ -0,0 +1,72 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _readPkgUp = require('eslint-module-utils/readPkgUp');var _readPkgUp2 = _interopRequireDefault(_readPkgUp); + +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +/** @param {string} filePath */ +function toPosixPath(filePath) { + return filePath.replace(/\\/g, '/'); +} + +function findNamedPackage(filePath) { + var found = (0, _readPkgUp2['default'])({ cwd: filePath }); + if (found.pkg && !found.pkg.name) { + return findNamedPackage(_path2['default'].join(found.path, '../..')); + } + return found; +} + +function checkImportForRelativePackage(context, importPath, node) { + var potentialViolationTypes = ['parent', 'index', 'sibling']; + if (potentialViolationTypes.indexOf((0, _importType2['default'])(importPath, context)) === -1) { + return; + } + + var resolvedImport = (0, _resolve2['default'])(importPath, context); + var resolvedContext = (0, _contextCompat.getPhysicalFilename)(context); + + if (!resolvedImport || !resolvedContext) { + return; + } + + var importPkg = findNamedPackage(resolvedImport); + var contextPkg = findNamedPackage(resolvedContext); + + if (importPkg.pkg && contextPkg.pkg && importPkg.pkg.name !== contextPkg.pkg.name) { + var importBaseName = _path2['default'].basename(importPath); + var importRoot = _path2['default'].dirname(importPkg.path); + var properPath = _path2['default'].relative(importRoot, resolvedImport); + var properImport = _path2['default'].join( + importPkg.pkg.name, + _path2['default'].dirname(properPath), + importBaseName === _path2['default'].basename(importRoot) ? '' : importBaseName); + + context.report({ + node: node, + message: 'Relative import from another package is not allowed. Use `' + String(properImport) + '` instead of `' + String(importPath) + '`', + fix: function () {function fix(fixer) {return fixer.replaceText(node, JSON.stringify(toPosixPath(properImport)));}return fix;}() }); + + + } +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Static analysis', + description: 'Forbid importing packages through relative paths.', + url: (0, _docsUrl2['default'])('no-relative-packages') }, + + fixable: 'code', + schema: [(0, _moduleVisitor.makeOptionsSchema)()] }, + + + create: function () {function create(context) { + return (0, _moduleVisitor2['default'])(function (source) {return checkImportForRelativePackage(context, source.value, source);}, context.options[0]); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1yZWxhdGl2ZS1wYWNrYWdlcy5qcyJdLCJuYW1lcyI6WyJ0b1Bvc2l4UGF0aCIsImZpbGVQYXRoIiwicmVwbGFjZSIsImZpbmROYW1lZFBhY2thZ2UiLCJmb3VuZCIsImN3ZCIsInBrZyIsIm5hbWUiLCJwYXRo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import/lib/rules/no-relative-parent-imports.js b/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js new file mode 100644 index 0000000000000000000000000000000000000000..84c04fafd3783f6f117e4c87b25f11c155816bb5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js @@ -0,0 +1,49 @@ +'use strict';var _path = require('path'); +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); + +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Static analysis', + description: 'Forbid importing modules from parent directories.', + url: (0, _docsUrl2['default'])('no-relative-parent-imports') }, + + schema: [(0, _moduleVisitor.makeOptionsSchema)()] }, + + + create: function () {function noRelativePackages(context) { + var myPath = (0, _contextCompat.getPhysicalFilename)(context); + if (myPath === '') {return {};} // can't check a non-file + + function checkSourceValue(sourceNode) { + var depPath = sourceNode.value; + + if ((0, _importType2['default'])(depPath, context) === 'external') {// ignore packages + return; + } + + var absDepPath = (0, _resolve2['default'])(depPath, context); + + if (!absDepPath) {// unable to resolve path + return; + } + + var relDepPath = (0, _path.relative)((0, _path.dirname)(myPath), absDepPath); + + if ((0, _importType2['default'])(relDepPath, context) === 'parent') { + context.report({ + node: sourceNode, + message: 'Relative imports from parent directories are not allowed. Please either pass what you\'re importing through at runtime (dependency injection), move `' + String((0, _path.basename)(myPath)) + '` to same directory as `' + String(depPath) + '` or consider making `' + String(depPath) + '` a package.' }); + + } + } + + return (0, _moduleVisitor2['default'])(checkSourceValue, context.options[0]); + }return noRelativePackages;}() }; +//# sourceMappingURL=data:application/json;charset=utf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lIHRvIHJlc29sdmUgcGF0aFxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IHJlbERlcFBhdGggPSByZWxhdGl2ZShkaXJuYW1lKG15UGF0aCksIGFic0RlcFBhdGgpO1xuXG4gICAgICBpZiAoaW1wb3J0VHlwZShyZWxEZXBQYXRoLCBjb250ZXh0KSA9PT0gJ3BhcmVudCcpIHtcbiAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgIG5vZGU6IHNvdXJjZU5vZGUsXG4gICAgICAgICAgbWVzc2FnZTogYFJlbGF0aXZlIGltcG9ydHMgZnJvbSBwYXJlbnQgZGlyZWN0b3JpZXMgYXJlIG5vdCBhbGxvd2VkLiBQbGVhc2UgZWl0aGVyIHBhc3Mgd2hhdCB5b3UncmUgaW1wb3J0aW5nIHRocm91Z2ggYXQgcnVudGltZSAoZGVwZW5kZW5jeSBpbmplY3Rpb24pLCBtb3ZlIFxcYCR7YmFzZW5hbWUobXlQYXRoKX1cXGAgdG8gc2FtZSBkaXJlY3RvcnkgYXMgXFxgJHtkZXBQYXRofVxcYCBvciBjb25zaWRlciBtYWtpbmcgXFxgJHtkZXBQYXRofVxcYCBhIHBhY2thZ2UuYCxcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIG1vZHVsZVZpc2l0b3IoY2hlY2tTb3VyY2VWYWx1ZSwgY29udGV4dC5vcHRpb25zWzBdKTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js b/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js new file mode 100644 index 0000000000000000000000000000000000000000..890cb05ad06afc4fe76e77a7bd21fb7af64be9a5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js @@ -0,0 +1,246 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _isGlob = require('is-glob');var _isGlob2 = _interopRequireDefault(_isGlob); +var _minimatch = require('minimatch'); + +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var containsPath = function containsPath(filepath, target) { + var relative = _path2['default'].relative(target, filepath); + return relative === '' || !relative.startsWith('..'); +}; + +function isMatchingTargetPath(filename, targetPath) { + if ((0, _isGlob2['default'])(targetPath)) { + var mm = new _minimatch.Minimatch(targetPath); + return mm.match(filename); + } + + return containsPath(filename, targetPath); +} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Static analysis', + description: 'Enforce which files can be imported in a given folder.', + url: (0, _docsUrl2['default'])('no-restricted-paths') }, + + + schema: [ + { + type: 'object', + properties: { + zones: { + type: 'array', + minItems: 1, + items: { + type: 'object', + properties: { + target: { + anyOf: [ + { type: 'string' }, + { + type: 'array', + items: { type: 'string' }, + uniqueItems: true, + minLength: 1 }] }, + + + + from: { + anyOf: [ + { type: 'string' }, + { + type: 'array', + items: { type: 'string' }, + uniqueItems: true, + minLength: 1 }] }, + + + + except: { + type: 'array', + items: { + type: 'string' }, + + uniqueItems: true }, + + message: { type: 'string' } }, + + additionalProperties: false } }, + + + basePath: { type: 'string' } }, + + additionalProperties: false }] }, + + + + + create: function () {function noRestrictedPaths(context) { + var options = context.options[0] || {}; + var restrictedPaths = options.zones || []; + var basePath = options.basePath || process.cwd(); + var currentFilename = (0, _contextCompat.getPhysicalFilename)(context); + var matchingZones = restrictedPaths.filter( + function (zone) {return [].concat(zone.target). + map(function (target) {return _path2['default'].resolve(basePath, target);}). + some(function (targetPath) {return isMatchingTargetPath(currentFilename, targetPath);});}); + + + function isValidExceptionPath(absoluteFromPath, absoluteExceptionPath) { + var relativeExceptionPath = _path2['default'].relative(absoluteFromPath, absoluteExceptionPath); + + return (0, _importType2['default'])(relativeExceptionPath, context) !== 'parent'; + } + + function areBothGlobPatternAndAbsolutePath(areGlobPatterns) { + return areGlobPatterns.some(function (isGlob) {return isGlob;}) && areGlobPatterns.some(function (isGlob) {return !isGlob;}); + } + + function reportInvalidExceptionPath(node) { + context.report({ + node: node, + message: 'Restricted path exceptions must be descendants of the configured `from` path for that zone.' }); + + } + + function reportInvalidExceptionMixedGlobAndNonGlob(node) { + context.report({ + node: node, + message: 'Restricted path `from` must contain either only glob patterns or none' }); + + } + + function reportInvalidExceptionGlob(node) { + context.report({ + node: node, + message: 'Restricted path exceptions must be glob patterns when `from` contains glob patterns' }); + + } + + function computeMixedGlobAndAbsolutePathValidator() { + return { + isPathRestricted: function () {function isPathRestricted() {return true;}return isPathRestricted;}(), + hasValidExceptions: false, + reportInvalidException: reportInvalidExceptionMixedGlobAndNonGlob }; + + } + + function computeGlobPatternPathValidator(absoluteFrom, zoneExcept) { + var isPathException = void 0; + + var mm = new _minimatch.Minimatch(absoluteFrom); + var isPathRestricted = function () {function isPathRestricted(absoluteImportPath) {return mm.match(absoluteImportPath);}return isPathRestricted;}(); + var hasValidExceptions = zoneExcept.every(_isGlob2['default']); + + if (hasValidExceptions) { + var exceptionsMm = zoneExcept.map(function (except) {return new _minimatch.Minimatch(except);}); + isPathException = function () {function isPathException(absoluteImportPath) {return exceptionsMm.some(function (mm) {return mm.match(absoluteImportPath);});}return isPathException;}(); + } + + var reportInvalidException = reportInvalidExceptionGlob; + + return { + isPathRestricted: isPathRestricted, + hasValidExceptions: hasValidExceptions, + isPathException: isPathException, + reportInvalidException: reportInvalidException }; + + } + + function computeAbsolutePathValidator(absoluteFrom, zoneExcept) { + var isPathException = void 0; + + var isPathRestricted = function () {function isPathRestricted(absoluteImportPath) {return containsPath(absoluteImportPath, absoluteFrom);}return isPathRestricted;}(); + + var absoluteExceptionPaths = zoneExcept. + map(function (exceptionPath) {return _path2['default'].resolve(absoluteFrom, exceptionPath);}); + var hasValidExceptions = absoluteExceptionPaths. + every(function (absoluteExceptionPath) {return isValidExceptionPath(absoluteFrom, absoluteExceptionPath);}); + + if (hasValidExceptions) { + isPathException = function () {function isPathException(absoluteImportPath) {return absoluteExceptionPaths.some( + function (absoluteExceptionPath) {return containsPath(absoluteImportPath, absoluteExceptionPath);});}return isPathException;}(); + + } + + var reportInvalidException = reportInvalidExceptionPath; + + return { + isPathRestricted: isPathRestricted, + hasValidExceptions: hasValidExceptions, + isPathException: isPathException, + reportInvalidException: reportInvalidException }; + + } + + function reportInvalidExceptions(validators, node) { + validators.forEach(function (validator) {return validator.reportInvalidException(node);}); + } + + function reportImportsInRestrictedZone(validators, node, importPath, customMessage) { + validators.forEach(function () { + context.report({ + node: node, + message: 'Unexpected path "{{importPath}}" imported in restricted zone.' + (customMessage ? ' ' + String(customMessage) : ''), + data: { importPath: importPath } }); + + }); + } + + var makePathValidators = function () {function makePathValidators(zoneFrom) {var zoneExcept = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var allZoneFrom = [].concat(zoneFrom); + var areGlobPatterns = allZoneFrom.map(_isGlob2['default']); + + if (areBothGlobPatternAndAbsolutePath(areGlobPatterns)) { + return [computeMixedGlobAndAbsolutePathValidator()]; + } + + var isGlobPattern = areGlobPatterns.every(function (isGlob) {return isGlob;}); + + return allZoneFrom.map(function (singleZoneFrom) { + var absoluteFrom = _path2['default'].resolve(basePath, singleZoneFrom); + + if (isGlobPattern) { + return computeGlobPatternPathValidator(absoluteFrom, zoneExcept); + } + return computeAbsolutePathValidator(absoluteFrom, zoneExcept); + }); + }return makePathValidators;}(); + + var validators = []; + + function checkForRestrictedImportPath(importPath, node) { + var absoluteImportPath = (0, _resolve2['default'])(importPath, context); + + if (!absoluteImportPath) { + return; + } + + matchingZones.forEach(function (zone, index) { + if (!validators[index]) { + validators[index] = makePathValidators(zone.from, zone.except); + } + + var applicableValidatorsForImportPath = validators[index].filter(function (validator) {return validator.isPathRestricted(absoluteImportPath);}); + + var validatorsWithInvalidExceptions = applicableValidatorsForImportPath.filter(function (validator) {return !validator.hasValidExceptions;}); + reportInvalidExceptions(validatorsWithInvalidExceptions, node); + + var applicableValidatorsForImportPathExcludingExceptions = applicableValidatorsForImportPath. + filter(function (validator) {return validator.hasValidExceptions && !validator.isPathException(absoluteImportPath);}); + reportImportsInRestrictedZone(applicableValidatorsForImportPathExcludingExceptions, node, importPath, zone.message); + }); + } + + return (0, _moduleVisitor2['default'])(function (source) { + checkForRestrictedImportPath(source.value, source); + }, { commonjs: true }); + }return noRestrictedPaths;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1yZXN0cmljdGVkLXBhdGhzLmpzIl0sIm5hbWVzIjpbImNvbnRhaW5zUGF0aCIsImZpbGVwYXRoIiwidGFyZ2V0IiwicmVsYXRpdmUiLCJwYXRoIiwic3RhcnRzV2l0aCIsImlzTWF0Y2hpbmdUYXJnZXRQYXRoIiwiZmlsZW5hbWUiLCJ0YXJnZXRQYXRoIiwibW0iLCJNaW5pbWF0Y2giLCJtYXRjaCIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwic2NoZW1hIiwicHJvcGVydGllcyIsInpvbmVzIiwibWluSXRlbXMiLCJpdGVtcyIsImFueU9mIiwidW5pcXVlSXRlbXMiLCJtaW5MZW5ndGgiLCJmcm9tIiwiZXhjZXB0IiwibWVzc2FnZSIsImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiwiYmFzZVBhdGgiLCJjcmVhdGUiLCJub1Jlc3RyaWN0ZWRQYXRocyIsImNvbnRleHQiLCJvcHRpb25zIiwicmVzdHJpY3RlZ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lwZTogJ29iamVjdCcsXG4gICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICB6b25lczoge1xuICAgICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICAgIG1pbkl0ZW1zOiAxLFxuICAgICAgICAgICAgaXRlbXM6IHtcbiAgICAgICAgICAgICAgdHlwZTogJ29iamVjdCcsXG4gICAgICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IHtcbiAgICAgICAgICAgICAgICAgIGFueU9mOiBbXG4gICAgICAgICAgICAgICAgICAgIHsgdHlwZTogJ3N0cmluZycgfSxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgICAgICAgICAgICAgaXRlbXM6IHsgdHlwZTogJ3N0cmluZycgfSxcbiAgICAgICAgICAgICAgICAgICAgICB1bmlxdWVJdGVtczogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICBtaW5MZW5ndGg6IDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgZnJvbToge1xuICAgICAgICAgICAgICAgICAgYW55T2Y6IFtcbiAgICAgICAgICAgICAgICAgICAgeyB0eXBlOiAnc3RyaW5nJyB9LFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICAgICAgICAgICAgICBpdGVtczogeyB0eXBlOiAnc3RyaW5nJyB9LFxuICAgICAgICAgICAgICAgICAgICAgIHVuaXF1ZUl0ZW1zOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgIG1pbkxlbmd0aDogMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBleGNlcHQ6IHtcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB1bmlxdWVJdGVtczogdHJ1ZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6IHsgdHlwZTogJ3N0cmluZycgfSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgYWRkaXRpb25hbFByb3BlcnRpZXM6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGJhc2VQYXRoOiB7IHR5cGU6ICdzdHJpbmcnIH0sXG4gICAgICAgIH0sXG4gICAgICAgIGFkZGl0aW9uYWxQcm9wZXJ0aWVzOiBmYWxzZSxcbiAgICAgIH0sXG4gICAgXSxcbiAgfSxcblxuICBjcmVhdGU6IGZ1bmN0aW9uIG5vUmVzdHJpY3RlZFBhdGhzKGNvbnRleHQpIHtcbiAgICBjb25zdCBvcHRpb25zID0gY29udGV4dC5vcHRpb25zWzBdIHx8IHt9O1xuICAgIGNvbnN0IHJlc3RyaWN0ZWRQYXRocyA9IG9wdGlvbnMuem9uZXMgfHwgW107XG4gICAgY29uc3QgYmFzZVBhdGggPSBvcHRpb25zLmJhc2VQYXRoIHx8IHByb2Nlc3MuY3dkKCk7XG4gICAgY29uc3QgY3VycmVudEZpbGVuYW1lID0gZ2V0UGh5c2ljYWxGaWxlbmFtZShjb250ZXh0KTtcbiAgICBjb25zdCBtYXRjaGluZ1pvbmVzID0gcmVzdHJpY3RlZFBhdGhzLmZpbHRlcihcbiAgICAgICh6b25lKSA9PiBbXS5jb25jYXQoem9uZS50YXJnZXQpXG4gICAgICAgIC5tYXAoKHRhcmdldCkgPT4gcGF0aC5yZXNvbHZlKGJhc2V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gICAgICBjb25zdCB2YWxpZGF0b3JzV2l0aEludmFsaWRFeGNlcHRpb25zID0gYXBwbGljYWJsZVZhbGlkYXRvcnNGb3JJbXBvcnRQYXRoLmZpbHRlcigodmFsaWRhdG9yKSA9PiAhdmFsaWRhdG9yLmhhc1ZhbGlkRXhjZXB0aW9ucyk7XG4gICAgICAgIHJlcG9ydEludmFsaWRFeGNlcHRpb25zKHZhbGlkYXRvcnNXaXRoSW52YWxpZEV4Y2VwdGlvbnMsIG5vZGUpO1xuXG4gICAgICAgIGNvbnN0IGFwcGxpY2FibGVWYWxpZGF0b3JzRm9ySW1wb3J0UGF0aEV4Y2x1ZGluZ0V4Y2VwdGlvbnMgPSBhcHBsaWNhYmxlVmFsaWRhdG9yc0ZvckltcG9ydFBhdGhcbiAgICAgICAgICAuZmlsdGVyKCh2YWxpZGF0b3IpID0+IHZhbGlkYXRvci5oYXNWYWxpZEV4Y2VwdGlvbnMgJiYgIXZhbGlkYXRvci5pc1BhdGhFeGNlcHRpb24oYWJzb2x1dGVJbXBvcnRQYXRoKSk7XG4gICAgICAgIHJlcG9ydEltcG9ydHNJblJlc3RyaWN0ZWRab25lKGFwcGxpY2FibGVWYWxpZGF0b3JzRm9ySW1wb3J0UGF0aEV4Y2x1ZGluZ0V4Y2VwdGlvbnMsIG5vZGUsIGltcG9ydFBhdGgsIHpvbmUubWVzc2FnZSk7XG4gICAgICB9KTtcbiAgICB9XG5cbiAgICByZXR1cm4gbW9kdWxlVmlzaXRvcigoc291cmNlKSA9PiB7XG4gICAgICBjaGVja0ZvclJlc3RyaWN0ZWRJbXBvcnRQYXRoKHNvdXJjZS52YWx1ZSwgc291cmNlKTtcbiAgICB9LCB7IGNvbW1vbmpzOiB0cnVlIH0pO1xuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-self-import.js b/node_modules/eslint-plugin-import/lib/rules/no-self-import.js new file mode 100644 index 0000000000000000000000000000000000000000..6a4e0dd3ca43c1cd8e06e7d07e09a660531cc57b --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-self-import.js @@ -0,0 +1,41 @@ +'use strict'; + + + + +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /** + * @fileOverview Forbids a module from importing itself + * @author Gio d'Amelio + */function isImportingSelf(context, node, requireName) {var filePath = (0, _contextCompat.getPhysicalFilename)(context); + + // If the input is from stdin, this test can't fail + if (filePath !== '' && filePath === (0, _resolve2['default'])(requireName, context)) { + context.report({ + node: node, + message: 'Module imports itself.' }); + + } +} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Static analysis', + description: 'Forbid a module from importing itself.', + recommended: true, + url: (0, _docsUrl2['default'])('no-self-import') }, + + + schema: [] }, + + create: function () {function create(context) { + return (0, _moduleVisitor2['default'])(function (source, node) { + isImportingSelf(context, node, source.value); + }, { commonjs: true }); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1zZWxmLWltcG9ydC5qcyJdLCJuYW1lcyI6WyJpc0ltcG9ydGluZ1NlbGYiLCJjb250ZXh0Iiwibm9kZSIsInJlcXVpcmVOYW1lIiwiZmlsZVBhdGgiLCJyZXBvcnQiLCJtZXNzYWdlIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJyZWNvbW1lbmRlZCIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsInNvdXJjZSIsInZhbHVl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by1zZWxmLWltcG9ydCcpLFxuICAgIH0sXG5cbiAgICBzY2hlbWE6IFtdLFxuICB9LFxuICBjcmVhdGUoY29udGV4dCkge1xuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKChzb3VyY2UsIG5vZGUpID0+IHtcbiAgICAgIGlzSW1wb3J0aW5nU2VsZihjb250ZXh0LCBub2RlLCBzb3VyY2UudmFsdWUpO1xuICAgIH0sIHsgY29tbW9uanM6IHRydWUgfSk7XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js b/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js new file mode 100644 index 0000000000000000000000000000000000000000..121d5110923ca474a7eed915051146ff92f8879b --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js @@ -0,0 +1,80 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _contextCompat = require('eslint-module-utils/contextCompat'); + +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function report(context, node) { + context.report({ + node: node, + message: 'Imported module should be assigned' }); + +} + +function testIsAllow(globs, filename, source) { + if (!Array.isArray(globs)) { + return false; // default doesn't allow any patterns + } + + var filePath = void 0; + + if (source[0] !== '.' && source[0] !== '/') {// a node module + filePath = source; + } else { + filePath = _path2['default'].resolve(_path2['default'].dirname(filename), source); // get source absolute path + } + + return globs.find(function (glob) {return (0, _minimatch2['default'])(filePath, glob) || + (0, _minimatch2['default'])(filePath, _path2['default'].join(process.cwd(), glob));}) !== + undefined; +} + +function create(context) { + var options = context.options[0] || {}; + var filename = (0, _contextCompat.getPhysicalFilename)(context); + var isAllow = function isAllow(source) {return testIsAllow(options.allow, filename, source);}; + + return { + ImportDeclaration: function () {function ImportDeclaration(node) { + if (node.specifiers.length === 0 && !isAllow(node.source.value)) { + report(context, node); + } + }return ImportDeclaration;}(), + ExpressionStatement: function () {function ExpressionStatement(node) { + if ( + node.expression.type === 'CallExpression' && + (0, _staticRequire2['default'])(node.expression) && + !isAllow(node.expression.arguments[0].value)) + { + report(context, node.expression); + } + }return ExpressionStatement;}() }; + +} + +module.exports = { + create: create, + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Forbid unassigned imports', + url: (0, _docsUrl2['default'])('no-unassigned-import') }, + + schema: [ + { + type: 'object', + properties: { + devDependencies: { type: ['boolean', 'array'] }, + optionalDependencies: { type: ['boolean', 'array'] }, + peerDependencies: { type: ['boolean', 'array'] }, + allow: { + type: 'array', + items: { + type: 'string' } } }, + + + + additionalProperties: false }] } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby11bmFzc2lnbmVkLWltcG9ydC5qcyJdLCJuYW1lcyI6WyJyZXBvcnQiLCJjb250ZXh0Iiwibm9kZSIsIm1lc3NhZ2UiLCJ0ZXN0SXNBbGxvdyIsImdsb2JzIiwiZmlsZW5hbWUiLCJzb3VyY2UiLCJBcnJheSIsImlzQXJyYXkiLCJmaWxlUGF0aCIsInBhdGgiLCJyZXNvbHZlIiwiZGlybmFtZSIsImZpbmQiLCJnbG9iIiwiam9pbiIsInByb2Nlc3MiLCJjd2QiLCJ1bmRlZmluZWQiLCJjcmVhdGUiLCJvcHRpb25zIiwiaXNBbGxvdyIsImFsbG93IiwiSW1wb3J0RGVjbGFyYXRpb24iLCJzcGVjaWZpZXJzIiwibGVuZ3RoIiwidmFsdWUiLCJFeHByZXNzaW9uU3RhdGVtZW50IiwiZXhwcmVzc2lvbiIsInR5cGUiLCJhcmd1bWVudHMiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsImRv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nJheSddIH0sXG4gICAgICAgICAgYWxsb3c6IHtcbiAgICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgYWRkaXRpb25hbFByb3BlcnRpZXM6IGZhbHNlLFxuICAgICAgfSxcbiAgICBdLFxuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js b/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js new file mode 100644 index 0000000000000000000000000000000000000000..b77bd08f619ba63b2d0a690512bfcb40733057a7 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js @@ -0,0 +1,60 @@ +'use strict'; + + + + +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _ModuleCache = require('eslint-module-utils/ModuleCache');var _ModuleCache2 = _interopRequireDefault(_ModuleCache); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /** + * @fileOverview Ensures that an imported path exists, given resolution rules. + * @author Ben Mosher + */module.exports = { meta: { + type: 'problem', + docs: { + category: 'Static analysis', + description: 'Ensure imports point to a file/module that can be resolved.', + url: (0, _docsUrl2['default'])('no-unresolved') }, + + + schema: [ + (0, _moduleVisitor.makeOptionsSchema)({ + caseSensitive: { type: 'boolean', 'default': true }, + caseSensitiveStrict: { type: 'boolean', 'default': false } })] }, + + + + + create: function () {function create(context) { + var options = context.options[0] || {}; + + function checkSourceValue(source, node) { + // ignore type-only imports and exports + if (node.importKind === 'type' || node.exportKind === 'type') { + return; + } + + var caseSensitive = !_resolve.CASE_SENSITIVE_FS && options.caseSensitive !== false; + var caseSensitiveStrict = !_resolve.CASE_SENSITIVE_FS && options.caseSensitiveStrict; + + var resolvedPath = (0, _resolve2['default'])(source.value, context); + + if (resolvedPath === undefined) { + context.report( + source, 'Unable to resolve path to module \'' + String( + source.value) + '\'.'); + + } else if (caseSensitive || caseSensitiveStrict) { + var cacheSettings = _ModuleCache2['default'].getSettings(context.settings); + if (!(0, _resolve.fileExistsWithCaseSync)(resolvedPath, cacheSettings, caseSensitiveStrict)) { + context.report( + source, 'Casing of ' + String( + source.value) + ' does not match the underlying filesystem.'); + + } + } + } + + return (0, _moduleVisitor2['default'])(checkSourceValue, options); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby11bnJlc29sdmVkLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwic2NoZW1hIiwiY2FzZVNlbnNpdGl2ZSIsImNhc2VTZW5zaXRpdmVTdHJpY3QiLCJjcmVhdGUiLCJjb250ZXh0Iiwib3B0aW9ucyIsImNoZWNrU291cmNlVmFsdWUiLCJzb3VyY2UiLCJub2RlIiwiaW1wb3J0S2luZCIsImV4cG9ydEtpbmQiLCJDQVNFX1NFTlNJVElWRV9GUyIsInJlc29sdmVkUGF0aCIsInZhbHVlIiwidW5kZWZpbmVkIiwicmVwb3J0IiwiY2FjaGVTZXR0aW5ncyIsIk1vZHVsZUNhY2hlIiwiZ2V0U2V0dGluZ3MiLCJzZXR0aW5ncyJdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFLQSxzRDtBQUNBLDhEO0FBQ0Esa0U7QUFDQSxxQyxpSkFSQTs7O3lMQVVBQSxPQUFPQyxPQUFQLEdBQWlCLEVBQ2ZDLE1BQU07QUFD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BpZiAocmVzb2x2ZWRQYXRoID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgY29udGV4dC5yZXBvcnQoXG4gICAgICAgICAgc291cmNlLFxuICAgICAgICAgIGBVbmFibGUgdG8gcmVzb2x2ZSBwYXRoIHRvIG1vZHVsZSAnJHtzb3VyY2UudmFsdWV9Jy5gLFxuICAgICAgICApO1xuICAgICAgfSBlbHNlIGlmIChjYXNlU2Vuc2l0aXZlIHx8IGNhc2VTZW5zaXRpdmVTdHJpY3QpIHtcbiAgICAgICAgY29uc3QgY2FjaGVTZXR0aW5ncyA9IE1vZHVsZUNhY2hlLmdldFNldHRpbmdzKGNvbnRleHQuc2V0dGluZ3MpO1xuICAgICAgICBpZiAoIWZpbGVFeGlzdHNXaXRoQ2FzZVN5bmMocmVzb2x2ZWRQYXRoLCBjYWNoZVNldHRpbmdzLCBjYXNlU2Vuc2l0aXZlU3RyaWN0KSkge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KFxuICAgICAgICAgICAgc291cmNlLFxuICAgICAgICAgICAgYENhc2luZyBvZiAke3NvdXJjZS52YWx1ZX0gZG9lcyBub3QgbWF0Y2ggdGhlIHVuZGVybHlpbmcgZmlsZXN5c3RlbS5gLFxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbW9kdWxlVmlzaXRvcihjaGVja1NvdXJjZVZhbHVlLCBvcHRpb25zKTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js b/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js new file mode 100644 index 0000000000000000000000000000000000000000..04e0d6f12bec53c8e1c96f5367a42e5059eb7b5e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js @@ -0,0 +1,1072 @@ +'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;}; + + + + + +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _ignore = require('eslint-module-utils/ignore'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _visit = require('eslint-module-utils/visit');var _visit2 = _interopRequireDefault(_visit); +var _path = require('path'); +var _readPkgUp2 = require('eslint-module-utils/readPkgUp');var _readPkgUp3 = _interopRequireDefault(_readPkgUp2); +var _object = require('object.values');var _object2 = _interopRequireDefault(_object); +var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes); +var _arrayPrototype = require('array.prototype.flatmap');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype); + +var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _patternCapture = require('../exportMap/patternCapture');var _patternCapture2 = _interopRequireDefault(_patternCapture); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {arr2[i] = arr[i];}return arr2;} else {return Array.from(arr);}} /** + * @fileOverview Ensures that modules contain exports and/or all + * modules are consumed within other modules. + * @author René Fermann + */ /** + * Attempt to load the internal `FileEnumerator` class, which has existed in a couple + * of different places, depending on the version of `eslint`. Try requiring it from both + * locations. + * @returns Returns the `FileEnumerator` class if its requirable, otherwise `undefined`. + */function requireFileEnumerator() {var FileEnumerator = void 0; + + // Try getting it from the eslint private / deprecated api + try {var _require = + require('eslint/use-at-your-own-risk');FileEnumerator = _require.FileEnumerator; + } catch (e) { + // Absorb this if it's MODULE_NOT_FOUND + if (e.code !== 'MODULE_NOT_FOUND') { + throw e; + } + + // If not there, then try getting it from eslint/lib/cli-engine/file-enumerator (moved there in v6) + try {var _require2 = + require('eslint/lib/cli-engine/file-enumerator');FileEnumerator = _require2.FileEnumerator; + } catch (e) { + // Absorb this if it's MODULE_NOT_FOUND + if (e.code !== 'MODULE_NOT_FOUND') { + throw e; + } + } + } + return FileEnumerator; +} + +/** + * Given a FileEnumerator class, instantiate and load the list of files. + * @param FileEnumerator the `FileEnumerator` class from `eslint`'s internal api + * @param {string} src path to the src root + * @param {string[]} extensions list of supported extensions + * @returns {{ filename: string, ignored: boolean }[]} list of files to operate on + */ +function listFilesUsingFileEnumerator(FileEnumerator, src, extensions) { + // We need to know whether this is being run with flat config in order to + // determine how to report errors if FileEnumerator throws due to a lack of eslintrc. + var + ESLINT_USE_FLAT_CONFIG = process.env.ESLINT_USE_FLAT_CONFIG; + + // This condition is sufficient to test in v8, since the environment variable is necessary to turn on flat config + var isUsingFlatConfig = ESLINT_USE_FLAT_CONFIG && process.env.ESLINT_USE_FLAT_CONFIG !== 'false'; + + // In the case of using v9, we can check the `shouldUseFlatConfig` function + // If this function is present, then we assume it's v9 + try {var _require3 = + require('eslint/use-at-your-own-risk'),shouldUseFlatConfig = _require3.shouldUseFlatConfig; + isUsingFlatConfig = shouldUseFlatConfig && ESLINT_USE_FLAT_CONFIG !== 'false'; + } catch (_) { + // We don't want to throw here, since we only want to update the + // boolean if the function is available. + } + + var enumerator = new FileEnumerator({ + extensions: extensions }); + + + try { + return Array.from( + enumerator.iterateFiles(src), + function (_ref) {var filePath = _ref.filePath,ignored = _ref.ignored;return { filename: filePath, ignored: ignored };}); + + } catch (e) { + // If we're using flat config, and FileEnumerator throws due to a lack of eslintrc, + // then we want to throw an error so that the user knows about this rule's reliance on + // the legacy config. + if ( + isUsingFlatConfig && + e.message.includes('No ESLint configuration found')) + { + throw new Error('\nDue to the exclusion of certain internal ESLint APIs when using flat config,\nthe import/no-unused-modules rule requires an .eslintrc file to know which\nfiles to ignore (even when using flat config).\nThe .eslintrc file only needs to contain "ignorePatterns", or can be empty if\nyou do not want to ignore any files.\n\nSee https://github.com/import-js/eslint-plugin-import/issues/3079\nfor additional context.\n'); + + + + + + + + + + } + // If this isn't the case, then we'll just let the error bubble up + throw e; + } +} + +/** + * Attempt to require old versions of the file enumeration capability from v6 `eslint` and earlier, and use + * those functions to provide the list of files to operate on + * @param {string} src path to the src root + * @param {string[]} extensions list of supported extensions + * @returns {string[]} list of files to operate on + */ +function listFilesWithLegacyFunctions(src, extensions) { + try { + // eslint/lib/util/glob-util has been moved to eslint/lib/util/glob-utils with version 5.3 + var _require4 = require('eslint/lib/util/glob-utils'),originalListFilesToProcess = _require4.listFilesToProcess; + // Prevent passing invalid options (extensions array) to old versions of the function. + // https://github.com/eslint/eslint/blob/v5.16.0/lib/util/glob-utils.js#L178-L280 + // https://github.com/eslint/eslint/blob/v5.2.0/lib/util/glob-util.js#L174-L269 + + return originalListFilesToProcess(src, { + extensions: extensions }); + + } catch (e) { + // Absorb this if it's MODULE_NOT_FOUND + if (e.code !== 'MODULE_NOT_FOUND') { + throw e; + } + + // Last place to try (pre v5.3) + var _require5 = + + require('eslint/lib/util/glob-util'),_originalListFilesToProcess = _require5.listFilesToProcess; + var patterns = src.concat( + (0, _arrayPrototype2['default'])( + src, + function (pattern) {return extensions.map(function (extension) {return (/\*\*|\*\./.test(pattern) ? pattern : String(pattern) + '/**/*' + String(extension));});})); + + + + return _originalListFilesToProcess(patterns); + } +} + +/** + * Given a src pattern and list of supported extensions, return a list of files to process + * with this rule. + * @param {string} src - file, directory, or glob pattern of files to act on + * @param {string[]} extensions - list of supported file extensions + * @returns {string[] | { filename: string, ignored: boolean }[]} the list of files that this rule will evaluate. + */ +function listFilesToProcess(src, extensions) { + var FileEnumerator = requireFileEnumerator(); + + // If we got the FileEnumerator, then let's go with that + if (FileEnumerator) { + return listFilesUsingFileEnumerator(FileEnumerator, src, extensions); + } + // If not, then we can try even older versions of this capability (listFilesToProcess) + return listFilesWithLegacyFunctions(src, extensions); +} + +var EXPORT_DEFAULT_DECLARATION = 'ExportDefaultDeclaration'; +var EXPORT_NAMED_DECLARATION = 'ExportNamedDeclaration'; +var EXPORT_ALL_DECLARATION = 'ExportAllDeclaration'; +var IMPORT_DECLARATION = 'ImportDeclaration'; +var IMPORT_NAMESPACE_SPECIFIER = 'ImportNamespaceSpecifier'; +var IMPORT_DEFAULT_SPECIFIER = 'ImportDefaultSpecifier'; +var VARIABLE_DECLARATION = 'VariableDeclaration'; +var FUNCTION_DECLARATION = 'FunctionDeclaration'; +var CLASS_DECLARATION = 'ClassDeclaration'; +var IDENTIFIER = 'Identifier'; +var OBJECT_PATTERN = 'ObjectPattern'; +var ARRAY_PATTERN = 'ArrayPattern'; +var TS_INTERFACE_DECLARATION = 'TSInterfaceDeclaration'; +var TS_TYPE_ALIAS_DECLARATION = 'TSTypeAliasDeclaration'; +var TS_ENUM_DECLARATION = 'TSEnumDeclaration'; +var DEFAULT = 'default'; + +function forEachDeclarationIdentifier(declaration, cb) { + if (declaration) { + var isTypeDeclaration = declaration.type === TS_INTERFACE_DECLARATION || + declaration.type === TS_TYPE_ALIAS_DECLARATION || + declaration.type === TS_ENUM_DECLARATION; + + if ( + declaration.type === FUNCTION_DECLARATION || + declaration.type === CLASS_DECLARATION || + isTypeDeclaration) + { + cb(declaration.id.name, isTypeDeclaration); + } else if (declaration.type === VARIABLE_DECLARATION) { + declaration.declarations.forEach(function (_ref2) {var id = _ref2.id; + if (id.type === OBJECT_PATTERN) { + (0, _patternCapture2['default'])(id, function (pattern) { + if (pattern.type === IDENTIFIER) { + cb(pattern.name, false); + } + }); + } else if (id.type === ARRAY_PATTERN) { + id.elements.forEach(function (_ref3) {var name = _ref3.name; + cb(name, false); + }); + } else { + cb(id.name, false); + } + }); + } + } +} + +/** + * List of imports per file. + * + * Represented by a two-level Map to a Set of identifiers. The upper-level Map + * keys are the paths to the modules containing the imports, while the + * lower-level Map keys are the paths to the files which are being imported + * from. Lastly, the Set of identifiers contains either names being imported + * or a special AST node name listed above (e.g ImportDefaultSpecifier). + * + * For example, if we have a file named foo.js containing: + * + * import { o2 } from './bar.js'; + * + * Then we will have a structure that looks like: + * + * Map { 'foo.js' => Map { 'bar.js' => Set { 'o2' } } } + * + * @type {Map>>} + */ +var importList = new Map(); + +/** + * List of exports per file. + * + * Represented by a two-level Map to an object of metadata. The upper-level Map + * keys are the paths to the modules containing the exports, while the + * lower-level Map keys are the specific identifiers or special AST node names + * being exported. The leaf-level metadata object at the moment only contains a + * `whereUsed` property, which contains a Set of paths to modules that import + * the name. + * + * For example, if we have a file named bar.js containing the following exports: + * + * const o2 = 'bar'; + * export { o2 }; + * + * And a file named foo.js containing the following import: + * + * import { o2 } from './bar.js'; + * + * Then we will have a structure that looks like: + * + * Map { 'bar.js' => Map { 'o2' => { whereUsed: Set { 'foo.js' } } } } + * + * @type {Map>} + */ +var exportList = new Map(); + +var visitorKeyMap = new Map(); + +/** @type {Set} */ +var ignoredFiles = new Set(); +var filesOutsideSrc = new Set(); + +var isNodeModule = function isNodeModule(path) {return (/\/(node_modules)\//.test(path));}; + +/** + * read all files matching the patterns in src and ignoreExports + * + * return all files matching src pattern, which are not matching the ignoreExports pattern + * @type {(src: string, ignoreExports: string, context: import('eslint').Rule.RuleContext) => Set} + */ +function resolveFiles(src, ignoreExports, context) { + var extensions = Array.from((0, _ignore.getFileExtensions)(context.settings)); + + var srcFileList = listFilesToProcess(src, extensions); + + // prepare list of ignored files + var ignoredFilesList = listFilesToProcess(ignoreExports, extensions); + + // The modern api will return a list of file paths, rather than an object + if (ignoredFilesList.length && typeof ignoredFilesList[0] === 'string') { + ignoredFilesList.forEach(function (filename) {return ignoredFiles.add(filename);}); + } else { + ignoredFilesList.forEach(function (_ref4) {var filename = _ref4.filename;return ignoredFiles.add(filename);}); + } + + // prepare list of source files, don't consider files from node_modules + var resolvedFiles = srcFileList.length && typeof srcFileList[0] === 'string' ? + srcFileList.filter(function (filePath) {return !isNodeModule(filePath);}) : + (0, _arrayPrototype2['default'])(srcFileList, function (_ref5) {var filename = _ref5.filename;return isNodeModule(filename) ? [] : filename;}); + + return new Set(resolvedFiles); +} + +/** + * parse all source files and build up 2 maps containing the existing imports and exports + */ +var prepareImportsAndExports = function prepareImportsAndExports(srcFiles, context) { + var exportAll = new Map(); + srcFiles.forEach(function (file) { + var exports = new Map(); + var imports = new Map(); + var currentExports = _builder2['default'].get(file, context); + if (currentExports) {var + + dependencies = + + + + + currentExports.dependencies,reexports = currentExports.reexports,localImportList = currentExports.imports,namespace = currentExports.namespace,visitorKeys = currentExports.visitorKeys; + + visitorKeyMap.set(file, visitorKeys); + // dependencies === export * from + var currentExportAll = new Set(); + dependencies.forEach(function (getDependency) { + var dependency = getDependency(); + if (dependency === null) { + return; + } + + currentExportAll.add(dependency.path); + }); + exportAll.set(file, currentExportAll); + + reexports.forEach(function (value, key) { + if (key === DEFAULT) { + exports.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: new Set() }); + } else { + exports.set(key, { whereUsed: new Set() }); + } + var reexport = value.getImport(); + if (!reexport) { + return; + } + var localImport = imports.get(reexport.path); + var currentValue = void 0; + if (value.local === DEFAULT) { + currentValue = IMPORT_DEFAULT_SPECIFIER; + } else { + currentValue = value.local; + } + if (typeof localImport !== 'undefined') { + localImport = new Set([].concat(_toConsumableArray(localImport), [currentValue])); + } else { + localImport = new Set([currentValue]); + } + imports.set(reexport.path, localImport); + }); + + localImportList.forEach(function (value, key) { + if (isNodeModule(key)) { + return; + } + var localImport = imports.get(key) || new Set(); + value.declarations.forEach(function (_ref6) {var importedSpecifiers = _ref6.importedSpecifiers; + importedSpecifiers.forEach(function (specifier) { + localImport.add(specifier); + }); + }); + imports.set(key, localImport); + }); + importList.set(file, imports); + + // build up export list only, if file is not ignored + if (ignoredFiles.has(file)) { + return; + } + namespace.forEach(function (value, key) { + if (key === DEFAULT) { + exports.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: new Set() }); + } else { + exports.set(key, { whereUsed: new Set() }); + } + }); + } + exports.set(EXPORT_ALL_DECLARATION, { whereUsed: new Set() }); + exports.set(IMPORT_NAMESPACE_SPECIFIER, { whereUsed: new Set() }); + exportList.set(file, exports); + }); + exportAll.forEach(function (value, key) { + value.forEach(function (val) { + var currentExports = exportList.get(val); + if (currentExports) { + var currentExport = currentExports.get(EXPORT_ALL_DECLARATION); + currentExport.whereUsed.add(key); + } + }); + }); +}; + +/** + * traverse through all imports and add the respective path to the whereUsed-list + * of the corresponding export + */ +var determineUsage = function determineUsage() { + importList.forEach(function (listValue, listKey) { + listValue.forEach(function (value, key) { + var exports = exportList.get(key); + if (typeof exports !== 'undefined') { + value.forEach(function (currentImport) { + var specifier = void 0; + if (currentImport === IMPORT_NAMESPACE_SPECIFIER) { + specifier = IMPORT_NAMESPACE_SPECIFIER; + } else if (currentImport === IMPORT_DEFAULT_SPECIFIER) { + specifier = IMPORT_DEFAULT_SPECIFIER; + } else { + specifier = currentImport; + } + if (typeof specifier !== 'undefined') { + var exportStatement = exports.get(specifier); + if (typeof exportStatement !== 'undefined') {var + whereUsed = exportStatement.whereUsed; + whereUsed.add(listKey); + exports.set(specifier, { whereUsed: whereUsed }); + } + } + }); + } + }); + }); +}; + +var getSrc = function getSrc(src) { + if (src) { + return src; + } + return [process.cwd()]; +}; + +/** + * prepare the lists of existing imports and exports - should only be executed once at + * the start of a new eslint run + */ +/** @type {Set} */ +var srcFiles = void 0; +var lastPrepareKey = void 0; +var doPreparation = function doPreparation(src, ignoreExports, context) { + var prepareKey = JSON.stringify({ + src: (src || []).sort(), + ignoreExports: (ignoreExports || []).sort(), + extensions: Array.from((0, _ignore.getFileExtensions)(context.settings)).sort() }); + + if (prepareKey === lastPrepareKey) { + return; + } + + importList.clear(); + exportList.clear(); + ignoredFiles.clear(); + filesOutsideSrc.clear(); + + srcFiles = resolveFiles(getSrc(src), ignoreExports, context); + prepareImportsAndExports(srcFiles, context); + determineUsage(); + lastPrepareKey = prepareKey; +}; + +var newNamespaceImportExists = function newNamespaceImportExists(specifiers) {return specifiers.some(function (_ref7) {var type = _ref7.type;return type === IMPORT_NAMESPACE_SPECIFIER;});}; + +var newDefaultImportExists = function newDefaultImportExists(specifiers) {return specifiers.some(function (_ref8) {var type = _ref8.type;return type === IMPORT_DEFAULT_SPECIFIER;});}; + +var fileIsInPkg = function fileIsInPkg(file) {var _readPkgUp = + (0, _readPkgUp3['default'])({ cwd: file }),path = _readPkgUp.path,pkg = _readPkgUp.pkg; + var basePath = (0, _path.dirname)(path); + + var checkPkgFieldString = function checkPkgFieldString(pkgField) { + if ((0, _path.join)(basePath, pkgField) === file) { + return true; + } + }; + + var checkPkgFieldObject = function checkPkgFieldObject(pkgField) { + var pkgFieldFiles = (0, _arrayPrototype2['default'])((0, _object2['default'])(pkgField), function (value) {return typeof value === 'boolean' ? [] : (0, _path.join)(basePath, value);}); + + if ((0, _arrayIncludes2['default'])(pkgFieldFiles, file)) { + return true; + } + }; + + var checkPkgField = function checkPkgField(pkgField) { + if (typeof pkgField === 'string') { + return checkPkgFieldString(pkgField); + } + + if ((typeof pkgField === 'undefined' ? 'undefined' : _typeof(pkgField)) === 'object') { + return checkPkgFieldObject(pkgField); + } + }; + + if (pkg['private'] === true) { + return false; + } + + if (pkg.bin) { + if (checkPkgField(pkg.bin)) { + return true; + } + } + + if (pkg.browser) { + if (checkPkgField(pkg.browser)) { + return true; + } + } + + if (pkg.main) { + if (checkPkgFieldString(pkg.main)) { + return true; + } + } + + return false; +}; + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Helpful warnings', + description: 'Forbid modules without exports, or exports without matching import in another module.', + url: (0, _docsUrl2['default'])('no-unused-modules') }, + + schema: [{ + properties: { + src: { + description: 'files/paths to be analyzed (only for unused exports)', + type: 'array', + uniqueItems: true, + items: { + type: 'string', + minLength: 1 } }, + + + ignoreExports: { + description: 'files/paths for which unused exports will not be reported (e.g module entry points)', + type: 'array', + uniqueItems: true, + items: { + type: 'string', + minLength: 1 } }, + + + missingExports: { + description: 'report modules without any exports', + type: 'boolean' }, + + unusedExports: { + description: 'report exports without any usage', + type: 'boolean' }, + + ignoreUnusedTypeExports: { + description: 'ignore type exports without any usage', + type: 'boolean' } }, + + + anyOf: [ + { + properties: { + unusedExports: { 'enum': [true] }, + src: { + minItems: 1 } }, + + + required: ['unusedExports'] }, + + { + properties: { + missingExports: { 'enum': [true] } }, + + required: ['missingExports'] }] }] }, + + + + + + create: function () {function create(context) {var _ref9 = + + + + + + + context.options[0] || {},src = _ref9.src,_ref9$ignoreExports = _ref9.ignoreExports,ignoreExports = _ref9$ignoreExports === undefined ? [] : _ref9$ignoreExports,missingExports = _ref9.missingExports,unusedExports = _ref9.unusedExports,ignoreUnusedTypeExports = _ref9.ignoreUnusedTypeExports; + + if (unusedExports) { + doPreparation(src, ignoreExports, context); + } + + var file = (0, _contextCompat.getPhysicalFilename)(context); + + var checkExportPresence = function () {function checkExportPresence(node) { + if (!missingExports) { + return; + } + + if (ignoredFiles.has(file)) { + return; + } + + var exportCount = exportList.get(file); + var exportAll = exportCount.get(EXPORT_ALL_DECLARATION); + var namespaceImports = exportCount.get(IMPORT_NAMESPACE_SPECIFIER); + + exportCount['delete'](EXPORT_ALL_DECLARATION); + exportCount['delete'](IMPORT_NAMESPACE_SPECIFIER); + if (exportCount.size < 1) { + // node.body[0] === 'undefined' only happens, if everything is commented out in the file + // being linted + context.report(node.body[0] ? node.body[0] : node, 'No exports found'); + } + exportCount.set(EXPORT_ALL_DECLARATION, exportAll); + exportCount.set(IMPORT_NAMESPACE_SPECIFIER, namespaceImports); + }return checkExportPresence;}(); + + var checkUsage = function () {function checkUsage(node, exportedValue, isTypeExport) { + if (!unusedExports) { + return; + } + + if (isTypeExport && ignoreUnusedTypeExports) { + return; + } + + if (ignoredFiles.has(file)) { + return; + } + + if (fileIsInPkg(file)) { + return; + } + + if (filesOutsideSrc.has(file)) { + return; + } + + // make sure file to be linted is included in source files + if (!srcFiles.has(file)) { + srcFiles = resolveFiles(getSrc(src), ignoreExports, context); + if (!srcFiles.has(file)) { + filesOutsideSrc.add(file); + return; + } + } + + exports = exportList.get(file); + + if (!exports) { + console.error('file `' + String(file) + '` has no exports. Please update to the latest, and if it still happens, report this on https://github.com/import-js/eslint-plugin-import/issues/2866!'); + } + + // special case: export * from + var exportAll = exports.get(EXPORT_ALL_DECLARATION); + if (typeof exportAll !== 'undefined' && exportedValue !== IMPORT_DEFAULT_SPECIFIER) { + if (exportAll.whereUsed.size > 0) { + return; + } + } + + // special case: namespace import + var namespaceImports = exports.get(IMPORT_NAMESPACE_SPECIFIER); + if (typeof namespaceImports !== 'undefined') { + if (namespaceImports.whereUsed.size > 0) { + return; + } + } + + // exportsList will always map any imported value of 'default' to 'ImportDefaultSpecifier' + var exportsKey = exportedValue === DEFAULT ? IMPORT_DEFAULT_SPECIFIER : exportedValue; + + var exportStatement = exports.get(exportsKey); + + var value = exportsKey === IMPORT_DEFAULT_SPECIFIER ? DEFAULT : exportsKey; + + if (typeof exportStatement !== 'undefined') { + if (exportStatement.whereUsed.size < 1) { + context.report( + node, 'exported declaration \'' + + value + '\' not used within other modules'); + + } + } else { + context.report( + node, 'exported declaration \'' + + value + '\' not used within other modules'); + + } + }return checkUsage;}(); + + /** + * only useful for tools like vscode-eslint + * + * update lists of existing exports during runtime + */ + var updateExportUsage = function () {function updateExportUsage(node) { + if (ignoredFiles.has(file)) { + return; + } + + var exports = exportList.get(file); + + // new module has been created during runtime + // include it in further processing + if (typeof exports === 'undefined') { + exports = new Map(); + } + + var newExports = new Map(); + var newExportIdentifiers = new Set(); + + node.body.forEach(function (_ref10) {var type = _ref10.type,declaration = _ref10.declaration,specifiers = _ref10.specifiers; + if (type === EXPORT_DEFAULT_DECLARATION) { + newExportIdentifiers.add(IMPORT_DEFAULT_SPECIFIER); + } + if (type === EXPORT_NAMED_DECLARATION) { + if (specifiers.length > 0) { + specifiers.forEach(function (specifier) { + if (specifier.exported) { + newExportIdentifiers.add(specifier.exported.name || specifier.exported.value); + } + }); + } + forEachDeclarationIdentifier(declaration, function (name) { + newExportIdentifiers.add(name); + }); + } + }); + + // old exports exist within list of new exports identifiers: add to map of new exports + exports.forEach(function (value, key) { + if (newExportIdentifiers.has(key)) { + newExports.set(key, value); + } + }); + + // new export identifiers added: add to map of new exports + newExportIdentifiers.forEach(function (key) { + if (!exports.has(key)) { + newExports.set(key, { whereUsed: new Set() }); + } + }); + + // preserve information about namespace imports + var exportAll = exports.get(EXPORT_ALL_DECLARATION); + var namespaceImports = exports.get(IMPORT_NAMESPACE_SPECIFIER); + + if (typeof namespaceImports === 'undefined') { + namespaceImports = { whereUsed: new Set() }; + } + + newExports.set(EXPORT_ALL_DECLARATION, exportAll); + newExports.set(IMPORT_NAMESPACE_SPECIFIER, namespaceImports); + exportList.set(file, newExports); + }return updateExportUsage;}(); + + /** + * only useful for tools like vscode-eslint + * + * update lists of existing imports during runtime + */ + var updateImportUsage = function () {function updateImportUsage(node) { + if (!unusedExports) { + return; + } + + var oldImportPaths = importList.get(file); + if (typeof oldImportPaths === 'undefined') { + oldImportPaths = new Map(); + } + + var oldNamespaceImports = new Set(); + var newNamespaceImports = new Set(); + + var oldExportAll = new Set(); + var newExportAll = new Set(); + + var oldDefaultImports = new Set(); + var newDefaultImports = new Set(); + + var oldImports = new Map(); + var newImports = new Map(); + oldImportPaths.forEach(function (value, key) { + if (value.has(EXPORT_ALL_DECLARATION)) { + oldExportAll.add(key); + } + if (value.has(IMPORT_NAMESPACE_SPECIFIER)) { + oldNamespaceImports.add(key); + } + if (value.has(IMPORT_DEFAULT_SPECIFIER)) { + oldDefaultImports.add(key); + } + value.forEach(function (val) { + if ( + val !== IMPORT_NAMESPACE_SPECIFIER && + val !== IMPORT_DEFAULT_SPECIFIER) + { + oldImports.set(val, key); + } + }); + }); + + function processDynamicImport(source) { + if (source.type !== 'Literal') { + return null; + } + var p = (0, _resolve2['default'])(source.value, context); + if (p == null) { + return null; + } + newNamespaceImports.add(p); + } + + (0, _visit2['default'])(node, visitorKeyMap.get(file), { + ImportExpression: function () {function ImportExpression(child) { + processDynamicImport(child.source); + }return ImportExpression;}(), + CallExpression: function () {function CallExpression(child) { + if (child.callee.type === 'Import') { + processDynamicImport(child.arguments[0]); + } + }return CallExpression;}() }); + + + node.body.forEach(function (astNode) { + var resolvedPath = void 0; + + // support for export { value } from 'module' + if (astNode.type === EXPORT_NAMED_DECLARATION) { + if (astNode.source) { + resolvedPath = (0, _resolve2['default'])(astNode.source.raw.replace(/('|")/g, ''), context); + astNode.specifiers.forEach(function (specifier) { + var name = specifier.local.name || specifier.local.value; + if (name === DEFAULT) { + newDefaultImports.add(resolvedPath); + } else { + newImports.set(name, resolvedPath); + } + }); + } + } + + if (astNode.type === EXPORT_ALL_DECLARATION) { + resolvedPath = (0, _resolve2['default'])(astNode.source.raw.replace(/('|")/g, ''), context); + newExportAll.add(resolvedPath); + } + + if (astNode.type === IMPORT_DECLARATION) { + resolvedPath = (0, _resolve2['default'])(astNode.source.raw.replace(/('|")/g, ''), context); + if (!resolvedPath) { + return; + } + + if (isNodeModule(resolvedPath)) { + return; + } + + if (newNamespaceImportExists(astNode.specifiers)) { + newNamespaceImports.add(resolvedPath); + } + + if (newDefaultImportExists(astNode.specifiers)) { + newDefaultImports.add(resolvedPath); + } + + astNode.specifiers. + filter(function (specifier) {return specifier.type !== IMPORT_DEFAULT_SPECIFIER && specifier.type !== IMPORT_NAMESPACE_SPECIFIER;}). + forEach(function (specifier) { + newImports.set(specifier.imported.name || specifier.imported.value, resolvedPath); + }); + } + }); + + newExportAll.forEach(function (value) { + if (!oldExportAll.has(value)) { + var imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(EXPORT_ALL_DECLARATION); + oldImportPaths.set(value, imports); + + var _exports = exportList.get(value); + var currentExport = void 0; + if (typeof _exports !== 'undefined') { + currentExport = _exports.get(EXPORT_ALL_DECLARATION); + } else { + _exports = new Map(); + exportList.set(value, _exports); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + var whereUsed = new Set(); + whereUsed.add(file); + _exports.set(EXPORT_ALL_DECLARATION, { whereUsed: whereUsed }); + } + } + }); + + oldExportAll.forEach(function (value) { + if (!newExportAll.has(value)) { + var imports = oldImportPaths.get(value); + imports['delete'](EXPORT_ALL_DECLARATION); + + var _exports2 = exportList.get(value); + if (typeof _exports2 !== 'undefined') { + var currentExport = _exports2.get(EXPORT_ALL_DECLARATION); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed['delete'](file); + } + } + } + }); + + newDefaultImports.forEach(function (value) { + if (!oldDefaultImports.has(value)) { + var imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(IMPORT_DEFAULT_SPECIFIER); + oldImportPaths.set(value, imports); + + var _exports3 = exportList.get(value); + var currentExport = void 0; + if (typeof _exports3 !== 'undefined') { + currentExport = _exports3.get(IMPORT_DEFAULT_SPECIFIER); + } else { + _exports3 = new Map(); + exportList.set(value, _exports3); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + var whereUsed = new Set(); + whereUsed.add(file); + _exports3.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: whereUsed }); + } + } + }); + + oldDefaultImports.forEach(function (value) { + if (!newDefaultImports.has(value)) { + var imports = oldImportPaths.get(value); + imports['delete'](IMPORT_DEFAULT_SPECIFIER); + + var _exports4 = exportList.get(value); + if (typeof _exports4 !== 'undefined') { + var currentExport = _exports4.get(IMPORT_DEFAULT_SPECIFIER); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed['delete'](file); + } + } + } + }); + + newNamespaceImports.forEach(function (value) { + if (!oldNamespaceImports.has(value)) { + var imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(IMPORT_NAMESPACE_SPECIFIER); + oldImportPaths.set(value, imports); + + var _exports5 = exportList.get(value); + var currentExport = void 0; + if (typeof _exports5 !== 'undefined') { + currentExport = _exports5.get(IMPORT_NAMESPACE_SPECIFIER); + } else { + _exports5 = new Map(); + exportList.set(value, _exports5); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + var whereUsed = new Set(); + whereUsed.add(file); + _exports5.set(IMPORT_NAMESPACE_SPECIFIER, { whereUsed: whereUsed }); + } + } + }); + + oldNamespaceImports.forEach(function (value) { + if (!newNamespaceImports.has(value)) { + var imports = oldImportPaths.get(value); + imports['delete'](IMPORT_NAMESPACE_SPECIFIER); + + var _exports6 = exportList.get(value); + if (typeof _exports6 !== 'undefined') { + var currentExport = _exports6.get(IMPORT_NAMESPACE_SPECIFIER); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed['delete'](file); + } + } + } + }); + + newImports.forEach(function (value, key) { + if (!oldImports.has(key)) { + var imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(key); + oldImportPaths.set(value, imports); + + var _exports7 = exportList.get(value); + var currentExport = void 0; + if (typeof _exports7 !== 'undefined') { + currentExport = _exports7.get(key); + } else { + _exports7 = new Map(); + exportList.set(value, _exports7); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + var whereUsed = new Set(); + whereUsed.add(file); + _exports7.set(key, { whereUsed: whereUsed }); + } + } + }); + + oldImports.forEach(function (value, key) { + if (!newImports.has(key)) { + var imports = oldImportPaths.get(value); + imports['delete'](key); + + var _exports8 = exportList.get(value); + if (typeof _exports8 !== 'undefined') { + var currentExport = _exports8.get(key); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed['delete'](file); + } + } + } + }); + }return updateImportUsage;}(); + + return { + 'Program:exit': function () {function ProgramExit(node) { + updateExportUsage(node); + updateImportUsage(node); + checkExportPresence(node); + }return ProgramExit;}(), + ExportDefaultDeclaration: function () {function ExportDefaultDeclaration(node) { + checkUsage(node, IMPORT_DEFAULT_SPECIFIER, false); + }return ExportDefaultDeclaration;}(), + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + node.specifiers.forEach(function (specifier) { + checkUsage(specifier, specifier.exported.name || specifier.exported.value, false); + }); + forEachDeclarationIdentifier(node.declaration, function (name, isTypeExport) { + checkUsage(node, name, isTypeExport); + }); + }return ExportNamedDeclaration;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby11bnVzZWQtbW9kdWxlcy5qcyJdLCJuYW1lcyI6WyJyZXF1aXJlRmlsZUVudW1lcmF0b3IiLCJGaWxlRW51bWVyYXRvciIsInJlcXVpcmUiLCJlIiwiY29kZSIsImxpc3RGaWxlc1VzaW5nRmlsZUVudW1lcmF0b3IiLCJzcmMiLCJleHRlbnNpb25zIiwiRVNMSU5UX1VTRV9GTEFUX0NPTkZJRyIsInByb2Nlc3MiLCJlbnYiLCJpc1VzaW5nRmxhdENvbmZpZyIsInNob3VsZFVzZUZsYXRDb25maWciLCJfIiwiZW51bWVyYXRvciIsIkFycmF5IiwiZnJvbSIsIml0ZXJhdGVGaWxlcyIsImZpbGVQYXRoIiwiaWdub3JlZCIsImZpbGVuYW1lIiwibWVzc2FnZSIsImluY2x1ZGVzIiwiRXJyb3IiLCJsaXN0RmlsZXNXaXRoTGVnYWN5RnVuY3Rpb25zIiwib3JpZ2luYWxMaXN0RmlsZXNUb1Byb2Nlc3MiLCJsaXN0RmlsZXNUb1Byb2Nlc3MiLCJwYXR0ZXJucyIsImNvbmNhdCIsInBhdHRlcm4iLCJtYXAiLCJleHRlbnNpb24iLCJ0ZXN0IiwiRVhQT1JUX0RFRkFVTFRfREVDTEFSQVRJT04iLCJFWFBPUlRfTkFNRURfREVDTEFSQVRJT04iLCJFWFBPUlRfQUxMX0RFQ0xBUkFUSU9OIiwiSU1QT1JUX0RFQ0xBUkFUSU9OIiwiSU1QT1JUX05BTUVTUEFDRV9TUEVDSUZJRVIiLCJJTVBPUlRfREVGQVVMVF9TUEVDSUZJRVIiLCJWQVJJQUJMRV9ERUNMQVJBVElPTiIsIkZVTkNUSU9OX0RFQ0xBUkFUSU9OIiwiQ0xBU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HBvcnRMaXN0LmdldChrZXkpO1xuICAgICAgaWYgKHR5cGVvZiBleHBvcnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICB2YWx1ZS5mb3JFYWNoKChjdXJyZW50SW1wb3J0KSA9PiB7XG4gICAgICAgICAgbGV0IHNwZWNpZmllcjtcbiAgICAgICAgICBpZiAoY3VycmVudEltcG9ydCA9PT0gSU1QT1JUX05BTUVTUEFDRV9TUEVDSUZJRVIpIHtcbiAgICAgICAgICAgIHNwZWNpZmllciA9IElNUE9SVF9OQU1FU1BBQ0VfU1BFQ0lGSUVSO1xuICAgICAgICAgIH0gZWxzZSBpZiAoY3VycmVudEltcG9ydCA9PT0gSU1QT1JUX0RFRkFVTFRfU1BFQ0lGSUVSKSB7XG4gICAgICAgICAgICBzcGVjaWZpZXIgPSBJTVBPUlRfREVGQVVMVF9TUEVDSUZJRVI7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNwZWNpZmllciA9IGN1cnJlbnRJbXBvcnQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh0eXBlb2Ygc3BlY2lmaWVyICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY29uc3QgZXhwb3J0U3RhdGVtZW50ID0gZXhwb3J0cy5nZXQoc3BlY2lmaWVyKTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgZXhwb3J0U3RhdGVtZW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICBjb25zdCB7IHdoZXJlVXNlZCB9ID0gZXhwb3J0U3RhdGVtZW50O1xuICAgICAgICAgICAgICB3aGVyZVVzZWQuYWRkKGxpc3RLZXkpO1xuICAgICAgICAgICAgICBleHBvcnRzLnNldChzcGVjaWZpZXIsIHsgd2hlcmVVc2VkIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH0pO1xufTtcblxuY29uc3QgZ2V0U3Jj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tcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfSk7XG5cbiAgICAgIGZ1bmN0aW9uIHByb2Nlc3NEeW5hbWljSW1wb3J0KHNvdXJjZSkge1xuICAgICAgICBpZiAoc291cmNlLnR5cGUgIT09ICdMaXRlcmFsJykge1xuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IHAgPSByZXNvbHZlKHNvdXJjZS52YWx1ZSwgY29udGV4dCk7XG4gICAgICAgIGlmIChwID09IG51bGwpIHtcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBuZXdOYW1lc3BhY2VJbXBvcnRzLmFkZChwKTtcbiAgICAgIH1cblxuICAgICAgdmlzaXQobm9kZSwgdmlzaXRvcktleU1hcC5nZXQoZmlsZSksIHtcbiAgICAgICAgSW1wb3J0RXhwcmVzc2lvbihjaGlsZCkge1xuICAgICAgICAgIHByb2Nlc3NEeW5hbWljSW1wb3J0KGNoaWxkLnNvdXJjZSk7XG4gICAgICAgIH0sXG4gICAgICAgIENhbGxFeHByZXNzaW9uKGNoaWxkKSB7XG4gICAgICAgICAgaWYgKGNoaWxkLmNhbGxlZS50eXBlID09PSAnSW1wb3J0Jykge1xuICAgICAgICAgICAgcHJvY2Vzc0R5bmFtaWNJbXBvcnQoY2hpbGQuYXJndW1lbnRzWzBdKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICB9KTtcblxuICAgICAgbm9kZS5ib2R5LmZvckVhY2goKGFzdE5vZGUpID0+IHtcbiAgICAgICAgbGV0IHJlc29sdmVkUGF0aDtcblxuICAgICAgICAvLyBzdXBwb3J0IGZvciBleHBvcnQgeyB2YWx1ZSB9IGZyb20gJ21vZHVsZSdcbiAgICAgICAgaWYgKGFzdE5vZGUudHlwZSA9PT0gRVhQT1JUX05BTUVEX0RFQ0xBUkFUSU9OKSB7XG4gICAgICAgICAgaWYgKGFzdE5vZGUuc291cmNl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biAgICAgICAgICAgICAgY3VycmVudEV4cG9ydC53aGVyZVVzZWQuZGVsZXRlKGZpbGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIG5ld0ltcG9ydHMuZm9yRWFjaCgodmFsdWUsIGtleSkgPT4ge1xuICAgICAgICBpZiAoIW9sZEltcG9ydHMuaGFzKGtleSkpIHtcbiAgICAgICAgICBsZXQgaW1wb3J0cyA9IG9sZEltcG9ydFBhdGhzLmdldCh2YWx1ZSk7XG4gICAgICAgICAgaWYgKHR5cGVvZiBpbXBvcnRzID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaW1wb3J0cyA9IG5ldyBTZXQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaW1wb3J0cy5hZGQoa2V5KTtcbiAgICAgICAgICBvbGRJbXBvcnRQYXRocy5zZXQodmFsdWUsIGltcG9ydHMpO1xuXG4gICAgICAgICAgbGV0IGV4cG9ydHMgPSBleHBvcnRMaXN0LmdldCh2YWx1ZSk7XG4gICAgICAgICAgbGV0IGN1cnJlbnRFeHBvcnQ7XG4gICAgICAgICAgaWYgKHR5cGVvZiBleHBvcnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY3VycmVudEV4cG9ydCA9IGV4cG9ydHMuZ2V0KGtleSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGV4cG9ydHMgPSBuZXcgTWFwKCk7XG4gICAgICAgICAgICBleHBvcnRMaXN0LnNldCh2YWx1ZSwgZXhwb3J0cyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHR5cGVvZiBjdXJyZW50RXhwb3J0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY3VycmVudEV4cG9ydC53aGVyZVVzZWQuYWRkKGZpbGUpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25zdCB3aGVyZVVzZW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nZShub2RlLCBJTVBPUlRfREVGQVVMVF9TUEVDSUZJRVIsIGZhbHNlKTtcbiAgICAgIH0sXG4gICAgICBFeHBvcnROYW1lZERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgbm9kZS5zcGVjaWZpZXJzLmZvckVhY2goKHNwZWNpZmllcikgPT4ge1xuICAgICAgICAgIGNoZWNrVXNhZ2Uoc3BlY2lmaWVyLCBzcGVjaWZpZXIuZXhwb3J0ZWQubmFtZSB8fCBzcGVjaWZpZXIuZXhwb3J0ZWQudmFsdWUsIGZhbHNlKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGZvckVhY2hEZWNsYXJhdGlvbklkZW50aWZpZXIobm9kZS5kZWNsYXJhdGlvbiwgKG5hbWUsIGlzVHlwZUV4cG9ydCkgPT4ge1xuICAgICAgICAgIGNoZWNrVXNhZ2Uobm9kZSwgbmFtZSwgaXNUeXBlRXhwb3J0KTtcbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js b/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js new file mode 100644 index 0000000000000000000000000000000000000000..617dd0c6e853a7af150a9d89bdce8c1af17108dd --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js @@ -0,0 +1,148 @@ +'use strict'; + + + + +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _ignore = require('eslint-module-utils/ignore'); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +/** + * convert a potentially relative path from node utils into a true + * relative path. + * + * ../ -> .. + * ./ -> . + * .foo/bar -> ./.foo/bar + * ..foo/bar -> ./..foo/bar + * foo/bar -> ./foo/bar + * + * @param relativePath {string} relative posix path potentially missing leading './' + * @returns {string} relative posix path that always starts with a ./ + **/ /** + * @fileOverview Ensures that there are no useless path segments + * @author Thomas Grainger + */function toRelativePath(relativePath) {var stripped = relativePath.replace(/\/$/g, ''); // Remove trailing / + return (/^((\.\.)|(\.))($|\/)/.test(stripped) ? stripped : './' + String(stripped)); +} + +function normalize(fn) { + return toRelativePath(_path2['default'].posix.normalize(fn)); +} + +function countRelativeParents(pathSegments) { + return pathSegments.filter(function (x) {return x === '..';}).length; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Static analysis', + description: 'Forbid unnecessary path segments in import and require statements.', + url: (0, _docsUrl2['default'])('no-useless-path-segments') }, + + + fixable: 'code', + + schema: [ + { + type: 'object', + properties: { + commonjs: { type: 'boolean' }, + noUselessIndex: { type: 'boolean' } }, + + additionalProperties: false }] }, + + + + + create: function () {function create(context) { + var currentDir = _path2['default'].dirname((0, _contextCompat.getPhysicalFilename)(context)); + var options = context.options[0]; + + function checkSourceValue(source) {var + importPath = source.value; + + function reportWithProposedPath(proposedPath) { + context.report({ + node: source, + // Note: Using messageIds is not possible due to the support for ESLint 2 and 3 + message: 'Useless path segments for "' + String(importPath) + '", should be "' + String(proposedPath) + '"', + fix: function () {function fix(fixer) {return proposedPath && fixer.replaceText(source, JSON.stringify(proposedPath));}return fix;}() }); + + } + + // Only relative imports are relevant for this rule --> Skip checking + if (!importPath.startsWith('.')) { + return; + } + + // Report rule violation if path is not the shortest possible + var resolvedPath = (0, _resolve2['default'])(importPath, context); + var normedPath = normalize(importPath); + var resolvedNormedPath = (0, _resolve2['default'])(normedPath, context); + if (normedPath !== importPath && resolvedPath === resolvedNormedPath) { + return reportWithProposedPath(normedPath); + } + + var fileExtensions = (0, _ignore.getFileExtensions)(context.settings); + var regexUnnecessaryIndex = new RegExp('.*\\/index(\\' + String( + Array.from(fileExtensions).join('|\\')) + ')?$'); + + + // Check if path contains unnecessary index (including a configured extension) + if (options && options.noUselessIndex && regexUnnecessaryIndex.test(importPath)) { + var parentDirectory = _path2['default'].dirname(importPath); + + // Try to find ambiguous imports + if (parentDirectory !== '.' && parentDirectory !== '..') {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = fileExtensions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var fileExtension = _step.value; + if ((0, _resolve2['default'])('' + String(parentDirectory) + String(fileExtension), context)) { + return reportWithProposedPath(String(parentDirectory) + '/'); + } + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + } + + return reportWithProposedPath(parentDirectory); + } + + // Path is shortest possible + starts from the current directory --> Return directly + if (importPath.startsWith('./')) { + return; + } + + // Path is not existing --> Return directly (following code requires path to be defined) + if (resolvedPath === undefined) { + return; + } + + var expected = _path2['default'].relative(currentDir, resolvedPath); // Expected import path + var expectedSplit = expected.split(_path2['default'].sep); // Split by / or \ (depending on OS) + var importPathSplit = importPath.replace(/^\.\//, '').split('/'); + var countImportPathRelativeParents = countRelativeParents(importPathSplit); + var countExpectedRelativeParents = countRelativeParents(expectedSplit); + var diff = countImportPathRelativeParents - countExpectedRelativeParents; + + // Same number of relative parents --> Paths are the same --> Return directly + if (diff <= 0) { + return; + } + + // Report and propose minimal number of required relative parents + return reportWithProposedPath( + toRelativePath( + importPathSplit. + slice(0, countExpectedRelativeParents). + concat(importPathSplit.slice(countImportPathRelativeParents + diff)). + join('/'))); + + + } + + return (0, _moduleVisitor2['default'])(checkSourceValue, options); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy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ICk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG1vZHVsZVZpc2l0b3IoY2hlY2tTb3VyY2VWYWx1ZSwgb3B0aW9ucyk7XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js b/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js new file mode 100644 index 0000000000000000000000000000000000000000..a0e1a1481d2160eceac58a0a541a4bbe8399a41e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js @@ -0,0 +1,26 @@ +'use strict';var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +function reportIfNonStandard(context, node, name) { + if (name && name.indexOf('!') !== -1) { + context.report(node, 'Unexpected \'!\' in \'' + String(name) + '\'. Do not use import syntax to configure webpack loaders.'); + } +} + +module.exports = { + meta: { + type: 'problem', + docs: { + category: 'Static analysis', + description: 'Forbid webpack loader syntax in imports.', + url: (0, _docsUrl2['default'])('no-webpack-loader-syntax') }, + + schema: [] }, + + + create: function () {function create(context) { + return (0, _moduleVisitor2['default'])(function (source, node) { + reportIfNonStandard(context, node, source.value); + }, { commonjs: true }); + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby13ZWJwYWNrLWxvYWRlci1zeW50YXguanMiXSwibmFtZXMiOlsicmVwb3J0SWZOb25TdGFuZGFyZCIsImNvbnRleHQiLCJub2RlIiwibmFtZSIsImluZGV4T2YiLCJyZXBvcnQiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwiY2F0ZWdvcnkiLCJkZXNjcmlwd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G5vZGUsIG5hbWUpIHtcbiAgaWYgKG5hbWUgJiYgbmFtZS5pbmRleE9mKCchJykgIT09IC0xKSB7XG4gICAgY29udGV4dC5yZXBvcnQobm9kZSwgYFVuZXhwZWN0ZWQgJyEnIGluICcke25hbWV9Jy4gRG8gbm90IHVzZSBpbXBvcnQgc3ludGF4IHRvIGNvbmZpZ3VyZSB3ZWJwYWNrIGxvYWRlcnMuYCk7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIG1ldGE6IHtcbiAgICB0eXBlOiAncHJvYmxlbScsXG4gICAgZG9jczoge1xuICAgICAgY2F0ZWdvcnk6ICdTdGF0aWMgYW5hbHlzaXMnLFxuICAgICAgZGVzY3JpcHRpb246ICdGb3JiaWQgd2VicGFjayBsb2FkZXIgc3ludGF4IGluIGltcG9ydHMuJyxcbiAgICAgIHVybDogZG9jc1VybCgnbm8td2VicGFjay1sb2FkZXItc3ludGF4JyksXG4gICAgfSxcbiAgICBzY2hlbWE6IFtdLFxuICB9LFxuXG4gIGNyZWF0ZShjb250ZXh0KSB7XG4gICAgcmV0dXJuIG1vZHVsZVZpc2l0b3IoKHNvdXJjZSwgbm9kZSkgPT4ge1xuICAgICAgcmVwb3J0SWZOb25TdGFuZGFyZChjb250ZXh0LCBub2RlLCBzb3VyY2UudmFsdWUpO1xuICAgIH0sIHsgY29tbW9uanM6IHRydWUgfSk7XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/order.js b/node_modules/eslint-plugin-import/lib/rules/order.js new file mode 100644 index 0000000000000000000000000000000000000000..578709bf0b90c1c794ed7f8c046d9b3edaf0ff0a --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/order.js @@ -0,0 +1,1349 @@ +'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}(); + +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes); +var _object = require('object.groupby');var _object2 = _interopRequireDefault(_object); +var _contextCompat = require('eslint-module-utils/contextCompat'); +var _stringPrototype = require('string.prototype.trimend');var _stringPrototype2 = _interopRequireDefault(_stringPrototype); + +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var categories = { + named: 'named', + 'import': 'import', + exports: 'exports' }; + + +var defaultGroups = ['builtin', 'external', 'parent', 'sibling', 'index']; + +// REPORTING AND FIXING + +function reverse(array) { + return array.map(function (v) {return Object.assign({}, v, { rank: -v.rank });}).reverse(); +} + +function getTokensOrCommentsAfter(sourceCode, node, count) { + var currentNodeOrToken = node; + var result = []; + for (var i = 0; i < count; i++) { + currentNodeOrToken = sourceCode.getTokenOrCommentAfter(currentNodeOrToken); + if (currentNodeOrToken == null) { + break; + } + result.push(currentNodeOrToken); + } + return result; +} + +function getTokensOrCommentsBefore(sourceCode, node, count) { + var currentNodeOrToken = node; + var result = []; + for (var i = 0; i < count; i++) { + currentNodeOrToken = sourceCode.getTokenOrCommentBefore(currentNodeOrToken); + if (currentNodeOrToken == null) { + break; + } + result.push(currentNodeOrToken); + } + return result.reverse(); +} + +function takeTokensAfterWhile(sourceCode, node, condition) { + var tokens = getTokensOrCommentsAfter(sourceCode, node, 100); + var result = []; + for (var i = 0; i < tokens.length; i++) { + if (condition(tokens[i])) { + result.push(tokens[i]); + } else { + break; + } + } + return result; +} + +function takeTokensBeforeWhile(sourceCode, node, condition) { + var tokens = getTokensOrCommentsBefore(sourceCode, node, 100); + var result = []; + for (var i = tokens.length - 1; i >= 0; i--) { + if (condition(tokens[i])) { + result.push(tokens[i]); + } else { + break; + } + } + return result.reverse(); +} + +function findOutOfOrder(imported) { + if (imported.length === 0) { + return []; + } + var maxSeenRankNode = imported[0]; + return imported.filter(function (importedModule) { + var res = importedModule.rank < maxSeenRankNode.rank; + if (maxSeenRankNode.rank < importedModule.rank) { + maxSeenRankNode = importedModule; + } + return res; + }); +} + +function findRootNode(node) { + var parent = node; + while (parent.parent != null && parent.parent.body == null) { + parent = parent.parent; + } + return parent; +} + +function commentOnSameLineAs(node) { + return function (token) {return (token.type === 'Block' || token.type === 'Line') && + token.loc.start.line === token.loc.end.line && + token.loc.end.line === node.loc.end.line;}; +} + +function findEndOfLineWithComments(sourceCode, node) { + var tokensToEndOfLine = takeTokensAfterWhile(sourceCode, node, commentOnSameLineAs(node)); + var endOfTokens = tokensToEndOfLine.length > 0 ? + tokensToEndOfLine[tokensToEndOfLine.length - 1].range[1] : + node.range[1]; + var result = endOfTokens; + for (var i = endOfTokens; i < sourceCode.text.length; i++) { + if (sourceCode.text[i] === '\n') { + result = i + 1; + break; + } + if (sourceCode.text[i] !== ' ' && sourceCode.text[i] !== '\t' && sourceCode.text[i] !== '\r') { + break; + } + result = i + 1; + } + return result; +} + +function findStartOfLineWithComments(sourceCode, node) { + var tokensToEndOfLine = takeTokensBeforeWhile(sourceCode, node, commentOnSameLineAs(node)); + var startOfTokens = tokensToEndOfLine.length > 0 ? tokensToEndOfLine[0].range[0] : node.range[0]; + var result = startOfTokens; + for (var i = startOfTokens - 1; i > 0; i--) { + if (sourceCode.text[i] !== ' ' && sourceCode.text[i] !== '\t') { + break; + } + result = i; + } + return result; +} + +function findSpecifierStart(sourceCode, node) { + var token = void 0; + + do { + token = sourceCode.getTokenBefore(node); + } while (token.value !== ',' && token.value !== '{'); + + return token.range[1]; +} + +function findSpecifierEnd(sourceCode, node) { + var token = void 0; + + do { + token = sourceCode.getTokenAfter(node); + } while (token.value !== ',' && token.value !== '}'); + + return token.range[0]; +} + +function isRequireExpression(expr) { + return expr != null && + expr.type === 'CallExpression' && + expr.callee != null && + expr.callee.name === 'require' && + expr.arguments != null && + expr.arguments.length === 1 && + expr.arguments[0].type === 'Literal'; +} + +function isSupportedRequireModule(node) { + if (node.type !== 'VariableDeclaration') { + return false; + } + if (node.declarations.length !== 1) { + return false; + } + var decl = node.declarations[0]; + var isPlainRequire = decl.id && ( + decl.id.type === 'Identifier' || decl.id.type === 'ObjectPattern') && + isRequireExpression(decl.init); + var isRequireWithMemberExpression = decl.id && ( + decl.id.type === 'Identifier' || decl.id.type === 'ObjectPattern') && + decl.init != null && + decl.init.type === 'CallExpression' && + decl.init.callee != null && + decl.init.callee.type === 'MemberExpression' && + isRequireExpression(decl.init.callee.object); + return isPlainRequire || isRequireWithMemberExpression; +} + +function isPlainImportModule(node) { + return node.type === 'ImportDeclaration' && node.specifiers != null && node.specifiers.length > 0; +} + +function isPlainImportEquals(node) { + return node.type === 'TSImportEqualsDeclaration' && node.moduleReference.expression; +} + +function isCJSExports(context, node) { + if ( + node.type === 'MemberExpression' && + node.object.type === 'Identifier' && + node.property.type === 'Identifier' && + node.object.name === 'module' && + node.property.name === 'exports') + { + return (0, _contextCompat.getScope)(context, node).variables.findIndex(function (variable) {return variable.name === 'module';}) === -1; + } + if ( + node.type === 'Identifier' && + node.name === 'exports') + { + return (0, _contextCompat.getScope)(context, node).variables.findIndex(function (variable) {return variable.name === 'exports';}) === -1; + } +} + +function getNamedCJSExports(context, node) { + if (node.type !== 'MemberExpression') { + return; + } + var result = []; + var root = node; + var parent = null; + while (root.type === 'MemberExpression') { + if (root.property.type !== 'Identifier') { + return; + } + result.unshift(root.property.name); + parent = root; + root = root.object; + } + + if (isCJSExports(context, root)) { + return result; + } + + if (isCJSExports(context, parent)) { + return result.slice(1); + } +} + +function canCrossNodeWhileReorder(node) { + return isSupportedRequireModule(node) || isPlainImportModule(node) || isPlainImportEquals(node); +} + +function canReorderItems(firstNode, secondNode) { + var parent = firstNode.parent;var _sort = + [ + parent.body.indexOf(firstNode), + parent.body.indexOf(secondNode)]. + sort(),_sort2 = _slicedToArray(_sort, 2),firstIndex = _sort2[0],secondIndex = _sort2[1]; + var nodesBetween = parent.body.slice(firstIndex, secondIndex + 1);var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { + for (var _iterator = nodesBetween[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var nodeBetween = _step.value; + if (!canCrossNodeWhileReorder(nodeBetween)) { + return false; + } + }} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}} + return true; +} + +function makeImportDescription(node) { + if (node.type === 'export') { + if (node.node.exportKind === 'type') { + return 'type export'; + } + return 'export'; + } + if (node.node.importKind === 'type') { + return 'type import'; + } + if (node.node.importKind === 'typeof') { + return 'typeof import'; + } + return 'import'; +} + +function fixOutOfOrder(context, firstNode, secondNode, order, category) { + var isNamed = category === categories.named; + var isExports = category === categories.exports; + var sourceCode = (0, _contextCompat.getSourceCode)(context);var _ref = + + + + + isNamed ? { + firstRoot: firstNode.node, + secondRoot: secondNode.node } : + { + firstRoot: findRootNode(firstNode.node), + secondRoot: findRootNode(secondNode.node) },firstRoot = _ref.firstRoot,secondRoot = _ref.secondRoot;var _ref2 = + + + + + + + + isNamed ? { + firstRootStart: findSpecifierStart(sourceCode, firstRoot), + firstRootEnd: findSpecifierEnd(sourceCode, firstRoot), + secondRootStart: findSpecifierStart(sourceCode, secondRoot), + secondRootEnd: findSpecifierEnd(sourceCode, secondRoot) } : + { + firstRootStart: findStartOfLineWithComments(sourceCode, firstRoot), + firstRootEnd: findEndOfLineWithComments(sourceCode, firstRoot), + secondRootStart: findStartOfLineWithComments(sourceCode, secondRoot), + secondRootEnd: findEndOfLineWithComments(sourceCode, secondRoot) },firstRootStart = _ref2.firstRootStart,firstRootEnd = _ref2.firstRootEnd,secondRootStart = _ref2.secondRootStart,secondRootEnd = _ref2.secondRootEnd; + + + if (firstNode.displayName === secondNode.displayName) { + if (firstNode.alias) { + firstNode.displayName = String(firstNode.displayName) + ' as ' + String(firstNode.alias); + } + if (secondNode.alias) { + secondNode.displayName = String(secondNode.displayName) + ' as ' + String(secondNode.alias); + } + } + + var firstImport = String(makeImportDescription(firstNode)) + ' of `' + String(firstNode.displayName) + '`'; + var secondImport = '`' + String(secondNode.displayName) + '` ' + String(makeImportDescription(secondNode)); + var message = secondImport + ' should occur ' + String(order) + ' ' + firstImport; + + if (isNamed) { + var firstCode = sourceCode.text.slice(firstRootStart, firstRoot.range[1]); + var firstTrivia = sourceCode.text.slice(firstRoot.range[1], firstRootEnd); + var secondCode = sourceCode.text.slice(secondRootStart, secondRoot.range[1]); + var secondTrivia = sourceCode.text.slice(secondRoot.range[1], secondRootEnd); + + if (order === 'before') { + var trimmedTrivia = (0, _stringPrototype2['default'])(secondTrivia); + var gapCode = sourceCode.text.slice(firstRootEnd, secondRootStart - 1); + var whitespaces = secondTrivia.slice(trimmedTrivia.length); + context.report({ + node: secondNode.node, + message: message, + fix: function () {function fix(fixer) {return fixer.replaceTextRange( + [firstRootStart, secondRootEnd], String( + secondCode) + ',' + String(trimmedTrivia) + String(firstCode) + String(firstTrivia) + String(gapCode) + String(whitespaces));}return fix;}() }); + + + } else if (order === 'after') { + var _trimmedTrivia = (0, _stringPrototype2['default'])(firstTrivia); + var _gapCode = sourceCode.text.slice(secondRootEnd + 1, firstRootStart); + var _whitespaces = firstTrivia.slice(_trimmedTrivia.length); + context.report({ + node: secondNode.node, + message: message, + fix: function () {function fix(fixes) {return fixes.replaceTextRange( + [secondRootStart, firstRootEnd], '' + String( + _gapCode) + String(firstCode) + ',' + String(_trimmedTrivia) + String(secondCode) + String(_whitespaces));}return fix;}() }); + + + } + } else { + var canFix = isExports || canReorderItems(firstRoot, secondRoot); + var newCode = sourceCode.text.substring(secondRootStart, secondRootEnd); + + if (newCode[newCode.length - 1] !== '\n') { + newCode = String(newCode) + '\n'; + } + + if (order === 'before') { + context.report({ + node: secondNode.node, + message: message, + fix: canFix && function (fixer) {return fixer.replaceTextRange( + [firstRootStart, secondRootEnd], + newCode + sourceCode.text.substring(firstRootStart, secondRootStart));} }); + + + } else if (order === 'after') { + context.report({ + node: secondNode.node, + message: message, + fix: canFix && function (fixer) {return fixer.replaceTextRange( + [secondRootStart, firstRootEnd], + sourceCode.text.substring(secondRootEnd, firstRootEnd) + newCode);} }); + + + } + } +} + +function reportOutOfOrder(context, imported, outOfOrder, order, category) { + outOfOrder.forEach(function (imp) { + var found = imported.find(function () {function hasHigherRank(importedItem) { + return importedItem.rank > imp.rank; + }return hasHigherRank;}()); + fixOutOfOrder(context, found, imp, order, category); + }); +} + +function makeOutOfOrderReport(context, imported, category) { + var outOfOrder = findOutOfOrder(imported); + if (!outOfOrder.length) { + return; + } + + // There are things to report. Try to minimize the number of reported errors. + var reversedImported = reverse(imported); + var reversedOrder = findOutOfOrder(reversedImported); + if (reversedOrder.length < outOfOrder.length) { + reportOutOfOrder(context, reversedImported, reversedOrder, 'after', category); + return; + } + reportOutOfOrder(context, imported, outOfOrder, 'before', category); +} + +var compareString = function compareString(a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; +}; + +/** Some parsers (languages without types) don't provide ImportKind */ +var DEFAULT_IMPORT_KIND = 'value'; +var getNormalizedValue = function getNormalizedValue(node, toLowerCase) { + var value = node.value; + return toLowerCase ? String(value).toLowerCase() : value; +}; + +function getSorter(alphabetizeOptions) { + var multiplier = alphabetizeOptions.order === 'asc' ? 1 : -1; + var orderImportKind = alphabetizeOptions.orderImportKind; + var multiplierImportKind = orderImportKind !== 'ignore' && ( + alphabetizeOptions.orderImportKind === 'asc' ? 1 : -1); + + return function () {function importsSorter(nodeA, nodeB) { + var importA = getNormalizedValue(nodeA, alphabetizeOptions.caseInsensitive); + var importB = getNormalizedValue(nodeB, alphabetizeOptions.caseInsensitive); + var result = 0; + + if (!(0, _arrayIncludes2['default'])(importA, '/') && !(0, _arrayIncludes2['default'])(importB, '/')) { + result = compareString(importA, importB); + } else { + var A = importA.split('/'); + var B = importB.split('/'); + var a = A.length; + var b = B.length; + + for (var i = 0; i < Math.min(a, b); i++) { + // Skip comparing the first path segment, if they are relative segments for both imports + if (i === 0 && (A[i] === '.' || A[i] === '..') && (B[i] === '.' || B[i] === '..')) { + // If one is sibling and the other parent import, no need to compare at all, since the paths belong in different groups + if (A[i] !== B[i]) {break;} + continue; + } + result = compareString(A[i], B[i]); + if (result) {break;} + } + + if (!result && a !== b) { + result = a < b ? -1 : 1; + } + } + + result = result * multiplier; + + // In case the paths are equal (result === 0), sort them by importKind + if (!result && multiplierImportKind) { + result = multiplierImportKind * compareString( + nodeA.node.importKind || DEFAULT_IMPORT_KIND, + nodeB.node.importKind || DEFAULT_IMPORT_KIND); + + } + + return result; + }return importsSorter;}(); +} + +function mutateRanksToAlphabetize(imported, alphabetizeOptions) { + var groupedByRanks = (0, _object2['default'])(imported, function (item) {return item.rank;}); + + var sorterFn = getSorter(alphabetizeOptions); + + // sort group keys so that they can be iterated on in order + var groupRanks = Object.keys(groupedByRanks).sort(function (a, b) { + return a - b; + }); + + // sort imports locally within their group + groupRanks.forEach(function (groupRank) { + groupedByRanks[groupRank].sort(sorterFn); + }); + + // assign globally unique rank to each import + var newRank = 0; + var alphabetizedRanks = groupRanks.reduce(function (acc, groupRank) { + groupedByRanks[groupRank].forEach(function (importedItem) { + acc[String(importedItem.value) + '|' + String(importedItem.node.importKind)] = parseInt(groupRank, 10) + newRank; + newRank += 1; + }); + return acc; + }, {}); + + // mutate the original group-rank with alphabetized-rank + imported.forEach(function (importedItem) { + importedItem.rank = alphabetizedRanks[String(importedItem.value) + '|' + String(importedItem.node.importKind)]; + }); +} + +// DETECTING + +function computePathRank(ranks, pathGroups, path, maxPosition) { + for (var i = 0, l = pathGroups.length; i < l; i++) {var _pathGroups$i = + pathGroups[i],pattern = _pathGroups$i.pattern,patternOptions = _pathGroups$i.patternOptions,group = _pathGroups$i.group,_pathGroups$i$positio = _pathGroups$i.position,position = _pathGroups$i$positio === undefined ? 1 : _pathGroups$i$positio; + if ((0, _minimatch2['default'])(path, pattern, patternOptions || { nocomment: true })) { + return ranks[group] + position / maxPosition; + } + } +} + +function computeRank(context, ranks, importEntry, excludedImportTypes, isSortingTypesGroup) { + var impType = void 0; + var rank = void 0; + + var isTypeGroupInGroups = ranks.omittedTypes.indexOf('type') === -1; + var isTypeOnlyImport = importEntry.node.importKind === 'type'; + var isExcludedFromPathRank = isTypeOnlyImport && isTypeGroupInGroups && excludedImportTypes.has('type'); + + if (importEntry.type === 'import:object') { + impType = 'object'; + } else if (isTypeOnlyImport && isTypeGroupInGroups && !isSortingTypesGroup) { + impType = 'type'; + } else { + impType = (0, _importType2['default'])(importEntry.value, context); + } + + if (!excludedImportTypes.has(impType) && !isExcludedFromPathRank) { + rank = computePathRank(ranks.groups, ranks.pathGroups, importEntry.value, ranks.maxPosition); + } + + if (typeof rank === 'undefined') { + rank = ranks.groups[impType]; + + if (typeof rank === 'undefined') { + return -1; + } + } + + if (isTypeOnlyImport && isSortingTypesGroup) { + rank = ranks.groups.type + rank / 10; + } + + if (importEntry.type !== 'import' && !importEntry.type.startsWith('import:')) { + rank += 100; + } + + return rank; +} + +function registerNode(context, importEntry, ranks, imported, excludedImportTypes, isSortingTypesGroup) { + var rank = computeRank(context, ranks, importEntry, excludedImportTypes, isSortingTypesGroup); + if (rank !== -1) { + var importNode = importEntry.node; + + if (importEntry.type === 'require' && importNode.parent.parent.type === 'VariableDeclaration') { + importNode = importNode.parent.parent; + } + + imported.push(Object.assign({}, + importEntry, { + rank: rank, + isMultiline: importNode.loc.end.line !== importNode.loc.start.line })); + + } +} + +function getRequireBlock(node) { + var n = node; + // Handle cases like `const baz = require('foo').bar.baz` + // and `const foo = require('foo')()` + while ( + n.parent.type === 'MemberExpression' && n.parent.object === n || + n.parent.type === 'CallExpression' && n.parent.callee === n) + { + n = n.parent; + } + if ( + n.parent.type === 'VariableDeclarator' && + n.parent.parent.type === 'VariableDeclaration' && + n.parent.parent.parent.type === 'Program') + { + return n.parent.parent.parent; + } +} + +var types = ['builtin', 'external', 'internal', 'unknown', 'parent', 'sibling', 'index', 'object', 'type']; + +/** + * Creates an object with type-rank pairs. + * + * Example: { index: 0, sibling: 1, parent: 1, external: 1, builtin: 2, internal: 2 } + */ +function convertGroupsToRanks(groups) { + var rankObject = groups.reduce(function (res, group, index) { + [].concat(group).forEach(function (groupItem) { + res[groupItem] = index * 2; + }); + return res; + }, {}); + + var omittedTypes = types.filter(function (type) { + return typeof rankObject[type] === 'undefined'; + }); + + var ranks = omittedTypes.reduce(function (res, type) { + res[type] = groups.length * 2; + return res; + }, rankObject); + + return { groups: ranks, omittedTypes: omittedTypes }; +} + +function convertPathGroupsForRanks(pathGroups) { + var after = {}; + var before = {}; + + var transformed = pathGroups.map(function (pathGroup, index) {var + group = pathGroup.group,positionString = pathGroup.position; + var position = 0; + if (positionString === 'after') { + if (!after[group]) { + after[group] = 1; + } + position = after[group]++; + } else if (positionString === 'before') { + if (!before[group]) { + before[group] = []; + } + before[group].push(index); + } + + return Object.assign({}, pathGroup, { position: position }); + }); + + var maxPosition = 1; + + Object.keys(before).forEach(function (group) { + var groupLength = before[group].length; + before[group].forEach(function (groupIndex, index) { + transformed[groupIndex].position = -1 * (groupLength - index); + }); + maxPosition = Math.max(maxPosition, groupLength); + }); + + Object.keys(after).forEach(function (key) { + var groupNextPosition = after[key]; + maxPosition = Math.max(maxPosition, groupNextPosition - 1); + }); + + return { + pathGroups: transformed, + maxPosition: maxPosition > 10 ? Math.pow(10, Math.ceil(Math.log10(maxPosition))) : 10 }; + +} + +function fixNewLineAfterImport(context, previousImport) { + var prevRoot = findRootNode(previousImport.node); + var tokensToEndOfLine = takeTokensAfterWhile( + (0, _contextCompat.getSourceCode)(context), + prevRoot, + commentOnSameLineAs(prevRoot)); + + + var endOfLine = prevRoot.range[1]; + if (tokensToEndOfLine.length > 0) { + endOfLine = tokensToEndOfLine[tokensToEndOfLine.length - 1].range[1]; + } + return function (fixer) {return fixer.insertTextAfterRange([prevRoot.range[0], endOfLine], '\n');}; +} + +function removeNewLineAfterImport(context, currentImport, previousImport) { + var sourceCode = (0, _contextCompat.getSourceCode)(context); + var prevRoot = findRootNode(previousImport.node); + var currRoot = findRootNode(currentImport.node); + var rangeToRemove = [ + findEndOfLineWithComments(sourceCode, prevRoot), + findStartOfLineWithComments(sourceCode, currRoot)]; + + if (/^\s*$/.test(sourceCode.text.substring(rangeToRemove[0], rangeToRemove[1]))) { + return function (fixer) {return fixer.removeRange(rangeToRemove);}; + } + return undefined; +} + +function makeNewlinesBetweenReport(context, imported, newlinesBetweenImports_, newlinesBetweenTypeOnlyImports_, distinctGroup, isSortingTypesGroup, isConsolidatingSpaceBetweenImports) { + var getNumberOfEmptyLinesBetween = function getNumberOfEmptyLinesBetween(currentImport, previousImport) { + var linesBetweenImports = (0, _contextCompat.getSourceCode)(context).lines.slice( + previousImport.node.loc.end.line, + currentImport.node.loc.start.line - 1); + + + return linesBetweenImports.filter(function (line) {return !line.trim().length;}).length; + }; + var getIsStartOfDistinctGroup = function getIsStartOfDistinctGroup(currentImport, previousImport) {return currentImport.rank - 1 >= previousImport.rank;}; + var previousImport = imported[0]; + + imported.slice(1).forEach(function (currentImport) { + var emptyLinesBetween = getNumberOfEmptyLinesBetween( + currentImport, + previousImport); + + + var isStartOfDistinctGroup = getIsStartOfDistinctGroup( + currentImport, + previousImport); + + + var isTypeOnlyImport = currentImport.node.importKind === 'type'; + var isPreviousImportTypeOnlyImport = previousImport.node.importKind === 'type'; + + var isNormalImportNextToTypeOnlyImportAndRelevant = isTypeOnlyImport !== isPreviousImportTypeOnlyImport && isSortingTypesGroup; + + var isTypeOnlyImportAndRelevant = isTypeOnlyImport && isSortingTypesGroup; + + // In the special case where newlinesBetweenImports and consolidateIslands + // want the opposite thing, consolidateIslands wins + var newlinesBetweenImports = isSortingTypesGroup && + isConsolidatingSpaceBetweenImports && ( + previousImport.isMultiline || currentImport.isMultiline) && + newlinesBetweenImports_ === 'never' ? + 'always-and-inside-groups' : + newlinesBetweenImports_; + + // In the special case where newlinesBetweenTypeOnlyImports and + // consolidateIslands want the opposite thing, consolidateIslands wins + var newlinesBetweenTypeOnlyImports = isSortingTypesGroup && + isConsolidatingSpaceBetweenImports && ( + isNormalImportNextToTypeOnlyImportAndRelevant || + previousImport.isMultiline || + currentImport.isMultiline) && + newlinesBetweenTypeOnlyImports_ === 'never' ? + 'always-and-inside-groups' : + newlinesBetweenTypeOnlyImports_; + + var isNotIgnored = isTypeOnlyImportAndRelevant && + newlinesBetweenTypeOnlyImports !== 'ignore' || + !isTypeOnlyImportAndRelevant && newlinesBetweenImports !== 'ignore'; + + if (isNotIgnored) { + var shouldAssertNewlineBetweenGroups = (isTypeOnlyImportAndRelevant || isNormalImportNextToTypeOnlyImportAndRelevant) && ( + newlinesBetweenTypeOnlyImports === 'always' || + newlinesBetweenTypeOnlyImports === 'always-and-inside-groups') || + !isTypeOnlyImportAndRelevant && !isNormalImportNextToTypeOnlyImportAndRelevant && ( + newlinesBetweenImports === 'always' || + newlinesBetweenImports === 'always-and-inside-groups'); + + var shouldAssertNoNewlineWithinGroup = (isTypeOnlyImportAndRelevant || isNormalImportNextToTypeOnlyImportAndRelevant) && + newlinesBetweenTypeOnlyImports !== 'always-and-inside-groups' || + !isTypeOnlyImportAndRelevant && !isNormalImportNextToTypeOnlyImportAndRelevant && + newlinesBetweenImports !== 'always-and-inside-groups'; + + var shouldAssertNoNewlineBetweenGroup = !isSortingTypesGroup || + !isNormalImportNextToTypeOnlyImportAndRelevant || + newlinesBetweenTypeOnlyImports === 'never'; + + var isTheNewlineBetweenImportsInTheSameGroup = distinctGroup && currentImport.rank === previousImport.rank || + !distinctGroup && !isStartOfDistinctGroup; + + // Let's try to cut down on linting errors sent to the user + var alreadyReported = false; + + if (shouldAssertNewlineBetweenGroups) { + if (currentImport.rank !== previousImport.rank && emptyLinesBetween === 0) { + if (distinctGroup || isStartOfDistinctGroup) { + alreadyReported = true; + context.report({ + node: previousImport.node, + message: 'There should be at least one empty line between import groups', + fix: fixNewLineAfterImport(context, previousImport) }); + + } + } else if (emptyLinesBetween > 0 && shouldAssertNoNewlineWithinGroup) { + if (isTheNewlineBetweenImportsInTheSameGroup) { + alreadyReported = true; + context.report({ + node: previousImport.node, + message: 'There should be no empty line within import group', + fix: removeNewLineAfterImport(context, currentImport, previousImport) }); + + } + } + } else if (emptyLinesBetween > 0 && shouldAssertNoNewlineBetweenGroup) { + alreadyReported = true; + context.report({ + node: previousImport.node, + message: 'There should be no empty line between import groups', + fix: removeNewLineAfterImport(context, currentImport, previousImport) }); + + } + + if (!alreadyReported && isConsolidatingSpaceBetweenImports) { + if (emptyLinesBetween === 0 && currentImport.isMultiline) { + context.report({ + node: previousImport.node, + message: 'There should be at least one empty line between this import and the multi-line import that follows it', + fix: fixNewLineAfterImport(context, previousImport) }); + + } else if (emptyLinesBetween === 0 && previousImport.isMultiline) { + context.report({ + node: previousImport.node, + message: 'There should be at least one empty line between this multi-line import and the import that follows it', + fix: fixNewLineAfterImport(context, previousImport) }); + + } else if ( + emptyLinesBetween > 0 && + !previousImport.isMultiline && + !currentImport.isMultiline && + isTheNewlineBetweenImportsInTheSameGroup) + { + context.report({ + node: previousImport.node, + message: + 'There should be no empty lines between this single-line import and the single-line import that follows it', + fix: removeNewLineAfterImport(context, currentImport, previousImport) }); + + } + } + } + + previousImport = currentImport; + }); +} + +function getAlphabetizeConfig(options) { + var alphabetize = options.alphabetize || {}; + var order = alphabetize.order || 'ignore'; + var orderImportKind = alphabetize.orderImportKind || 'ignore'; + var caseInsensitive = alphabetize.caseInsensitive || false; + + return { order: order, orderImportKind: orderImportKind, caseInsensitive: caseInsensitive }; +} + +// TODO, semver-major: Change the default of "distinctGroup" from true to false +var defaultDistinctGroup = true; + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Enforce a convention in module import order.', + url: (0, _docsUrl2['default'])('order') }, + + + fixable: 'code', + schema: [ + { + type: 'object', + properties: { + groups: { + type: 'array', + uniqueItems: true, + items: { + oneOf: [ + { 'enum': types }, + { + type: 'array', + uniqueItems: true, + items: { 'enum': types } }] } }, + + + + + pathGroupsExcludedImportTypes: { + type: 'array' }, + + distinctGroup: { + type: 'boolean', + 'default': defaultDistinctGroup }, + + pathGroups: { + type: 'array', + items: { + type: 'object', + properties: { + pattern: { + type: 'string' }, + + patternOptions: { + type: 'object' }, + + group: { + type: 'string', + 'enum': types }, + + position: { + type: 'string', + 'enum': ['after', 'before'] } }, + + + additionalProperties: false, + required: ['pattern', 'group'] } }, + + + 'newlines-between': { + 'enum': [ + 'ignore', + 'always', + 'always-and-inside-groups', + 'never'] }, + + + 'newlines-between-types': { + 'enum': [ + 'ignore', + 'always', + 'always-and-inside-groups', + 'never'] }, + + + consolidateIslands: { + 'enum': [ + 'inside-groups', + 'never'] }, + + + sortTypesGroup: { + type: 'boolean', + 'default': false }, + + named: { + 'default': false, + oneOf: [{ + type: 'boolean' }, + { + type: 'object', + properties: { + enabled: { type: 'boolean' }, + 'import': { type: 'boolean' }, + 'export': { type: 'boolean' }, + require: { type: 'boolean' }, + cjsExports: { type: 'boolean' }, + types: { + type: 'string', + 'enum': [ + 'mixed', + 'types-first', + 'types-last'] } }, + + + + additionalProperties: false }] }, + + + alphabetize: { + type: 'object', + properties: { + caseInsensitive: { + type: 'boolean', + 'default': false }, + + order: { + 'enum': ['ignore', 'asc', 'desc'], + 'default': 'ignore' }, + + orderImportKind: { + 'enum': ['ignore', 'asc', 'desc'], + 'default': 'ignore' } }, + + + additionalProperties: false }, + + warnOnUnassignedImports: { + type: 'boolean', + 'default': false } }, + + + additionalProperties: false, + dependencies: { + sortTypesGroup: { + oneOf: [ + { + // When sortTypesGroup is true, groups must NOT be an array that does not contain 'type' + properties: { + sortTypesGroup: { 'enum': [true] }, + groups: { + not: { + type: 'array', + uniqueItems: true, + items: { + oneOf: [ + { 'enum': types.filter(function (t) {return t !== 'type';}) }, + { + type: 'array', + uniqueItems: true, + items: { 'enum': types.filter(function (t) {return t !== 'type';}) } }] } } } }, + + + + + + + required: ['groups'] }, + + { + properties: { + sortTypesGroup: { 'enum': [false] } } }] }, + + + + + 'newlines-between-types': { + properties: { + sortTypesGroup: { 'enum': [true] } }, + + required: ['sortTypesGroup'] }, + + consolidateIslands: { + oneOf: [ + { + properties: { + consolidateIslands: { 'enum': ['inside-groups'] } }, + + anyOf: [ + { + properties: { + 'newlines-between': { 'enum': ['always-and-inside-groups'] } }, + + required: ['newlines-between'] }, + + { + properties: { + 'newlines-between-types': { 'enum': ['always-and-inside-groups'] } }, + + required: ['newlines-between-types'] }] }, + + + + { + properties: { + consolidateIslands: { 'enum': ['never'] } } }] } } }] }, + + + + + + + + + + create: function () {function create(context) { + var options = context.options[0] || {}; + var newlinesBetweenImports = options['newlines-between'] || 'ignore'; + var newlinesBetweenTypeOnlyImports = options['newlines-between-types'] || newlinesBetweenImports; + var pathGroupsExcludedImportTypes = new Set(options.pathGroupsExcludedImportTypes || ['builtin', 'external', 'object']); + var sortTypesGroup = options.sortTypesGroup; + var consolidateIslands = options.consolidateIslands || 'never'; + + var named = Object.assign({ + types: 'mixed' }, + _typeof(options.named) === 'object' ? Object.assign({}, + options.named, { + 'import': 'import' in options.named ? options.named['import'] : options.named.enabled, + 'export': 'export' in options.named ? options.named['export'] : options.named.enabled, + require: 'require' in options.named ? options.named.require : options.named.enabled, + cjsExports: 'cjsExports' in options.named ? options.named.cjsExports : options.named.enabled }) : + { + 'import': options.named, + 'export': options.named, + require: options.named, + cjsExports: options.named }); + + + + var namedGroups = named.types === 'mixed' ? [] : named.types === 'types-last' ? ['value'] : ['type']; + var alphabetize = getAlphabetizeConfig(options); + var distinctGroup = options.distinctGroup == null ? defaultDistinctGroup : !!options.distinctGroup; + var ranks = void 0; + + try {var _convertPathGroupsFor = + convertPathGroupsForRanks(options.pathGroups || []),pathGroups = _convertPathGroupsFor.pathGroups,maxPosition = _convertPathGroupsFor.maxPosition;var _convertGroupsToRanks = + convertGroupsToRanks(options.groups || defaultGroups),groups = _convertGroupsToRanks.groups,omittedTypes = _convertGroupsToRanks.omittedTypes; + ranks = { + groups: groups, + omittedTypes: omittedTypes, + pathGroups: pathGroups, + maxPosition: maxPosition }; + + } catch (error) { + // Malformed configuration + return { + Program: function () {function Program(node) { + context.report(node, error.message); + }return Program;}() }; + + } + var importMap = new Map(); + var exportMap = new Map(); + + var isTypeGroupInGroups = ranks.omittedTypes.indexOf('type') === -1; + var isSortingTypesGroup = isTypeGroupInGroups && sortTypesGroup; + + function getBlockImports(node) { + if (!importMap.has(node)) { + importMap.set(node, []); + } + return importMap.get(node); + } + + function getBlockExports(node) { + if (!exportMap.has(node)) { + exportMap.set(node, []); + } + return exportMap.get(node); + } + + function makeNamedOrderReport(context, namedImports) { + if (namedImports.length > 1) { + var imports = namedImports.map( + function (namedImport) { + var kind = namedImport.kind || 'value'; + var rank = namedGroups.findIndex(function (entry) {return [].concat(entry).indexOf(kind) > -1;}); + + return Object.assign({ + displayName: namedImport.value, + rank: rank === -1 ? namedGroups.length : rank }, + namedImport, { + value: String(namedImport.value) + ':' + String(namedImport.alias || '') }); + + }); + + if (alphabetize.order !== 'ignore') { + mutateRanksToAlphabetize(imports, alphabetize); + } + + makeOutOfOrderReport(context, imports, categories.named); + } + } + + return Object.assign({ + ImportDeclaration: function () {function ImportDeclaration(node) { + // Ignoring unassigned imports unless warnOnUnassignedImports is set + if (node.specifiers.length || options.warnOnUnassignedImports) { + var name = node.source.value; + registerNode( + context, + { + node: node, + value: name, + displayName: name, + type: 'import' }, + + ranks, + getBlockImports(node.parent), + pathGroupsExcludedImportTypes, + isSortingTypesGroup); + + + if (named['import']) { + makeNamedOrderReport( + context, + node.specifiers.filter( + function (specifier) {return specifier.type === 'ImportSpecifier';}).map( + function (specifier) {return Object.assign({ + node: specifier, + value: specifier.imported.name, + type: 'import', + kind: specifier.importKind }, + specifier.local.range[0] !== specifier.imported.range[0] && { + alias: specifier.local.name });})); + + + + + } + } + }return ImportDeclaration;}(), + TSImportEqualsDeclaration: function () {function TSImportEqualsDeclaration(node) { + // skip "export import"s + if (node.isExport) { + return; + } + + var displayName = void 0; + var value = void 0; + var type = void 0; + if (node.moduleReference.type === 'TSExternalModuleReference') { + value = node.moduleReference.expression.value; + displayName = value; + type = 'import'; + } else { + value = ''; + displayName = (0, _contextCompat.getSourceCode)(context).getText(node.moduleReference); + type = 'import:object'; + } + + registerNode( + context, + { + node: node, + value: value, + displayName: displayName, + type: type }, + + ranks, + getBlockImports(node.parent), + pathGroupsExcludedImportTypes, + isSortingTypesGroup); + + }return TSImportEqualsDeclaration;}(), + CallExpression: function () {function CallExpression(node) { + if (!(0, _staticRequire2['default'])(node)) { + return; + } + var block = getRequireBlock(node); + if (!block) { + return; + } + var name = node.arguments[0].value; + registerNode( + context, + { + node: node, + value: name, + displayName: name, + type: 'require' }, + + ranks, + getBlockImports(block), + pathGroupsExcludedImportTypes, + isSortingTypesGroup); + + }return CallExpression;}() }, + named.require && { + VariableDeclarator: function () {function VariableDeclarator(node) { + if (node.id.type === 'ObjectPattern' && isRequireExpression(node.init)) { + for (var i = 0; i < node.id.properties.length; i++) { + if ( + node.id.properties[i].key.type !== 'Identifier' || + node.id.properties[i].value.type !== 'Identifier') + { + return; + } + } + makeNamedOrderReport( + context, + node.id.properties.map(function (prop) {return Object.assign({ + node: prop, + value: prop.key.name, + type: 'require' }, + prop.key.range[0] !== prop.value.range[0] && { + alias: prop.value.name });})); + + + + } + }return VariableDeclarator;}() }, + + named['export'] && { + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + makeNamedOrderReport( + context, + node.specifiers.map(function (specifier) {return Object.assign({ + node: specifier, + value: specifier.local.name, + type: 'export', + kind: specifier.exportKind }, + specifier.local.range[0] !== specifier.exported.range[0] && { + alias: specifier.exported.name });})); + + + + }return ExportNamedDeclaration;}() }, + + named.cjsExports && { + AssignmentExpression: function () {function AssignmentExpression(node) { + if (node.parent.type === 'ExpressionStatement') { + if (isCJSExports(context, node.left)) { + if (node.right.type === 'ObjectExpression') { + for (var i = 0; i < node.right.properties.length; i++) { + if ( + !node.right.properties[i].key || + node.right.properties[i].key.type !== 'Identifier' || + !node.right.properties[i].value || + node.right.properties[i].value.type !== 'Identifier') + { + return; + } + } + + makeNamedOrderReport( + context, + node.right.properties.map(function (prop) {return Object.assign({ + node: prop, + value: prop.key.name, + type: 'export' }, + prop.key.range[0] !== prop.value.range[0] && { + alias: prop.value.name });})); + + + + } + } else { + var nameParts = getNamedCJSExports(context, node.left); + if (nameParts && nameParts.length > 0) { + var name = nameParts.join('.'); + getBlockExports(node.parent.parent).push({ + node: node, + value: name, + displayName: name, + type: 'export', + rank: 0 }); + + } + } + } + }return AssignmentExpression;}() }, { + + 'Program:exit': function () {function ProgramExit() { + importMap.forEach(function (imported) { + if (newlinesBetweenImports !== 'ignore' || newlinesBetweenTypeOnlyImports !== 'ignore') { + makeNewlinesBetweenReport( + context, + imported, + newlinesBetweenImports, + newlinesBetweenTypeOnlyImports, + distinctGroup, + isSortingTypesGroup, + consolidateIslands === 'inside-groups' && ( + newlinesBetweenImports === 'always-and-inside-groups' || + newlinesBetweenTypeOnlyImports === 'always-and-inside-groups')); + + } + + if (alphabetize.order !== 'ignore') { + mutateRanksToAlphabetize(imported, alphabetize); + } + + makeOutOfOrderReport(context, imported, categories['import']); + }); + + exportMap.forEach(function (exported) { + if (alphabetize.order !== 'ignore') { + mutateRanksToAlphabetize(exported, alphabetize); + makeOutOfOrderReport(context, exported, categories.exports); + } + }); + + importMap.clear(); + exportMap.clear(); + }return ProgramExit;}() }); + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9vcmRlci5qcyJdLCJuYW1lcyI6WyJjYXRlZ29yaWVzIiwibmFtZWQiLCJleHBvcnRzIiwiZGVmYXVsdEdyb3VwcyIsInJldmVyc2UiLCJhcnJheSIsIm1hcCIsInYiLCJyYW5rIiwiZ2V0VG9rZW5zT3JDb21tZW50c0FmdGVyIiwic291cmNlQ29kZSIsIm5vZGUiLCJjb3VudCIsImN1cnJlbnROb2RlT3JUb2tlbiIsInJlc3VsdCIsImkiLCJnZXRUb2tlbk9yQ29tbWVudEFmdGVyIiwicHVzaCIsImdldFRva2Vuc09yQ29tbWVudHNCZWZvcmUiLCJnZXRUb2tlbk9yQ29tbWVudEJlZm9yZSIsInRha2VUb2tlbnNBZnRlcldoaWxlIiwiY29uZGl0aW9uIiwidG9rZW5zIiwibGVuZ3RoIiwidGFrZVRva2Vuc0JlZm9yZVdoaWxlIiwiZmluZE91dE9mT3JkZXIiLCJpbXBvcnRlZCIsIm1heFNlZW5SYW5rTm9kZSIsImZpbHRlciIsImltcG9ydGVkTW9kdWxlIiwicmVzIiwiZmluZFJvb3ROb2RlIiwicGFyZW50IiwiYm9keSIsImNvbW1lbnRPblNhbWVMaW5lQXMiLCJ0b2tlbiIsInR5cGUiLCJsb2MiLCJzdGFydCIsImxpbmUiLCJlbmQiLCJmaW5kRW5kT2ZMaW5lV2l0aENvbW1lbnRzIiwidG9rZW5zVG9FbmRPZkxpbmUiLCJlbmRPZlRva2VucyIsInJhbmdlIiwidGV4dCIsImZpbmRTdGFydE9mTGluZ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XhhYmxlOiAnY29kZScsXG4gICAgc2NoZW1hOiBbXG4gICAgICB7XG4gICAgICAgIHR5cGU6ICdvYmplY3QnLFxuICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgZ3JvdXBzOiB7XG4gICAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgICAgdW5pcXVlSXRlbXM6IHRydWUsXG4gICAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgICBvbmVPZjogW1xuICAgICAgICAgICAgICAgIHsgZW51bTogdHlwZXMgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgICAgICAgICAgdW5pcXVlSXRlbXM6IHRydWUsXG4gICAgICAgICAgICAgICAgICBpdGVtczogeyBlbnVtOiB0eXBlcyB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0sXG4gICAgICAgICAgcGF0aEdyb3Vwc0V4Y2x1ZGVkSW1wb3J0VHlwZXM6IHtcbiAgICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBkaXN0aW5jdEdyb3VwOiB7XG4gICAgICAgICAgICB0eXBlOiAnYm9vbGVhbicsXG4gICAgICAgICAgICBkZWZhdWx0OiBkZWZhdWx0RGlzdGluY3RHcm91cCxcbiAgICAgICAgICB9LFxuICAgICAgICAgIHBhdGhHcm91cHM6IHtcbiAgICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgICB0eXBlOiAnb2JqZWN0JyxcbiAgICAgICAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgICAgICAgIHBhdHRlcm46IHtcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdzdHJpbmcnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcGF0dGVybk9wdGlvbnM6IHtcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdvYmplY3QnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgZ3JvdXA6IHtcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdzdHJpbmcnLFxuICAgICAgICAgICAgICAgICAgZW51bTogdHlwZXMsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgICAgICAgICAgdHlwZTogJ3N0cmluZycsXG4gICAgICAgICAgICAgICAgICBlbnVtOiBbJ2FmdGVyJywgJ2JlZm9yZSddLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGFkZGl0aW9uYWxQcm9wZXJ0aWVzOiBmYWxzZSxcbiAgICAgICAgICAgICAgcmVxdWlyZWQ6IFsncGF0dGVybicsICdncm91cCddLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICAgICduZXdsaW5lcy1iZXR3ZWVuJzoge1xuICAgICAgICAgICAgZW51bTogW1xuICAgICAgICAgICAgICAnaWdub3JlJyxcbiAgICAgICAgICAgICAgJ2Fsd2F5cycsXG4gICAgICAgICAgICAgICdhbHdheXMtYW5kLWluc2lkZS1ncm91cHMnLFxuICAgICAgICAgICAgICAnbmV2ZXInLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICB9LFxuICAgICAgICAgICduZXdsaW5lcy1iZXR3ZWVuLXR5cGVzJzoge1xuICAgICAgICAgICAgZW51bTogW1xuICAgICAgICAgICAgICAnaWdub3JlJyxcbiAgICAgICAgICAgICAgJ2Fsd2F5cycsXG4gICAgICAgICAgICAgICdhbHdheXMtYW5kLWluc2lkZS1ncm91cHMnLFxuICAgICAgICAgICAgICAnbmV2ZXInLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNvbnNvbGlkYXRlSXNsYW5kczoge1xuICAgICAgICAgICAgZW51bTogW1xuICAgICAgICAgICAgICAnaW5zaWRlLWdyb3VwcycsXG4gICAgICAgICAgICAgICduZXZlcicsXG4gICAgICAgICAgICBdLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgc29ydFR5cGVzR3JvdXA6IHtcbiAgICAgICAgICAgIHR5cGU6ICdib29sZWFuJyxcbiAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgbmFtZWQ6IHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlLFxuICAgICAgICAgICAgb25lT2Y6IFt7XG4gICAgICAgICAgICAgIHR5cGU6ICdib29sZWFuJyxcbiAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgdHlwZTogJ29iamVjdCcsXG4gICAgICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgICAgICBlbmFibGVkOiB7IHR5cGU6ICdib29sZWFuJyB9LFxuICAgICAgICAgICAgICAgIGltcG9ydDogeyB0eXBlOiAnYm9vbGVhbicgfSxcbiAgICAgICAgICAgICAgICBleHBvcnQ6IHsgdHlwZTogJ2Jvb2xlYW4nIH0sXG4gICAgICAgICAgICAgICAgcmVxdWlyZTogeyB0eXBlOiAnYm9vbGVhbicgfSxcbiAgICAgICAgICAgICAgICBjanNFeHBvcnRzOiB7IHR5cGU6ICdib29sZWFuJyB9LFxuICAgICAgICAgICAgICAgIHR5cGVzOiB7XG4gICAgICAgICAgICAgICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICAgICAgICAgICAgICAgIGVudW06IFtcbiAgICAgICAgICAgICAgICAgICAgJ21peGVkJyxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGVzLWZpcnN0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGVzLWxhc3QnLFxuICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBhZGRpdGlvbmFsUHJvcGVydGllczogZmFsc2UsXG4gICAgICAgICAgICB9XSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGFscGhhYmV0aXplOiB7XG4gICAgICAgICAgICB0eXBlOiAnb2JqZWN0JyxcbiAgICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgICAgY2FzZUluc2Vuc2l0aXZlOiB7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2Jvb2xlYW4nLFxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBvcmRlcjoge1xuICAgICAgICAgICAgICAgIGVudW06IFsnaWdub3JlJywgJ2FzYycsICdkZXNjJ10sXG4gICAgICAgICAgICAgICAgZGVmYXVsdDogJ2lnbm9yZScsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIG9yZGVySW1wb3J0S2luZDoge1xuICAgICAgICAgICAgICAgIGVudW06IFsnaWdub3JlJywgJ2FzYycsICdkZXNjJ10sXG4gICAgICAgICAgICAgICAgZGVmYXVsdDogJ2lnbm9yZScsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWRkaXRpb25hbFByb3BlcnRpZXM6IGZhbHNlLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgd2Fybk9uVW5hc3NpZ25lZEltcG9ydHM6IHtcbiAgICAgICAgICAgIHR5cGU6ICdib29sZWFuJyxcbiAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlLFxuICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIGFkZGl0aW9uYWxQcm9wZXJ0aWVzOiBmYWxzZSxcbiAgICAgICAgZGVwZW5kZW5jaWVzOiB7XG4gICAgICAgICAgc29ydFR5cGVzR3JvdXA6IHtcbiAgICAgICAgICAgIG9uZU9mOiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAvLyBXaGVuIHNvcnRUeXBlc0dyb3VwIGlzIHRydWUsIGdyb3VwcyBtdXN0IE5PVCBiZSBhbiBhcnJheSB0aGF0IGRvZXMgbm90IGNvbnRhaW4gJ3R5cGUnXG4gICAgICAgICAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgICAgICAgICAgc29ydFR5cGVzR3JvdXA6IHsgZW51bTogW3RydWVdIH0sXG4gICAgICAgICAgICAgICAgICBncm91cHM6IHtcbiAgICAgICAgICAgICAgICAgICAgbm90OiB7XG4gICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICAgICAgICAgICAgICB1bmlxdWVJdGVtczogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgb25lT2Y6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgeyBlbnVtOiB0eXBlcy5maWx0ZXIoKHQpID0+IHQgIT09ICd0eXBlJykgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pcXVlSXRlbXM6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXM6IHsgZW51bTogdHlwZXMuZmlsdGVyKCh0KSA9PiB0ICE9PSAndHlwZScpIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcmVxdWlyZWQ6IFsnZ3JvdXBzJ10sXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgICAgICAgICBzb3J0VHlwZXNHcm91cDogeyBlbnVtOiBbZmFsc2VdIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgfSxcbiAgICAgICAgICAnbmV3bGluZXMtYmV0d2Vlbi10eXBlcyc6IHtcbiAgICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgICAgc29ydFR5cGVzR3JvdXA6IHsgZW51bTogW3RydWVdIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVxdWlyZWQ6IFsnc29ydFR5cGVzR3JvdXAnXSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNvbnNvbGlkYXRlSXNsYW5kczoge1xuICAgICAgICAgICAgb25lT2Y6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGlkYXRlSXNsYW5kczogeyBlbnVtOiBbJ2luc2lkZS1ncm91cHMnXSB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgYW55T2Y6IFtcbiAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgICAgICAgICAgICAgICduZXdsaW5lcy1iZXR3ZWVuJzogeyBlbnVtOiBbJ2Fsd2F5cy1hbmQtaW5zaWRlLWdyb3VwcyddIH0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmVkOiBbJ25ld2xpbmVzLWJldHdlZW4nXSxcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAnbmV3bGluZXMtYmV0d2Vlbi10eXBlcyc6IHsgZW51bTogWydhbHdheXMtYW5kLWluc2lkZS1ncm91cHMnXSB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlZDogWyduZXdsaW5lcy1iZXR3ZWVuLXR5cGVzJ10sXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xpZGF0ZUlzbGFuZHM6IHsgZW51bTogWyduZXZlciddIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgIH0sXG4gICAgXSxcbiAgfSxcblxuICBjcmVhdGUoY29udGV4dCkge1xuICAgIGNvbnN0IG9wdGlvbnMgPSBjb250ZXh0Lm9wdGlvbnNbMF0gfHwge307XG4gICAgY29uc3QgbmV3bGluZXNCZXR3ZWVuSW1wb3J0cyA9IG9wdGlvbnNbJ25ld2xpbmVzLWJldHdlZW4nXSB8fCAnaWdub3JlJztcbiAgICBjb25zdCBuZXdsaW5lc0JldHdlZW5UeXBlT25seUltcG9ydHMgPSBvcHRpb25zWyduZXdsaW5lcy1iZXR3ZWVuLXR5cGVzJ10gfHwgbmV3bGluZXNCZXR3ZWVuSW1wb3J0cztcbiAgICBjb25zdCBwYXRoR3JvdXBzRXhjbHVkZWRJbXBvcnRUeXBlcyA9IG5ldyBTZXQob3B0aW9ucy5wYXRoR3JvdXBzRXhjbHVkZWRJbXBvcnRUeXBlcyB8fCBbJ2J1aWx0aW4nLCAnZXh0ZXJuYWwnLCAnb2JqZWN0J10pO1xuICAgIGNvbnN0IHNvcnRUeXBlc0dyb3VwID0gb3B0aW9ucy5zb3J0VHlwZXNHcm91cDtcbiAgICBjb25zdCBjb25zb2xpZGF0ZUl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W1lZEdyb3Vwcy5sZW5ndGggOiByYW5rLFxuICAgICAgICAgICAgICAuLi5uYW1lZEltcG9ydCxcbiAgICAgICAgICAgICAgdmFsdWU6IGAke25hbWVkSW1wb3J0LnZhbHVlfToke25hbWVkSW1wb3J0LmFsaWFzIHx8ICcnfWAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChhbHBoYWJldGl6ZS5vcmRlciAhPT0gJ2lnbm9yZScpIHtcbiAgICAgICAgICBtdXRhdGVSYW5rc1RvQWxwaGFiZXRpemUoaW1wb3J0cywgYWxwaGFiZXRpemUpO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFrZU91dE9mT3JkZXJSZXBvcnQoY29udGV4dCwgaW1wb3J0cywgY2F0ZWdvcmllcy5uYW1lZCk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHtcbiAgICAgIEltcG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgLy8gSWdub3JpbmcgdW5hc3NpZ25lZCBpbXBvcnRzIHVubGVzcyB3YXJuT25VbmFzc2lnbmVkSW1wb3J0cyBpcyBzZXRcbiAgICAgICAgaWYgKG5vZGUuc3BlY2lmaWVycy5sZW5ndGggfHwgb3B0aW9ucy53YXJuT25VbmFzc2lnbmVkSW1wb3J0cykge1xuICAgICAgICAgIGNvbnN0IG5hbWUgPSBub2RlLnNvdXJjZS52YWx1ZTtcbiAgICAgICAgICByZWdpc3Rlck5vZGUoXG4gICAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICB2YWx1ZTogbmFtZSxcbiAgICAgICAgICAgICAgZGlzcGxheU5hbWU6IG5hbWUsXG4gICAgICAgICAgICAgIHR5cGU6ICdpbXBvcnQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJhbmtzLFxuICAgICAgICAgICAgZ2V0QmxvY2tJbXBvcnRzKG5vZGUucGFyZW50KSxcbiAgICAgICAgICAgIHBhdGhHcm91cHNFeGNsdWRlZEltcG9ydFR5cGVzLFxuICAgICAgICAgICAgaXNTb3J0aW5nVHlwZXNHcm91cCxcbiAgICAgICAgICApO1xuXG4gICAgICAgICAgaWYgKG5hbWVkLmltcG9ydCkge1xuICAgICAgICAgICAgbWFrZU5hbWVkT3JkZXJSZXBvcnQoXG4gICAgICAgICAgICAgIGNvbnRleHQsXG4gICAgICAgICAgICAgIG5vZGUuc3BlY2lmaWVycy5maWx0ZXIoXG4gICAgICAgICAgICAgICAgKHNwZWNpZmllcikgPT4gc3BlY2lmaWVyLnR5cGUgPT09ICdJbXBvcnRTcGVjaWZpZXInKS5tYXAoXG4gICAgICAgICAgICAgICAgKHNwZWNpZmllcikgPT4gKHtcbiAgICAgICAgICAgICAgICAgIG5vZGU6IHNwZWNpZmllcixcbiAgICAgICAgICAgICAgICAgIHZhbHVlOiBzcGVjaWZpZXIuaW1wb3J0ZWQubmFtZSxcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdpbXBvcnQnLFxuICAgICAgICAgICAgICAgICAga2luZDogc3BlY2lmaWVyLmltcG9ydEtpbmQsXG4gICAgICAgICAgICAgICAgICAuLi5zcGVjaWZpZXIubG9jYWwucmFuZ2VbMF0gIT09IHNwZWNpZmllci5pbXBvcnRlZC5yYW5nZVswXSAmJiB7XG4gICAgICAgICAgICAgICAgICAgIGFsaWFzOiBzcGVjaWZpZXIubG9jYWwubmFtZSxcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFRTSW1wb3J0RXF1YWxzRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICAvLyBza2lwIFwiZXhwb3J0IGltcG9ydFwic1xuICAgICAgICBpZiAobm9kZS5pc0V4cG9ydCkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBkaXNwbGF5TmFtZTtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICBsZXQgdHlwZTtcbiAgICAgICAgaWYgKG5vZGUubW9kdWxlUmVmZXJlbmNlLnR5cGUgPT09ICdUU0V4dGVybmFsTW9kdWxlUmVmZXJlbmNlJykge1xuICAgICAgICAgIHZhbHVlID0gbm9kZS5tb2R1bGVSZWZlcmVuY2UuZXhwcmVzc2lvbi52YWx1ZTtcbiAgICAgICAgICBkaXNwbGF5TmFtZSA9IHZhbHVlO1xuICAgICAgICAgIHR5cGUgPSAnaW1wb3J0JztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YWx1ZSA9ICcnO1xuICAgICAgICAgIGRpc3BsYXlOYW1lID0gZ2V0U291cmNlQ29kZShjb250ZXh0KS5nZXRUZXh0KG5vZGUubW9kdWxlUmVmZXJlbmNlKTtcbiAgICAgICAgICB0eXBlID0gJ2ltcG9ydDpvYmplY3QnO1xuICAgICAgICB9XG5cbiAgICAgICAgcmVnaXN0ZXJOb2RlKFxuICAgICAgICAgIGNvbnRleHQsXG4gICAgICAgICAge1xuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIHZhbHVlLFxuICAgICAgICAgICAgZGlzcGxheU5hbWUsXG4gICAgICAgICAgICB0eXBlLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgcmFua3MsXG4gICAgICAgICAgZ2V0QmxvY2tJbXBvcnRzKG5vZGUucGFyZW50KSxcbiAgICAgICAgICBwYXRoR3JvdXBzRXhjbHVkZWRJbXBvcnRUeXBlcyxcbiAgICAgICAgICBpc1NvcnRpbmdUeXBlc0dyb3VwLFxuICAgICAgICApO1xuICAgICAgfSxcbiAgICAgIENhbGxFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKCFpc1N0YXRpY1JlcXVpcmUobm9kZSkpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgYmxvY2sgPSBnZXRSZXF1aXJlQmxvY2sobm9kZSk7XG4gICAgICAgIGlmICghYmxvY2spIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgbmFtZSA9IG5vZGUuYXJndW1lbnRzWzBdLnZhbHVlO1xuICAgICAgICByZWdpc3Rlck5vZGUoXG4gICAgICAgICAgY29udGV4dCxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgdmFsdWU6IG5hbWUsXG4gICAgICAgICAgICBkaXNwbGF5TmFtZTogbmFtZSxcbiAgICAgICAgICAgIHR5cGU6ICdyZXF1aXJlJyxcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJhbmtzLFxuICAgICAgICAgIGdldEJsb2NrSW1wb3J0cyhibG9jayksXG4gICAgICAgICAgcGF0aEdyb3Vwc0V4Y2x1ZGVkSW1wb3J0VHlwZXMsXG4gICAgICAgICAgaXNTb3J0aW5nVHlwZXNHcm91cCxcbiAgICAgICAgKTtcbiAgICAgIH0sXG4gICAgICAuLi5uYW1lZC5yZXF1aXJlICYmIHtcbiAgICAgICAgVmFyaWFibGVEZWNsYXJhdG9yKG5vZGUpIHtcbiAgICAgICAgICBpZiAobm9kZS5pZC50eXBlID09PSAnT2JqZWN0UGF0dGVybicgJiYgaXNSZXF1aXJlRXhwcmVzc2lvbihub2RlLmluaXQpKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGUuaWQucHJvcGVydGllcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgbm9kZS5pZC5wcm9wZXJ0aWVzW2ldLmtleS50eXBlICE9PSAnSWRlbnRpZmllcidcbiAgICAgICAgICAgICAgICB8fCBub2RlLmlkLnByb3BlcnRpZXNbaV0udmFsdWUudHlwZSAhPT0gJ0lkZW50aWZpZXInXG4gICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWFrZU5hbWVkT3JkZXJSZXBvcnQoXG4gICAgICAgICAgICAgIGNvbnRleHQsXG4gICAgICAgICAgICAgIG5vZGUuaWQucHJvcGVydGllcy5tYXAoKHByb3ApID0+ICh7XG4gICAgICAgICAgICAgICAgbm9kZTogcHJvcCxcbiAgICAgICAgICAgICAgICB2YWx1ZTogcHJvcC5rZXkubmFtZSxcbiAgICAgICAgICAgICAgICB0eXBlOiAncmVxdWlyZScsXG4gICAgICAgICAgICAgICAgLi4ucHJvcC5rZXkucmFuZ2VbMF0gIT09IHByb3AudmFsdWUucmFuZ2VbMF0gJiYge1xuICAgICAgICAgICAgICAgICAgYWxpYXM6IHByb3AudmFsdWUubmFtZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9KSksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgIH0sXG4gICAgICAuLi5uYW1lZC5leHBvcnQgJiYge1xuICAgICAgICBFeHBvcnROYW1lZERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgICBtYWtlTmFtZWRPcmRlclJlcG9ydChcbiAgICAgICAgICAgIGNvbnRleHQsXG4gICAgICAgICAgICBub2RlLnNwZWNpZmllcnMubWFwKChzcGVjaWZpZXIpID0+ICh7XG4gICAgICAgICAgICAgIG5vZGU6IHNwZWNpZmllcixcbiAgICAgICAgICAgICAgdmFsdWU6IHNwZWNpZmllci5sb2NhbC5uYW1lLFxuICAgICAgICAgICAgICB0eXBlOiAnZXhwb3J0JyxcbiAgICAgICAgICAgICAga2luZDogc3BlY2lmaWVyLmV4cG9ydEtpbmQsXG4gICAgICAgICAgICAgIC4uLnNwZWNpZmllci5sb2NhbC5yYW5nZVswXSAhPT0gc3BlY2lmaWVyLmV4cG9ydGVkLnJhbmdlWzBdICYmIHtcbiAgICAgICAgICAgICAgICBhbGlhczogc3BlY2lmaWVyLmV4cG9ydGVkLm5hbWUsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSksXG4gICAgICAgICAgKTtcbiAgICAgICAgfSxcbiAgICAgIH0sXG4gICAgICAuLi5uYW1lZC5janNFeHBvcnRzICYmIHtcbiAgICAgICAgQXNzaWdubWVudEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICAgIGlmIChub2RlLnBhcmVudC50eXBlID09PSAnRXhwcmVzc2lvblN0YXRlbWVudCcpIHtcbiAgICAgICAgICAgIGlmIChpc0NKU0V4cG9ydHMoY29udGV4dCwgbm9kZS5sZWZ0KSkge1xuICAgICAgICAgICAgICBpZiAobm9kZS5yaWdodC50eXBlID09PSAnT2JqZWN0RXhwcmVzc2lvbicpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGUucmlnaHQucHJvcGVydGllcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAhbm9kZS5yaWdodC5wcm9wZXJ0aWVzW2ldLmtleVxuICAgICAgICAgICAgICAgICAgICB8fCBub2RlLnJpZ2h0LnByb3BlcnRpZXNbaV0ua2V5LnR5cGUgIT09ICdJZGVudGlmaWVyJ1xuICAgICAgICAgICAgICAgICAgICB8fCAhbm9kZS5yaWdodC5wcm9wZXJ0aWVzW2ldLnZhbHVlXG4gICAgICAgICAgICAgICAgICAgIHx8IG5vZGUucmlnaHQucHJvcGVydGllc1tpXS52YWx1ZS50eXBlICE9PSAnSWRlbnRpZmllcidcbiAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgbWFrZU5hbWVkT3JkZXJSZXBvcnQoXG4gICAgICAgICAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgICAgICAgICAgbm9kZS5yaWdodC5wcm9wZXJ0aWVzLm1hcCgocHJvcCkgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZTogcHJvcCxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHByb3Aua2V5Lm5hbWUsXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6ICdleHBvcnQnLFxuICAgICAgICAgICAgICAgICAgICAuLi5wcm9wLmtleS5yYW5nZVswXSAhPT0gcHJvcC52YWx1ZS5yYW5nZVswXSAmJiB7XG4gICAgICAgICAgICAgICAgICAgICAgYWxpYXM6IHByb3AudmFsdWUubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIH0pKSxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb25zdCBuYW1lUGFydHMgPSBnZXROYW1lZENKU0V4cG9ydHMoY29udGV4dCwgbm9kZS5sZWZ0KTtcbiAgICAgICAgICAgICAgaWYgKG5hbWVQYXJ0cyAmJiBuYW1lUGFydHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IG5hbWUgPSBuYW1lUGFydHMuam9pbignLicpO1xuICAgICAgICAgICAgICAgIGdldEJsb2NrRXhwb3J0cyhub2RlLnBhcmVudC5wYXJlbnQpLnB1c2goe1xuICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgIHZhbHVlOiBuYW1lLFxuICAgICAgICAgICAgICAgICAgZGlzcGxheU5hbWU6IG5hbWUsXG4gICAgICAgICAgICAgICAgICB0eXBlOiAnZXhwb3J0JyxcbiAgICAgICAgICAgICAgICAgIHJhbms6IDAsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICB9LFxuICAgICAgJ1By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k7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGV4cG9ydE1hcC5mb3JFYWNoKChleHBvcnRlZCkgPT4ge1xuICAgICAgICAgIGlmIChhbHBoYWJldGl6ZS5vcmRlciAhPT0gJ2lnbm9yZScpIHtcbiAgICAgICAgICAgIG11dGF0ZVJhbmtzVG9BbHBoYWJldGl6ZShleHBvcnRlZCwgYWxwaGFiZXRpemUpO1xuICAgICAgICAgICAgbWFrZU91dE9mT3JkZXJSZXBvcnQoY29udGV4dCwgZXhwb3J0ZWQsIGNhdGVnb3JpZXMuZXhwb3J0cyk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICBpbXBvcnRNYXAuY2xlYXIoKTtcbiAgICAgICAgZXhwb3J0TWFwLmNsZWFyKCk7XG4gICAgICB9LFxuICAgIH07XG4gIH0sXG59O1xuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js b/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js new file mode 100644 index 0000000000000000000000000000000000000000..a4d827977a55893bda8c501c1e5cd3925f05986a --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js @@ -0,0 +1,116 @@ +'use strict'; + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +var SINGLE_EXPORT_ERROR_MESSAGE = 'Prefer default export on a file with single export.'; +var ANY_EXPORT_ERROR_MESSAGE = 'Prefer default export to be present on every file that has export.'; + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Style guide', + description: 'Prefer a default export if module exports a single name or multiple names.', + url: (0, _docsUrl2['default'])('prefer-default-export') }, + + schema: [{ + type: 'object', + properties: { + target: { + type: 'string', + 'enum': ['single', 'any'], + 'default': 'single' } }, + + + additionalProperties: false }] }, + + + + create: function () {function create(context) { + var specifierExportCount = 0; + var hasDefaultExport = false; + var hasStarExport = false; + var hasTypeExport = false; + var namedExportNode = null; + // get options. by default we look into files with single export + var _ref = context.options[0] || {},_ref$target = _ref.target,target = _ref$target === undefined ? 'single' : _ref$target; + function captureDeclaration(identifierOrPattern) { + if (identifierOrPattern && identifierOrPattern.type === 'ObjectPattern') { + // recursively capture + identifierOrPattern.properties. + forEach(function (property) { + captureDeclaration(property.value); + }); + } else if (identifierOrPattern && identifierOrPattern.type === 'ArrayPattern') { + identifierOrPattern.elements. + forEach(captureDeclaration); + } else { + // assume it's a single standard identifier + specifierExportCount++; + } + } + + return { + ExportDefaultSpecifier: function () {function ExportDefaultSpecifier() { + hasDefaultExport = true; + }return ExportDefaultSpecifier;}(), + + ExportSpecifier: function () {function ExportSpecifier(node) { + if ((node.exported.name || node.exported.value) === 'default') { + hasDefaultExport = true; + } else { + specifierExportCount++; + namedExportNode = node; + } + }return ExportSpecifier;}(), + + ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) { + // if there are specifiers, node.declaration should be null + if (!node.declaration) {return;}var + + type = node.declaration.type; + + if ( + type === 'TSTypeAliasDeclaration' || + type === 'TypeAlias' || + type === 'TSInterfaceDeclaration' || + type === 'InterfaceDeclaration') + { + specifierExportCount++; + hasTypeExport = true; + return; + } + + if (node.declaration.declarations) { + node.declaration.declarations.forEach(function (declaration) { + captureDeclaration(declaration.id); + }); + } else { + // captures 'export function foo() {}' syntax + specifierExportCount++; + } + + namedExportNode = node; + }return ExportNamedDeclaration;}(), + + ExportDefaultDeclaration: function () {function ExportDefaultDeclaration() { + hasDefaultExport = true; + }return ExportDefaultDeclaration;}(), + + ExportAllDeclaration: function () {function ExportAllDeclaration() { + hasStarExport = true; + }return ExportAllDeclaration;}(), + + 'Program:exit': function () {function ProgramExit() { + if (hasDefaultExport || hasStarExport || hasTypeExport) { + return; + } + if (target === 'single' && specifierExportCount === 1) { + context.report(namedExportNode, SINGLE_EXPORT_ERROR_MESSAGE); + } else if (target === 'any' && specifierExportCount > 0) { + context.report(namedExportNode, ANY_EXPORT_ERROR_MESSAGE); + } + }return ProgramExit;}() }; + + }return create;}() }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9wcmVmZXItZGVmYXVsdC1leHBvcnQuanMiXSwibmFtZXMiOlsiU0lOR0xFX0VYUE9SVF9FUlJPUl9NRVNTQUdFIiwiQU5ZX0VYUE9SVF9FUlJPUl9NRVNTQUdFIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwidGFyZ2V0IiwiYWRkaXRpb25hbFByb3BlcnRpZXMiLCJjcmVhdGUiLCJjb250ZXh0Iiwic3BlY2lmaWVyRXhwb3J0Q291bnQiLCJoYXNEZWZhdWx0RXhwb3J0IiwiaGFzU3RhckV4cG9ydCIsImhhc1R5cGVFeHBvcnQiLCJuYW1lZEV4cG9ydE5vZGUiLCJvcHRpb25zIiwiY2FwdHVyZURlY2xhcmF0aW9uIiwiaWRlbnRpZmllck9yUGF0dGVybiIsImZvckVhY2giLCJwcm9wZXJ0eSIsInZhbHVlIiwiZWxlbWVudHMiLCJFeHBvcnREZWZhdWx0U3BlY2lmaWVyIiwiRXhwb3J0U3BlY2lmaWVyIiwibm9kZSIsImV4cG9ydGVkIiwibmFtZSIsIkV4cG9ydE5hbWVkRGVjbGFyYXRpb24iLCJkZWNsYXJhdGlvbiIsImRlY2xhcmF0aW9ucyIsImlkIiwiRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uIiwiRXhwb3J0QWxsRGVjbGFyYXRpb24iLCJyZXBvcnQiXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBLHFDOztBQUVBLElBQU1BLDhCQUE4QixxREFBcEM7QUFDQSxJQUFNQywyQkFBMkIsb0VBQWpDOztBQUVBQyxPQUFPQyx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9ydENvdW50Kys7XG4gICAgICAgICAgbmFtZWRFeHBvcnROb2RlID0gbm9kZTtcbiAgICAgICAgfVxuICAgICAgfSxcblxuICAgICAgRXhwb3J0TmFtZWREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIC8vIGlmIHRoZXJlIGFyZSBzcGVjaWZpZXJzLCBub2RlLmRlY2xhcmF0aW9uIHNob3VsZCBiZSBudWxsXG4gICAgICAgIGlmICghbm9kZS5kZWNsYXJhdGlvbikgeyByZXR1cm47IH1cblxuICAgICAgICBjb25zdCB7IHR5cGUgfSA9IG5vZGUuZGVjbGFyYXRpb247XG5cbiAgICAgICAgaWYgKFxuICAgICAgICAgIHR5cGUgPT09ICdUU1R5cGVBbGlhc0RlY2xhcmF0aW9uJ1xuICAgICAgICAgIHx8IHR5cGUgPT09ICdUeXBlQWxpYXMnXG4gICAgICAgICAgfHwgdHlwZSA9PT0gJ1RTSW50ZXJmYWNlRGVjbGFyYXRpb24nXG4gICAgICAgICAgfHwgdHlwZSA9PT0gJ0ludGVyZmFjZURlY2xhcmF0aW9uJ1xuICAgICAgICApIHtcbiAgICAgICAgICBzcGVjaWZpZXJFeHBvcnRDb3VudCsrO1xuICAgICAgICAgIGhhc1R5cGVFeHBvcnQgPSB0cnVlO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChub2RlLmRlY2xhcmF0aW9uLmRlY2xhcmF0aW9ucykge1xuICAgICAgICAgIG5vZGUuZGVjbGFyYXRpb24uZGVjbGFyYXRpb25zLmZvckVhY2goZnVuY3Rpb24gKGRlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICBjYXB0dXJlRGVjbGFyYXRpb24oZGVjbGFyYXRpb24uaWQpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGNhcHR1cmVzICdleHBvcnQgZnVuY3Rpb24gZm9vKCkge30nIHN5bnRheFxuICAgICAgICAgIHNwZWNpZmllckV4cG9ydENvdW50Kys7XG4gICAgICAgIH1cblxuICAgICAgICBuYW1lZEV4cG9ydE5vZGUgPSBub2RlO1xuICAgICAgfSxcblxuICAgICAgRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uKCkge1xuICAgICAgICBoYXNEZWZhdWx0RXhwb3J0ID0gdHJ1ZTtcbiAgICAgIH0sXG5cbiAgICAgIEV4cG9ydEFsbERlY2xhcmF0aW9uKCkge1xuICAgICAgICBoYXNTdGFyRXhwb3J0ID0gdHJ1ZTtcbiAgICAgIH0sXG5cbiAgICAgICdQcm9ncmFtOmV4aXQnKCkge1xuICAgICAgICBpZiAoaGFzRGVmYXVsdEV4cG9ydCB8fCBoYXNTdGFyRXhwb3J0IHx8IGhhc1R5cGVFeHBvcnQpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRhcmdldCA9PT0gJ3NpbmdsZScgJiYgc3BlY2lmaWVyRXhwb3J0Q291bnQgPT09IDEpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChuYW1lZEV4cG9ydE5vZGUsIFNJTkdMRV9FWFBPUlRfRVJST1JfTUVTU0FHRSk7XG4gICAgICAgIH0gZWxzZSBpZiAodGFyZ2V0ID09PSAnYW55JyAmJiBzcGVjaWZpZXJFeHBvcnRDb3VudCA+IDApIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChuYW1lZEV4cG9ydE5vZGUsIEFOWV9FWFBPUlRfRVJST1JfTUVTU0FHRSk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/unambiguous.js b/node_modules/eslint-plugin-import/lib/rules/unambiguous.js new file mode 100644 index 0000000000000000000000000000000000000000..314a2e57069d4c2b3cdc240b036d20aadaa3032f --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/unambiguous.js @@ -0,0 +1,42 @@ +'use strict'; + + + + +var _unambiguous = require('eslint-module-utils/unambiguous'); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _sourceType = require('../core/sourceType');var _sourceType2 = _interopRequireDefault(_sourceType);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + category: 'Module systems', + description: 'Forbid potentially ambiguous parse goal (`script` vs. `module`).', + url: (0, _docsUrl2['default'])('unambiguous') }, + + schema: [] }, + + + create: function () {function create(context) { + // ignore non-modules + if ((0, _sourceType2['default'])(context) !== 'module') { + return {}; + } + + return { + Program: function () {function Program(ast) { + if (!(0, _unambiguous.isModule)(ast)) { + context.report({ + node: ast, + message: 'This module could be parsed as a valid script.' }); + + } + }return Program;}() }; + + + }return create;}() }; /** + * @fileOverview Report modules that could parse incorrectly as scripts. + * @author Ben Mosher + */ +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy91bmFtYmlndW91cy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwiY2F0ZWdvcnkiLCJkZXNjcmlwdGlvbiIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJQcm9ncmFtIiwiYXN0IiwicmVwb3J0Iiwibm9kZSIsIm1lc3NhZ2UiXSwibWFwcGluZ3MiOiI7Ozs7O0FBS0E7QUFDQSxxQztBQUNBLGdEOztBQUVBQSxPQUFPQyxPQUFQLEdBQWlCO0FBQ2ZDLFFBQU07QUFDSkMsVUFBTSxZQURGO0FBRUpDLFVBQU07QUFDSkMsZ0JBQVUsZ0JBRE47QUFFSkMsbUJBQWEsa0VBRlQ7QUFHSkMsV0FBSywwQkFBUSxhQUFSLENBSEQsRUFGRjs7QUFPSkMsWUFBUSxFQVBKLEVBRFM7OztBQVdmQyxRQV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ycpLFxuICAgIH0sXG4gICAgc2NoZW1hOiBbXSxcbiAgfSxcblxuICBjcmVhdGUoY29udGV4dCkge1xuICAgIC8vIGlnbm9yZSBub24tbW9kdWxlc1xuICAgIGlmIChzb3VyY2VUeXBlKGNvbnRleHQpICE9PSAnbW9kdWxlJykge1xuICAgICAgcmV0dXJuIHt9O1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBQcm9ncmFtKGFzdCkge1xuICAgICAgICBpZiAoIWlzTW9kdWxlKGFzdCkpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlOiBhc3QsXG4gICAgICAgICAgICBtZXNzYWdlOiAnVGhpcyBtb2R1bGUgY291bGQgYmUgcGFyc2VkIGFzIGEgdmFsaWQgc2NyaXB0LicsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfTtcblxuICB9LFxufTtcbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/scc.js b/node_modules/eslint-plugin-import/lib/scc.js new file mode 100644 index 0000000000000000000000000000000000000000..3451d1bd3c288e261ba3c6c1e531648967d1e916 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/scc.js @@ -0,0 +1,92 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _scc = require('@rtsao/scc');var _scc2 = _interopRequireDefault(_scc); +var _hash = require('eslint-module-utils/hash'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _builder = require('./exportMap/builder');var _builder2 = _interopRequireDefault(_builder); +var _childContext = require('./exportMap/childContext');var _childContext2 = _interopRequireDefault(_childContext);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {arr2[i] = arr[i];}return arr2;} else {return Array.from(arr);}}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}} + +var cache = new Map();var + +StronglyConnectedComponentsBuilder = function () {function StronglyConnectedComponentsBuilder() {_classCallCheck(this, StronglyConnectedComponentsBuilder);}_createClass(StronglyConnectedComponentsBuilder, null, [{ key: 'clearCache', value: function () {function clearCache() + { + cache = new Map(); + }return clearCache;}() }, { key: 'get', value: function () {function get( + + source, context) { + var path = (0, _resolve2['default'])(source, context); + if (path == null) {return null;} + return StronglyConnectedComponentsBuilder['for']((0, _childContext2['default'])(path, context)); + }return get;}() }, { key: 'for', value: function () {function _for( + + context) { + var settingsHash = (0, _hash.hashObject)({ + settings: context.settings, + parserOptions: context.parserOptions, + parserPath: context.parserPath }). + digest('hex'); + var cacheKey = context.path + settingsHash; + if (cache.has(cacheKey)) { + return cache.get(cacheKey); + } + var scc = StronglyConnectedComponentsBuilder.calculate(context); + var visitedFiles = Object.keys(scc); + visitedFiles.forEach(function (filePath) {return cache.set(filePath + settingsHash, scc);}); + return scc; + }return _for;}() }, { key: 'calculate', value: function () {function calculate( + + context) { + var exportMap = _builder2['default']['for'](context); + var adjacencyList = this.exportMapToAdjacencyList(exportMap); + var calculatedScc = (0, _scc2['default'])(adjacencyList); + return StronglyConnectedComponentsBuilder.calculatedSccToPlainObject(calculatedScc); + }return calculate;}() + + /** @returns {Map>} for each dep, what are its direct deps */ }, { key: 'exportMapToAdjacencyList', value: function () {function exportMapToAdjacencyList( + initialExportMap) { + var adjacencyList = new Map(); + // BFS + function visitNode(exportMap) { + if (!exportMap) { + return; + } + exportMap.imports.forEach(function (v, importedPath) { + var from = exportMap.path; + var to = importedPath; + + // Ignore type-only imports, because we care only about SCCs of value imports + var toTraverse = [].concat(_toConsumableArray(v.declarations)).filter(function (_ref) {var isOnlyImportingTypes = _ref.isOnlyImportingTypes;return !isOnlyImportingTypes;}); + if (toTraverse.length === 0) {return;} + + if (!adjacencyList.has(from)) { + adjacencyList.set(from, new Set()); + } + + if (adjacencyList.get(from).has(to)) { + return; // prevent endless loop + } + adjacencyList.get(from).add(to); + visitNode(v.getter()); + }); + } + visitNode(initialExportMap); + // Fill gaps + adjacencyList.forEach(function (values) { + values.forEach(function (value) { + if (!adjacencyList.has(value)) { + adjacencyList.set(value, new Set()); + } + }); + }); + return adjacencyList; + }return exportMapToAdjacencyList;}() + + /** @returns {Record} for each key, its SCC's index */ }, { key: 'calculatedSccToPlainObject', value: function () {function calculatedSccToPlainObject( + sccs) { + var obj = {}; + sccs.forEach(function (scc, index) { + scc.forEach(function (node) { + obj[node] = index; + }); + }); + return obj; + }return calculatedSccToPlainObject;}() }]);return StronglyConnectedComponentsBuilder;}();exports['default'] = StronglyConnectedComponentsBuilder; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9zY2MuanMiXSwibmFtZXMiOlsiY2FjaGUiLCJNYXAiLCJTdHJvbmdseUNvbm5lY3RlZENvbXBvbmVudHNCdWlsZGVyIiwic291cmNlIiwiY29udGV4dCIsInBhdGgiLCJzZXR0aW5nc0hhc2giLCJzZXR0aW5ncyIsInBhcnNlck9wdGlvbnMiLCJwYXJzZXJQYXRoIiwiZGlnZXN0IiwiY2FjaGVLZXkiLCJoYXMiLCJnZXQiLCJzY2MiLCJjYWxjdWxhdGUiLCJ2aXNpdGVkRmlsZXMiLCJPYmplY3QiLCJrZXlzIiwiZm9yRWFjaCIsImZpbGVQYXRoIiwic2V0IiwiZXhwb3J0TWFwIiwiRXhwb3J0TWFwQnVpbGRlciIsImFkamFjZW5jeUxpc3QiLCJleHB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ICBpZiAoYWRqYWNlbmN5TGlzdC5nZXQoZnJvbSkuaGFzKHRvKSkge1xuICAgICAgICAgIHJldHVybjsgLy8gcHJldmVudCBlbmRsZXNzIGxvb3BcbiAgICAgICAgfVxuICAgICAgICBhZGphY2VuY3lMaXN0LmdldChmcm9tKS5hZGQodG8pO1xuICAgICAgICB2aXNpdE5vZGUodi5nZXR0ZXIoKSk7XG4gICAgICB9KTtcbiAgICB9XG4gICAgdmlzaXROb2RlKGluaXRpYWxFeHBvcnRNYXApO1xuICAgIC8vIEZpbGwgZ2Fwc1xuICAgIGFkamFjZW5jeUxpc3QuZm9yRWFjaCgodmFsdWVzKSA9PiB7XG4gICAgICB2YWx1ZXMuZm9yRWFjaCgodmFsdWUpID0+IHtcbiAgICAgICAgaWYgKCFhZGphY2VuY3lMaXN0Lmhhcyh2YWx1ZSkpIHtcbiAgICAgICAgICBhZGphY2VuY3lMaXN0LnNldCh2YWx1ZSwgbmV3IFNldCgpKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG4gICAgcmV0dXJuIGFkamFjZW5jeUxpc3Q7XG4gIH1cblxuICAvKiogQHJldHVybnMge1JlY29yZDxzdHJpbmcsIG51bWJlcj59IGZvciBlYWNoIGtleSwgaXRzIFNDQydzIGluZGV4ICovXG4gIHN0YXRpYyBjYWxjdWxhdGVkU2NjVG9QbGFpbk9iamVjdChzY2NzKSB7XG4gICAgY29uc3Qgb2JqID0ge307XG4gICAgc2Njcy5mb3JFYWNoKChzY2MsIGluZGV4KSA9PiB7XG4gICAgICBzY2MuZm9yRWFjaCgobm9kZSkgPT4ge1xuICAgICAgICBvYmpbbm9kZV0gPSBpbmRleDtcbiAgICAgIH0pO1xuICAgIH0pO1xuICAgIHJldHVybiBvYmo7XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/memo-parser/LICENSE b/node_modules/eslint-plugin-import/memo-parser/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c6ade2a433a2d64efb01cb1289b895357dd03cf9 --- /dev/null +++ b/node_modules/eslint-plugin-import/memo-parser/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +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/node_modules/eslint-plugin-import/memo-parser/README.md b/node_modules/eslint-plugin-import/memo-parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..741e0ed4d0a9c39d3842f82c42e4a7bc71402354 --- /dev/null +++ b/node_modules/eslint-plugin-import/memo-parser/README.md @@ -0,0 +1,21 @@ +# eslint-plugin-import/memo-parser + +## NOTE + +This used to improve performance, but as of ESLint 5 and v2 of this plugin, it seems to just consume a bunch of memory and slightly increase lint times. + +**Not recommended for use at this time!** + +This parser is just a memoizing wrapper around some actual parser. + +To configure, just add your _actual_ parser to the `parserOptions`, like so: + +```yaml +parser: eslint-plugin-import/memo-parser +# parser: babel-eslint + +parserOptions: + parser: babel-eslint + sourceType: module + ecmaVersion: 6 +``` diff --git a/node_modules/eslint-plugin-import/memo-parser/index.js b/node_modules/eslint-plugin-import/memo-parser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7868b7e9530bd42662e2722695e78aed674830b9 --- /dev/null +++ b/node_modules/eslint-plugin-import/memo-parser/index.js @@ -0,0 +1,41 @@ +'use strict'; + +const crypto = require('crypto'); +const moduleRequire = require('eslint-module-utils/module-require').default; +const hashObject = require('eslint-module-utils/hash').hashObject; + +const cache = new Map(); + +// must match ESLint default options or we'll miss the cache every time +const parserOptions = { + loc: true, + range: true, + raw: true, + tokens: true, + comment: true, + attachComment: true, +}; + +exports.parse = function parse(content, options) { + options = { ...options, ...parserOptions }; + + if (!options.filePath) { + throw new Error('no file path provided!'); + } + + const keyHash = crypto.createHash('sha256'); + keyHash.update(content); + hashObject(options, keyHash); + + const key = keyHash.digest('hex'); + + let ast = cache.get(key); + if (ast != null) { return ast; } + + const realParser = moduleRequire(options.parser); + + ast = realParser.parse(content, options); + cache.set(key, ast); + + return ast; +}; diff --git a/node_modules/eslint-plugin-import/node_modules/.bin/semver b/node_modules/eslint-plugin-import/node_modules/.bin/semver new file mode 100644 index 0000000000000000000000000000000000000000..666034a75d8442be9bb2d9c55c3909b55a093cb5 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/.bin/semver @@ -0,0 +1,174 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var rtl = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + '--rtl', + ' Coerce version strings right to left', + '', + '--ltr', + ' Coerce version strings left to right (default)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md b/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..820d21e3322b9d2778786ea743dd5e818991d595 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md @@ -0,0 +1,395 @@ + +3.1.0 / 2017-09-26 +================== + + * Add `DEBUG_HIDE_DATE` env var (#486) + * Remove ReDoS regexp in %o formatter (#504) + * Remove "component" from package.json + * Remove `component.json` + * Ignore package-lock.json + * Examples: fix colors printout + * Fix: browser detection + * Fix: spelling mistake (#496, @EdwardBetts) + +3.0.1 / 2017-08-24 +================== + + * Fix: Disable colors in Edge and Internet Explorer (#489) + +3.0.0 / 2017-08-08 +================== + + * Breaking: Remove DEBUG_FD (#406) + * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) + * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) + * Addition: document `enabled` flag (#465) + * Addition: add 256 colors mode (#481) + * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) + * Update: component: update "ms" to v2.0.0 + * Update: separate the Node and Browser tests in Travis-CI + * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots + * Update: separate Node.js and web browser examples for organization + * Update: update "browserify" to v14.4.0 + * Fix: fix Readme typo (#473) + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/eslint-plugin-import/node_modules/debug/LICENSE b/node_modules/eslint-plugin-import/node_modules/debug/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..658c933d28255e8c716899789e8c0f846e5dc125 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +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/node_modules/eslint-plugin-import/node_modules/debug/README.md b/node_modules/eslint-plugin-import/node_modules/debug/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0ee7634ddd0a4a6337fe7677e99ba78cd626fa07 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/README.md @@ -0,0 +1,437 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> + +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/node_modules/eslint-plugin-import/node_modules/debug/node.js b/node_modules/eslint-plugin-import/node_modules/debug/node.js new file mode 100644 index 0000000000000000000000000000000000000000..7fc36fe6dbecbfd41530c5a490cc738ec2968653 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/eslint-plugin-import/node_modules/debug/package.json b/node_modules/eslint-plugin-import/node_modules/debug/package.json new file mode 100644 index 0000000000000000000000000000000000000000..191c8154787cb9f8662967d4c4f8f9f3467a2bbf --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/package.json @@ -0,0 +1,51 @@ +{ + "name": "debug", + "version": "3.2.7", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "node.js", + "dist/debug.js", + "LICENSE", + "README.md" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + }, + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "browserify": "14.4.0", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.0.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "xo": "^0.23.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "unpkg": "./dist/debug.js" +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js b/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..c924b0ac4d4882e4a72a116436ed17a487c2fc05 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js @@ -0,0 +1,180 @@ +"use strict"; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +/** + * Colors. + */ + +exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ +// eslint-disable-next-line complexity + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } // Internet Explorer and Edge do not support colors. + + + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + + + return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); +} +/** + * Colorize log arguments if enabled. + * + * @api public + */ + + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if (match === '%%') { + return; + } + + index++; + + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + args.splice(lastC, 0, c); +} +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + +function log() { + var _console; + + // This hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + var r; + + try { + r = exports.storage.getItem('debug'); + } catch (error) {} // Swallow + // XXX (@Qix-) should we be logging these? + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + + + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); +var formatters = module.exports.formatters; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; + diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/common.js b/node_modules/eslint-plugin-import/node_modules/debug/src/common.js new file mode 100644 index 0000000000000000000000000000000000000000..e0de3fb530f1c2ea33c4c65bcfd39b98a53600d7 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/common.js @@ -0,0 +1,249 @@ +"use strict"; + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + Object.keys(env).forEach(function (key) { + createDebug[key] = env[key]; + }); + /** + * Active `debug` instances. + */ + + createDebug.instances = []; + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + + createDebug.formatters = {}; + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + + function selectColor(namespace) { + var hash = 0; + + for (var i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + + createDebug.selectColor = selectColor; + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function createDebug(namespace) { + var prevTime; + + function debug() { + // Disabled? + if (!debug.enabled) { + return; + } + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var self = debug; // Set `diff` timestamp + + var curr = Number(new Date()); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } // Apply any `formatters` transformations + + + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return match; + } + + index++; + var formatter = createDebug.formatters[format]; + + if (typeof formatter === 'function') { + var val = args[index]; + match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; + } + + return match; + }); // Apply env-specific formatting (colors, etc.) + + createDebug.formatArgs.call(self, args); + var logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = createDebug.enabled(namespace); + debug.useColors = createDebug.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + debug.extend = extend; // Debug.formatArgs = formatArgs; + // debug.rawLog = rawLog; + // env-specific initialization logic for debug instances + + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + createDebug.instances.push(debug); + return debug; + } + + function destroy() { + var index = createDebug.instances.indexOf(this); + + if (index !== -1) { + createDebug.instances.splice(index, 1); + return true; + } + + return false; + } + + function extend(namespace, delimiter) { + return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.names = []; + createDebug.skips = []; + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < createDebug.instances.length; i++) { + var instance = createDebug.instances[i]; + instance.enabled = createDebug.enabled(instance.namespace); + } + } + /** + * Disable debug output. + * + * @api public + */ + + + function disable() { + createDebug.enable(''); + } + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + var i; + var len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + + return val; + } + + createDebug.enable(createDebug.load()); + return createDebug; +} + +module.exports = setup; + diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/index.js b/node_modules/eslint-plugin-import/node_modules/debug/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..021731593ac517b224bddda8c450bac52889843a --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/index.js @@ -0,0 +1,12 @@ +"use strict"; + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} + diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/node.js b/node_modules/eslint-plugin-import/node_modules/debug/src/node.js new file mode 100644 index 0000000000000000000000000000000000000000..1e6a5f16aecdd38a2bfb607f3d82e299f7624f9a --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/node.js @@ -0,0 +1,177 @@ +"use strict"; + +/** + * Module dependencies. + */ +var tty = require('tty'); + +var util = require('util'); +/** + * This is the Node.js implementation of `debug()`. + */ + + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + var supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221]; + } +} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be. + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // Camel-case + var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { + return k.toUpperCase(); + }); // Coerce string value into JS value + + var val = process.env[key]; + + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); +} +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + +function formatArgs(args) { + var name = this.namespace, + useColors = this.useColors; + + if (useColors) { + var c = this.color; + var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c); + var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m"); + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + + return new Date().toISOString() + ' '; +} +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + + +function log() { + return process.stderr.write(util.format.apply(util, arguments) + '\n'); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + return process.env.DEBUG; +} +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + +function init(debug) { + debug.inspectOpts = {}; + var keys = Object.keys(exports.inspectOpts); + + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); +var formatters = module.exports.formatters; +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(function (str) { return str.trim(); }) + .join(' '); +}; +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + diff --git a/node_modules/eslint-plugin-import/node_modules/semver/LICENSE b/node_modules/eslint-plugin-import/node_modules/semver/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..19129e315fe593965a2fdd50ec0d1253bcbd2ece --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/eslint-plugin-import/node_modules/semver/README.md b/node_modules/eslint-plugin-import/node_modules/semver/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2293a14fdc3579558dbe9fbc50aa549657948c3e --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/semver/README.md @@ -0,0 +1,443 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` diff --git a/node_modules/eslint-plugin-import/node_modules/semver/bin/semver.js b/node_modules/eslint-plugin-import/node_modules/semver/bin/semver.js new file mode 100644 index 0000000000000000000000000000000000000000..666034a75d8442be9bb2d9c55c3909b55a093cb5 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/semver/bin/semver.js @@ -0,0 +1,174 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var rtl = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + '--rtl', + ' Coerce version strings right to left', + '', + '--ltr', + ' Coerce version strings left to right (default)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/node_modules/eslint-plugin-import/node_modules/semver/package.json b/node_modules/eslint-plugin-import/node_modules/semver/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6b970a629ffe81d300d6b0469fa9b1992ca24c8e --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/semver/package.json @@ -0,0 +1,38 @@ +{ + "name": "semver", + "version": "6.3.1", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap test/ --100 --timeout=30", + "lint": "echo linting disabled", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap test/ --100 --timeout=30", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/template-oss": "4.17.0", + "tap": "^12.7.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "./bin/semver.js" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "content": "./scripts/template-oss", + "version": "4.17.0" + } +} diff --git a/node_modules/eslint-plugin-import/node_modules/semver/range.bnf b/node_modules/eslint-plugin-import/node_modules/semver/range.bnf new file mode 100644 index 0000000000000000000000000000000000000000..d4c6ae0d76c9ac0c10c93062e5ff9cec277b07cd --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/eslint-plugin-import/node_modules/semver/semver.js b/node_modules/eslint-plugin-import/node_modules/semver/semver.js new file mode 100644 index 0000000000000000000000000000000000000000..39319c13cac27d65d88d34dac95470a6494a0dae --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/semver/semver.js @@ -0,0 +1,1643 @@ +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +// The actual regexps go on exports.re +var re = exports.re = [] +var safeRe = exports.safeRe = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 + +function tok (n) { + t[n] = R++ +} + +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' + +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' + +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' + +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' + +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' + +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' + +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') +var tildeTrimReplace = '$1~' + +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' + +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') +var caretTrimReplace = '$1^' + +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$' + +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + var i = 0 + do { + var a = this.build[i] + var b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.compareBuild = compareBuild +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose) + var versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + if (this.value === '') { + return true + } + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + this.raw) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) +} + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true + var remainingComparators = comparators.slice() + var testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(safeRe[t.STAR], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = safeRe[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + safeRe[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} diff --git a/node_modules/eslint-plugin-import/package.json b/node_modules/eslint-plugin-import/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3163544b95fe3361214e2b9cd5b89200aba55725 --- /dev/null +++ b/node_modules/eslint-plugin-import/package.json @@ -0,0 +1,138 @@ +{ + "name": "eslint-plugin-import", + "version": "2.32.0", + "description": "Import with sanity.", + "engines": { + "node": ">=4" + }, + "main": "lib/index.js", + "types": "index.d.ts", + "directories": { + "test": "tests" + }, + "files": [ + "*.md", + "!{CONTRIBUTING,RELEASE}.md", + "LICENSE", + "docs", + "lib", + "config", + "memo-parser/{*.js,LICENSE,*.md}", + "index.d.ts" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "babel --quiet --out-dir lib src", + "postbuild": "npm run copy-metafiles", + "copy-metafiles": "node --require babel-register ./scripts/copyMetafiles", + "watch": "npm run tests-only -- -- --watch", + "pretest": "linklocal", + "posttest": "eslint . && npm run update:eslint-docs -- --check && markdownlint \"**/*.md\"", + "mocha": "cross-env BABEL_ENV=test nyc mocha", + "tests-only": "npm run mocha tests/src", + "test": "npm run tests-only", + "test-compiled": "npm run prepublish && BABEL_ENV=testCompiled mocha --compilers js:babel-register tests/src", + "test-all": "node --require babel-register ./scripts/testAll", + "test-examples": "npm run build && npm run test-example:legacy && npm run test-example:flat && npm run test-example:v9", + "test-example:legacy": "cd examples/legacy && npm install && npm run lint", + "test-example:flat": "cd examples/flat && npm install && npm run lint", + "test-example:v9": "cd examples/v9 && npm install && npm run lint", + "test-types": "npx --package typescript@latest tsc --noEmit index.d.ts", + "prepublishOnly": "safe-publish-latest && npm run build", + "prepublish": "not-in-publish || npm run prepublishOnly", + "preupdate:eslint-docs": "npm run build", + "update:eslint-docs": "eslint-doc-generator --rule-doc-title-format prefix-name --rule-doc-section-options false --rule-list-split meta.docs.category --ignore-config stage-0 --config-emoji recommended,☑️" + }, + "repository": { + "type": "git", + "url": "https://github.com/import-js/eslint-plugin-import" + }, + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "es6", + "jsnext", + "modules", + "import", + "export" + ], + "author": "Ben Mosher ", + "license": "MIT", + "bugs": { + "url": "https://github.com/import-js/eslint-plugin-import/issues" + }, + "homepage": "https://github.com/import-js/eslint-plugin-import", + "devDependencies": { + "@angular-eslint/template-parser": "^13.5.0", + "@eslint/import-test-order-redirect-scoped": "file:./tests/files/order-redirect-scoped", + "@test-scope/some-module": "file:./tests/files/symlinked-module", + "@types/eslint": "^8.56.12", + "@typescript-eslint/parser": "^2.23.0 || ^3.3.0 || ^4.29.3 || ^5.10.0", + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-eslint": "=8.0.3 || ^8.2.6", + "babel-plugin-istanbul": "^4.1.6", + "babel-plugin-module-resolver": "^2.7.1", + "babel-preset-airbnb": "^2.6.0", + "babel-preset-flow": "^6.23.0", + "babel-register": "^6.26.0", + "babylon": "^6.18.0", + "chai": "^4.3.10", + "cross-env": "^4.0.0", + "escope": "^3.6.0", + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9", + "eslint-doc-generator": "^1.6.1", + "eslint-import-resolver-node": "file:./resolvers/node", + "eslint-import-resolver-typescript": "^1.0.2 || ^1.1.1", + "eslint-import-resolver-webpack": "file:./resolvers/webpack", + "eslint-import-test-order-redirect": "file:./tests/files/order-redirect", + "eslint-module-utils": "file:./utils", + "eslint-plugin-eslint-plugin": "^2.3.0", + "eslint-plugin-import": "2.x", + "eslint-plugin-json": "^2.1.2", + "find-babel-config": "=1.2.0", + "fs-copy-file-sync": "^1.1.1", + "glob": "^7.2.3", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "jsonc-parser": "=3.2.0", + "linklocal": "^2.8.2", + "lodash.isarray": "^4.0.0", + "markdownlint-cli": "~0.35", + "mocha": "^3.5.3", + "npm-which": "^3.0.1", + "nyc": "^11.9.0", + "redux": "^3.7.2", + "rimraf": "^2.7.1", + "safe-publish-latest": "^2.0.0", + "sinon": "^2.4.1", + "tmp": "^0.2.1", + "typescript": "^2.8.1 || ~3.9.5 || ~4.5.2", + "typescript-eslint-parser": "^15 || ^20 || ^22" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" + }, + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.9", + "array.prototype.findlastindex": "^1.2.6", + "array.prototype.flat": "^1.3.3", + "array.prototype.flatmap": "^1.3.3", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.1", + "hasown": "^2.0.2", + "is-core-module": "^2.16.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.1", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.9", + "tsconfig-paths": "^3.15.0" + } +} diff --git a/node_modules/eslint-plugin-jsx-a11y/.babelrc b/node_modules/eslint-plugin-jsx-a11y/.babelrc new file mode 100644 index 0000000000000000000000000000000000000000..058a9a5a7391bdc05c5608dfb8784de524507eef --- /dev/null +++ b/node_modules/eslint-plugin-jsx-a11y/.babelrc @@ -0,0 +1,17 @@ +{ + "presets": [ + [ + "airbnb", + { + "targets": { + "node": 4 + }, + "transformRuntime": false + } + ] + ], + "plugins": [ + "@babel/plugin-transform-flow-strip-types", + "add-module-exports" + ] +} diff --git a/node_modules/eslint-plugin-jsx-a11y/.eslintrc b/node_modules/eslint-plugin-jsx-a11y/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..67859870f4d540b4c600a873a8bc77f0c1714da7 --- /dev/null +++ b/node_modules/eslint-plugin-jsx-a11y/.eslintrc @@ -0,0 +1,44 @@ +{ + "root": true, + "extends": [ + "airbnb-base", + "plugin:flowtype/recommended" + ], + "ignorePatterns": [ + "lib/", + "reports/", + "examples/", + ], + "parser": "@babel/eslint-parser", + "plugins": [ + "flowtype", + ], + "rules": { + "max-len": "off", + "no-template-curly-in-string": "off", + }, + "overrides": [ + { + "files": ["src/rules/*"], + "extends": ["plugin:eslint-plugin/rules-recommended"], + "rules": { + "eslint-plugin/require-meta-docs-description": ["error", { "pattern": "^(Enforce|Require|Disallow)" }], + "eslint-plugin/require-meta-docs-url": [ + "error", + { "pattern": "https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/{{name}}.md" }, + ], + "eslint-plugin/require-meta-type": "off", + }, + }, + { + "files": ["__tests__/src/rules/*.js"], + "extends": ["plugin:eslint-plugin/tests-recommended"], + }, + { + "files": ["__tests__/**/*"], + "env": { + "jest": true, + }, + }, + ], +} diff --git a/node_modules/eslint-plugin-jsx-a11y/CHANGELOG.md b/node_modules/eslint-plugin-jsx-a11y/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..c659190b89373754158ffe5a9b641c634f4978e8 --- /dev/null +++ b/node_modules/eslint-plugin-jsx-a11y/CHANGELOG.md @@ -0,0 +1,774 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v6.10.2](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.10.1...v6.10.2) - 2024-10-25 + +### Fixed + +- [patch] `no-redundandant-roles`: allow `<img src="*.svg" role="img" />` [`#936`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/936) + +### Commits + +- [meta] fix changelog URLs [`0d01a1a`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0d01a1aff796802bca70183b24978ffebdbef073) +- [Refactor] remove no-longer-needed `es-iterator-helpers` [`aa075bd`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/aa075bd1897e0b0bb61683e4da68558f38511dae) +- [Refactor] avoid spreading things that are already arrays [`d15d3ab`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/d15d3abace7afe833d0988eaf3fb7cc166c05c06) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `@babel/register` [`5dad7c4`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/5dad7c4fdfdc56c6e488fab54f25f602430dad30) +- [Tests] `aria-role`: Add valid test for `<svg role="img" />` [`daba189`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/daba18974473bce1301ffaafb822558a9e1738ae) +- [Docs] `label-has-associated-control`: add line breaks for readability [`0bc6378`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0bc63781c8f284ac6bef00321763c13c5bea6b9f) +- [Tests] `label-has-associated-control`: add additional test cases [`30d2318`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/30d23189d0b6354750c31a622204a9dc412dc2c1) +- [Tests] Add tests to reinforce required attributes for role="heading" [`d92446c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/d92446c6e608617a4c75173e8b0917c06be14dc6) + +## [v6.10.1](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.10.0...v6.10.1) - 2024-10-20 + +### Commits + +- [Fix] handle interactive/noninteractive changes from aria-query [`4925ba8`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/4925ba8d0bf80a4b1d8e8645d310590bf1b40b64) +- [Docs] Use consistent spelling of 'screen reader' [`cb6788c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/cb6788c56d7108f2faa102d041dfa37dbc0e9f59) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `@babel/register`, `auto-changelog`, `eslint-plugin-import`, `tape` [`518a77e`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/518a77e1e23fb2b1df2e8a97d14bfdd08aded797) +- [Deps] update `es-iterator-helpers`, `string.prototype.includes` [`eed03a3`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/eed03a31f313442158cf7d702443723ad4800dec) +- [meta] package.json - Update jscodeshift & remove babel-jest [`2ee940c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/2ee940c5ae87bcd0d384b6dc565d630ea70e103a) +- [Docs] Remove accidental whitespace in CONTRIBUTING.md [`a262131`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/a26213142854ffe3d931fab35f0ee4e6ae101875) +- [Deps] unpin `aria-query` [`e517937`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/e51793729e5e366e30d2f3bf0f253f2bdb9e6523) + +## [v6.10.0](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.9.0...v6.10.0) - 2024-09-03 + +### Fixed + +- [New] `label-has-associated-control`: add additional error message [`#1005`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/1005) +- [Fix] `label-has-associated-control`: ignore undetermined label text [`#966`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/966) + +### Commits + +- [Tests] switch from jest to tape [`a284cbf`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/a284cbf4eb21292c4cff87f02be0bfb82764757f) +- [New] add eslint 9 support [`deac4fd`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/deac4fd06eff4c0f5da27611c2a44a009b7e7fda) +- [New] add `attributes` setting [`a1ee7f8`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/a1ee7f8810efafe416eb5d7f6eb0505b52873495) +- [New] allow polymorphic linting to be restricted [`6cd1a70`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6cd1a7011446e3925f2b49c51ff26246a21491d1) +- [Tests] remove duplicate tests [`74d5dec`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/74d5decb6f2e42c05ce40a45630041fd695a2e7f) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types` [`6eca235`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6eca2359f5457af72dbfba265b73297c9232cb3e) +- [readme] remove deprecated travis ci badge; add github actions badge [`0be7ea9`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0be7ea95f560c6afc6817d381054d914ebd0b2ca) +- [Tests] use `npm audit` instead of `aud` [`05a5e49`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/05a5e4992900e0d5d61e29e13046c90797b68a7c) +- [Deps] update `axobject-query` [`912e98c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/912e98c425ef9fcc2d7d22b45b4f7e3b445112a5) +- [Deps] unpin `axobject-query` [`75147aa`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/75147aa68888fc150a4efea5b99809969bdc32b2) +- [Deps] update `axe-core` [`27ff7cb`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/27ff7cbf562bf2685fd5a6062e58eb4727cb85c6) +- [readme] fix jsxA11y import name [`ce846e0`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/ce846e00414c41676a6a8601022059878bcc0b89) +- [readme] fix typo in shareable config section in readme [`cca288b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/cca288b73a39fa0932a57c02a7a88de68fc971fc) + +## [v6.9.0](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.8.0...v6.9.0) - 2024-06-19 + +### Fixed + +- [Fix] `img-redundant-alt`: fixed multibyte character support [`#969`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/969) +- [meta] fix changelog links [`#960`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/960) + +### Commits + +- [New] add support for Flat Config [`6b5f096`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6b5f096f10b47326d68e2893152a48a79c8555b4) +- Revert "[Fix] `isNonInteractiveElement`: Upgrade aria-query to 5.3.0 and axobject-query to 3.2.1" [`75d5dd7`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/75d5dd722bd67186d97afa7b151fd6fee5885c70) +- [Robustness] use `safe-regex-test` [`4c7e781`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/4c7e7815c12a797587bb8e3cdced7f3003848964) +- [actions] update actions/checkout [`51a1ca7`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/51a1ca7b4d83d4fbd1ea62888f7f2dc21ece6788) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `@babel/register`, `eslint-doc-generator`, `object.entries` [`1271ac1`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/1271ac1d6e5dcf9a2bc2c086faaf062335629171) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/register`, `aud`, `eslint-plugin-import`, `npmignore`, `object.assign` [`540cb7a`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/540cb7aefead582f237071d55a40f098d0885478) +- [Deps] update `@babel/runtime`, `array-includes`, `es-iterator-helpers`, `hasown`, `object.fromentries`, `safe-regex-test` [`5d14408`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/5d1440825a8838ae10dc94cc3a4a7e1e967644b4) +- [Deps] pin `aria-query` and `axobject-query`, add `ls-engines` test to CI [`32fd82c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/32fd82c628d7f3e4ec8c06a1994f4eca1be2be4f) +- [Dev Deps] update `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `eslint-doc-generator` [`d1b4114`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/d1b41142248a7cca45bb5f0b96ff23ee87fb9411) +- [Fix] ensure `summary` remains non-interactive [`6a048da`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6a048dacf2b98eaa204e2a5a70dc7e3d48d9463a) +- [Deps] remove `@babel/runtime` [`0a98ad8`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0a98ad83ffa7f4b66458cc1c39db2ef32bb2c480) +- [New] `no-noninteractive-element-to-interactive-role`: allow `menuitemradio` and `menuitemcheckbox` on <li> [`c0733f9`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/c0733f94031fe3eec6b4d54176afe47929bb0a84) +- [Deps] update `@babel/runtime`, `safe-regex-test` [`0d5321a`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0d5321a5457c5f0da0ca216053cc5b4f571b53ae) +- [actions] pin codecov to v3.1.5 [`961817f`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/961817f61fa56cd7815c6940c27ef08469b1516b) +- [Deps] unpin `axe-core` [`b3559cf`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/b3559cf89be6b5352cd77ffa025831b3d793d565) +- [Deps] move `object.entries` to dev deps [`1be7b70`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/1be7b709eececd83f1d5f67a60b2c97cfe9a561d) +- [Deps] update `@babel/runtime` [`2a48abb`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/2a48abb5effa911e7d1a8575e1c9768c947a33f1) +- [Deps] update `@babel/runtime` [`1adec35`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/1adec3517fc2c9797212ca4d38858deed917e7be) + +## [v6.8.0](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.7.1...v6.8.0) - 2023-11-01 + +### Merged + +- Allow `title` attribute or `aria-label` attribute instead of accessible child in the "anchor-has-content" rule [`#727`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/727) + +### Fixed + +- [Docs] `aria-activedescendant-has-tabindex`: align with changes from #708 [`#924`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/924) +- [Fix] `control-has-associated-label`: don't accept whitespace as an accessible label [`#918`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/918) + +### Commits + +- [Tests] migrate helper parsers function from `eslint-plugin-react` [`ce4d57f`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/ce4d57f853ce7f71bd31edaa524eeb3ff1d27cf1) +- [Refactor] use `es-iterator-helpers` [`52de824`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/52de82403752bb2ccbcac3379925650a0112d4af) +- [New] `mouse-events-have-key-events`: add `hoverInHandlers`/`hoverOutHandlers` config [`db64898`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/db64898fa591f17827053ad3c2ddeafdf7297dd6) +- [New] add `polymorphicPropName` setting for polymorphic components [`fffb05b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/fffb05b38c8eee926ee758e9ceb9eae4e697fbdd) +- [Fix] `isNonInteractiveElement`: Upgrade aria-query to 5.3.0 and axobject-query to 3.2.1 [`64bfea6`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/64bfea6352a704470a760fa6ea25cfc5a50414db) +- [Refactor] use `hasown` instead of `has` [`9a8edde`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/9a8edde7f2e80b7d104dd576f91526c6c4cbebb9) +- [actions] update used actions [`10c061a`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/10c061a70cac067641e3a084d0fb464960544505) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `@babel/register`, `aud`, `eslint-doc-generator`, `eslint-plugin-import`, `minimist` [`6d5022d`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6d5022d4894fa88d3c15c8b858114e8b2a8a440f) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/register`, `eslint-doc-generator`, `eslint-plugin-import` [`4dc7f1e`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/4dc7f1e5c611aeea2f81dc50d4ec0b206566181a) +- [New] `anchor-has-content`: Allow title attribute OR aria-label attribute [`e6bfd5c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/e6bfd5cb7c060fcaf54ede85a1be74ebe2f60d1e) +- [patch] `mouse-events-have-key-events`: rport the attribute, not the node [`eadd70c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/eadd70cb1d0478c24538ee7604cf5493a96c0715) +- [Deps] update `@babel/runtime`, `array-includes`, `array.prototype.flatmap`, `object.entries`, `object.fromentries` [`46ffbc3`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/46ffbc38512be4ed3db2f0fcd7d21af830574f63) +- [Deps] update `@babel/runtime`, `axobject-query`, `jsx-ast-utils`, `semver` [`5999555`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/5999555714f594c0fccfeeab2063c2658d9e4392) +- [Fix] pin `aria-query` and `axe-core` to fix failing tests on main [`8d8f016`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/8d8f0169dbaaa28143cf936cba3046c6e53fa134) +- [patch] move `semver` from Deps to Dev Deps [`4da13e7`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/4da13e79743ad2e1073fc2bb682197e1ba6dbea3) +- [Deps] update `ast-types-flow` [`b755318`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/b755318e675e73a33b1bb7ee809abc88c1927408) +- [Dev Deps] update `eslint-plugin-import` [`f1c976b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/f1c976b6af2d4f5237b481348868a5216e169296) +- [Deps] unpin `language-tags` [`3d1d26d`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/3d1d26d89d492947cbf69f439deec9e7cfaf9867) +- [Docs] `no-static-element-interactions`: tabIndex is written tabindex [`1271153`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/1271153653ada3f8d95b8e39f0164d5b255abea0) +- [Deps] Upgrade ast-types-flow to mitigate Docker user namespacing problems [`f0d2ddb`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/f0d2ddb65f21278ad29be43fb167a1092287b4b1) +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 [`0c278f4`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0c278f4805ec18d8ee4d3e8dfa2f603a28d7e113) + +## [v6.7.1](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.7.0...v6.7.1) - 2023-01-11 + +### Commits + +- [Fix] `no-aria-hidden-on-focusable` rule's missing export [`b01219e`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/b01219edc2eb289c7a068b4fa195f2ac04e915fa) + +## [v6.7.0](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.6.1...v6.7.0) - 2023-01-09 + +### Merged + +- New rule: prefer-tag-over-role [`#833`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/833) + +### Fixed + +- [Tests] `aria-role`: add now-passing test [`#756`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/756) +- [Docs] `control-has-associated-label`: fix metadata [`#892`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/892) +- [New] add `no-aria-hidden-on-focusable` rule [`#881`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/881) + +### Commits + +- [Docs] automate docs with `eslint-doc-generator` [`6d7a857`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6d7a857eccceb58dabfa244f6a196ad1697c01a4) +- [Refactor] use fromEntries, flatMap, etc; better use iteration methods [`3d77c84`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/3d77c845a98b6fc8cf10c810996278c02e308f35) +- [New] add `anchor-ambiguous-text` rule [`7f6463e`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/7f6463e5cffd1faa5cf22e3b0d33465e22bd10e1) +- [New] add `getAccessibleChildText` util [`630116b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/630116b334e22db853a95cd64e20b7df9f2b6dc8) +- [New] Add `isFocusable` utils method [`e199d17`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/e199d17db0b6bf1d917dab13a9690876ef6f77e3) +- [Docs] update `eslint-doc-generator` to v1.0.0 [`6b9855b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6b9855b9c3633308004960594327a10bc2551ad2) +- [Fix] `no-noninteractive-element-interactions`: Ignore contenteditable elements in no-noninteractive-element-interactions [`9aa878b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/9aa878bc39769f6c7b31c72bd1140c1370d202f1) +- [New] `anchor-ambiguous-text`: ignore punctuation [`bbae2c4`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/bbae2c46ab4ae94122be6c898f2ef313c6154c27) +- [New] `anchor-ambiguous-text`, `getAccessibleChildText`: Implements check for `alt` tags on `<img />` elements [`bb84abc`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/bb84abc793435a25398160242c5f2870b83b72ca) +- [meta] use `npmignore` to autogenerate an npmignore file [`6ad2312`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6ad23124582741385df50e98d5ed0d070f86eafe) +- [meta] add `auto-changelog` [`283817b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/283817b82252ef4a6395c22585d8681f97305ca0) +- [Docs] missing descriptions in some rules [`79b975a`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/79b975ab7185cc4fbf6a3adea45c78fac2162d77) +- [Deps] update `aria-query`, `axobject-query` [`7b3cda3`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/7b3cda3854451affe20b2e4f2dd57cf317dd7d1b) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `aud`, `object.assign` [`0852947`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0852947cfd57a34353a97c67f6de28dbcc8be0e3) +- [meta] move `.eslintignore` to `ignorePatterns` [`65be35b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/65be35b0f6c6cf8b79e9a748cb657a64b78c6535) +- [Dev Deps] update `@babel/cli`, `@babel/core`, `aud`, `eslint-doc-generator` [`60c2df5`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/60c2df5388a3f841a7780eafe1a0fbb44056743d) +- [Deps] update `@babel/runtime`, `array-includes`, `axe-core` [`4abc751`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/4abc751d87a8491219a9a3d2dacd80ea8adcb79b) +- [Deps] update `@babel/runtime`, `axe-core` [`89f766c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/89f766cd40fd32ada2020856b251ad6e34a6f365) +- [meta] run the build in prepack, not prepublish [`e411ce3`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/e411ce35cfa58181d375544ba5204c35db83678c) +- [Dev Deps] update `@babel/core`, `minimist` [`cccdb62`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/cccdb625d6237538fb4443349870293e8df818eb) +- [Dev Deps] update `markdown-magic` [`3382059`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/3382059feb5367c79e049943772e3a6e27e77609) +- [Fix] expose `prefer-tag-over-role` [`38d52f8`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/38d52f856a18d444e6db7d16d373e0d18c5b287d) +- [Docs] `label-has-for`: reran generate-list-of-rules [`9a2af01`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/9a2af0172cefad7fdce869401b2df42536812152) +- [Deps] pin `language-tags` to `v1.0.5` [`f84bb74`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/f84bb746857cfbc075f8e7104b3a16dddb66be7c) +- [Dev Deps] update `@babel/core` [`cf3f8d0`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/cf3f8d0a6bde6dc5ad39a96a6ed1912c1ad80e89) +- [Deps] update `axe-core` [`0a73cf4`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0a73cf4ad0adca0bef0a383a10a14597acef5713) +- [Deps] update `@babel/runtime` [`053f04d`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/053f04da8b60d259e4c92f214ffba07a14f3ec61) +- [Deps] update `@babel/runtime` [`bccf0ae`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/bccf0aeab8dd337c5f134f892a6d3588fbc29bdf) +- [Deps] update `jsx-ast-utils` [`c9687cc`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/c9687cc2a1b7f5f72c8181a9fd6a47f49c373240) +- [readme] Preventing code repetition in user's eslint config file [`8b889bf`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/8b889bff2731c9db6988c88c0d76bdbff17bd3c5) +- [Docs] `prefer-tag-over-role`: rename docs file [`0bdf95b`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/0bdf95b41cce32c8b7916367e7c8c663411d881c) + + + +6.6.1 / 2022-07-21 +================== +- 38405ad [Fix] `no-interactive-tabindex`: allow role assignments using a ternary with literals on both sides +- 7524e0c [Fix] `no-static-element-interactions`: allow role assignments using a ternary with literals on both sides (#865) +- 1c06306 [readme] properly describe rule settings in builtin configs +- 0c19f02 [Docs] `no-noninteractive-tabindex`, `no-static-element-interactions`: document `allowExpressionValues` (#870) +- 2362832 [readme] added link to redirect eslint to relevant docs (#862) +- 2c6926c [Deps] unpin `axe-core` +- b78f19d [Deps] pin `axe-core` to v4.4.1, due to a breaking change in a patch +- 768910e [Deps] update `@babel/runtime` +- f0e04ce [Deps] update `@babel/runtime`, `jsx-ast-utils` +- 93b2a9d [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `@babel/register` +- a962211 [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/plugin-transform-flow-strip-types`, `@babel/register` +- 0d2bc43 [Tests] `no-noninteractive-element-interactions`: add passing test cases (#876) +- ffefbad [Tests] `no-noninteractive-element-interactions`: add passing tests for form with onSubmit (#871) +- e7d405d [Tests] `no-static-element-interactions`: add passing test cases + +6.6.0 / 2022-06-23 +================== +- 566011b [New] `aria-role`: add `allowedInvalidRoles` option (#828) +- 64dcac6 [New] Introduce a plugin-wide setting for custom components. (#844) +- ce2c328 [Fix] `no-redundant-roles`, `role-supports-aria-props`: Remove implicit role from dl element (#848) +- fb20bc4 [Refactor] `role-supports-aria-props`: clean up the logic a bit +- 1826628 [Refactor] reduce egregious use of array spread, in favor of `[].concat` idiom +- 0f1615a [Docs] `no-static-element-interactions`: Update error message (#843) +- 9980d1d [Docs] Add infrastructure for auto-generating markdown table and list (#837) +- f878d3b [Docs] Update project readme (#831) +- aea7671 [Deps] update `@babel/runtime`, `array-includes`, `axe-core`, `jsx-ast-utils` +- d74173a [Deps] update `jsx-ast-utils` +- f6ba03c [Deps] update `@babel/runtime`, `jsx-ast-utils` +- 547dab4 [Deps] update `@babel/runtime`, `axe-core`, `minimatch` +- baaf791 [Deps] update `@babel/runtime`, `minimatch`, `semver` +- c015fef [Deps] update `@babel/runtime`, `axe-core`, `damerau-levenshtein` +- 832cbd6 [meta] add `export default` instead of `module.exports` (#861) +- ee933a2 [meta] Add CONTRIBUTING.md to solicit contributions (#846) +- fa3c869 [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `aud`, `eslint-plugin-eslint-plugin`, `eslint-plugin-flowtype`, `eslint-plugin-import` +- fb3d51e [Dev Deps] update `@babel/core`, `@babel/register`, `eslint-plugin-import`, `minimist` +- 8c1df4d [Dev Deps] pin `@technote-space/doctoc` because v2.5 is a breaking change +- fb071ab [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `eslint-plugin-eslint-plugin` +- 5e966e5 [Dev Deps] update `@babel/cli` +- f597f5b [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser` +- 287854a [Tests] Fix `npm run flow` (#856) +- 112261c [Tests] skip fragment tests in eslint < 6 +- ea877c4 [Tests] `img-redundant-alt-test`: add passing tests (#832) +- 685426d test: align usage of jest expect across tests (#827) +- c460a8b [Tests] move invalid test case to valid; changed in axe-core v4.4 + +6.5.1 / 2021-11-10 +================== +- 8f7d0b0 [Fix] properly build `module.exports` (#824) +- 2fd2087 [Dev Deps] update `eslint-plugin-import` + +6.5.0 / 2021-11-09 +================== +- 0f5f582 [New] support ESLint 8.x (#810) +- 1dbc416 [Deps] update `@babel/runtime`, `axe-core` +- 4043d31 [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `@babel/plugin-transform-flow-strip-types`, `eslint-config-airbnb-base` +- d143cba [Docs] HTTP => HTTPS (#823) +- 309b040 [Docs] `anchor-has-content`: add missing close / for jsx succeed example (#821) +- ba1e312 [eslint] simplify eslint command +- 0269025 [meta] change all `master` references in URLs to `HEAD` +- f1414cf [Dev Deps] add `eslint-plugin-eslint-plugin` (#818) +- f44fc05 [meta] update URLs +- df34872 [Refactor] switch to `export default` syntax for exporting rules (#819) +- ff26b82 [meta] fix prepublish scripts +- d4a57d8 [Deps] update `@babel/runtime`, `array-includes`, `axe-core`, `jsx-ast-utils` +- bd1dec6 [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/eslint-parser`, `eslint-plugin-import`, `estraverse`, `safe-publish-latest` +- 434c4cf [Tests] do not test eslint 7 on node 11 +- aed7a20 [Tests] use `@babel/eslint-parser` instead of `babel-eslint` (#811) +- 0021489 [actions] use codecov action +- 1251088 [meta] delete FUNDING.yml in favor of `.github` repo +- ecf7a27 [Docs] `scope`: replace duplicate `scope` word (#799) +- 952af25 [Fix] `no-access-key`: Fix wording and grammar (#800) +- 6cf7ac0 [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/plugin-transform-flow-strip-types`, `aud`, `eslint-plugin-flowtype`, `eslint-plugin-import` +- 79a35d4 [Deps] update `@babel/runtime`, `axe-core`, `damerau-levenshtein` +- 2a9ab71 [Tests] delete `src/util/getComputedRole-test.js` test in node 6 +- 0c1c587 [Tests] `autocomplete-valid`: move some failed tests to passing +- 8830902 [Tests] fix eslint < 7 not understanding `import type` +- d57887c [Tests] ensure all tests run +- 55e5c11 Support img role for canvas (#796) +- 36102cd [meta] use `prepublishOnly` script for npm 7+ +- 2501a7f Remove the link-button focus css from the anchor-is-valid doc (#662) +- d927625 Update recommended config to allow fieldset to have the radiogroup role (#746) +- 5aa8db9 [Docs] Clarify the title of the strictness table in the main doc (#786) +- df3c7ad [Docs] Document the similarity between html-has-lang and lang (#778) +- 426d4c2 Fix Flow warnings (#785) +- ecec8e4 Fully deprecate accessible-emoji rule (#782) +- 8a0e43c [Tests] remove .travis.yml +- f88bf6b [Dev Deps] update `flow-bin` to support aarch64 (#784) +- 369f9db [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/plugin-transform-flow-strip-types`, `aud`, `eslint-plugin-flowtype`, `jscodeshift` +- ce0785f [Deps] update `@babel/runtime`, `array-includes`, `axe-core`, `emoji-regex` +- 2c2a2ad [actions] update to use `node/install` action +- c275964 [Docs] `anchor-is-valid`: general cleanup (#728) +- 3df059e [Docs] `no-redundant-roles`: Adds missing closing square bracket (#775) +- 42ce5b7 [Docs] `anchor-is-valid`: Add Next.js case (#769) +- 2e5df91 [Tests] fix tests breaking on npm 7 +- 066ccff [Docs] `no-noninteractive-tabindex`: Add example for tabIndex on seemingly non-interactive element (#760) +- 6b19aa5 [Tests] migrate tests to Github Actions (#764) +- 7e158e3 [meta] run `aud` in `posttest` +- 71f390f [Tests] stop using coveralls +- e54b466 [meta] add Automatic Rebase and Require Allow Edits workflows +- 7d5511d [New] `label-has-associated-control`: Add glob support (#749) +- 854da0c Ran npm update; latest packages (#763) +- 8637aa7 (source/pr/734, fork/pr/26) [patch] `strict` config: Turn off `label-has-for` (#734) +- d85ce54 [doc] Add link to MDN Aria documentation (#762) +- 20b48a4 [patch] `no-onchange`: Remove rule from recommended/strict configs, and deprecate (#757) + +6.4.1 / 2020-10-26 +================== +- f8a4496 Upgrade jsx-ast-utils to v3.1.0 + +6.4.0 / 2020-10-26 +================== + +- 83e4ff2 [Deps] update `axe-core`, `jsx-ast-utils` +- eb92b07 [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/plugin-transform-flow-strip-types`, `eslint-plugin-flowtype`, `eslint-plugin-import`, `estraverse`, `expect`, `object.assign` +- 3d98d7a [Deps] update `@babel/runtime`, `axe-core` +- f702f62 [readme] add Spanish translation +- c2ae092 [Docs] `no-static-element-interactions`: Fixed rule name in comments +- b90e20d Fix screenreader -> screen reader +- 645900a Fixed rule name in comments +- 381b9d6 [fix:634] Ignore control elements that are hidden +- 2c47f0a [Fix] `autocomplete-valid`: workaround for axe not being able to handle `null` +- 00bd6d8 Add failing test for autocomplete with dynamic type +- 3c49c9a Add WCAG guidelines to rule documentation +- 4ecaf35 Add a testcase for tablist to interactive supports focus +- dac6864 Deprecate the accessible-emoji rule +- 5191053 Update to axobject-query@2.2.0 +- b315698 Allow negative tabindex in aria-activedescendant-has-tabindex +- 8e6fcd0 docs: fix travis badge now points to correct location at travis-ci.com +- 2234df7 Account for additional control elements in label-has-associated-control +- 5cbb718 Adding test cases for label tests +- 66c425c Additional test case for no-redundant-roles + +6.3.1 / 2020-06-19 +================== + +- 765da0f Update to aria-query 4.2.2 +- d528e8c Fix aria-level allowed on elements wit role heading (#704) +- 29c6859 [meta] remove yarn registry from npmrc, so publishing works +- f52c206 chore(package): update estraverse to version 5.0.0 + +6.3.0 / 2020-06-18 +================== + +- cce838a Update aria-query to 4.2.0 +- 121e8a4 Add two test cases found while upgrading to ARIA 1.2 +- 8059f51 Fix test failures raised by the upgrade to ARIA 1.2 +- 0d24e3a Update package.json +- b1f412a Fix test failures in role-has-required-aria-props due to ARIA 1.2 updates +- 74cec6e Fix test failures in no-noninteractive-element-interactions due to ARIA 1.2 updates +- 835b89e Fix test failures in role-supports-aria-props-test due to ARIA 1.2 updates +- 730319b Account for the null semantic generic role in ARIA 1.2 +- 7dfa7c9 Update aria-query from 4.0.1 to 4.0.2 +- 42098b9 [Refactor] `img-redundant-alt`: removing a use of `some` +- a910d83 [Tests] `label-has-associated-control`: add test for
+- b273fe5 [New] Support ESLint 7.x +- 1a97632 [Deps] update `@babel/runtime`, `array-includes`, `axe-core`, `axobject-query`, `damerau-levenshtein`, `jsx-ast-utils` +- b36976f [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/plugin-transform-flow-types`, `babel-eslint`, `babel-jest`, `coveralls`, `eslint-config-airbnb-base`, `eslint-plugin-flowtype`, `eslint-plugin-import`, `estraverse`, `in-publish`, `jest`, `minimist`, `rimraf`, `safe-publish-latest` +- 89acdc4 fix: removing the use of the some function +- 410ae43 chore(package): update eslint-plugin-flowtype to version 5.0.0 +- a87f83d fix(package): update emoji-regex to version 9.0.0 +- 71940e6 chore(package): update babel-preset-airbnb to version 5.0.0 +- d471f54 docs: Fix 404 links to WAI-ARIA spec +- 42a2016 Fixes #669: use the `language-tags` package to check the `lang` rule +- 7bcea20 [Tests] update axe-core +- f13dc38 [Deps] Pin axe-core version +- 33670bb fix: require missing 'autocomplete-valid' rule +- aca4c37 chore(mouse-event): revert unrelated formatting changes +- df1e275 fix(mouse-event): remove check from custom elements +- 1a16a1c chore(package): update jscodeshift to version 0.7.0 +- 7a55cdd chore(package): update flow-bin to version 0.113.0 +- 8e0d22b Update aria-query and axobject-query to the latest versions +- dd49060 Added test cases for an empty or undefined value of aria-label and aria-labelledby in alt-text +- 1a7b94f Updated dependencies including eslint-config-airbnb-base +- 3aea217 chore: replace ignoreNonDOM with inputComponents +- 1848d00 feat(autocomplete-valid): add to recommended & strict config +- 8703840 refactor: use to axe-cre 3.4 SerialVirtualNode format +- 3519c7b chore: Remove axe VirtualNode abstraction +- 9ac55c4 autocomplete-valid: Add inline comment +- 44c6098 Update axe-core to 3.3.0 +- 9916990 new autocomplete-valid rule +- 82f598e [Docs] examples: add language in code block for syntax highlight +- 2529ad3 fixing casing issue on aria-props +- 00926f2 Update README.md +- ce5d121 Update README.md +- 031574e chore(package): update flow-bin to version 0.103.0 +- e00e1db [meta] add FUNDING.yml +- e1e5fae Fix readme file + +6.2.3 / 2019-06-30 +================= +- [617] Add @babel/runtime to the dependencies + +6.2.2 / 2019-06-29 +================= +- Update jsx-ast-utils to v2.2.1 +- Add @babel/cli to the dev dependencies +- Update ESLint to v6 +- Update jsx-ast-utils to 2.2.0 +- Update flow-bin to version 0.102.0 +- [589] Allow expression statements for attribute values in no-noninteractive-tabindexlow-bin-0.101.0 +- [583] Allow expression values in attributes by configurationrror +- [596] Adding a test case for no-static-element-interactionseper/flow-bin-0.101.0) Merge branch 'master' into greenkeeper/flow-bin-0.101.0 +- Only run branch test coverage on the master branch +- chore(package): update flow-bin to version 0.100.0 +- Allow select as a valid child of label. +- Allow Node 4 / ESLint 3 failure to unblock ESLint upgrade in PR #568 +- chore(package): update flow-bin to version 0.99.0 +- Remove rootDir from Jest path configs +- (fix) Template literals with undefined evaluate to the string undefined. +- adds more tests to “anchor-is-valid” +- Fixes “anchor-is-valid” false positive for hrefs starting with the word “javascript” +- chore(package): update eslint-plugin-flowtype to version 3.5.0 +- Modified no-static-element-interactions to pass on non-literal roles. +- Added isNonLiteralProperty util method +- [#399] Account for spread in parser options +- [552] control-has-associated-label should allow generic links +- [issue 392] ul role='list' test case +- chore(package): update eslint to version 5.15.2 +- chore(package): update flow-bin to version 0.95.0 +- chore(package): update expect to version 24.3.1 +- Fix typo: defintions > definitions +- docs: add proper title to links to axe website for media-has-caption +- docs: removes deprecated rule label-has-for +- docs: fix typo and couple grammatical errors in Readme +- Ignore null/undefined values in role-supports-aria-props rule +- Ignore undefined values in aria-proptypes rule +- Ignore null values in aria-proptypes rule +- set target for node 4 + +6.2.1 / 2019-02-03 +================= +- 9980e45 [fix] Prevent Error when JSXSpreadAttribute is passed to isSemanticRoleElement + +6.2.0 / 2019-01-25 +================= +- 5650674 [new rule] control-has-associated-label checks interactives for a label +- f234698 [docs] add How to manage IDs +- 9924d03 [docs] document jsx-a11y/label-has-associated-control assert option +- 77b9870 [docs] Add newlines below headings +- 8244e43 [docs] Add syntax highlighting to example +- 26f41c8 [docs] Change explanation for role="presentation" escape hatch +- 33a1f94 [fix] - Purely decorative emojis do not need descriptions. +- 29d20f7 [fix] (package): update emoji-regex to version 7.0.2 +- 0b63f73 [chore] (package): update flow-bin to version 0.88.0 +- baa1344 [fix] Disable jsx-a11y/label-has-for in recommended +- 2c5fb06 [chore] (package): update jscodeshift to version 0.6.0 +- 87debc0 [fix] corrected no-noninteractive-element-to-interactive-role.md file +- d56265b [chore] (package): update flow-bin to version 0.87.0 +- 477966f [fix] Update test for implicit role of `img` +- f484ce3 [fix] No implicit role for `` with `alt=""` +- 6c33bcb [fix] Add select to the list of default control elements in label-has-associated-control +- 011f8d9 [fix] Dialog and Alert roles can host keyboard listeners +- 0f6a8af [fix] More easier `plugin:jsx-a11y/{recommended,strict}` configs +- 3844248 [fix] Mark the replacement for label-has-for +- 93265cb [fix] normalizedValues to values +- 651366c [fix] Make aria-role case sensitive +- 56d3b9a [fix] [484] Fix role-has-required-aria-props for semantic elements like input[checkbox] +- 46e9abd [fix] Handle the type={truthy} case in jsx + +6.1.2 / 2018-10-05 +================= +- [fix] Add link-type styling recommendation to anchor-is-valid #486 +- [fix] `label-has-for`: `textarea`s are inputs too #470 + +6.1.1 / 2018-07-03 +================== +- [fix] aria-proptypes support for idlist, #454 +- [fix] Image with expanded props throws 'The prop must be a JSXAttribute collected by the AST parser.', #459 +- [fix] label-has-for: broken in v6.1.0, #455 + +6.1.0 / 2018-06-26 +================== +- [new] Support for eslint v5, #451 +- [new] aria-query updated to latest version +- [new] eslint-config-airbnb-base updated to the latest version +- [deprecate] The rule label-has-for is deprecated and replaced with label-has-associated-control +- [fix] heading-has-content updated to work with custom components, #431 +- [fix] aria-errormessage prop is now a valid ARIA property, #424 + +6.0.2 / 2017-06-28 +================== +- [fix] Prefix directories in `.npmignore` with `/` so it only matches the top-level directory + + +6.0.1 / 2017-06-28 +================== +- [temporary] Remove `src` and `flow` from package to resolve flow issues for consuming packages. + + +6.0.0 / 2017-06-05 +================= +- [new] Add rule `anchor-is-valid`. See documentation for configuration options. Thanks @AlmeroSteyn. +- [breaking] `href-no-hash` replaced with `anchor-is-valid` in the recommended and strict configs. Use the `invalidHref` aspect (active by default) in `anchor-is-valid` to continue to apply the behavior provided by `href-no-hash`. +- [breaking] Removed support for ESLint peer dependency at version ^2.10.2. +- [update] The rule `label-has-for` now allows inputs nested in label tags. Previously it was strict about requiring a `for` attribute. Thanks @ignatiusreza and @mjaltamirano. +- [update] New configuration for `interactive-supports-focus`. Recommended and strict configs for now contain a trimmed-down whitelist of roles that will be checked. +- [fix] Incompatibility between node version 4 and 5. Thanks @evilebottnawi. +- [fix] Missing README entry for `media-has-caption`. Thanks @ismail-syed. +- [fix] README updates explaining recommended and strict configs. Thanks @Donaldini. +- [fix] Updated to aria-query@0.7.0, which includes new ARIA 1.1 properties. Previously, the `aria-props` rule incorrectly threw errors for these new properties. + +5.1.1 / 2017-07-03 +================== + - [fix] revert v6 breaking changes unintentionally added in v5.1 (#283) + +5.1.0 / 2017-06-26 +================== + - [new] Support eslint v4. (#267) + - [new] `label-has-for`: add "required" option to allow customization (#240) + - [new] add `anchor-is-valid` (#224) + - [new] `interactive-supports-focus`: Split interactive supports focus into tabbable and focusable cases (#236) + - [new] `anchor-is-valid`: add `aspects` option (#251) + - [Deps] Bump aria-query to 0.7.0 + +5.0.3 / 2017-05-16 +================== +- [fix] Remove `flow` directory from `.npmignore` to accommodate explicit imports from `v5.0.2`. + + +5.0.2 / 2017-05-16 +================== +- [fix] Explicitly import flow types to resolve flow failures in consuming projects. + + +5.0.1 / 2017-05-07 +================== +- [fix] Polyfill Array.includes for node < 6 support. + + +5.0.0 / 2017-05-05 +================== +- [breaking] Refactor `img-has-alt` rule into `alt-text` rule +- [breaking] Rule `onclick-has-role` is removed. Replaced with `no-static-element-interactions` and `no-noninteractive-element-interactions`. +- [breaking] Rule `onclick-has-focus` is removed. Replaced with `interactive-supports-focus`. +- [new] - Add rule `media-has-caption` rule +- [new] - Add `ignoreNonDOM` option to `no-autofocus`. +- [new] - Add rule `no-interactive-element-to-noninteractive-role` +- [new] - Add rule `no-noninteractive-element-to-interactive-role` +- [new] - Add rule `no-noninteractive-tabindex` +- [new] - Configs split into "recommended" and "strict". +- [enhanced] - Configuration options added to `no-static-element-interactions` and `no-noninteractive-element-interactions`. Options allow for fine-tuning of elements and event handlers to check. + + +4.0.0 / 2017-02-04 +================== +Add new rules: +- `jsx-a11y/accessible-emoji` +- `jsx-a11y/aria-activedescendant-has-tabindex` +- `jsx-a11y/iframe-has-title` +- `jsx-a11y/no-autofocus` +- `jsx-a11y/no-distracting-elements` *(breaking: consolidated no-marquee and no-blink into this rule.)* +- `jsx-a11y/no-redundant-roles` +- [fix] - redundant-alt to only check full words +- [docs] - Documentation upgrades across the board. +- [new] - Add `ignoreNonDom` +- [dev] - Add script to scaffold new rule creation. + + +3.0.2 / 2016-12-14 +================== +- [fix] - make `aria-invalid` values true and false pass for rule `aria-proptypes` + +3.0.1 / 2016-10-11 +================== +- [breaking] - Update all rule schemas to accept objects. This allows a future schema expansion to not be a breaking change. +- [breaking] - All rules with schemas that accepted a string OR array, now only allows an array. +- [new] - `href-no-hash` accepts new schema property `specialLink` to check for custom `href` properties on elements. (fixes [#76](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/76)) +- [breaking][fix] - `img-has-alt` now prefers `alt=""` over `role="presentation"`. You can set both, but not just `role="presentation"` by itself to ensure a11y across all devices. + +Note - see [rule documentation](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules) for updated schemas. + +2.2.3 / 2016-10-08 +================== +- [fix] - Add `switch` aria role. +- [devDependencies] - Updgrade dev dependencies and fix linting issues. + + +2.2.2 / 2016-09-12 +================== +- [fix] `x-has-content` rules now pass with children prop set. + + +2.2.1 / 2016-08-31 +================== +- [fix] Update `tablist` role to include missing property `aria-multiselectable`. + + +2.2.0 / 2016-08-26 +================== +- [new] Add `click-events-have-key-events` rule. +- [new] Add `no-static-element-interactions` rule. +- [devDependencies] Upgrade `eslint`, `eslint-config-airbnb`, `mocha` to latest. +- [lint] Fix all new linting errors with upgrade +- [nit] Use `error` syntax over `2` syntax in recommended config. + + +2.1.0 / 2016-08-10 +================== +- [fix] Require `aria-checked` for roles that are subclasses of `checkbox` +- [new] Add `anchor-has-content` rule. +- [refactor] Use new eslint rule syntax +- [new] Add support for custom words in `img-redundant-alt` (mainly for i18n). + + +2.0.1 / 2016-07-13 +================== +- [fix] JSXElement support in expression handlers for prop types. +- [fix] `heading-has-content`: dangerouslySetInnerHTML will pass. + + +2.0.0 / 2016-07-12 +================== +- [breaking] Scope `no-onchange` rule to select menu elements only. + + +1.5.5 / 2016-07-05 +================== +- [fix] Add `eslint` v3 as a `peerDependency`. + + +1.5.4 / 2016-07-05 +================== +- [fix] Add `eslint` as a `peerDependency`. + + +1.5.3 / 2016-06-16 +================== +- [fix] Fix crash when ```` for `role-supports-aria-props`. + + +1.5.2 / 2016-06-16 +================== +- [fix] Fix `img-redundant-alt` rule to use `getLiteralPropValue` from `jsx-ast-utils`. + + +1.5.1 / 2016-06-16 +================== +- [fix] Fix checking for undefined in `heading-has-content` for children content. + + +1.5.0 / 2016-06-16 +================== +- [new] Add [heading-has-content](docs/rules/heading-has-content.md) rule. +- [new] Add [html-has-lang](docs/rules/html-has-lang.md) rule. +- [new] Add [lang](docs/rules/lang.md) rule. +- [new] Add [no-marquee](docs/rules/no-marquee.md) rule. +- [new] Add [scope](docs/rules/scope.md) rule. + + +1.4.2 / 2016-06-10 +================== +- [new] Integrate with latest `jsx-ast-utils` to use `propName` function. More support for namespaced names on attributes and elements. + + +1.4.1 / 2016-06-10 +================== +- [fix] Handle spread props in `aria-unsupported-elements` and `role-supports-aria-props` when reporting. + + +1.4.0 / 2016-06-10 +================== +- [dependency] Integrate [jsx-ast-utils](https://github.com/jsx-eslint/jsx-ast-utils) +- [fix] Better error reporting for aria-unsupported-elements indicating which prop to remove. + + +1.3.0 / 2016-06-05 +================== +- [new] Spelling suggestions for incorrect `aria-*` props +- [fix] Ensure `role` value is a string before converting to lowercase in `img-has-alt` rule. + + +1.2.3 / 2016-06-02 +================== +- [fix] Handle dynamic `tabIndex` expression values, but still retain validation logic for literal `tabIndex` values. + + +1.2.2 / 2016-05-20 +================== +- [fix] Fix checks involving the tabIndex attribute that do not account for integer literals + + +1.2.1 / 2016-05-19 +================== +- [fix] Avoid testing interactivity of wrapper components with same name but different casing +as DOM elements (such as `Button` vs `button`). + + +1.2.0 / 2016-05-06 +================== +- [new] Import all roles from DPUB-ARIA. + + +1.1.0 / 2016-05-06 +================== +- [new] Add expression value handler for `BinaryExpression` type. +- [new] Add expression value handler for `NewExpression` type. +- [new] Add expression value handler for `ObjectExpression` type. +- [fix] Throws error when getting an expression of type without a handler function. + - This is for more graceful error handling and better issue reporting. + + +1.0.4 / 2016-04-28 +================== +- [fix] Add expression value handler for `ConditionalExpression` type. + + +1.0.3 / 2016-04-25 +================== +- [fix] Fix typo in recommended rules for `onclick-has-focus`. + + +1.0.2 / 2016-04-20 +================== +- [fix] Add expression value handler for `ThisExpression` type. + + +1.0.1 / 2016-04-19 +================== +- [fix] Fix build to copy source JSON files to build output. + + +1.0.0 / 2016-04-19 +================== +- [breaking] Rename `img-uses-alt` to `img-has-alt` +- [breaking] Rename `onlick-uses-role` to `onclick-has-role` +- [breaking] Rename `mouse-events-map-to-key-events` to `mouse-events-have-key-events` +- [breaking] Rename `use-onblur-not-onchange` to `no-onchange` +- [breaking] Rename `label-uses-for` to `label-has-for` +- [breaking] Rename `redundant-alt` to `img-redundant-alt` +- [breaking] Rename `no-hash-href` to `href-no-hash` +- [breaking] Rename `valid-aria-role` to `aria-role` + +- [new] Implement `aria-props` rule +- [new] Implement `aria-proptypes` rule +- [new] Implement `aria-unsupported-elements` rule +- [new] Implement `onclick-has-focus` rule +- [new] Implement `role-has-required-aria-props` rule +- [new] Implement `role-supports-aria-props` rule +- [new] Implement `tabindex-no-positive` rule + + +0.6.2 / 2016-04-08 +================== +- [fix] Fix rule details for img-uses-alt: allow alt="" or role="presentation". + + +0.6.1 / 2016-04-07 +================== +- [fix] Do not infer interactivity of components that are not low-level DOM elements. + + +0.6.0 / 2016-04-06 +================== +- [breaking] Allow alt="" when role="presentation" on img-uses-alt rule. +- [new] More descriptive error messaging for img-uses-alt rule. + + +0.5.2 / 2016-04-05 +================== +- [fix] Handle token lists for valid-aria-role. + + +0.5.1 / 2016-04-05 +================== +- [fix] Handle null valued props for valid-aria-role. + + +0.5.0 / 2016-04-02 +================== +- [new] Implement valid-aria-role rule. Based on [AX_ARIA_01](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_01) + + +0.4.3 / 2016-03-29 +================== +- [fix] Handle LogicalExpression attribute types when extracting values. LogicalExpressions are of form `` + + +0.4.2 / 2016-03-24 +================== +- [fix] Allow component names of form `Object.Property` i.e. `UX.Layout` + + +0.3.0 / 2016-03-02 +================== +- [new] Implement [no-hash-href](docs/rules/no-hash-href.md) rule. +- [fix] Fixed TemplateLiteral AST value building to get more exact values from template strings. + + +0.2.0 / 2016-03-01 +================== +- [new] Implement [redunant-alt](docs/rules/redundant-alt.md) rule. + + +0.1.2 / 2016-03-01 +================== +- Initial pre-release. diff --git a/node_modules/eslint-plugin-jsx-a11y/LICENSE.md b/node_modules/eslint-plugin-jsx-a11y/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..a66c74b7233f0cb4874e40b9bdc1d9c9896fcbf2 --- /dev/null +++ b/node_modules/eslint-plugin-jsx-a11y/LICENSE.md @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2016 Ethan Cohen + +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/node_modules/eslint-plugin-jsx-a11y/README.md b/node_modules/eslint-plugin-jsx-a11y/README.md new file mode 100644 index 0000000000000000000000000000000000000000..44cb16ea70fa69019288c7d6d08e3c5358490412 --- /dev/null +++ b/node_modules/eslint-plugin-jsx-a11y/README.md @@ -0,0 +1,423 @@ +

+ + CI status + + + npm version + + + license + + + Coverage Status + + + Total npm downloads + +

+ +Get professional support for eslint-plugin-jsx-a11y on Tidelift + +# eslint-plugin-jsx-a11y + +Static AST checker for accessibility rules on JSX elements. + +#### _Read this in [other languages](https://github.com/ari-os310/eslint-plugin-jsx-a11y/blob/HEAD/translations/Translations.md)._ + +[Mexican Spanish🇲🇽](https://github.com/ari-os310/eslint-plugin-jsx-a11y/blob/HEAD/translations/README.mx.md) + +## Why? + +This plugin does a static evaluation of the JSX to spot accessibility issues in React apps. Because it only catches errors in static code, use it in combination with [@axe-core/react](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/react) to test the accessibility of the rendered DOM. Consider these tools just as one step of a larger a11y testing process and always test your apps with assistive technology. + +## Installation + +**If you are installing this plugin via `eslint-config-airbnb`, please follow [these instructions](https://github.com/airbnb/javascript/tree/HEAD/packages/eslint-config-airbnb#eslint-config-airbnb-1).** + +You'll first need to install [ESLint](https://eslint.org/docs/latest/user-guide/getting-started): + +```sh +# npm +npm install eslint --save-dev + +# yarn +yarn add eslint --dev +``` + +Next, install `eslint-plugin-jsx-a11y`: + +```sh +# npm +npm install eslint-plugin-jsx-a11y --save-dev + +# yarn +yarn add eslint-plugin-jsx-a11y --dev +``` + +**Note:** If you installed ESLint globally (using the `-g` flag in npm, or the `global` prefix in yarn) then you must also install `eslint-plugin-jsx-a11y` globally. + + +## Usage - Legacy Config (`.eslintrc`) + +Add `jsx-a11y` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: + +```json +{ + "plugins": ["jsx-a11y"] +} +``` + +Then configure the rules you want to use under the rules section. + +```json +{ + "rules": { + "jsx-a11y/rule-name": 2 + } +} +``` + +You can also enable all the recommended or strict rules at once. +Add `plugin:jsx-a11y/recommended` or `plugin:jsx-a11y/strict` in `extends`: + +```json +{ + "extends": ["plugin:jsx-a11y/recommended"] +} +``` + +### Configurations + +> As you are extending our configuration, you can omit `"plugins": ["jsx-a11y"]` from your `.eslintrc` configuration file. + +```json +{ + "settings": { + "jsx-a11y": { + "polymorphicPropName": "as", + "components": { + "CityInput": "input", + "CustomButton": "button", + "MyButton": "button", + "RoundButton": "button" + }, + "attributes": { + "for": ["htmlFor", "for"] + } + } + } +} +``` + +## Usage - Flat Config (`eslint.config.js`) + +The default export of `eslint-plugin-jsx-a11y` is a plugin object. + +```js +const jsxA11y = require('eslint-plugin-jsx-a11y'); + +module.exports = [ + … + { + files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'], + plugins: { + 'jsx-a11y': jsxA11y, + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + rules: { + // ... any rules you want + 'jsx-a11y/alt-text': 'error', + }, + // ... others are omitted for brevity + }, + … +]; +``` + +### Shareable Configs + +There are two shareable configs, provided by the plugin. + +- `flatConfigs.recommended` +- `flatConfigs.strict` + +#### CJS + +```js +const jsxA11y = require('eslint-plugin-jsx-a11y'); + +export default [ + jsxA11y.flatConfigs.recommended, + { + // Your additional configs and overrides + }, +]; +``` + +#### ESM + +```js +import jsxA11y from 'eslint-plugin-jsx-a11y'; + +export default [ + jsxA11y.flatConfigs.recommended, + { + // Your additional configs and overrides + }, +]; +``` + +**Note**: Our shareable configs do NOT configure `files` or [`languageOptions.globals`](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuration-objects). +For most of the cases, you probably want to configure some of these properties yourself. + +```js +const jsxA11y = require('eslint-plugin-jsx-a11y'); +const globals = require('globals'); + +module.exports = [ + … + { + files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'], + ...jsxA11y.flatConfigs.recommended, + languageOptions: { + ...jsxA11y.flatConfigs.recommended.languageOptions, + globals: { + ...globals.serviceworker, + ...globals.browser, + }, + }, + }, + … +]; +``` + +#### Component Mapping + +To enable your custom components to be checked as DOM elements, you can set global settings in your configuration file by mapping each custom component name to a DOM element type. + +#### Attribute Mapping + +To configure the JSX property to use for attribute checking, you can set global settings in your configuration file by mapping each DOM attribute to the JSX property you want to check. +For example, you may want to allow the `for` attribute in addition to the `htmlFor` attribute for checking label associations. + +#### Polymorphic Components + +You can optionally use the `polymorphicPropName` setting to define the prop your code uses to create polymorphic components. +This setting will be used determine the element type in rules that require semantic context. + +For example, if you set the `polymorphicPropName` setting to `as` then this element: + +`Configurations ` + +will be evaluated as an `h3`. If no `polymorphicPropName` is set, then the component will be evaluated as `Box`. + +To restrict polymorphic linting to specified components, additionally set `polymorphicAllowList` to an array of component names. + +⚠️ Polymorphic components can make code harder to maintain; please use this feature with caution. + +## Supported Rules + + + +💼 Configurations enabled in.\ +🚫 Configurations disabled in.\ +☑️ Set in the `recommended` configuration.\ +🔒 Set in the `strict` configuration.\ +❌ Deprecated. + +| Name                                          | Description | 💼 | 🚫 | ❌ | +| :----------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- | :---- | :---- | :- | +| [accessible-emoji](docs/rules/accessible-emoji.md) | Enforce emojis are wrapped in `` and provide screen reader access. | | | ❌ | +| [alt-text](docs/rules/alt-text.md) | Enforce all elements that require alternative text have meaningful information to relay back to end user. | ☑️ 🔒 | | | +| [anchor-ambiguous-text](docs/rules/anchor-ambiguous-text.md) | Enforce `` text to not exactly match "click here", "here", "link", or "a link". | | ☑️ | | +| [anchor-has-content](docs/rules/anchor-has-content.md) | Enforce all anchors to contain accessible content. | ☑️ 🔒 | | | +| [anchor-is-valid](docs/rules/anchor-is-valid.md) | Enforce all anchors are valid, navigable elements. | ☑️ 🔒 | | | +| [aria-activedescendant-has-tabindex](docs/rules/aria-activedescendant-has-tabindex.md) | Enforce elements with aria-activedescendant are tabbable. | ☑️ 🔒 | | | +| [aria-props](docs/rules/aria-props.md) | Enforce all `aria-*` props are valid. | ☑️ 🔒 | | | +| [aria-proptypes](docs/rules/aria-proptypes.md) | Enforce ARIA state and property values are valid. | ☑️ 🔒 | | | +| [aria-role](docs/rules/aria-role.md) | Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role. | ☑️ 🔒 | | | +| [aria-unsupported-elements](docs/rules/aria-unsupported-elements.md) | Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes. | ☑️ 🔒 | | | +| [autocomplete-valid](docs/rules/autocomplete-valid.md) | Enforce that autocomplete attributes are used correctly. | ☑️ 🔒 | | | +| [click-events-have-key-events](docs/rules/click-events-have-key-events.md) | Enforce a clickable non-interactive element has at least one keyboard event listener. | ☑️ 🔒 | | | +| [control-has-associated-label](docs/rules/control-has-associated-label.md) | Enforce that a control (an interactive element) has a text label. | | ☑️ 🔒 | | +| [heading-has-content](docs/rules/heading-has-content.md) | Enforce heading (`h1`, `h2`, etc) elements contain accessible content. | ☑️ 🔒 | | | +| [html-has-lang](docs/rules/html-has-lang.md) | Enforce `` element has `lang` prop. | ☑️ 🔒 | | | +| [iframe-has-title](docs/rules/iframe-has-title.md) | Enforce iframe elements have a title attribute. | ☑️ 🔒 | | | +| [img-redundant-alt](docs/rules/img-redundant-alt.md) | Enforce `` alt prop does not contain the word "image", "picture", or "photo". | ☑️ 🔒 | | | +| [interactive-supports-focus](docs/rules/interactive-supports-focus.md) | Enforce that elements with interactive handlers like `onClick` must be focusable. | ☑️ 🔒 | | | +| [label-has-associated-control](docs/rules/label-has-associated-control.md) | Enforce that a `label` tag has a text label and an associated control. | ☑️ 🔒 | | | +| [label-has-for](docs/rules/label-has-for.md) | Enforce that `