diff --git a/.gitignore b/.gitignore index 97ec6ab..e704934 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ release-builds -node_modules \ No newline at end of file +node_modules +node_modules/ \ No newline at end of file diff --git a/node_modules/.bin/build b/node_modules/.bin/build deleted file mode 120000 index 13c115a..0000000 --- a/node_modules/.bin/build +++ /dev/null @@ -1 +0,0 @@ -../electron-builder/out/cli/cli.js \ No newline at end of file diff --git a/node_modules/.bin/electron-builder b/node_modules/.bin/electron-builder deleted file mode 120000 index 13c115a..0000000 --- a/node_modules/.bin/electron-builder +++ /dev/null @@ -1 +0,0 @@ -../electron-builder/out/cli/cli.js \ No newline at end of file diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse deleted file mode 120000 index 7423b18..0000000 --- a/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate deleted file mode 120000 index 16069ef..0000000 --- a/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/.bin/install-app-deps b/node_modules/.bin/install-app-deps deleted file mode 120000 index 8032069..0000000 --- a/node_modules/.bin/install-app-deps +++ /dev/null @@ -1 +0,0 @@ -../electron-builder/out/cli/install-app-deps.js \ No newline at end of file diff --git a/node_modules/.bin/is-ci b/node_modules/.bin/is-ci deleted file mode 120000 index fe6aca6..0000000 --- a/node_modules/.bin/is-ci +++ /dev/null @@ -1 +0,0 @@ -../is-ci/bin.js \ No newline at end of file diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml deleted file mode 120000 index 9dbd010..0000000 --- a/node_modules/.bin/js-yaml +++ /dev/null @@ -1 +0,0 @@ -../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 deleted file mode 120000 index 217f379..0000000 --- a/node_modules/.bin/json5 +++ /dev/null @@ -1 +0,0 @@ -../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime deleted file mode 120000 index fbb7ee0..0000000 --- a/node_modules/.bin/mime +++ /dev/null @@ -1 +0,0 @@ -../mime/cli.js \ No newline at end of file diff --git a/node_modules/7zip-bin/7x.sh b/node_modules/7zip-bin/7x.sh deleted file mode 100755 index 2da7630..0000000 --- a/node_modules/7zip-bin/7x.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -sz_program=${SZA_PATH:-7za} -sz_type=${SZA_ARCHIVE_TYPE:-xz} - -case $1 in - -d) "$sz_program" e -si -so -t${sz_type} ;; - *) "$sz_program" a f -si -so -t${sz_type} -mx${SZA_COMPRESSION_LEVEL:-9} ;; -esac 2> /dev/null \ No newline at end of file diff --git a/node_modules/7zip-bin/LICENSE.txt b/node_modules/7zip-bin/LICENSE.txt deleted file mode 100644 index 7299192..0000000 --- a/node_modules/7zip-bin/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Vladimir Krivosheev - -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/7zip-bin/README.md b/node_modules/7zip-bin/README.md deleted file mode 100644 index 3c23640..0000000 --- a/node_modules/7zip-bin/README.md +++ /dev/null @@ -1 +0,0 @@ -7-Zip precompiled binaries. \ No newline at end of file diff --git a/node_modules/7zip-bin/index.d.ts b/node_modules/7zip-bin/index.d.ts deleted file mode 100644 index bfc4c48..0000000 --- a/node_modules/7zip-bin/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const path7za: string -export const path7x: string \ No newline at end of file diff --git a/node_modules/7zip-bin/index.js b/node_modules/7zip-bin/index.js deleted file mode 100644 index 088b944..0000000 --- a/node_modules/7zip-bin/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict" - -const path = require("path") - -function getPath() { - if (process.env.USE_SYSTEM_7ZA === "true") { - return "7za" - } - - if (process.platform === "darwin") { - return path.join(__dirname, "mac", "7za") - } - else if (process.platform === "win32") { - return path.join(__dirname, "win", process.arch, "7za.exe") - } - else { - return path.join(__dirname, "linux", process.arch, "7za") - } -} - -exports.path7za = getPath() -exports.path7x = path.join(__dirname, "7x.sh") \ No newline at end of file diff --git a/node_modules/7zip-bin/linux/arm/7za b/node_modules/7zip-bin/linux/arm/7za deleted file mode 100755 index a484fb9..0000000 Binary files a/node_modules/7zip-bin/linux/arm/7za and /dev/null differ diff --git a/node_modules/7zip-bin/linux/arm64/7za b/node_modules/7zip-bin/linux/arm64/7za deleted file mode 100755 index 5e62a60..0000000 Binary files a/node_modules/7zip-bin/linux/arm64/7za and /dev/null differ diff --git a/node_modules/7zip-bin/linux/ia32/7za b/node_modules/7zip-bin/linux/ia32/7za deleted file mode 100755 index 8d85d21..0000000 Binary files a/node_modules/7zip-bin/linux/ia32/7za and /dev/null differ diff --git a/node_modules/7zip-bin/linux/x64/7za b/node_modules/7zip-bin/linux/x64/7za deleted file mode 100755 index 5a20bd9..0000000 Binary files a/node_modules/7zip-bin/linux/x64/7za and /dev/null differ diff --git a/node_modules/7zip-bin/linux/x64/build.sh b/node_modules/7zip-bin/linux/x64/build.sh deleted file mode 100755 index 01bed24..0000000 --- a/node_modules/7zip-bin/linux/x64/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -e - -BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -rm -rf /tmp/7z-linux -mkdir /tmp/7z-linux -cp "$BASEDIR/do-build.sh" /tmp/7z-linux/do-build.sh -docker run --rm -v /tmp/7z-linux:/project buildpack-deps:xenial /project/do-build.sh \ No newline at end of file diff --git a/node_modules/7zip-bin/linux/x64/do-build.sh b/node_modules/7zip-bin/linux/x64/do-build.sh deleted file mode 100755 index b415e66..0000000 --- a/node_modules/7zip-bin/linux/x64/do-build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -e - -apt-get update -qq -apt-get upgrade -qq - -echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" > /etc/apt/sources.list.d/llvm.list -curl -L http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - -apt-get update -qq -apt-get install -qq bzip2 yasm clang-5.0 lldb-5.0 lld-5.0 - -ln -s /usr/bin/clang-5.0 /usr/bin/clang -ln -s /usr/bin/clang++-5.0 /usr/bin/clang++ - -mkdir -p /tmp/7z -cd /tmp/7z -curl -L http://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2 | tar -xj -C . --strip-components 1 -cp makefile.linux_clang_amd64_asm makefile.machine -make -j4 -mv bin/7za /project/7za diff --git a/node_modules/7zip-bin/mac/7za b/node_modules/7zip-bin/mac/7za deleted file mode 100755 index 59cc64a..0000000 Binary files a/node_modules/7zip-bin/mac/7za and /dev/null differ diff --git a/node_modules/7zip-bin/package.json b/node_modules/7zip-bin/package.json deleted file mode 100644 index 4e27e73..0000000 --- a/node_modules/7zip-bin/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_from": "7zip-bin@~4.1.0", - "_id": "7zip-bin@4.1.0", - "_inBundle": false, - "_integrity": "sha512-AsnBZN3a8/JcNt+KPkGGODaA4c7l3W5+WpeKgGSbstSLxqWtTXqd1ieJGBQ8IFCtRg8DmmKUcSkIkUc0A4p3YA==", - "_location": "/7zip-bin", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "7zip-bin@~4.1.0", - "name": "7zip-bin", - "escapedName": "7zip-bin", - "rawSpec": "~4.1.0", - "saveSpec": null, - "fetchSpec": "~4.1.0" - }, - "_requiredBy": [ - "/app-builder-lib", - "/builder-util" - ], - "_resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-4.1.0.tgz", - "_shasum": "33eff662a5c39c0c2061170cc003c5120743fff0", - "_spec": "7zip-bin@~4.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "bugs": { - "url": "https://github.com/develar/7zip-bin/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "7-Zip precompiled binaries", - "files": [ - "*.js", - "7x.sh", - "index.d.ts", - "linux", - "mac", - "win" - ], - "homepage": "https://github.com/develar/7zip-bin#readme", - "keywords": [ - "7zip", - "7z", - "7za" - ], - "license": "MIT", - "name": "7zip-bin", - "repository": { - "type": "git", - "url": "git+https://github.com/develar/7zip-bin.git" - }, - "version": "4.1.0" -} diff --git a/node_modules/7zip-bin/win/ia32/7za.exe b/node_modules/7zip-bin/win/ia32/7za.exe deleted file mode 100644 index d516eb5..0000000 Binary files a/node_modules/7zip-bin/win/ia32/7za.exe and /dev/null differ diff --git a/node_modules/7zip-bin/win/x64/7za.exe b/node_modules/7zip-bin/win/x64/7za.exe deleted file mode 100644 index d3055c8..0000000 Binary files a/node_modules/7zip-bin/win/x64/7za.exe and /dev/null differ diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index 49a7a15..64e6d00 100644 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -1,32 +1,37 @@ { - "_from": "@types/node@^8.0.24", + "_args": [ + [ + "@types/node@8.10.39", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "@types/node@8.10.39", "_id": "@types/node@8.10.39", "_inBundle": false, "_integrity": "sha512-rE7fktr02J8ybFf6eysife+WF+L4sAHWzw09DgdCebEu+qDwMvv4zl6Bc+825ttGZP73kCKxa3dhJOoGJ8+5mA==", "_location": "/@types/node", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "@types/node@^8.0.24", + "raw": "@types/node@8.10.39", "name": "@types/node", "escapedName": "@types%2fnode", "scope": "@types", - "rawSpec": "^8.0.24", + "rawSpec": "8.10.39", "saveSpec": null, - "fetchSpec": "^8.0.24" + "fetchSpec": "8.10.39" }, "_requiredBy": [ "/electron" ], "_resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.39.tgz", - "_shasum": "e7e87ad00364dd7bc485c940926345b8ec1a26ca", - "_spec": "@types/node@^8.0.24", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron", + "_spec": "8.10.39", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Microsoft TypeScript", @@ -118,7 +123,6 @@ } ], "dependencies": {}, - "deprecated": false, "description": "TypeScript definitions for Node.js", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", "license": "MIT", diff --git a/node_modules/ajv-keywords/LICENSE b/node_modules/ajv-keywords/LICENSE deleted file mode 100644 index 90139aa..0000000 --- a/node_modules/ajv-keywords/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Evgeny Poberezkin - -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/ajv-keywords/README.md b/node_modules/ajv-keywords/README.md deleted file mode 100644 index 6b630be..0000000 --- a/node_modules/ajv-keywords/README.md +++ /dev/null @@ -1,683 +0,0 @@ -# ajv-keywords - -Custom JSON-Schema keywords for [Ajv](https://github.com/epoberezkin/ajv) validator - -[![Build Status](https://travis-ci.org/epoberezkin/ajv-keywords.svg?branch=master)](https://travis-ci.org/epoberezkin/ajv-keywords) -[![npm](https://img.shields.io/npm/v/ajv-keywords.svg)](https://www.npmjs.com/package/ajv-keywords) -[![npm downloads](https://img.shields.io/npm/dm/ajv-keywords.svg)](https://www.npmjs.com/package/ajv-keywords) -[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/ajv-keywords/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/ajv-keywords?branch=master) -[![Greenkeeper badge](https://badges.greenkeeper.io/epoberezkin/ajv-keywords.svg)](https://greenkeeper.io/) -[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) - - -## Contents - -- [Install](#install) -- [Usage](#usage) -- [Keywords](#keywords) - - [typeof](#typeof) - - [instanceof](#instanceof) - - [range and exclusiveRange](#range-and-exclusiverange) - - [switch](#switch) - - [select/selectCases/selectDefault](#selectselectcasesselectdefault) (BETA) - - [patternRequired](#patternrequired) - - [prohibited](#prohibited) - - [deepProperties](#deepproperties) - - [deepRequired](#deeprequired) - - [uniqueItemProperties](#uniqueitemproperties) - - [regexp](#regexp) - - [formatMaximum / formatMinimum and formatExclusiveMaximum / formatExclusiveMinimum](#formatmaximum--formatminimum-and-formatexclusivemaximum--formatexclusiveminimum) - - [dynamicDefaults](#dynamicdefaults) - - [transform](#transform) -- [License](#license) - - -## Install - -``` -npm install ajv-keywords -``` - - -## Usage - -To add all available keywords: - -```javascript -var Ajv = require('ajv'); -var ajv = new Ajv; -require('ajv-keywords')(ajv); - -ajv.validate({ instanceof: 'RegExp' }, /.*/); // true -ajv.validate({ instanceof: 'RegExp' }, '.*'); // false -``` - -To add a single keyword: - -```javascript -require('ajv-keywords')(ajv, 'instanceof'); -``` - -To add multiple keywords: - -```javascript -require('ajv-keywords')(ajv, ['typeof', 'instanceof']); -``` - -To add a single keyword in browser (to avoid adding unused code): - -```javascript -require('ajv-keywords/keywords/instanceof')(ajv); -``` - - -## Keywords - -### `typeof` - -Based on JavaScript `typeof` operation. - -The value of the keyword should be a string (`"undefined"`, `"string"`, `"number"`, `"object"`, `"function"`, `"boolean"` or `"symbol"`) or array of strings. - -To pass validation the result of `typeof` operation on the value should be equal to the string (or one of the strings in the array). - -``` -ajv.validate({ typeof: 'undefined' }, undefined); // true -ajv.validate({ typeof: 'undefined' }, null); // false -ajv.validate({ typeof: ['undefined', 'object'] }, null); // true -``` - - -### `instanceof` - -Based on JavaScript `instanceof` operation. - -The value of the keyword should be a string (`"Object"`, `"Array"`, `"Function"`, `"Number"`, `"String"`, `"Date"`, `"RegExp"`, `"Promise"` or `"Buffer"`) or array of strings. - -To pass validation the result of `data instanceof ...` operation on the value should be true: - -``` -ajv.validate({ instanceof: 'Array' }, []); // true -ajv.validate({ instanceof: 'Array' }, {}); // false -ajv.validate({ instanceof: ['Array', 'Function'] }, function(){}); // true -``` - -You can add your own constructor function to be recognised by this keyword: - -```javascript -function MyClass() {} -var instanceofDefinition = require('ajv-keywords').get('instanceof').definition; -// or require('ajv-keywords/keywords/instanceof').definition; -instanceofDefinition.CONSTRUCTORS.MyClass = MyClass; - -ajv.validate({ instanceof: 'MyClass' }, new MyClass); // true -``` - - -### `range` and `exclusiveRange` - -Syntax sugar for the combination of minimum and maximum keywords, also fails schema compilation if there are no numbers in the range. - -The value of this keyword must be the array consisting of two numbers, the second must be greater or equal than the first one. - -If the validated value is not a number the validation passes, otherwise to pass validation the value should be greater (or equal) than the first number and smaller (or equal) than the second number in the array. If `exclusiveRange` keyword is present in the same schema and its value is true, the validated value must not be equal to the range boundaries. - -```javascript -var schema = { range: [1, 3] }; -ajv.validate(schema, 1); // true -ajv.validate(schema, 2); // true -ajv.validate(schema, 3); // true -ajv.validate(schema, 0.99); // false -ajv.validate(schema, 3.01); // false - -var schema = { range: [1, 3], exclusiveRange: true }; -ajv.validate(schema, 1.01); // true -ajv.validate(schema, 2); // true -ajv.validate(schema, 2.99); // true -ajv.validate(schema, 1); // false -ajv.validate(schema, 3); // false -``` - - -### `switch` - -This keyword allows to perform advanced conditional validation. - -The value of the keyword is the array of if/then clauses. Each clause is the object with the following properties: - -- `if` (optional) - the value is JSON-schema -- `then` (required) - the value is JSON-schema or boolean -- `continue` (optional) - the value is boolean - -The validation process is dynamic; all clauses are executed sequentially in the following way: - -1. `if`: - 1. `if` property is JSON-schema according to which the data is: - 1. valid => go to step 2. - 2. invalid => go to the NEXT clause, if this was the last clause the validation of `switch` SUCCEEDS. - 2. `if` property is absent => go to step 2. -2. `then`: - 1. `then` property is `true` or it is JSON-schema according to which the data is valid => go to step 3. - 2. `then` property is `false` or it is JSON-schema according to which the data is invalid => the validation of `switch` FAILS. -3. `continue`: - 1. `continue` property is `true` => go to the NEXT clause, if this was the last clause the validation of `switch` SUCCEEDS. - 2. `continue` property is `false` or absent => validation of `switch` SUCCEEDS. - -```javascript -require('ajv-keywords')(ajv, 'switch'); - -var schema = { - type: 'array', - items: { - type: 'integer', - 'switch': [ - { if: { not: { minimum: 1 } }, then: false }, - { if: { maximum: 10 }, then: true }, - { if: { maximum: 100 }, then: { multipleOf: 10 } }, - { if: { maximum: 1000 }, then: { multipleOf: 100 } }, - { then: false } - ] - } -}; - -var validItems = [1, 5, 10, 20, 50, 100, 200, 500, 1000]; - -var invalidItems = [1, 0, 2000, 11, 57, 123, 'foo']; -``` - -__Please note__: this keyword is moved here from Ajv, mainly to preserve backward compatibility. It is unlikely to become a standard. It's preferable to use `if`/`then`/`else` keywords if possible, as they are likely to be added to the standard. The above schema is equivalent to (for example): - -```javascript -{ - type: 'array', - items: { - type: 'integer', - if: { minimum: 1, maximum: 10 }, - then: true, - else: { - if: { maximum: 100 }, - then: { multipleOf: 10 }, - else: { - if: { maximum: 1000 }, - then: { multipleOf: 100 }, - else: false - } - } - } -} -``` - - -### `select`/`selectCases`/`selectDefault` - -These keywords allow to choose the schema to validate the data based on the value of some property in the validated data. - -These keywords must be present in the same schema object (`selectDefault` is optional). - -The value of `select` keyword should be a [$data reference](https://github.com/epoberezkin/ajv/tree/5.0.2-beta.0#data-reference) that points to any primitive JSON type (string, number, boolean or null) in the data that is validated. You can also use a constant of primitive type as the value of this keyword (e.g., for debugging purposes). - -The value of `selectCases` keyword must be an object where each property name is a possible string representation of the value of `select` keyword and each property value is a corresponding schema (from draft-06 it can be boolean) that must be used to validate the data. - -The value of `selectDefault` keyword is a schema (from draft-06 it can be boolean) that must be used to validate the data in case `selectCases` has no key equal to the stringified value of `select` keyword. - -The validation succeeds in one of the following cases: -- the validation of data using selected schema succeeds, -- none of the schemas is selected for validation, -- the value of select is undefined (no property in the data that the data reference points to). - -If `select` value (in data) is not a primitive type the validation fails. - -__Please note__: these keywords require Ajv `$data` option to support [$data reference](https://github.com/epoberezkin/ajv/tree/5.0.2-beta.0#data-reference). - - -```javascript -require('ajv-keywords')(ajv, 'select'); - -var schema = { - type: object, - required: ['kind'], - properties: { - kind: { type: 'string' } - }, - select: { $data: '0/kind' }, - selectCases: { - foo: { - required: ['foo'], - properties: { - kind: {}, - foo: { type: 'string' } - }, - additionalProperties: false - }, - bar: { - required: ['bar'], - properties: { - kind: {}, - bar: { type: 'number' } - }, - additionalProperties: false - } - }, - selectDefault: { - propertyNames: { - not: { enum: ['foo', 'bar'] } - } - } -}; - -var validDataList = [ - { kind: 'foo', foo: 'any' }, - { kind: 'bar', bar: 1 }, - { kind: 'anything_else', not_bar_or_foo: 'any value' } -]; - -var invalidDataList = [ - { kind: 'foo' }, // no propery foo - { kind: 'bar' }, // no propery bar - { kind: 'foo', foo: 'any', another: 'any value' }, // additional property - { kind: 'bar', bar: 1, another: 'any value' }, // additional property - { kind: 'anything_else', foo: 'any' } // property foo not allowed - { kind: 'anything_else', bar: 1 } // property bar not allowed -]; -``` - -__Please note__: the current implementation is BETA. It does not allow using relative URIs in $ref keywords in schemas in `selectCases` and `selectDefault` that point outside of these schemas. The workaround is to use absolute URIs (that can point to any (sub-)schema added to Ajv, including those inside the current root schema where `select` is used). See [tests](https://github.com/epoberezkin/ajv-keywords/blob/v2.0.0/spec/tests/select.json#L314). - - -### `patternRequired` - -This keyword allows to require the presence of properties that match some pattern(s). - -This keyword applies only to objects. If the data is not an object, the validation succeeds. - -The value of this keyword should be an array of strings, each string being a regular expression. For data object to be valid each regular expression in this array should match at least one property name in the data object. - -If the array contains multiple regular expressions, more than one expression can match the same property name. - -```javascript -var schema = { patternRequired: [ 'f.*o', 'b.*r' ] }; - -var validData = { foo: 1, bar: 2 }; -var alsoValidData = { foobar: 3 }; - -var invalidDataList = [ {}, { foo: 1 }, { bar: 2 } ]; -``` - - -### `prohibited` - -This keyword allows to prohibit that any of the properties in the list is present in the object. - -This keyword applies only to objects. If the data is not an object, the validation succeeds. - -The value of this keyword should be an array of strings, each string being a property name. For data object to be valid none of the properties in this array should be present in the object. - -``` -var schema = { prohibited: ['foo', 'bar']}; - -var validData = { baz: 1 }; -var alsoValidData = {}; - -var invalidDataList = [ - { foo: 1 }, - { bar: 2 }, - { foo: 1, bar: 2} -]; -``` - - -### `deepProperties` - -This keyword allows to validate deep properties (identified by JSON pointers). - -This keyword applies only to objects. If the data is not an object, the validation succeeds. - -The value should be an object, where keys are JSON pointers to the data, starting from the current position in data, and the values are JSON schemas. For data object to be valid the value of each JSON pointer should be valid according to the corresponding schema. - -```javascript -var schema = { - type: 'object', - deepProperties: { - "/users/1/role": { "enum": ["admin"] } - } -}; - -var validData = { - users: [ - {}, - { - id: 123, - role: 'admin' - } - ] -}; - -var alsoValidData = { - users: { - "1": { - id: 123, - role: 'admin' - } - } -}; - -var invalidData = { - users: [ - {}, - { - id: 123, - role: 'user' - } - ] -}; - -var alsoInvalidData = { - users: { - "1": { - id: 123, - role: 'user' - } - } -}; -``` - - -### `deepRequired` - -This keyword allows to check that some deep properties (identified by JSON pointers) are available. - -This keyword applies only to objects. If the data is not an object, the validation succeeds. - -The value should be an array of JSON pointers to the data, starting from the current position in data. For data object to be valid each JSON pointer should be some existing part of the data. - -```javascript -var schema = { - type: 'object', - deepRequired: ["/users/1/role"] -}; - -var validData = { - users: [ - {}, - { - id: 123, - role: 'admin' - } - ] -}; - -var invalidData = { - users: [ - {}, - { - id: 123 - } - ] -}; -``` - -See [json-schema-org/json-schema-spec#203](https://github.com/json-schema-org/json-schema-spec/issues/203#issue-197211916) for an example of the equivalent schema without `deepRequired` keyword. - - -### `uniqueItemProperties` - -The keyword allows to check that some properties in array items are unique. - -This keyword applies only to arrays. If the data is not an array, the validation succeeds. - -The value of this keyword must be an array of strings - property names that should have unique values across all items. - -```javascript -var schema = { uniqueItemProperties: [ "id", "name" ] }; - -var validData = [ - { id: 1 }, - { id: 2 }, - { id: 3 } -]; - -var invalidData1 = [ - { id: 1 }, - { id: 1 }, - { id: 3 } -]; - -var invalidData2 = [ - { id: 1, name: "taco" }, - { id: 2, name: "taco" }, // duplicate "name" - { id: 3, name: "salsa" } -]; -``` - -This keyword is contributed by [@blainesch](https://github.com/blainesch). - - -### `regexp` - -This keyword allows to use regular expressions with flags in schemas (the standard `pattern` keyword does not support flags). - -This keyword applies only to strings. If the data is not a string, the validation succeeds. - -The value of this keyword can be either a string (the result of `regexp.toString()`) or an object with the properties `pattern` and `flags` (the same strings that should be passed to RegExp constructor). - -```javascript -var schema = { - type: 'object', - properties: { - foo: { regexp: '/foo/i' }, - bar: { regexp: { pattern: 'bar', flags: 'i' } } - } -}; - -var validData = { - foo: 'Food', - bar: 'Barmen' -}; - -var invalidData = { - foo: 'fog', - bar: 'bad' -}; -``` - - -### `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` - -These keywords allow to define minimum/maximum constraints when the format keyword defines ordering. - -These keywords apply only to strings. If the data is not a string, the validation succeeds. - -The value of keyword `formatMaximum` (`formatMinimum`) should be a string. This value is the maximum (minimum) allowed value for the data to be valid as determined by `format` keyword. - -When this keyword is added, it defines comparison rules for formats `"date"`, `"time"` and `"date-time". Custom formats also can have comparison rules. See [addFormat](https://github.com/epoberezkin/ajv#api-addformat) method. - -The value of keyword `formatExclusiveMaximum` (`formatExclusiveMinimum`) should be a boolean value. These keyword cannot be used without `formatMaximum` (`formatMinimum`). If this keyword value is equal to `true`, the data to be valid should not be equal to the value in `formatMaximum` (`formatMinimum`) keyword. - -```javascript -require('ajv-keywords')(ajv, ['formatMinimum', 'formatMaximum']); - -var schema = { - format: 'date', - formatMinimum: '2016-02-06', - formatMaximum: '2016-12-27', - formatExclusiveMaximum: true -} - -var validDataList = ['2016-02-06', '2016-12-26', 1]; - -var invalidDataList = ['2016-02-05', '2016-12-27', 'abc']; -``` - - -### `dynamicDefaults` - -This keyword allows to assign dynamic defaults to properties, such as timestamps, unique IDs etc. - -This keyword only works if `useDefaults` options is used and not inside `anyOf` keywrods etc., in the same way as [default keyword treated by Ajv](https://github.com/epoberezkin/ajv#assigning-defaults). - -The keyword should be added on the object level. Its value should be an object with each property corresponding to a property name, in the same way as in standard `properties` keyword. The value of each property can be: - -- an identifier of default function (a string) -- an object with properties `func` (an identifier) and `args` (an object with parameters that will be passed to this function during schema compilation - see examples). - -The properties used in `dynamicDefaults` should not be added to `required` keyword (or validation will fail), because unlike `default` this keyword is processed after validation. - -There are several predefined dynamic default functions: - -- `"timestamp"` - current timestamp in milliseconds -- `"datetime"` - current date and time as string (ISO, valid according to `date-time` format) -- `"date"` - current date as string (ISO, valid according to `date` format) -- `"time"` - current time as string (ISO, valid according to `time` format) -- `"random"` - pseudo-random number in [0, 1) interval -- `"randomint"` - pseudo-random integer number. If string is used as a property value, the function will randomly return 0 or 1. If object `{func: 'randomint', max: N}` is used then the default will be an integer number in [0, N) interval. -- `"seq"` - sequential integer number starting from 0. If string is used as a property value, the default sequence will be used. If object `{func: 'seq', name: 'foo'}` is used then the sequence with name `"foo"` will be used. Sequences are global, even if different ajv instances are used. - -```javascript -var schema = { - type: 'object', - dynamicDefaults: { - ts: 'datetime', - r: { func: 'randomint', max: 100 }, - id: { func: 'seq', name: 'id' } - }, - properties: { - ts: { - type: 'string', - format: 'datetime' - }, - r: { - type: 'integer', - minimum: 0, - maximum: 100, - exclusiveMaximum: true - }, - id: { - type: 'integer', - minimum: 0 - } - } -}; - -var data = {}; -ajv.validate(data); // true -data; // { ts: '2016-12-01T22:07:28.829Z', r: 25, id: 0 } - -var data1 = {}; -ajv.validate(data1); // true -data1; // { ts: '2016-12-01T22:07:29.832Z', r: 68, id: 1 } - -ajv.validate(data1); // true -data1; // didn't change, as all properties were defined -``` - -You can add your own dynamic default function to be recognised by this keyword: - -```javascript -var uuid = require('uuid'); - -function uuidV4() { return uuid.v4(); } - -var definition = require('ajv-keywords').get('dynamicDefaults').definition; -// or require('ajv-keywords/keywords/dynamicDefaults').definition; -definition.DEFAULTS.uuid = uuidV4; - -var schema = { - dynamicDefaults: { id: 'uuid' }, - properties: { id: { type: 'string', format: 'uuid' } } -}; - -var data = {}; -ajv.validate(schema, data); // true -data; // { id: 'a1183fbe-697b-4030-9bcc-cfeb282a9150' }; - -var data1 = {}; -ajv.validate(schema, data1); // true -data1; // { id: '5b008de7-1669-467a-a5c6-70fa244d7209' } -``` - -You also can define dynamic default that accepts parameters, e.g. version of uuid: - -```javascript -var uuid = require('uuid'); - -function getUuid(args) { - var version = 'v' + (arvs && args.v || 4); - return function() { - return uuid[version](); - }; -} - -var definition = require('ajv-keywords').get('dynamicDefaults').definition; -definition.DEFAULTS.uuid = getUuid; - -var schema = { - dynamicDefaults: { - id1: 'uuid', // v4 - id2: { func: 'uuid', v: 4 }, // v4 - id3: { func: 'uuid', v: 1 } // v1 - } -}; -``` - -### `transform` - -This keyword allows a string to be modified before validation. - -These keywords apply only to strings. If the data is not a string, the transform is skipped. - -There are limitation due to how ajv is written: -- a stand alone string cannot be transformed. ie `data = 'a'; ajv.validate(schema, data);` -- currently cannot work with `ajv-pack` - -**Supported options:** -- `trim`: remove whitespace from start and end -- `trimLeft`: remove whitespace from start -- `trimRight`: remove whitespace from end -- `toLowerCase`: case string to all lower case -- `toUpperCase`: case string to all upper case -- `toEnumCase`: case string to match case in schema - -Options are applied in the order they are listed. - -Note: `toEnumCase` requires that all allowed values are unique when case insensitive. - -**Example: multiple options** -```javascript -require('ajv-keywords')(ajv, ['transform']); - -var schema = { - type: 'array', - items: { - type:'string', - transform:['trim','lowercase'] - } -}; - -var data = [' MixCase ']; -avj.validate(schema, data); -console.log(data); // ['mixcase'] - -``` - -**Example: `enumcase`** -```javascript -require('ajv-keywords')(ajv, ['transform']); - -var schema = { - type: 'array', - items: { - type:'string', - transform:['trim','enumcase'], - enum:['pH'] - } -}; - -var data = ['ph',' Ph','PH','pH ']; -avj.validate(schema, data); -console.log(data); // ['pH','pH','pH','pH'] -``` - - -## License - -[MIT](https://github.com/epoberezkin/ajv-keywords/blob/master/LICENSE) diff --git a/node_modules/ajv-keywords/index.js b/node_modules/ajv-keywords/index.js deleted file mode 100644 index 07a8eda..0000000 --- a/node_modules/ajv-keywords/index.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var KEYWORDS = require('./keywords'); - -module.exports = defineKeywords; - - -/** - * Defines one or several keywords in ajv instance - * @param {Ajv} ajv validator instance - * @param {String|Array|undefined} keyword keyword(s) to define - * @return {Ajv} ajv instance (for chaining) - */ -function defineKeywords(ajv, keyword) { - if (Array.isArray(keyword)) { - for (var i=0; i d2) return 1; - if (d1 < d2) return -1; - if (d1 === d2) return 0; -} - - -function compareTime(t1, t2) { - if (!(t1 && t2)) return; - t1 = t1.match(TIME); - t2 = t2.match(TIME); - if (!(t1 && t2)) return; - t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); - t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); - if (t1 > t2) return 1; - if (t1 < t2) return -1; - if (t1 === t2) return 0; -} - - -function compareDateTime(dt1, dt2) { - if (!(dt1 && dt2)) return; - dt1 = dt1.split(DATE_TIME_SEPARATOR); - dt2 = dt2.split(DATE_TIME_SEPARATOR); - var res = compareDate(dt1[0], dt2[0]); - if (res === undefined) return; - return res || compareTime(dt1[1], dt2[1]); -} diff --git a/node_modules/ajv-keywords/keywords/_util.js b/node_modules/ajv-keywords/keywords/_util.js deleted file mode 100644 index eebd07a..0000000 --- a/node_modules/ajv-keywords/keywords/_util.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = { - metaSchemaRef: metaSchemaRef -}; - -var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema'; - -function metaSchemaRef(ajv) { - var defaultMeta = ajv._opts.defaultMeta; - if (typeof defaultMeta == 'string') return { $ref: defaultMeta }; - if (ajv.getSchema(META_SCHEMA_ID)) return { $ref: META_SCHEMA_ID }; - console.warn('meta schema not defined'); - return {}; -} diff --git a/node_modules/ajv-keywords/keywords/deepProperties.js b/node_modules/ajv-keywords/keywords/deepProperties.js deleted file mode 100644 index 3dac5fb..0000000 --- a/node_modules/ajv-keywords/keywords/deepProperties.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -var util = require('./_util'); - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'object', - macro: function (schema) { - var schemas = []; - for (var pointer in schema) - schemas.push(getSchema(pointer, schema[pointer])); - return { 'allOf': schemas }; - }, - metaSchema: { - type: 'object', - propertyNames: { - type: 'string', - format: 'json-pointer' - }, - additionalProperties: util.metaSchemaRef(ajv) - } - }; - - ajv.addKeyword('deepProperties', defFunc.definition); - return ajv; -}; - - -function getSchema(jsonPointer, schema) { - var segments = jsonPointer.split('/'); - var rootSchema = {}; - var pointerSchema = rootSchema; - for (var i=1; i' - , $result = 'result' + $lvl; -}} - -{{# def.$data }} - - -{{? $isDataExcl }} - {{ - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) - , $exclusive = 'exclusive' + $lvl - , $opExpr = 'op' + $lvl - , $opStr = '\' + ' + $opExpr + ' + \''; - }} - var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; - {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} - - if (typeof {{=$schemaValueExcl}} != 'boolean' && {{=$schemaValueExcl}} !== undefined) { - {{=$valid}} = false; - {{ var $errorKeyword = $exclusiveKeyword; }} - {{# def.error:'_formatExclusiveLimit' }} - } - - {{# def.elseIfValid }} - - {{# def.compareFormat }} - var {{=$exclusive}} = {{=$schemaValueExcl}} === true; - - if ({{=$valid}} === undefined) { - {{=$valid}} = {{=$exclusive}} - ? {{=$result}} {{=$op}} 0 - : {{=$result}} {{=$op}}= 0; - } - - if (!{{=$valid}}) var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; -{{??}} - {{ - var $exclusive = $schemaExcl === true - , $opStr = $op; /*used in error*/ - if (!$exclusive) $opStr += '='; - var $opExpr = '\'' + $opStr + '\''; /*used in error*/ - }} - - {{# def.compareFormat }} - - if ({{=$valid}} === undefined) - {{=$valid}} = {{=$result}} {{=$op}}{{?!$exclusive}}={{?}} 0; -{{?}} - -{{= $closingBraces }} - -if (!{{=$valid}}) { - {{ var $errorKeyword = $keyword; }} - {{# def.error:'_formatLimit' }} -} diff --git a/node_modules/ajv-keywords/keywords/dot/patternRequired.jst b/node_modules/ajv-keywords/keywords/dot/patternRequired.jst deleted file mode 100644 index 6f82f62..0000000 --- a/node_modules/ajv-keywords/keywords/dot/patternRequired.jst +++ /dev/null @@ -1,33 +0,0 @@ -{{# def.definitions }} -{{# def.errors }} -{{# def.setupKeyword }} - -{{ - var $key = 'key' + $lvl - , $idx = 'idx' + $lvl - , $matched = 'patternMatched' + $lvl - , $dataProperties = 'dataProperties' + $lvl - , $closingBraces = '' - , $ownProperties = it.opts.ownProperties; -}} - -var {{=$valid}} = true; -{{? $ownProperties }} - var {{=$dataProperties}} = undefined; -{{?}} - -{{~ $schema:$pProperty }} - var {{=$matched}} = false; - {{# def.iterateProperties }} - {{=$matched}} = {{= it.usePattern($pProperty) }}.test({{=$key}}); - if ({{=$matched}}) break; - } - - {{ var $missingPattern = it.util.escapeQuotes($pProperty); }} - if (!{{=$matched}}) { - {{=$valid}} = false; - {{# def.addError:'patternRequired' }} - } {{# def.elseIfValid }} -{{~}} - -{{= $closingBraces }} diff --git a/node_modules/ajv-keywords/keywords/dot/switch.jst b/node_modules/ajv-keywords/keywords/dot/switch.jst deleted file mode 100644 index 389678e..0000000 --- a/node_modules/ajv-keywords/keywords/dot/switch.jst +++ /dev/null @@ -1,73 +0,0 @@ -{{# def.definitions }} -{{# def.errors }} -{{# def.setupKeyword }} -{{# def.setupNextLevel }} - - -{{## def.validateIf: - {{# def.setCompositeRule }} - {{ $it.createErrors = false; }} - {{# def._validateSwitchRule:if }} - {{ $it.createErrors = true; }} - {{# def.resetCompositeRule }} - {{=$ifPassed}} = {{=$nextValid}}; -#}} - -{{## def.validateThen: - {{? typeof $sch.then == 'boolean' }} - {{? $sch.then === false }} - {{# def.error:'switch' }} - {{?}} - var {{=$nextValid}} = {{= $sch.then }}; - {{??}} - {{# def._validateSwitchRule:then }} - {{?}} -#}} - -{{## def._validateSwitchRule:_clause: - {{ - $it.schema = $sch._clause; - $it.schemaPath = $schemaPath + '[' + $caseIndex + ']._clause'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/_clause'; - }} - {{# def.insertSubschemaCode }} -#}} - -{{## def.switchCase: - {{? $sch.if && {{# def.nonEmptySchema:$sch.if }} }} - var {{=$errs}} = errors; - {{# def.validateIf }} - if ({{=$ifPassed}}) { - {{# def.validateThen }} - } else { - {{# def.resetErrors }} - } - {{??}} - {{=$ifPassed}} = true; - {{# def.validateThen }} - {{?}} -#}} - - -{{ - var $ifPassed = 'ifPassed' + it.level - , $currentBaseId = $it.baseId - , $shouldContinue; -}} -var {{=$ifPassed}}; - -{{~ $schema:$sch:$caseIndex }} - {{? $caseIndex && !$shouldContinue }} - if (!{{=$ifPassed}}) { - {{ $closingBraces+= '}'; }} - {{?}} - - {{# def.switchCase }} - {{ $shouldContinue = $sch.continue }} -{{~}} - -{{= $closingBraces }} - -var {{=$valid}} = {{=$nextValid}}; - -{{# def.cleanUp }} diff --git a/node_modules/ajv-keywords/keywords/dotjs/README.md b/node_modules/ajv-keywords/keywords/dotjs/README.md deleted file mode 100644 index e2846c8..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -These files are compiled dot templates from dot folder. - -Do NOT edit them directly, edit the templates and run `npm run build` from main ajv-keywords folder. diff --git a/node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js b/node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js deleted file mode 100644 index fc56e20..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js +++ /dev/null @@ -1,176 +0,0 @@ -'use strict'; -module.exports = function generate__formatLimit(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - out += 'var ' + ($valid) + ' = undefined;'; - if (it.opts.format === false) { - out += ' ' + ($valid) + ' = true; '; - return out; - } - var $schemaFormat = it.schema.format, - $isDataFormat = it.opts.$data && $schemaFormat.$data, - $closingBraces = ''; - if ($isDataFormat) { - var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr), - $format = 'format' + $lvl, - $compare = 'compare' + $lvl; - out += ' var ' + ($format) + ' = formats[' + ($schemaValueFormat) + '] , ' + ($compare) + ' = ' + ($format) + ' && ' + ($format) + '.compare;'; - } else { - var $format = it.formats[$schemaFormat]; - if (!($format && $format.compare)) { - out += ' ' + ($valid) + ' = true; '; - return out; - } - var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; - } - var $isMax = $keyword == 'formatMaximum', - $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum'), - $schemaExcl = it.schema[$exclusiveKeyword], - $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, - $op = $isMax ? '<' : '>', - $result = 'result' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - if ($isDataExcl) { - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), - $exclusive = 'exclusive' + $lvl, - $opExpr = 'op' + $lvl, - $opStr = '\' + ' + $opExpr + ' + \''; - out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; - $schemaValueExcl = 'schemaExcl' + $lvl; - out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; - var $errorKeyword = $exclusiveKeyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; - } - if ($isData) { - out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; - } - if ($isDataFormat) { - out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; - $closingBraces += '}'; - } - out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; - } else { - var $exclusive = $schemaExcl === true, - $opStr = $op; - if (!$exclusive) $opStr += '='; - var $opExpr = '\'' + $opStr + '\''; - if ($isData) { - out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; - } - if ($isDataFormat) { - out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; - $closingBraces += '}'; - } - out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); - if (!$exclusive) { - out += '='; - } - out += ' 0;'; - } - out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , exclusive: ' + ($exclusive) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be ' + ($opStr) + ' "'; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + (it.util.escapeQuotes($schema)); - } - out += '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '}'; - return out; -} diff --git a/node_modules/ajv-keywords/keywords/dotjs/patternRequired.js b/node_modules/ajv-keywords/keywords/dotjs/patternRequired.js deleted file mode 100644 index 31bd0b6..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/patternRequired.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; -module.exports = function generate_patternRequired(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $key = 'key' + $lvl, - $idx = 'idx' + $lvl, - $matched = 'patternMatched' + $lvl, - $dataProperties = 'dataProperties' + $lvl, - $closingBraces = '', - $ownProperties = it.opts.ownProperties; - out += 'var ' + ($valid) + ' = true;'; - if ($ownProperties) { - out += ' var ' + ($dataProperties) + ' = undefined;'; - } - var arr1 = $schema; - if (arr1) { - var $pProperty, i1 = -1, - l1 = arr1.length - 1; - while (i1 < l1) { - $pProperty = arr1[i1 += 1]; - out += ' var ' + ($matched) + ' = false; '; - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } '; - var $missingPattern = it.util.escapeQuotes($pProperty); - out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternRequired') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \'' + ($missingPattern) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should have property matching pattern \\\'' + ($missingPattern) + '\\\'\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; - } - } - } - out += '' + ($closingBraces); - return out; -} diff --git a/node_modules/ajv-keywords/keywords/dotjs/switch.js b/node_modules/ajv-keywords/keywords/dotjs/switch.js deleted file mode 100644 index d6de28b..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/switch.js +++ /dev/null @@ -1,128 +0,0 @@ -'use strict'; -module.exports = function generate_switch(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $ifPassed = 'ifPassed' + it.level, - $currentBaseId = $it.baseId, - $shouldContinue; - out += 'var ' + ($ifPassed) + ';'; - var arr1 = $schema; - if (arr1) { - var $sch, $caseIndex = -1, - l1 = arr1.length - 1; - while ($caseIndex < l1) { - $sch = arr1[$caseIndex += 1]; - if ($caseIndex && !$shouldContinue) { - out += ' if (!' + ($ifPassed) + ') { '; - $closingBraces += '}'; - } - if ($sch.if && it.util.schemaHasRules($sch.if, it.RULES.all)) { - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.createErrors = false; - $it.schema = $sch.if; - $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if'; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - $it.createErrors = true; - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { '; - if (typeof $sch.then == 'boolean') { - if ($sch.then === false) { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should pass "switch" keyword validation\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } - out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; - } else { - $it.schema = $sch.then; - $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - } - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } '; - } else { - out += ' ' + ($ifPassed) + ' = true; '; - if (typeof $sch.then == 'boolean') { - if ($sch.then === false) { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should pass "switch" keyword validation\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } - out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; - } else { - $it.schema = $sch.then; - $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - } - } - $shouldContinue = $sch.continue - } - } - out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + '; '; - out = it.util.cleanUpCode(out); - return out; -} diff --git a/node_modules/ajv-keywords/keywords/dynamicDefaults.js b/node_modules/ajv-keywords/keywords/dynamicDefaults.js deleted file mode 100644 index e6766d1..0000000 --- a/node_modules/ajv-keywords/keywords/dynamicDefaults.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var sequences = {}; - -var DEFAULTS = { - timestamp: function() { return Date.now(); }, - datetime: function() { return (new Date).toISOString(); }, - date: function() { return (new Date).toISOString().slice(0, 10); }, - time: function() { return (new Date).toISOString().slice(11); }, - random: function() { return Math.random(); }, - randomint: function (args) { - var limit = args && args.max || 2; - return function() { return Math.floor(Math.random() * limit); }; - }, - seq: function (args) { - var name = args && args.name || ''; - sequences[name] = sequences[name] || 0; - return function() { return sequences[name]++; }; - } -}; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - compile: function (schema, parentSchema, it) { - var funcs = {}; - - for (var key in schema) { - var d = schema[key]; - var func = getDefault(typeof d == 'string' ? d : d.func); - funcs[key] = func.length ? func(d.args) : func; - } - - return it.opts.useDefaults && !it.compositeRule - ? assignDefaults - : noop; - - function assignDefaults(data) { - for (var prop in schema) - if (data[prop] === undefined) data[prop] = funcs[prop](); - return true; - } - - function noop() { return true; } - }, - DEFAULTS: DEFAULTS, - metaSchema: { - type: 'object', - additionalProperties: { - type: ['string', 'object'], - additionalProperties: false, - required: ['func', 'args'], - properties: { - func: { type: 'string' }, - args: { type: 'object' } - } - } - } - }; - - ajv.addKeyword('dynamicDefaults', defFunc.definition); - return ajv; - - function getDefault(d) { - var def = DEFAULTS[d]; - if (def) return def; - throw new Error('invalid "dynamicDefaults" keyword property value: ' + d); - } -}; diff --git a/node_modules/ajv-keywords/keywords/formatMaximum.js b/node_modules/ajv-keywords/keywords/formatMaximum.js deleted file mode 100644 index e7daabf..0000000 --- a/node_modules/ajv-keywords/keywords/formatMaximum.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./_formatLimit')('Maximum'); diff --git a/node_modules/ajv-keywords/keywords/formatMinimum.js b/node_modules/ajv-keywords/keywords/formatMinimum.js deleted file mode 100644 index eddd6e4..0000000 --- a/node_modules/ajv-keywords/keywords/formatMinimum.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./_formatLimit')('Minimum'); diff --git a/node_modules/ajv-keywords/keywords/index.js b/node_modules/ajv-keywords/keywords/index.js deleted file mode 100644 index 618ed02..0000000 --- a/node_modules/ajv-keywords/keywords/index.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -module.exports = { - 'instanceof': require('./instanceof'), - range: require('./range'), - regexp: require('./regexp'), - 'typeof': require('./typeof'), - dynamicDefaults: require('./dynamicDefaults'), - prohibited: require('./prohibited'), - uniqueItemProperties: require('./uniqueItemProperties'), - deepProperties: require('./deepProperties'), - deepRequired: require('./deepRequired'), - formatMinimum: require('./formatMinimum'), - formatMaximum: require('./formatMaximum'), - patternRequired: require('./patternRequired'), - 'switch': require('./switch'), - select: require('./select'), - transform: require('./transform') -}; diff --git a/node_modules/ajv-keywords/keywords/instanceof.js b/node_modules/ajv-keywords/keywords/instanceof.js deleted file mode 100644 index ea88f5c..0000000 --- a/node_modules/ajv-keywords/keywords/instanceof.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var CONSTRUCTORS = { - Object: Object, - Array: Array, - Function: Function, - Number: Number, - String: String, - Date: Date, - RegExp: RegExp -}; - -module.exports = function defFunc(ajv) { - /* istanbul ignore else */ - if (typeof Buffer != 'undefined') - CONSTRUCTORS.Buffer = Buffer; - - /* istanbul ignore else */ - if (typeof Promise != 'undefined') - CONSTRUCTORS.Promise = Promise; - - defFunc.definition = { - compile: function (schema) { - if (typeof schema == 'string') { - var Constructor = getConstructor(schema); - return function (data) { - return data instanceof Constructor; - }; - } - - var constructors = schema.map(getConstructor); - return function (data) { - for (var i=0; i max || (exclusive && min == max)) - throw new Error('There are no numbers in range'); - } -}; diff --git a/node_modules/ajv-keywords/keywords/regexp.js b/node_modules/ajv-keywords/keywords/regexp.js deleted file mode 100644 index 84efbd6..0000000 --- a/node_modules/ajv-keywords/keywords/regexp.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'string', - inline: function (it, keyword, schema) { - return getRegExp() + '.test(data' + (it.dataLevel || '') + ')'; - - function getRegExp() { - try { - if (typeof schema == 'object') - return new RegExp(schema.pattern, schema.flags); - - var rx = schema.match(/^\/(.*)\/([gimy]*)$/); - if (rx) return new RegExp(rx[1], rx[2]); - throw new Error('cannot parse string into RegExp'); - } catch(e) { - console.error('regular expression', schema, 'is invalid'); - throw e; - } - } - }, - metaSchema: { - type: ['string', 'object'], - properties: { - pattern: { type: 'string' }, - flags: { type: 'string' } - }, - required: ['pattern'], - additionalProperties: false - } - }; - - ajv.addKeyword('regexp', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/select.js b/node_modules/ajv-keywords/keywords/select.js deleted file mode 100644 index f79c6c7..0000000 --- a/node_modules/ajv-keywords/keywords/select.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -var util = require('./_util'); - -module.exports = function defFunc(ajv) { - if (!ajv._opts.$data) { - console.warn('keyword select requires $data option'); - return ajv; - } - var metaSchemaRef = util.metaSchemaRef(ajv); - var compiledCaseSchemas = []; - - defFunc.definition = { - validate: function v(schema, data, parentSchema) { - if (parentSchema.selectCases === undefined) - throw new Error('keyword "selectCases" is absent'); - var compiled = getCompiledSchemas(parentSchema, false); - var validate = compiled.cases[schema]; - if (validate === undefined) validate = compiled.default; - if (typeof validate == 'boolean') return validate; - var valid = validate(data); - if (!valid) v.errors = validate.errors; - return valid; - }, - $data: true, - metaSchema: { type: ['string', 'number', 'boolean', 'null'] } - }; - - ajv.addKeyword('select', defFunc.definition); - ajv.addKeyword('selectCases', { - compile: function (schemas, parentSchema) { - var compiled = getCompiledSchemas(parentSchema); - for (var value in schemas) - compiled.cases[value] = compileOrBoolean(schemas[value]); - return function() { return true; }; - }, - valid: true, - metaSchema: { - type: 'object', - additionalProperties: metaSchemaRef - } - }); - ajv.addKeyword('selectDefault', { - compile: function (schema, parentSchema) { - var compiled = getCompiledSchemas(parentSchema); - compiled.default = compileOrBoolean(schema); - return function() { return true; }; - }, - valid: true, - metaSchema: metaSchemaRef - }); - return ajv; - - - function getCompiledSchemas(parentSchema, create) { - var compiled; - compiledCaseSchemas.some(function (c) { - if (c.parentSchema === parentSchema) { - compiled = c; - return true; - } - }); - if (!compiled && create !== false) { - compiled = { - parentSchema: parentSchema, - cases: {}, - default: true - }; - compiledCaseSchemas.push(compiled); - } - return compiled; - } - - function compileOrBoolean(schema) { - return typeof schema == 'boolean' - ? schema - : ajv.compile(schema); - } -}; diff --git a/node_modules/ajv-keywords/keywords/switch.js b/node_modules/ajv-keywords/keywords/switch.js deleted file mode 100644 index 5b0f3f8..0000000 --- a/node_modules/ajv-keywords/keywords/switch.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var util = require('./_util'); - -module.exports = function defFunc(ajv) { - if (ajv.RULES.keywords.switch && ajv.RULES.keywords.if) return; - - var metaSchemaRef = util.metaSchemaRef(ajv); - - defFunc.definition = { - inline: require('./dotjs/switch'), - statements: true, - errors: 'full', - metaSchema: { - type: 'array', - items: { - required: [ 'then' ], - properties: { - 'if': metaSchemaRef, - 'then': { - anyOf: [ - { type: 'boolean' }, - metaSchemaRef - ] - }, - 'continue': { type: 'boolean' } - }, - additionalProperties: false, - dependencies: { - 'continue': [ 'if' ] - } - } - } - }; - - ajv.addKeyword('switch', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/transform.js b/node_modules/ajv-keywords/keywords/transform.js deleted file mode 100644 index 7ea0690..0000000 --- a/node_modules/ajv-keywords/keywords/transform.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -module.exports = function defFunc (ajv) { - defFunc.definition = { - type: 'string', - errors: false, - modifying: true, - valid: true, - compile: function (schema, parentSchema) { - - // build hash table to enum values - var hashtable = {}; - - if (schema.indexOf('toEnumCase') !== -1) { - // requires `enum` in schema - if (!parentSchema.enum) - throw new Error('Missing enum. To use `transform:["toEnumCase"]`, `enum:[...]` is required.'); - for (var i = parentSchema.enum.length; i--; i) { - var v = parentSchema.enum[i]; - if (typeof v !== 'string') continue; - var k = makeHashTableKey(v); - // requires all `enum` values have unique keys - if (hashtable[k]) - throw new Error('Invalid enum uniqueness. To use `transform:["toEnumCase"]`, all values must be unique when case insensitive.'); - hashtable[k] = v; - } - } - - var transform = { - trimLeft: function (value) { - return value.replace(/^[\s]+/, ''); - }, - trimRight: function (value) { - return value.replace(/[\s]+$/, ''); - }, - trim: function (value) { - return value.trim(); - }, - toLowerCase: function (value) { - return value.toLowerCase(); - }, - toUpperCase: function (value) { - return value.toUpperCase(); - }, - toEnumCase: function (value) { - return hashtable[makeHashTableKey(value)] || value; - } - }; - - return function (value, objectKey, object, key) { - // skip if value only - if (!object) return; - - // apply transform in order provided - for (var j = 0, l = schema.length; j < l; j++) { - if (typeof object[key] !== 'string') continue; - object[key] = transform[schema[j]](object[key]); - } - }; - }, - metaSchema: { - type: 'array', - items: { - type: 'string', - enum: [ - 'trimLeft', 'trimRight', 'trim', - 'toLowerCase', 'toUpperCase', 'toEnumCase' - ] - } - } - }; - - ajv.addKeyword('transform', defFunc.definition); - return ajv; - - function makeHashTableKey (value) { - return value.toLowerCase(); - } -}; diff --git a/node_modules/ajv-keywords/keywords/typeof.js b/node_modules/ajv-keywords/keywords/typeof.js deleted file mode 100644 index 3a3574d..0000000 --- a/node_modules/ajv-keywords/keywords/typeof.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -var KNOWN_TYPES = ['undefined', 'string', 'number', 'object', 'function', 'boolean', 'symbol']; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - inline: function (it, keyword, schema) { - var data = 'data' + (it.dataLevel || ''); - if (typeof schema == 'string') return 'typeof ' + data + ' == "' + schema + '"'; - schema = 'validate.schema' + it.schemaPath + '.' + keyword; - return schema + '.indexOf(typeof ' + data + ') >= 0'; - }, - metaSchema: { - anyOf: [ - { - type: 'string', - enum: KNOWN_TYPES - }, - { - type: 'array', - items: { - type: 'string', - enum: KNOWN_TYPES - } - } - ] - } - }; - - ajv.addKeyword('typeof', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/uniqueItemProperties.js b/node_modules/ajv-keywords/keywords/uniqueItemProperties.js deleted file mode 100644 index 2a8e7e8..0000000 --- a/node_modules/ajv-keywords/keywords/uniqueItemProperties.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'array', - compile: function(keys, parentSchema, it) { - var equal = it.util.equal; - return function(data) { - if (data.length > 1) { - for (var k=0; k < keys.length; k++) { - var key = keys[k]; - for (var i = data.length; i--;) { - if (typeof data[i] != 'object') continue; - for (var j = i; j--;) { - if (typeof data[j] == 'object' && equal(data[i][key], data[j][key])) - return false; - } - } - } - } - return true; - }; - }, - metaSchema: { - type: 'array', - items: {type: 'string'} - } - }; - - ajv.addKeyword('uniqueItemProperties', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/package.json b/node_modules/ajv-keywords/package.json deleted file mode 100644 index abe7f95..0000000 --- a/node_modules/ajv-keywords/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "ajv-keywords@^3.2.0", - "_id": "ajv-keywords@3.2.0", - "_inBundle": false, - "_integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "_location": "/ajv-keywords", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ajv-keywords@^3.2.0", - "name": "ajv-keywords", - "escapedName": "ajv-keywords", - "rawSpec": "^3.2.0", - "saveSpec": null, - "fetchSpec": "^3.2.0" - }, - "_requiredBy": [ - "/read-config-file" - ], - "_resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "_shasum": "e86b819c602cf8821ad637413698f1dec021847a", - "_spec": "ajv-keywords@^3.2.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/read-config-file", - "author": { - "name": "Evgeny Poberezkin" - }, - "bugs": { - "url": "https://github.com/epoberezkin/ajv-keywords/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Custom JSON-Schema keywords for Ajv validator", - "devDependencies": { - "ajv": "^6.0.0", - "ajv-pack": "^0.3.0", - "chai": "^4.0.2", - "coveralls": "^3.0.0", - "dot": "^1.1.1", - "eslint": "^4.9.0", - "glob": "^7.1.1", - "istanbul": "^0.4.3", - "js-beautify": "^1.7.4", - "json-schema-test": "^2.0.0", - "mocha": "^5.0.0", - "pre-commit": "^1.1.3", - "uuid": "^3.0.1" - }, - "files": [ - "index.js", - "keywords" - ], - "homepage": "https://github.com/epoberezkin/ajv-keywords#readme", - "keywords": [ - "JSON-Schema", - "ajv", - "keywords" - ], - "license": "MIT", - "main": "index.js", - "name": "ajv-keywords", - "peerDependencies": { - "ajv": "^6.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/ajv-keywords.git" - }, - "scripts": { - "build": "node node_modules/ajv/scripts/compile-dots.js node_modules/ajv/lib keywords", - "eslint": "eslint index.js keywords/*.js", - "prepublish": "npm run build", - "test": "npm run build && npm run eslint && npm run test-cov", - "test-cov": "istanbul cover -x 'spec/**' node_modules/mocha/bin/_mocha -- spec/*.spec.js -R spec", - "test-spec": "mocha spec/*.spec.js -R spec" - }, - "version": "3.2.0" -} diff --git a/node_modules/ajv/package.json b/node_modules/ajv/package.json index fc0c4f6..15ebb53 100644 --- a/node_modules/ajv/package.json +++ b/node_modules/ajv/package.json @@ -1,41 +1,44 @@ { - "_from": "ajv@^6.5.5", + "_args": [ + [ + "ajv@6.6.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "ajv@6.6.2", "_id": "ajv@6.6.2", "_inBundle": false, "_integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", "_location": "/ajv", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "ajv@^6.5.5", + "raw": "ajv@6.6.2", "name": "ajv", "escapedName": "ajv", - "rawSpec": "^6.5.5", + "rawSpec": "6.6.2", "saveSpec": null, - "fetchSpec": "^6.5.5" + "fetchSpec": "6.6.2" }, "_requiredBy": [ "/har-validator" ], "_resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz", - "_shasum": "caceccf474bf3fc3ce3b147443711a24063cc30d", - "_spec": "ajv@^6.5.5", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/har-validator", + "_spec": "6.6.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Evgeny Poberezkin" }, "bugs": { "url": "https://github.com/epoberezkin/ajv/issues" }, - "bundleDependencies": false, "dependencies": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, - "deprecated": false, "description": "Another JSON Schema Validator", "devDependencies": { "ajv-async": "^1.0.0", diff --git a/node_modules/ansi-align/CHANGELOG.md b/node_modules/ansi-align/CHANGELOG.md deleted file mode 100644 index 621e50a..0000000 --- a/node_modules/ansi-align/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -# [2.0.0](https://github.com/nexdrew/ansi-align/compare/v1.1.0...v2.0.0) (2017-05-01) - - -### Features - -* ES2015ify, dropping support for Node <4 ([#30](https://github.com/nexdrew/ansi-align/issues/30)) ([7b43f48](https://github.com/nexdrew/ansi-align/commit/7b43f48)) - - -### BREAKING CHANGES - -* Node 0.10 or 0.12 no longer supported, please update to Node 4+ or use ansi-align@1.1.0 - - - - -# [1.1.0](https://github.com/nexdrew/ansi-align/compare/v1.0.0...v1.1.0) (2016-06-06) - - -### Features - -* support left-alignment as no-op ([#3](https://github.com/nexdrew/ansi-align/issues/3)) ([e581db6](https://github.com/nexdrew/ansi-align/commit/e581db6)) - - - - -# 1.0.0 (2016-04-30) - - -### Features - -* initial commit ([1914d90](https://github.com/nexdrew/ansi-align/commit/1914d90)) diff --git a/node_modules/ansi-align/LICENSE b/node_modules/ansi-align/LICENSE deleted file mode 100644 index ab601b6..0000000 --- a/node_modules/ansi-align/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2016, 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/ansi-align/README.md b/node_modules/ansi-align/README.md deleted file mode 100644 index 3aafc67..0000000 --- a/node_modules/ansi-align/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# ansi-align - -> align-text with ANSI support for CLIs - -[![Build Status](https://travis-ci.org/nexdrew/ansi-align.svg?branch=master)](https://travis-ci.org/nexdrew/ansi-align) -[![Coverage Status](https://coveralls.io/repos/github/nexdrew/ansi-align/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/ansi-align?branch=master) -[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) - -Easily center- or right- align a block of text, carefully ignoring ANSI escape codes. - -E.g. turn this: - -ansi text block no alignment :( - -Into this: - -ansi text block center aligned! - -## Install - -```sh -npm install --save ansi-align -``` - -```js -var ansiAlign = require('ansi-align') -``` - -## API - -### `ansiAlign(text, [opts])` - -Align the given text per the line with the greatest [`string-width`](https://github.com/sindresorhus/string-width), returning a new string (or array). - -#### Arguments - -- `text`: required, string or array - - The text to align. If a string is given, it will be split using either the `opts.split` value or `'\n'` by default. If an array is given, a different array of modified strings will be returned. - -- `opts`: optional, object - - Options to change behavior, see below. - -#### Options - -- `opts.align`: string, default `'center'` - - The alignment mode. Use `'center'` for center-alignment, `'right'` for right-alignment, or `'left'` for left-alignment. Note that the given `text` is assumed to be left-aligned already, so specifying `align: 'left'` just returns the `text` as is (no-op). - -- `opts.split`: string or RegExp, default `'\n'` - - The separator to use when splitting the text. Only used if text is given as a string. - -- `opts.pad`: string, default `' '` - - The value used to left-pad (prepend to) lines of lesser width. Will be repeated as necessary to adjust alignment to the line with the greatest width. - -### `ansiAlign.center(text)` - -Alias for `ansiAlign(text, { align: 'center' })`. - -### `ansiAlign.right(text)` - -Alias for `ansiAlign(text, { align: 'right' })`. - -### `ansiAlign.left(text)` - -Alias for `ansiAlign(text, { align: 'left' })`, which is a no-op. - -## Similar Packages - -- [`center-align`](https://github.com/jonschlinkert/center-align): Very close to this package, except it doesn't support ANSI codes. -- [`left-pad`](https://github.com/camwest/left-pad): Great for left-padding but does not support center alignment or ANSI codes. -- Pretty much anything by the [chalk](https://github.com/chalk) team - -## License - -ISC © Contributors diff --git a/node_modules/ansi-align/index.js b/node_modules/ansi-align/index.js deleted file mode 100644 index 67fa826..0000000 --- a/node_modules/ansi-align/index.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' - -const stringWidth = require('string-width') - -function ansiAlign (text, opts) { - if (!text) return text - - opts = opts || {} - const align = opts.align || 'center' - - // short-circuit `align: 'left'` as no-op - if (align === 'left') return text - - const split = opts.split || '\n' - const pad = opts.pad || ' ' - const widthDiffFn = align !== 'right' ? halfDiff : fullDiff - - let returnString = false - if (!Array.isArray(text)) { - returnString = true - text = String(text).split(split) - } - - let width - let maxWidth = 0 - text = text.map(function (str) { - str = String(str) - width = stringWidth(str) - maxWidth = Math.max(width, maxWidth) - return { - str, - width - } - }).map(function (obj) { - return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str - }) - - return returnString ? text.join(split) : text -} - -ansiAlign.left = function left (text) { - return ansiAlign(text, { align: 'left' }) -} - -ansiAlign.center = function center (text) { - return ansiAlign(text, { align: 'center' }) -} - -ansiAlign.right = function right (text) { - return ansiAlign(text, { align: 'right' }) -} - -module.exports = ansiAlign - -function halfDiff (maxWidth, curWidth) { - return Math.floor((maxWidth - curWidth) / 2) -} - -function fullDiff (maxWidth, curWidth) { - return maxWidth - curWidth -} diff --git a/node_modules/ansi-align/node_modules/ansi-regex/index.js b/node_modules/ansi-align/node_modules/ansi-regex/index.js deleted file mode 100644 index c4aaecf..0000000 --- a/node_modules/ansi-align/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = () => { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, 'g'); -}; diff --git a/node_modules/ansi-align/node_modules/ansi-regex/license b/node_modules/ansi-align/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/ansi-align/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/ansi-align/node_modules/ansi-regex/package.json b/node_modules/ansi-align/node_modules/ansi-regex/package.json deleted file mode 100644 index 09febca..0000000 --- a/node_modules/ansi-align/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "ansi-regex@^3.0.0", - "_id": "ansi-regex@3.0.0", - "_inBundle": false, - "_integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "_location": "/ansi-align/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-regex@^3.0.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/ansi-align/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "_shasum": "ed0317c322064f79466c02966bddb605ab37d998", - "_spec": "ansi-regex@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/ansi-align/node_modules/strip-ansi", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/ansi-regex#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "3.0.0" -} diff --git a/node_modules/ansi-align/node_modules/ansi-regex/readme.md b/node_modules/ansi-align/node_modules/ansi-regex/readme.md deleted file mode 100644 index 22db1c3..0000000 --- a/node_modules/ansi-align/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] -``` - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/ansi-align/node_modules/is-fullwidth-code-point/index.js b/node_modules/ansi-align/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index d506327..0000000 --- a/node_modules/ansi-align/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -/* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { - return false; - } - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || - // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || - // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || - // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || - // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || - // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || - // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || - // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || - // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || - // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) - ) - ) { - return true; - } - - return false; -}; diff --git a/node_modules/ansi-align/node_modules/is-fullwidth-code-point/license b/node_modules/ansi-align/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/ansi-align/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/ansi-align/node_modules/is-fullwidth-code-point/package.json b/node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index 80c8316..0000000 --- a/node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-fullwidth-code-point@^2.0.0", - "_id": "is-fullwidth-code-point@2.0.0", - "_inBundle": false, - "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "_location": "/ansi-align/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-fullwidth-code-point@^2.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/ansi-align/string-width" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", - "_spec": "is-fullwidth-code-point@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/ansi-align/node_modules/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "license": "MIT", - "name": "is-fullwidth-code-point", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/ansi-align/node_modules/is-fullwidth-code-point/readme.md b/node_modules/ansi-align/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 093b028..0000000 --- a/node_modules/ansi-align/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ansi-align/node_modules/string-width/index.js b/node_modules/ansi-align/node_modules/string-width/index.js deleted file mode 100644 index bbc49d2..0000000 --- a/node_modules/ansi-align/node_modules/string-width/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -module.exports = str => { - if (typeof str !== 'string' || str.length === 0) { - return 0; - } - - str = stripAnsi(str); - - let width = 0; - - for (let i = 0; i < str.length; i++) { - const code = str.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; diff --git a/node_modules/ansi-align/node_modules/string-width/license b/node_modules/ansi-align/node_modules/string-width/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/ansi-align/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/ansi-align/node_modules/string-width/package.json b/node_modules/ansi-align/node_modules/string-width/package.json deleted file mode 100644 index 0835291..0000000 --- a/node_modules/ansi-align/node_modules/string-width/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "string-width@^2.0.0", - "_id": "string-width@2.1.1", - "_inBundle": false, - "_integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "_location": "/ansi-align/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^2.0.0", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/ansi-align" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "_shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e", - "_spec": "string-width@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/ansi-align", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "license": "MIT", - "name": "string-width", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/string-width.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.1.1" -} diff --git a/node_modules/ansi-align/node_modules/string-width/readme.md b/node_modules/ansi-align/node_modules/string-width/readme.md deleted file mode 100644 index df5b719..0000000 --- a/node_modules/ansi-align/node_modules/string-width/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ansi-align/node_modules/strip-ansi/index.js b/node_modules/ansi-align/node_modules/strip-ansi/index.js deleted file mode 100644 index 96e0292..0000000 --- a/node_modules/ansi-align/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; diff --git a/node_modules/ansi-align/node_modules/strip-ansi/license b/node_modules/ansi-align/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/ansi-align/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/ansi-align/node_modules/strip-ansi/package.json b/node_modules/ansi-align/node_modules/strip-ansi/package.json deleted file mode 100644 index 85406a8..0000000 --- a/node_modules/ansi-align/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "strip-ansi@^4.0.0", - "_id": "strip-ansi@4.0.0", - "_inBundle": false, - "_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "_location": "/ansi-align/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^4.0.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/ansi-align/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "_shasum": "a8479022eb1ac368a871389b635262c505ee368f", - "_spec": "strip-ansi@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/ansi-align/node_modules/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/strip-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/strip-ansi#readme", - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} diff --git a/node_modules/ansi-align/node_modules/strip-ansi/readme.md b/node_modules/ansi-align/node_modules/strip-ansi/readme.md deleted file mode 100644 index dc76f0c..0000000 --- a/node_modules/ansi-align/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/ansi-align/package.json b/node_modules/ansi-align/package.json deleted file mode 100644 index 53652a0..0000000 --- a/node_modules/ansi-align/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "ansi-align@^2.0.0", - "_id": "ansi-align@2.0.0", - "_inBundle": false, - "_integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "_location": "/ansi-align", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-align@^2.0.0", - "name": "ansi-align", - "escapedName": "ansi-align", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "_shasum": "c36aeccba563b89ceb556f3690f0b1d9e3547f7f", - "_spec": "ansi-align@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen", - "author": { - "name": "nexdrew" - }, - "bugs": { - "url": "https://github.com/nexdrew/ansi-align/issues" - }, - "bundleDependencies": false, - "dependencies": { - "string-width": "^2.0.0" - }, - "deprecated": false, - "description": "align-text with ANSI support for CLIs", - "devDependencies": { - "ava": "^0.19.1", - "chalk": "^1.1.3", - "coveralls": "^2.13.1", - "nyc": "^10.3.0", - "standard": "^10.0.2", - "standard-version": "^4.0.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/nexdrew/ansi-align#readme", - "keywords": [ - "ansi", - "align", - "cli", - "center", - "pad" - ], - "license": "ISC", - "main": "index.js", - "name": "ansi-align", - "repository": { - "type": "git", - "url": "git+https://github.com/nexdrew/ansi-align.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "pretest": "standard", - "release": "standard-version", - "test": "nyc ava" - }, - "version": "2.0.0" -} diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json index 11a5162..25e5890 100644 --- a/node_modules/ansi-regex/package.json +++ b/node_modules/ansi-regex/package.json @@ -1,27 +1,32 @@ { - "_from": "ansi-regex@^2.0.0", + "_args": [ + [ + "ansi-regex@2.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "ansi-regex@2.1.1", "_id": "ansi-regex@2.1.1", "_inBundle": false, "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "_location": "/ansi-regex", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "ansi-regex@^2.0.0", + "raw": "ansi-regex@2.1.1", "name": "ansi-regex", "escapedName": "ansi-regex", - "rawSpec": "^2.0.0", + "rawSpec": "2.1.1", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "2.1.1" }, "_requiredBy": [ "/strip-ansi" ], "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", - "_spec": "ansi-regex@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/strip-ansi", + "_spec": "2.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +35,6 @@ "bugs": { "url": "https://github.com/chalk/ansi-regex/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Regular expression for matching ANSI escape codes", "devDependencies": { "ava": "0.17.0", diff --git a/node_modules/app-builder-bin/index.d.ts b/node_modules/app-builder-bin/index.d.ts deleted file mode 100644 index 64f99fd..0000000 --- a/node_modules/app-builder-bin/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const appBuilderPath: string \ No newline at end of file diff --git a/node_modules/app-builder-bin/index.js b/node_modules/app-builder-bin/index.js deleted file mode 100644 index 7a6ffa5..0000000 --- a/node_modules/app-builder-bin/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict" - -const path = require("path") - -function getPath() { - if (process.env.USE_SYSTEM_APP_BUILDER === "true") { - return "app-builder" - } - - const platform = process.platform; - if (platform === "darwin") { - return path.join(__dirname, "mac", "app-builder") - } - else if (platform === "win32") { - return path.join(__dirname, "win", process.arch, "app-builder.exe") - } - else { - return path.join(__dirname, "linux", process.arch, "app-builder") - } -} - -exports.appBuilderPath = getPath() \ No newline at end of file diff --git a/node_modules/app-builder-bin/linux/arm/app-builder b/node_modules/app-builder-bin/linux/arm/app-builder deleted file mode 100755 index 8f1c621..0000000 Binary files a/node_modules/app-builder-bin/linux/arm/app-builder and /dev/null differ diff --git a/node_modules/app-builder-bin/linux/arm64/app-builder b/node_modules/app-builder-bin/linux/arm64/app-builder deleted file mode 100755 index 060e8e7..0000000 Binary files a/node_modules/app-builder-bin/linux/arm64/app-builder and /dev/null differ diff --git a/node_modules/app-builder-bin/linux/ia32/app-builder b/node_modules/app-builder-bin/linux/ia32/app-builder deleted file mode 100755 index d97c470..0000000 Binary files a/node_modules/app-builder-bin/linux/ia32/app-builder and /dev/null differ diff --git a/node_modules/app-builder-bin/linux/x64/app-builder b/node_modules/app-builder-bin/linux/x64/app-builder deleted file mode 100755 index 2ea4ed2..0000000 Binary files a/node_modules/app-builder-bin/linux/x64/app-builder and /dev/null differ diff --git a/node_modules/app-builder-bin/mac/app-builder b/node_modules/app-builder-bin/mac/app-builder deleted file mode 100755 index 91b9795..0000000 Binary files a/node_modules/app-builder-bin/mac/app-builder and /dev/null differ diff --git a/node_modules/app-builder-bin/package.json b/node_modules/app-builder-bin/package.json deleted file mode 100644 index 8062990..0000000 --- a/node_modules/app-builder-bin/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "_from": "app-builder-bin@2.6.1", - "_id": "app-builder-bin@2.6.1", - "_inBundle": false, - "_integrity": "sha512-W0l85O+s6lOaziWqAhszPfwiG0s15FvMBP9j9i/bknsMccUkwN60u4Cy7yYtf6akCUDuJenLqpTX4/xvkq1egw==", - "_location": "/app-builder-bin", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "app-builder-bin@2.6.1", - "name": "app-builder-bin", - "escapedName": "app-builder-bin", - "rawSpec": "2.6.1", - "saveSpec": null, - "fetchSpec": "2.6.1" - }, - "_requiredBy": [ - "/app-builder-lib", - "/builder-util" - ], - "_resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-2.6.1.tgz", - "_shasum": "aa97f82d341dfa6f1269d78955482d619cc613ed", - "_spec": "app-builder-bin@2.6.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "bugs": { - "url": "https://github.com/develar/app-builder/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "app-builder precompiled binaries", - "files": [ - "*.js", - "mac", - "linux", - "win", - "index.d.ts" - ], - "homepage": "https://github.com/develar/app-builder#readme", - "keywords": [ - "snap", - "appimage", - "icns" - ], - "license": "MIT", - "name": "app-builder-bin", - "repository": { - "type": "git", - "url": "git+https://github.com/develar/app-builder.git" - }, - "version": "2.6.1" -} diff --git a/node_modules/app-builder-bin/readme.md b/node_modules/app-builder-bin/readme.md deleted file mode 100644 index 3bf44f9..0000000 --- a/node_modules/app-builder-bin/readme.md +++ /dev/null @@ -1,97 +0,0 @@ -# app-builder - -Generic helper tool to build app in a distributable formats. -Used by [electron-builder](http://github.com/electron-userland/electron-builder) but applicable not only for building Electron applications. - -``` -usage: app-builder [] [ ...] - -app-builder - -Flags: - --help Show context-sensitive help (also try --help-long and --help-man). - --version Show application version. - -Commands: - help [...] - Show help. - - - blockmap --input=INPUT [] - Generates file block map for differential update using content defined - chunking (that is robust to insertions, deletions, and changes to input - file) - - -i, --input=INPUT input file - -o, --output=OUTPUT output file - -c, --compression=gzip compression, one of: gzip, deflate - - download --url=URL --output=OUTPUT [] - Download file. - - -u, --url=URL The URL. - -o, --output=OUTPUT The output file. - --sha512=SHA512 The expected sha512 of file. - - download-artifact --name=NAME --url=URL [] - Download, unpack and cache artifact from GitHub. - - -n, --name=NAME The artifact name. - -u, --url=URL The artifact URL. - --sha512=SHA512 The expected sha512 of file. - - copy --from=FROM --to=TO [] - Copy file or dir. - - -f, --from=FROM - -t, --to=TO - --hard-link Whether to use hard-links if possible - - appimage --app=APP --stage=STAGE --output=OUTPUT [] - Build AppImage. - - -a, --app=APP The app dir. - -s, --stage=STAGE The stage dir. - -o, --output=OUTPUT The output file. - --arch=x64 The arch. - --compression=COMPRESSION The compression. - --remove-stage Whether to remove stage after build. - - snap --app=APP --stage=STAGE --output=OUTPUT [] - Build snap. - - -t, --template=TEMPLATE The template file. - -u, --template-url=TEMPLATE-URL - The template archive URL. - --template-sha512=TEMPLATE-SHA512 - The expected sha512 of template archive. - -a, --app=APP The app dir. - -s, --stage=STAGE The stage dir. - --icon=ICON The path to the icon. - --hooks=HOOKS The hooks dir. - --arch=amd64 The arch. - -o, --output=OUTPUT The output file. - --docker-image="snapcore/snapcraft:latest" - The docker image. - --docker Whether to use Docker. - --remove-stage Whether to remove stage after build. - - icon --input=INPUT --format=FORMAT --out=OUT [] - create ICNS or ICO or icon set from PNG files - - -i, --input=INPUT ... input directory or file - -f, --format=FORMAT output format - --out=OUT output directory - -r, --root=ROOT ... base directory to resolve relative path - - dmg --volume=VOLUME [] - Build dmg. - - --volume=VOLUME - --icon=ICON - --background=BACKGROUND - - clear-exec-stack --input=INPUT - - -i, --input=INPUT -``` \ No newline at end of file diff --git a/node_modules/app-builder-bin/win/ia32/app-builder.exe b/node_modules/app-builder-bin/win/ia32/app-builder.exe deleted file mode 100755 index 5f6a703..0000000 Binary files a/node_modules/app-builder-bin/win/ia32/app-builder.exe and /dev/null differ diff --git a/node_modules/app-builder-bin/win/x64/app-builder.exe b/node_modules/app-builder-bin/win/x64/app-builder.exe deleted file mode 100755 index 9ac24d3..0000000 Binary files a/node_modules/app-builder-bin/win/x64/app-builder.exe and /dev/null differ diff --git a/node_modules/app-builder-lib/certs/root_certs.keychain b/node_modules/app-builder-lib/certs/root_certs.keychain deleted file mode 100644 index a823698..0000000 Binary files a/node_modules/app-builder-lib/certs/root_certs.keychain and /dev/null differ diff --git a/node_modules/app-builder-lib/node_modules/debug/CHANGELOG.md b/node_modules/app-builder-lib/node_modules/debug/CHANGELOG.md deleted file mode 100644 index 820d21e..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,395 +0,0 @@ - -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/app-builder-lib/node_modules/debug/LICENSE b/node_modules/app-builder-lib/node_modules/debug/LICENSE deleted file mode 100644 index 658c933..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(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/app-builder-lib/node_modules/debug/README.md b/node_modules/app-builder-lib/node_modules/debug/README.md deleted file mode 100644 index 88dae35..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/README.md +++ /dev/null @@ -1,455 +0,0 @@ -# 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 -``` - -`disable()` - -Will disable all namespaces. The functions returns the namespaces currently -enabled (and skipped). This can be useful if you want to disable debugging -temporarily without knowing what was enabled to begin with. - -For example: - -```js -let debug = require('debug'); -debug.enable('foo:*,-foo:bar'); -let namespaces = debug.disable(); -debug.enable(namespaces); -``` - -Note: There is no guarantee that the string will be identical to the initial -enable string, but semantically they will be identical. - -## 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/app-builder-lib/node_modules/debug/dist/debug.js b/node_modules/app-builder-lib/node_modules/debug/dist/debug.js deleted file mode 100644 index 89ad0c2..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/dist/debug.js +++ /dev/null @@ -1,912 +0,0 @@ -"use strict"; - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - -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); } - -(function (f) { - if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { - module.exports = f(); - } else if (typeof define === "function" && define.amd) { - define([], f); - } else { - var g; - - if (typeof window !== "undefined") { - g = window; - } else if (typeof global !== "undefined") { - g = global; - } else if (typeof self !== "undefined") { - g = self; - } else { - g = this; - } - - g.debug = f(); - } -})(function () { - var define, module, exports; - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = "function" == typeof require && require; - if (!f && c) return c(i, !0); - if (u) return u(i, !0); - var a = new Error("Cannot find module '" + i + "'"); - throw a.code = "MODULE_NOT_FOUND", a; - } - - var p = n[i] = { - exports: {} - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - - return n[i].exports; - } - - for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { - o(t[i]); - } - - return o; - } - - return r; - }()({ - 1: [function (require, module, exports) { - /** - * Helpers. - */ - var s = 1000; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - - module.exports = function (val, options) { - options = options || {}; - - var type = _typeof(val); - - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); - }; - /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - - - function parse(str) { - str = String(str); - - if (str.length > 100) { - return; - } - - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - - if (!match) { - return; - } - - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - - case 'weeks': - case 'week': - case 'w': - return n * w; - - case 'days': - case 'day': - case 'd': - return n * d; - - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - - default: - return undefined; - } - } - /** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtShort(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - - return ms + 'ms'; - } - /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtLong(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - - return ms + ' ms'; - } - /** - * Pluralization helper. - */ - - - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); - } - }, {}], - 2: [function (require, module, exports) { - // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - })(); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; // v8 likes predictible objects - - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - - process.listeners = function (name) { - return []; - }; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { - return '/'; - }; - - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - - process.umask = function () { - return 0; - }; - }, {}], - 3: [function (require, module, exports) { - /** - * 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() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - // Disabled? - if (!debug.enabled) { - return; - } - - 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) { - var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - /** - * 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. - * - * @return {String} namespaces - * @api public - */ - - - function disable() { - var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { - return '-' + namespace; - }))).join(','); - createDebug.enable(''); - return namespaces; - } - /** - * 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; - } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - - - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); - } - /** - * 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; - }, { - "ms": 1 - }], - 4: [function (require, module, exports) { - (function (process) { - /* 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; - } - }; - }).call(this, require('_process')); - }, { - "./common": 3, - "_process": 2 - }] - }, {}, [4])(4); -}); diff --git a/node_modules/app-builder-lib/node_modules/debug/package.json b/node_modules/app-builder-lib/node_modules/debug/package.json deleted file mode 100644 index 72d2d73..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_from": "debug@^4.1.0", - "_id": "debug@4.1.1", - "_inBundle": false, - "_integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "_location": "/app-builder-lib/debug", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "debug@^4.1.0", - "name": "debug", - "escapedName": "debug", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/app-builder-lib" - ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "_shasum": "3b72260255109c6b589cee050f1d516139664791", - "_spec": "debug@^4.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - } - ], - "dependencies": { - "ms": "^2.1.1" - }, - "deprecated": false, - "description": "small debugging utility", - "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" - }, - "files": [ - "src", - "dist/debug.js", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/visionmedia/debug#readme", - "keywords": [ - "debug", - "log", - "debugger" - ], - "license": "MIT", - "main": "./src/index.js", - "name": "debug", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "scripts": { - "build": "npm run build:debug && npm run build:test", - "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", - "build:test": "babel -d dist test.js", - "clean": "rimraf dist coverage", - "lint": "xo", - "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", - "pretest:browser": "npm run build", - "test": "npm run test:node && npm run test:browser", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls", - "test:node": "istanbul cover _mocha -- test.js" - }, - "unpkg": "./dist/debug.js", - "version": "4.1.1" -} diff --git a/node_modules/app-builder-lib/node_modules/debug/src/browser.js b/node_modules/app-builder-lib/node_modules/debug/src/browser.js deleted file mode 100644 index 5f34c0d..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/src/browser.js +++ /dev/null @@ -1,264 +0,0 @@ -/* 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; - } - - const 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 - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, 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(...args) { - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return typeof console === 'object' && - console.log && - console.log(...args); -} - -/** - * 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() { - let 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); - -const {formatters} = module.exports; - -/** - * 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/app-builder-lib/node_modules/debug/src/common.js b/node_modules/app-builder-lib/node_modules/debug/src/common.js deleted file mode 100644 index 2f82b8d..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/src/common.js +++ /dev/null @@ -1,266 +0,0 @@ - -/** - * 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(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) { - let hash = 0; - - for (let 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) { - let prevTime; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const 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 - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const 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); - - const 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() { - const index = createDebug.instances.indexOf(this); - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - return false; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * 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 = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const 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++) { - const instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * 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; - } - - let i; - let 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; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * 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/app-builder-lib/node_modules/debug/src/index.js b/node_modules/app-builder-lib/node_modules/debug/src/index.js deleted file mode 100644 index bf4c57f..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/app-builder-lib/node_modules/debug/src/node.js b/node_modules/app-builder-lib/node_modules/debug/src/node.js deleted file mode 100644 index 5e1f154..0000000 --- a/node_modules/app-builder-lib/node_modules/debug/src/node.js +++ /dev/null @@ -1,257 +0,0 @@ -/** - * Module dependencies. - */ - -const tty = require('tty'); -const 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 - const 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(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let 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) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[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(...args) { - return process.stderr.write(util.format(...args) + '\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 = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * 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) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * 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/app-builder-lib/out/Framework.d.ts b/node_modules/app-builder-lib/out/Framework.d.ts deleted file mode 100644 index 1d50b5a..0000000 --- a/node_modules/app-builder-lib/out/Framework.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { FileTransformer } from "builder-util/out/fs"; -import { AsarIntegrity } from "./asar/integrity"; -import { Platform, PlatformPackager, ElectronPlatformName, AfterPackContext } from "./index"; -export interface Framework { - readonly name: string; - readonly version: string; - readonly distMacOsAppName: string; - readonly macOsDefaultTargets: Array; - readonly defaultAppIdPrefix: string; - readonly isNpmRebuildRequired: boolean; - readonly isCopyElevateHelper: boolean; - getDefaultIcon?(platform: Platform): string | null; - getMainFile?(platform: Platform): string | null; - getExcludedDependencies?(platform: Platform): Array | null; - prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise; - beforeCopyExtraFiles?(options: BeforeCopyExtraFilesOptions): Promise; - afterPack?(context: AfterPackContext): Promise; - createTransformer?(): FileTransformer | null; -} -export interface BeforeCopyExtraFilesOptions { - packager: PlatformPackager; - appOutDir: string; - asarIntegrity: AsarIntegrity | null; - platformName: string; -} -export interface PrepareApplicationStageDirectoryOptions { - readonly packager: PlatformPackager; - /** - * Platform doesn't process application output directory in any way. Unpack implementation must create or empty dir if need. - */ - readonly appOutDir: string; - readonly platformName: ElectronPlatformName; - readonly arch: string; - readonly version: string; -} -export declare function isElectronBased(framework: Framework): boolean; diff --git a/node_modules/app-builder-lib/out/Framework.js b/node_modules/app-builder-lib/out/Framework.js deleted file mode 100644 index ba71fe2..0000000 --- a/node_modules/app-builder-lib/out/Framework.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isElectronBased = isElectronBased; - -function isElectronBased(framework) { - return framework.name === "electron" || framework.name === "muon"; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=Framework.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/Framework.js.map b/node_modules/app-builder-lib/out/Framework.js.map deleted file mode 100644 index f5fa670..0000000 --- a/node_modules/app-builder-lib/out/Framework.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/Framework.ts"],"names":[],"mappings":";;;;;;;AAmDM,SAAU,eAAV,CAA0B,SAA1B,EAA8C;AAClD,SAAO,SAAS,CAAC,IAAV,KAAmB,UAAnB,IAAiC,SAAS,CAAC,IAAV,KAAmB,MAA3D;AACD,C","sourcesContent":["import { FileTransformer } from \"builder-util/out/fs\"\nimport { AsarIntegrity } from \"./asar/integrity\"\nimport { Platform, PlatformPackager, ElectronPlatformName, AfterPackContext } from \"./index\"\n\nexport interface Framework {\n readonly name: string\n readonly version: string\n readonly distMacOsAppName: string\n readonly macOsDefaultTargets: Array\n readonly defaultAppIdPrefix: string\n\n readonly isNpmRebuildRequired: boolean\n\n readonly isCopyElevateHelper: boolean\n\n getDefaultIcon?(platform: Platform): string | null\n\n getMainFile?(platform: Platform): string | null\n\n getExcludedDependencies?(platform: Platform): Array | null\n\n prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise\n\n beforeCopyExtraFiles?(options: BeforeCopyExtraFilesOptions): Promise\n\n afterPack?(context: AfterPackContext): Promise\n\n createTransformer?(): FileTransformer | null\n}\n\nexport interface BeforeCopyExtraFilesOptions {\n packager: PlatformPackager\n appOutDir: string\n\n asarIntegrity: AsarIntegrity | null\n\n // ElectronPlatformName\n platformName: string\n}\n\nexport interface PrepareApplicationStageDirectoryOptions {\n readonly packager: PlatformPackager\n /**\n * Platform doesn't process application output directory in any way. Unpack implementation must create or empty dir if need.\n */\n readonly appOutDir: string\n readonly platformName: ElectronPlatformName\n readonly arch: string\n readonly version: string\n}\n\nexport function isElectronBased(framework: Framework) {\n return framework.name === \"electron\" || framework.name === \"muon\"\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/ProtonFramework.d.ts b/node_modules/app-builder-lib/out/ProtonFramework.d.ts deleted file mode 100644 index 4fcd219..0000000 --- a/node_modules/app-builder-lib/out/ProtonFramework.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FileTransformer } from "builder-util/out/fs"; -import { Platform } from "./core"; -import { LibUiFramework } from "./frameworks/LibUiFramework"; -export declare class ProtonFramework extends LibUiFramework { - readonly name = "proton"; - readonly defaultAppIdPrefix = "com.proton-native."; - constructor(version: string, distMacOsAppName: string, isUseLaunchUi: boolean); - getDefaultIcon(platform: Platform): string; - createTransformer(): FileTransformer | null; -} diff --git a/node_modules/app-builder-lib/out/ProtonFramework.js b/node_modules/app-builder-lib/out/ProtonFramework.js deleted file mode 100644 index 4e16122..0000000 --- a/node_modules/app-builder-lib/out/ProtonFramework.js +++ /dev/null @@ -1,158 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ProtonFramework = void 0; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("./core"); - - _core = function () { - return data; - }; - - return data; -} - -function _fileTransformer() { - const data = require("./fileTransformer"); - - _fileTransformer = function () { - return data; - }; - - return data; -} - -function _LibUiFramework() { - const data = require("./frameworks/LibUiFramework"); - - _LibUiFramework = function () { - return data; - }; - - return data; -} - -function _pathManager() { - const data = require("./util/pathManager"); - - _pathManager = function () { - return data; - }; - - return data; -} - -class ProtonFramework extends _LibUiFramework().LibUiFramework { - constructor(version, distMacOsAppName, isUseLaunchUi) { - super(version, distMacOsAppName, isUseLaunchUi); - this.name = "proton"; // noinspection JSUnusedGlobalSymbols - - this.defaultAppIdPrefix = "com.proton-native."; - } - - getDefaultIcon(platform) { - if (platform === _core().Platform.WINDOWS) { - return (0, _pathManager().getTemplatePath)("icons/proton-native/proton-native.ico"); - } else if (platform === _core().Platform.LINUX) { - return (0, _pathManager().getTemplatePath)("icons/proton-native/linux"); - } else { - return (0, _pathManager().getTemplatePath)("icons/proton-native/proton-native.icns"); - } - } - - createTransformer() { - let babel; - const babelOptions = { - ast: false, - sourceMaps: "inline" - }; - - if (process.env.TEST_SET_BABEL_PRESET === "true") { - babel = require("@babel/core"); - babel = testOnlyBabel(babel, babelOptions, this.version); - } else { - try { - babel = require("babel-core"); - } catch (e) { - // babel isn't installed - _builderUtil().log.debug(null, "don't transpile source code using Babel"); - - return null; - } - } - - _builderUtil().log.info({ - options: (0, _builderUtilRuntime().safeStringifyJson)(babelOptions, new Set(["presets"])) - }, "transpile source code using Babel"); - - return file => { - if (!(file.endsWith(".js") || file.endsWith(".jsx")) || file.includes(_fileTransformer().NODE_MODULES_PATTERN)) { - return null; - } - - return new Promise((resolve, reject) => { - return babel.transformFile(file, babelOptions, (error, result) => { - if (error == null) { - resolve(result.code); - } else { - reject(error); - } - }); - }); - }; - } - -} - -exports.ProtonFramework = ProtonFramework; - -function testOnlyBabel(babel, babelOptions, nodeVersion) { - // out test dir can be located outside of electron-builder node_modules and babel cannot resolve string names of preset - babelOptions.presets = [[require("@babel/preset-env").default, { - targets: { - node: nodeVersion - } - }], require("@babel/preset-react")]; - babelOptions.plugins = [// stage 0 - require("@babel/plugin-proposal-function-bind").default, // stage 1 - require("@babel/plugin-proposal-export-default-from").default, require("@babel/plugin-proposal-logical-assignment-operators").default, [require("@babel/plugin-proposal-optional-chaining").default, { - loose: false - }], [require("@babel/plugin-proposal-pipeline-operator").default, { - proposal: "minimal" - }], [require("@babel/plugin-proposal-nullish-coalescing-operator").default, { - loose: false - }], require("@babel/plugin-proposal-do-expressions").default, // stage 2 - [require("@babel/plugin-proposal-decorators").default, { - legacy: true - }], require("@babel/plugin-proposal-function-sent").default, require("@babel/plugin-proposal-export-namespace-from").default, require("@babel/plugin-proposal-numeric-separator").default, require("@babel/plugin-proposal-throw-expressions").default, // stage 3 - require("@babel/plugin-syntax-dynamic-import").default, require("@babel/plugin-syntax-import-meta").default, [require("@babel/plugin-proposal-class-properties").default, { - loose: false - }], require("@babel/plugin-proposal-json-strings").default]; - babelOptions.babelrc = false; - return babel; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=ProtonFramework.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/ProtonFramework.js.map b/node_modules/app-builder-lib/out/ProtonFramework.js.map deleted file mode 100644 index 759ff62..0000000 --- a/node_modules/app-builder-lib/out/ProtonFramework.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/ProtonFramework.ts"],"names":[],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,eAAP,SAA+B,gCAA/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C,IAAA,KAAK,EAAE;AAAR,GAAxE,CATqB,EAUrB,OAAO,CAAC,uCAAD,CAAP,CAAiD,OAV5B,EAYrB;AACA,GAAC,OAAO,CAAC,mCAAD,CAAP,CAA6C,OAA9C,EAAuD;AAAC,IAAA,MAAM,EAAE;AAAT,GAAvD,CAbqB,EAcrB,OAAO,CAAC,sCAAD,CAAP,CAAgD,OAd3B,EAerB,OAAO,CAAC,8CAAD,CAAP,CAAwD,OAfnC,EAgBrB,OAAO,CAAC,0CAAD,CAAP,CAAoD,OAhB/B,EAiBrB,OAAO,CAAC,0CAAD,CAAP,CAAoD,OAjB/B,EAmBrB;AACA,EAAA,OAAO,CAAC,qCAAD,CAAP,CAA+C,OApB1B,EAqBrB,OAAO,CAAC,kCAAD,CAAP,CAA4C,OArBvB,EAsBrB,CAAC,OAAO,CAAC,yCAAD,CAAP,CAAmD,OAApD,EAA6D;AAAC,IAAA,KAAK,EAAE;AAAR,GAA7D,CAtBqB,EAuBrB,OAAO,CAAC,qCAAD,CAAP,CAA+C,OAvB1B,CAAvB;AAyBA,EAAA,YAAY,CAAC,OAAb,GAAuB,KAAvB;AACA,SAAO,KAAP;AACD,C","sourcesContent":["import { FileTransformer } from \"builder-util/out/fs\"\nimport { log } from \"builder-util\"\nimport { safeStringifyJson } from \"builder-util-runtime\"\nimport { Platform } from \"./core\"\nimport { NODE_MODULES_PATTERN } from \"./fileTransformer\"\nimport { LibUiFramework } from \"./frameworks/LibUiFramework\"\nimport { getTemplatePath } from \"./util/pathManager\"\n\nexport class ProtonFramework extends LibUiFramework {\n readonly name = \"proton\"\n\n // noinspection JSUnusedGlobalSymbols\n readonly defaultAppIdPrefix = \"com.proton-native.\"\n\n constructor(version: string, distMacOsAppName: string, isUseLaunchUi: boolean) {\n super(version, distMacOsAppName, isUseLaunchUi)\n }\n\n getDefaultIcon(platform: Platform) {\n if (platform === Platform.WINDOWS) {\n return getTemplatePath(\"icons/proton-native/proton-native.ico\")\n }\n else if (platform === Platform.LINUX) {\n return getTemplatePath(\"icons/proton-native/linux\")\n }\n else {\n return getTemplatePath(\"icons/proton-native/proton-native.icns\")\n }\n }\n\n createTransformer(): FileTransformer | null {\n let babel: any\n const babelOptions: any = {ast: false, sourceMaps: \"inline\"}\n if (process.env.TEST_SET_BABEL_PRESET === \"true\") {\n babel = require(\"@babel/core\")\n babel = testOnlyBabel(babel, babelOptions, this.version)\n }\n else {\n try {\n babel = require(\"babel-core\")\n }\n catch (e) {\n // babel isn't installed\n log.debug(null, \"don't transpile source code using Babel\")\n return null\n }\n }\n\n log.info({options: safeStringifyJson(babelOptions, new Set([\"presets\"]))}, \"transpile source code using Babel\")\n return file => {\n if (!(file.endsWith(\".js\") || file.endsWith(\".jsx\")) || file.includes(NODE_MODULES_PATTERN)) {\n return null\n }\n\n return new Promise((resolve, reject) => {\n return babel.transformFile(file, babelOptions, (error: Error, result: any) => {\n if (error == null) {\n resolve(result.code)\n }\n else {\n reject(error)\n }\n })\n })\n }\n }\n}\n\nfunction testOnlyBabel(babel: any, babelOptions: any, nodeVersion: string) {\n // out test dir can be located outside of electron-builder node_modules and babel cannot resolve string names of preset\n babelOptions.presets = [\n [require(\"@babel/preset-env\").default, {targets: {node: nodeVersion}}],\n require(\"@babel/preset-react\"),\n ]\n babelOptions.plugins = [\n // stage 0\n require(\"@babel/plugin-proposal-function-bind\").default,\n\n // stage 1\n require(\"@babel/plugin-proposal-export-default-from\").default,\n require(\"@babel/plugin-proposal-logical-assignment-operators\").default,\n [require(\"@babel/plugin-proposal-optional-chaining\").default, {loose: false}],\n [require(\"@babel/plugin-proposal-pipeline-operator\").default, {proposal: \"minimal\"}],\n [require(\"@babel/plugin-proposal-nullish-coalescing-operator\").default, {loose: false}],\n require(\"@babel/plugin-proposal-do-expressions\").default,\n\n // stage 2\n [require(\"@babel/plugin-proposal-decorators\").default, {legacy: true}],\n require(\"@babel/plugin-proposal-function-sent\").default,\n require(\"@babel/plugin-proposal-export-namespace-from\").default,\n require(\"@babel/plugin-proposal-numeric-separator\").default,\n require(\"@babel/plugin-proposal-throw-expressions\").default,\n\n // stage 3\n require(\"@babel/plugin-syntax-dynamic-import\").default,\n require(\"@babel/plugin-syntax-import-meta\").default,\n [require(\"@babel/plugin-proposal-class-properties\").default, {loose: false}],\n require(\"@babel/plugin-proposal-json-strings\").default,\n ]\n babelOptions.babelrc = false\n return babel\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/appInfo.d.ts b/node_modules/app-builder-lib/out/appInfo.d.ts deleted file mode 100644 index 08aac7c..0000000 --- a/node_modules/app-builder-lib/out/appInfo.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions"; -import { Packager } from "./packager"; -export declare class AppInfo { - private readonly info; - private readonly platformSpecificOptions; - readonly description: string; - readonly version: string; - readonly buildNumber: string | undefined; - readonly buildVersion: string; - readonly productName: string; - readonly productFilename: string; - constructor(info: Packager, buildVersion: string | null | undefined, platformSpecificOptions?: PlatformSpecificBuildOptions | null); - readonly channel: string | null; - getVersionInWeirdWindowsForm(isSetBuildNumber?: boolean): string; - private readonly notNullDevMetadata; - readonly companyName: string | null; - readonly id: string; - readonly macBundleIdentifier: string; - readonly name: string; - readonly linuxPackageName: string; - readonly sanitizedName: string; - readonly updaterCacheDirName: string; - readonly copyright: string; - computePackageUrl(): Promise; -} -export declare function smarten(s: string): string; diff --git a/node_modules/app-builder-lib/out/appInfo.js b/node_modules/app-builder-lib/out/appInfo.js deleted file mode 100644 index e52d473..0000000 --- a/node_modules/app-builder-lib/out/appInfo.js +++ /dev/null @@ -1,216 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.filterCFBundleIdentifier = filterCFBundleIdentifier; -exports.smarten = smarten; -exports.AppInfo = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _sanitizeFilename() { - const data = _interopRequireDefault(require("sanitize-filename")); - - _sanitizeFilename = function () { - return data; - }; - - return data; -} - -function _semver() { - const data = require("semver"); - - _semver = function () { - return data; - }; - - return data; -} - -function _macroExpander() { - const data = require("./util/macroExpander"); - - _macroExpander = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -class AppInfo { - constructor(info, buildVersion, platformSpecificOptions = null) { - this.info = info; - this.platformSpecificOptions = platformSpecificOptions; - this.description = smarten(this.info.metadata.description || ""); - this.version = info.metadata.version; - - if (buildVersion == null) { - buildVersion = info.config.buildVersion; - } - - this.buildNumber = process.env.BUILD_NUMBER || process.env.TRAVIS_BUILD_NUMBER || process.env.APPVEYOR_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM || process.env.BUILD_BUILDNUMBER; - - if (buildVersion == null) { - buildVersion = this.version; - - if (!(0, _builderUtil().isEmptyOrSpaces)(this.buildNumber)) { - buildVersion += `.${this.buildNumber}`; - } - } - - this.buildVersion = buildVersion; - this.productName = info.config.productName || info.metadata.productName || info.metadata.name; - this.productFilename = (0, _sanitizeFilename().default)(this.productName); - } - - get channel() { - const prereleaseInfo = (0, _semver().prerelease)(this.version); - - if (prereleaseInfo != null && prereleaseInfo.length > 0) { - return prereleaseInfo[0]; - } - - return null; - } - - getVersionInWeirdWindowsForm(isSetBuildNumber = true) { - const parsedVersion = new (_semver().SemVer)(this.version); // https://github.com/electron-userland/electron-builder/issues/2635#issuecomment-371792272 - - let buildNumber = isSetBuildNumber ? this.buildNumber : null; - - if (buildNumber == null || !/^\d+$/.test(buildNumber)) { - buildNumber = "0"; - } - - return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}.${buildNumber}`; - } - - get notNullDevMetadata() { - return this.info.devMetadata || {}; - } - - get companyName() { - const author = this.info.metadata.author || this.notNullDevMetadata.author; - return author == null ? null : author.name; - } - - get id() { - let appId = null; - - for (const options of [this.platformSpecificOptions, this.info.config]) { - if (options != null && appId == null) { - appId = options.appId; - } - } - - const generateDefaultAppId = () => { - const info = this.info; - return `${info.framework.defaultAppIdPrefix}${info.metadata.name.toLowerCase()}`; - }; - - if (appId != null && (appId === "your.id" || (0, _builderUtil().isEmptyOrSpaces)(appId))) { - const incorrectAppId = appId; - appId = generateDefaultAppId(); - - _builderUtil().log.warn(`do not use "${incorrectAppId}" as appId, "${appId}" will be used instead`); - } - - return appId == null ? generateDefaultAppId() : appId; - } - - get macBundleIdentifier() { - return filterCFBundleIdentifier(this.id); - } - - get name() { - return this.info.metadata.name; - } - - get linuxPackageName() { - const name = this.name; // https://github.com/electron-userland/electron-builder/issues/2963 - - return name.startsWith("@") ? this.productFilename : name; - } - - get sanitizedName() { - return (0, _sanitizeFilename().default)(this.name); - } - - get updaterCacheDirName() { - return this.sanitizedName.toLowerCase() + "-updater"; - } - - get copyright() { - const copyright = this.info.config.copyright; - - if (copyright != null) { - return (0, _macroExpander().expandMacro)(copyright, null, this); - } - - return `Copyright © ${new Date().getFullYear()} ${this.companyName || this.productName}`; - } - - computePackageUrl() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const url = _this.info.metadata.homepage || _this.notNullDevMetadata.homepage; - - if (url != null) { - return url; - } - - const info = yield _this.info.repositoryInfo; - return info == null || info.type !== "github" ? null : `https://${info.domain}/${info.user}/${info.project}`; - })(); - } - -} -/** @internal */ - - -exports.AppInfo = AppInfo; - -function filterCFBundleIdentifier(identifier) { - // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) - // Apple documentation: https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070 - return identifier.replace(/ /g, "-").replace(/[^a-zA-Z0-9.-]/g, ""); -} // fpm bug - rpm build --description is not escaped, well... decided to replace quite to smart quote -// http://leancrew.com/all-this/2010/11/smart-quotes-in-javascript/ - - -function smarten(s) { - // opening singles - s = s.replace(/(^|[-\u2014\s(\["])'/g, "$1\u2018"); // closing singles & apostrophes - - s = s.replace(/'/g, "\u2019"); // opening doubles - - s = s.replace(/(^|[-\u2014/\[(\u2018\s])"/g, "$1\u201c"); // closing doubles - - s = s.replace(/"/g, "\u201d"); - return s; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=appInfo.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/appInfo.js.map b/node_modules/app-builder-lib/out/appInfo.js.map deleted file mode 100644 index 3d0980a..0000000 --- a/node_modules/app-builder-lib/out/appInfo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/appInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,MAAO,OAAP,CAAc;AAUlB,EAAA,WAAA,CAA6B,IAA7B,EAA6C,YAA7C,EAAuG,uBAAA,GAA+D,IAAtK,EAA0K;AAA7I,SAAA,IAAA,GAAA,IAAA;AAA0E,SAAA,uBAAA,GAAA,uBAAA;AAT9F,SAAA,WAAA,GAAc,OAAO,CAAC,KAAK,IAAL,CAAU,QAAV,CAAmB,WAAnB,IAAkC,EAAnC,CAArB;AAUP,SAAK,OAAL,GAAe,IAAI,CAAC,QAAL,CAAc,OAA7B;;AAEA,QAAI,YAAY,IAAI,IAApB,EAA0B;AACxB,MAAA,YAAY,GAAG,IAAI,CAAC,MAAL,CAAY,YAA3B;AACD;;AAED,SAAK,WAAL,GAAmB,OAAO,CAAC,GAAR,CAAY,YAAZ,IAA4B,OAAO,CAAC,GAAR,CAAY,mBAAxC,IAA+D,OAAO,CAAC,GAAR,CAAY,qBAA3E,IAAoG,OAAO,CAAC,GAAR,CAAY,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AACA,EAAA,CAAC,GAAG,CAAC,CAAC,OAAF,CAAU,IAAV,EAAgB,QAAhB,CAAJ,CAJ+B,CAK/B;;AACA,EAAA,CAAC,GAAG,CAAC,CAAC,OAAF,CAAU,6BAAV,EAAyC,UAAzC,CAAJ,CAN+B,CAO/B;;AACA,EAAA,CAAC,GAAG,CAAC,CAAC,OAAF,CAAU,IAAV,EAAgB,QAAhB,CAAJ;AACA,SAAO,CAAP;AACD,C","sourcesContent":["import { isEmptyOrSpaces, log } from \"builder-util\"\nimport sanitizeFileName from \"sanitize-filename\"\nimport { prerelease, SemVer } from \"semver\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { Packager } from \"./packager\"\nimport { expandMacro } from \"./util/macroExpander\"\n\nexport class AppInfo {\n readonly description = smarten(this.info.metadata.description || \"\")\n readonly version: string\n\n readonly buildNumber: string | undefined\n readonly buildVersion: string\n\n readonly productName: string\n readonly productFilename: string\n\n constructor(private readonly info: Packager, buildVersion: string | null | undefined, private readonly platformSpecificOptions: PlatformSpecificBuildOptions | null = null) {\n this.version = info.metadata.version!!\n\n if (buildVersion == null) {\n buildVersion = info.config.buildVersion\n }\n\n this.buildNumber = process.env.BUILD_NUMBER || process.env.TRAVIS_BUILD_NUMBER || process.env.APPVEYOR_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM || process.env.BUILD_BUILDNUMBER\n if (buildVersion == null) {\n buildVersion = this.version\n if (!isEmptyOrSpaces(this.buildNumber)) {\n buildVersion += `.${this.buildNumber}`\n }\n }\n this.buildVersion = buildVersion\n\n this.productName = info.config.productName || info.metadata.productName || info.metadata.name!!\n this.productFilename = sanitizeFileName(this.productName)\n }\n\n get channel(): string | null {\n const prereleaseInfo = prerelease(this.version)\n if (prereleaseInfo != null && prereleaseInfo.length > 0) {\n return prereleaseInfo[0]\n }\n return null\n }\n\n getVersionInWeirdWindowsForm(isSetBuildNumber = true): string {\n const parsedVersion = new SemVer(this.version)\n // https://github.com/electron-userland/electron-builder/issues/2635#issuecomment-371792272\n let buildNumber = isSetBuildNumber ? this.buildNumber : null\n if (buildNumber == null || !/^\\d+$/.test(buildNumber)) {\n buildNumber = \"0\"\n }\n return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}.${buildNumber}`\n }\n\n private get notNullDevMetadata() {\n return this.info.devMetadata || {}\n }\n\n get companyName(): string | null {\n const author = this.info.metadata.author || this.notNullDevMetadata.author\n return author == null ? null : author.name\n }\n\n get id(): string {\n let appId: string | null | undefined = null\n for (const options of [this.platformSpecificOptions, this.info.config]) {\n if (options != null && appId == null) {\n appId = options.appId\n }\n }\n\n const generateDefaultAppId = () => {\n const info = this.info\n return `${info.framework.defaultAppIdPrefix}${info.metadata.name!.toLowerCase()}`\n }\n\n if (appId != null && (appId === \"your.id\" || isEmptyOrSpaces(appId))) {\n const incorrectAppId = appId\n appId = generateDefaultAppId()\n log.warn(`do not use \"${incorrectAppId}\" as appId, \"${appId}\" will be used instead`)\n }\n\n return appId == null ? generateDefaultAppId() : appId\n }\n\n get macBundleIdentifier(): string {\n return filterCFBundleIdentifier(this.id)\n }\n\n get name(): string {\n return this.info.metadata.name!!\n }\n\n get linuxPackageName(): string {\n const name = this.name\n // https://github.com/electron-userland/electron-builder/issues/2963\n return name.startsWith(\"@\") ? this.productFilename : name\n }\n\n get sanitizedName(): string {\n return sanitizeFileName(this.name)\n }\n\n get updaterCacheDirName(): string {\n return this.sanitizedName.toLowerCase() + \"-updater\"\n }\n\n get copyright(): string {\n const copyright = this.info.config.copyright\n if (copyright != null) {\n return expandMacro(copyright, null, this)\n }\n return `Copyright © ${new Date().getFullYear()} ${this.companyName || this.productName}`\n }\n\n async computePackageUrl(): Promise {\n const url = this.info.metadata.homepage || this.notNullDevMetadata.homepage\n if (url != null) {\n return url\n }\n\n const info = await this.info.repositoryInfo\n return info == null || info.type !== \"github\" ? null : `https://${info.domain}/${info.user}/${info.project}`\n }\n}\n\n/** @internal */\nexport function filterCFBundleIdentifier(identifier: string) {\n // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)\n // Apple documentation: https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070\n return identifier.replace(/ /g, \"-\").replace(/[^a-zA-Z0-9.-]/g, \"\")\n}\n\n// fpm bug - rpm build --description is not escaped, well... decided to replace quite to smart quote\n// http://leancrew.com/all-this/2010/11/smart-quotes-in-javascript/\nexport function smarten(s: string): string {\n // opening singles\n s = s.replace(/(^|[-\\u2014\\s(\\[\"])'/g, \"$1\\u2018\")\n // closing singles & apostrophes\n s = s.replace(/'/g, \"\\u2019\")\n // opening doubles\n s = s.replace(/(^|[-\\u2014/\\[(\\u2018\\s])\"/g, \"$1\\u201c\")\n // closing doubles\n s = s.replace(/\"/g, \"\\u201d\")\n return s\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/asar/asar.d.ts b/node_modules/app-builder-lib/out/asar/asar.d.ts deleted file mode 100644 index c69ba82..0000000 --- a/node_modules/app-builder-lib/out/asar/asar.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function readAsar(archive: string): Promise; -export declare function readAsarJson(archive: string, file: string): Promise; diff --git a/node_modules/app-builder-lib/out/asar/asar.js b/node_modules/app-builder-lib/out/asar/asar.js deleted file mode 100644 index 951af0c..0000000 --- a/node_modules/app-builder-lib/out/asar/asar.js +++ /dev/null @@ -1,248 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.readAsar = readAsar; -exports.readAsarJson = readAsarJson; -exports.AsarFilesystem = exports.Node = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _chromiumPickleJs() { - const data = require("chromium-pickle-js"); - - _chromiumPickleJs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/** @internal */ -class Node {} -/** @internal */ - - -exports.Node = Node; - -class AsarFilesystem { - constructor(src, header = new Node(), headerSize = -1) { - this.src = src; - this.header = header; - this.headerSize = headerSize; - this.offset = 0; - - if (this.header.files == null) { - this.header.files = {}; - } - } - - searchNodeFromDirectory(p, isCreate) { - let node = this.header; - - for (const dir of p.split(path.sep)) { - if (dir !== ".") { - let child = node.files[dir]; - - if (child == null) { - if (!isCreate) { - return null; - } - - child = new Node(); - child.files = {}; - node.files[dir] = child; - } - - node = child; - } - } - - return node; - } - - getOrCreateNode(p) { - if (p == null || p.length === 0) { - return this.header; - } - - const name = path.basename(p); - const dirNode = this.searchNodeFromDirectory(path.dirname(p), true); - - if (dirNode.files == null) { - dirNode.files = {}; - } - - let result = dirNode.files[name]; - - if (result == null) { - result = new Node(); - dirNode.files[name] = result; - } - - return result; - } - - addFileNode(file, dirNode, size, unpacked, stat) { - if (size > 4294967295) { - throw new Error(`${file}: file size cannot be larger than 4.2GB`); - } - - const node = new Node(); - node.size = size; - - if (unpacked) { - node.unpacked = true; - } else { - // electron expects string - node.offset = this.offset.toString(); - - if (process.platform !== "win32" && stat.mode & 0o100) { - node.executable = true; - } - - this.offset += node.size; - } - - let children = dirNode.files; - - if (children == null) { - children = {}; - dirNode.files = children; - } - - children[path.basename(file)] = node; - return node; - } - - getNode(p) { - const node = this.searchNodeFromDirectory(path.dirname(p), false); - return node.files[path.basename(p)]; - } - - getFile(p, followLinks = true) { - const info = this.getNode(p); // if followLinks is false we don't resolve symlinks - - return followLinks && info.link != null ? this.getFile(info.link) : info; - } - - readJson(file) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - return JSON.parse((yield _this.readFile(file)).toString()); - })(); - } - - readFile(file) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - return yield readFileFromAsar(_this2, file, _this2.getFile(file)); - })(); - } - -} - -exports.AsarFilesystem = AsarFilesystem; - -function readAsar(_x) { - return _readAsar.apply(this, arguments); -} - -function _readAsar() { - _readAsar = (0, _bluebirdLst().coroutine)(function* (archive) { - const fd = yield (0, _fsExtraP().open)(archive, "r"); - let size; - let headerBuf; - - try { - const sizeBuf = Buffer.allocUnsafe(8); - - if ((yield (0, _fsExtraP().read)(fd, sizeBuf, 0, 8, null)) !== 8) { - throw new Error("Unable to read header size"); - } - - const sizePickle = (0, _chromiumPickleJs().createFromBuffer)(sizeBuf); - size = sizePickle.createIterator().readUInt32(); - headerBuf = Buffer.allocUnsafe(size); - - if ((yield (0, _fsExtraP().read)(fd, headerBuf, 0, size, null)) !== size) { - throw new Error("Unable to read header"); - } - } finally { - yield (0, _fsExtraP().close)(fd); - } - - const headerPickle = (0, _chromiumPickleJs().createFromBuffer)(headerBuf); - const header = headerPickle.createIterator().readString(); - return new AsarFilesystem(archive, JSON.parse(header), size); - }); - return _readAsar.apply(this, arguments); -} - -function readAsarJson(_x2, _x3) { - return _readAsarJson.apply(this, arguments); -} - -function _readAsarJson() { - _readAsarJson = (0, _bluebirdLst().coroutine)(function* (archive, file) { - const fs = yield readAsar(archive); - return yield fs.readJson(file); - }); - return _readAsarJson.apply(this, arguments); -} - -function readFileFromAsar(_x4, _x5, _x6) { - return _readFileFromAsar.apply(this, arguments); -} function _readFileFromAsar() { - _readFileFromAsar = (0, _bluebirdLst().coroutine)(function* (filesystem, filename, info) { - const size = info.size; - const buffer = Buffer.allocUnsafe(size); - - if (size <= 0) { - return buffer; - } - - if (info.unpacked) { - return yield (0, _fsExtraP().readFile)(path.join(`${filesystem.src}.unpacked`, filename)); - } - - const fd = yield (0, _fsExtraP().open)(filesystem.src, "r"); - - try { - const offset = 8 + filesystem.headerSize + parseInt(info.offset, 10); - yield (0, _fsExtraP().read)(fd, buffer, 0, size, offset); - } finally { - yield (0, _fsExtraP().close)(fd); - } - - return buffer; - }); - return _readFileFromAsar.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=asar.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/asar/asar.js.map b/node_modules/app-builder-lib/out/asar/asar.js.map deleted file mode 100644 index ce75706..0000000 --- a/node_modules/app-builder-lib/out/asar/asar.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/asar/asar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAEA;AACM,MAAO,IAAP,CAAW;AAejB;;;;;AACM,MAAO,cAAP,CAAqB;AAGzB,EAAA,WAAA,CAAqB,GAArB,EAA2C,MAAA,GAAS,IAAI,IAAJ,EAApD,EAAyE,UAAA,GAAqB,CAAC,CAA/F,EAAgG;AAA3E,SAAA,GAAA,GAAA,GAAA;AAAsB,SAAA,MAAA,GAAA,MAAA;AAA8B,SAAA,UAAA,GAAA,UAAA;AAFjE,SAAA,MAAA,GAAS,CAAT;;AAGN,QAAI,KAAK,MAAL,CAAY,KAAZ,IAAqB,IAAzB,EAA+B;AAC7B,WAAK,MAAL,CAAY,KAAZ,GAAoB,EAApB;AACD;AACF;;AAED,EAAA,uBAAuB,CAAC,CAAD,EAAY,QAAZ,EAA6B;AAClD,QAAI,IAAI,GAAG,KAAK,MAAhB;;AACA,SAAK,MAAM,GAAX,IAAkB,CAAC,CAAC,KAAF,CAAQ,IAAI,CAAC,GAAb,CAAlB,EAAqC;AACnC,UAAI,GAAG,KAAK,GAAZ,EAAiB;AACf,YAAI,KAAK,GAAG,IA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AA6C,IAA7C,EAAyD;AAC9D,UAAM,EAAE,SAAS,QAAQ,CAAC,OAAD,CAAzB;AACA,iBAAa,EAAE,CAAC,QAAH,CAAY,IAAZ,CAAb;AACD,G;;;;SAEc,gB;;;;;;oDAAf,WAAgC,UAAhC,EAA4D,QAA5D,EAA8E,IAA9E,EAAwF;AACtF,UAAM,IAAI,GAAG,IAAI,CAAC,IAAlB;AACA,UAAM,MAAM,GAAG,MAAM,CAAC,WAAP,CAAmB,IAAnB,CAAf;;AACA,QAAI,IAAI,IAAI,CAAZ,EAAe;AACb,aAAO,MAAP;AACD;;AAED,QAAI,IAAI,CAAC,QAAT,EAAmB;AACjB,mBAAa,0BAAS,IAAI,CAAC,IAAL,CAAU,GAAG,UAAU,CAAC,GAAG,WAA3B,EAAwC,QAAxC,CAAT,CAAb;AACD;;AAED,UAAM,EAAE,SAAS,sBAAK,UAAU,CAAC,GAAhB,EAAqB,GAArB,CAAjB;;AACA,QAAI;AACF,YAAM,MAAM,GAAG,IAAI,UAAU,CAAC,UAAf,GAA4B,QAAQ,CAAC,IAAI,CAAC,MAAN,EAAgB,EAAhB,CAAnD;AACA,YAAM,sBAAK,EAAL,EAAS,MAAT,EAAiB,CAAjB,EAAoB,IAApB,EAA0B,MAA1B,CAAN;AACD,KAHD,SAIQ;AACN,YAAM,uBAAM,EAAN,CAAN;AACD;;AACD,WAAO,MAAP;AACD,G","sourcesContent":["import { createFromBuffer } from \"chromium-pickle-js\"\nimport { close, open, read, readFile, Stats } from \"fs-extra-p\"\nimport * as path from \"path\"\n\n/** @internal */\nexport class Node {\n // we don't use Map because later it will be stringified\n files?: { [key: string]: Node }\n\n unpacked?: boolean\n\n size?: number\n // electron expects string\n offset?: string\n\n executable?: boolean\n\n link?: string\n}\n\n/** @internal */\nexport class AsarFilesystem {\n private offset = 0\n\n constructor(readonly src: string, readonly header = new Node(), readonly headerSize: number = -1) {\n if (this.header.files == null) {\n this.header.files = {}\n }\n }\n\n searchNodeFromDirectory(p: string, isCreate: boolean): Node | null {\n let node = this.header\n for (const dir of p.split(path.sep)) {\n if (dir !== \".\") {\n let child = node.files![dir]\n if (child == null) {\n if (!isCreate) {\n return null\n }\n child = new Node()\n child.files = {}\n node.files![dir] = child\n }\n node = child\n }\n }\n return node\n }\n\n getOrCreateNode(p: string): Node {\n if (p == null || p.length === 0) {\n return this.header\n }\n\n const name = path.basename(p)\n const dirNode = this.searchNodeFromDirectory(path.dirname(p), true)!\n if (dirNode.files == null) {\n dirNode.files = {}\n }\n\n let result = dirNode.files[name]\n if (result == null) {\n result = new Node()\n dirNode.files[name] = result\n }\n return result\n }\n\n addFileNode(file: string, dirNode: Node, size: number, unpacked: boolean, stat: Stats): Node {\n if (size > 4294967295) {\n throw new Error(`${file}: file size cannot be larger than 4.2GB`)\n }\n\n const node = new Node()\n node.size = size\n if (unpacked) {\n node.unpacked = true\n }\n else {\n // electron expects string\n node.offset = this.offset.toString()\n if (process.platform !== \"win32\" && (stat.mode & 0o100)) {\n node.executable = true\n }\n this.offset += node.size\n }\n\n let children = dirNode.files\n if (children == null) {\n children = {}\n dirNode.files = children\n }\n children[path.basename(file)] = node\n\n return node\n }\n\n getNode(p: string) {\n const node = this.searchNodeFromDirectory(path.dirname(p), false)!\n return node.files![path.basename(p)]\n }\n\n getFile(p: string, followLinks: boolean = true): Node {\n const info = this.getNode(p)!\n // if followLinks is false we don't resolve symlinks\n return followLinks && info.link != null ? this.getFile(info.link) : info\n }\n\n async readJson(file: string): Promise {\n return JSON.parse((await this.readFile(file)).toString())\n }\n\n async readFile(file: string): Promise {\n return await readFileFromAsar(this, file, this.getFile(file))\n }\n}\n\nexport async function readAsar(archive: string): Promise {\n const fd = await open(archive, \"r\")\n let size\n let headerBuf\n try {\n const sizeBuf = Buffer.allocUnsafe(8)\n if (await read(fd, sizeBuf, 0, 8, null as any) !== 8) {\n throw new Error(\"Unable to read header size\")\n }\n\n const sizePickle = createFromBuffer(sizeBuf)\n size = sizePickle.createIterator().readUInt32()\n headerBuf = Buffer.allocUnsafe(size)\n if (await read(fd, headerBuf, 0, size, null as any) !== size) {\n throw new Error(\"Unable to read header\")\n }\n }\n finally {\n await close(fd)\n }\n\n const headerPickle = createFromBuffer(headerBuf!)\n const header = headerPickle.createIterator().readString()\n return new AsarFilesystem(archive, JSON.parse(header), size)\n}\n\nexport async function readAsarJson(archive: string, file: string): Promise {\n const fs = await readAsar(archive)\n return await fs.readJson(file)\n}\n\nasync function readFileFromAsar(filesystem: AsarFilesystem, filename: string, info: Node): Promise {\n const size = info.size!!\n const buffer = Buffer.allocUnsafe(size)\n if (size <= 0) {\n return buffer\n }\n\n if (info.unpacked) {\n return await readFile(path.join(`${filesystem.src}.unpacked`, filename))\n }\n\n const fd = await open(filesystem.src, \"r\")\n try {\n const offset = 8 + filesystem.headerSize + parseInt(info.offset!!, 10)\n await read(fd, buffer, 0, size, offset)\n }\n finally {\n await close(fd)\n }\n return buffer\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/asar/asarFileChecker.d.ts b/node_modules/app-builder-lib/out/asar/asarFileChecker.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/asar/asarFileChecker.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/asar/asarFileChecker.js b/node_modules/app-builder-lib/out/asar/asarFileChecker.js deleted file mode 100644 index 69f1fda..0000000 --- a/node_modules/app-builder-lib/out/asar/asarFileChecker.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.checkFileInArchive = checkFileInArchive; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _asar() { - const data = require("./asar"); - - _asar = function () { - return data; - }; - - return data; -} - -/** @internal */ -function checkFileInArchive(_x, _x2, _x3) { - return _checkFileInArchive.apply(this, arguments); -} function _checkFileInArchive() { - _checkFileInArchive = (0, _bluebirdLst().coroutine)(function* (asarFile, relativeFile, messagePrefix) { - function error(text) { - return new Error(`${messagePrefix} "${relativeFile}" in the "${asarFile}" ${text}`); - } - - let fs; - - try { - fs = yield (0, _asar().readAsar)(asarFile); - } catch (e) { - throw error(`is corrupted: ${e}`); - } - - let stat; - - try { - stat = fs.getFile(relativeFile); - } catch (e) { - const fileStat = yield (0, _fs().statOrNull)(asarFile); - - if (fileStat == null) { - throw error(`does not exist. Seems like a wrong configuration.`); - } // asar throws error on access to undefined object (info.link) - - - stat = null; - } - - if (stat == null) { - throw error(`does not exist. Seems like a wrong configuration.`); - } - - if (stat.size === 0) { - throw error(`is corrupted: size 0`); - } - }); - return _checkFileInArchive.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=asarFileChecker.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/asar/asarFileChecker.js.map b/node_modules/app-builder-lib/out/asar/asarFileChecker.js.map deleted file mode 100644 index 5b8c97b..0000000 --- a/node_modules/app-builder-lib/out/asar/asarFileChecker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/asar/asarFileChecker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;SACsB,kB;;;;;;sDAAf,WAAkC,QAAlC,EAAoD,YAApD,EAA0E,aAA1E,EAA+F;AACpG,aAAS,KAAT,CAAe,IAAf,EAA2B;AACzB,aAAO,IAAI,KAAJ,CAAU,GAAG,aAAa,KAAK,YAAY,aAAa,QAAQ,KAAK,IAAI,EAAzE,CAAP;AACD;;AAED,QAAI,EAAJ;;AACA,QAAI;AACF,MAAA,EAAE,SAAS,sBAAS,QAAT,CAAX;AACD,KAFD,CAGA,OAAO,CAAP,EAAU;AACR,YAAM,KAAK,CAAC,iBAAiB,CAAC,EAAnB,CAAX;AACD;;AAED,QAAI,IAAJ;;AACA,QAAI;AACF,MAAA,IAAI,GAAG,EAAE,CAAC,OAAH,CAAW,YAAX,CAAP;AACD,KAFD,CAGA,OAAO,CAAP,EAAU;AACR,YAAM,QAAQ,SAAS,sBAAW,QAAX,CAAvB;;AACA,UAAI,QAAQ,IAAI,IAAhB,EAAsB;AACpB,cAAM,KAAK,CAAC,mDAAD,CAAX;AACD,OAJO,CAMR;;;AACA,MAAA,IAAI,GAAG,IAAP;AACD;;AAED,QAAI,IAAI,IAAI,IAAZ,EAAkB;AAChB,YAAM,KAAK,CAAC,mDAAD,CAAX;AACD;;AACD,QAAI,IAAI,CAAC,IAAL,KAAc,CAAlB,EAAqB;AACnB,YAAM,KAAK,CAAC,sBAAD,CAAX;AACD;AACF,G","sourcesContent":["import { statOrNull } from \"builder-util/out/fs\"\nimport { Node, readAsar } from \"./asar\"\n\n/** @internal */\nexport async function checkFileInArchive(asarFile: string, relativeFile: string, messagePrefix: string) {\n function error(text: string) {\n return new Error(`${messagePrefix} \"${relativeFile}\" in the \"${asarFile}\" ${text}`)\n }\n\n let fs\n try {\n fs = await readAsar(asarFile)\n }\n catch (e) {\n throw error(`is corrupted: ${e}`)\n }\n\n let stat: Node | null\n try {\n stat = fs.getFile(relativeFile)\n }\n catch (e) {\n const fileStat = await statOrNull(asarFile)\n if (fileStat == null) {\n throw error(`does not exist. Seems like a wrong configuration.`)\n }\n\n // asar throws error on access to undefined object (info.link)\n stat = null\n }\n\n if (stat == null) {\n throw error(`does not exist. Seems like a wrong configuration.`)\n }\n if (stat.size === 0) {\n throw error(`is corrupted: size 0`)\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/asar/asarUtil.d.ts b/node_modules/app-builder-lib/out/asar/asarUtil.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/asar/asarUtil.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/asar/asarUtil.js b/node_modules/app-builder-lib/out/asar/asarUtil.js deleted file mode 100644 index 12b83fe..0000000 --- a/node_modules/app-builder-lib/out/asar/asarUtil.js +++ /dev/null @@ -1,387 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AsarPackager = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fs2() { - const data = require("fs"); - - _fs2 = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _appFileCopier() { - const data = require("../util/appFileCopier"); - - _appFileCopier = function () { - return data; - }; - - return data; -} - -function _asar() { - const data = require("./asar"); - - _asar = function () { - return data; - }; - - return data; -} - -function _unpackDetector() { - const data = require("./unpackDetector"); - - _unpackDetector = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const pickle = require("chromium-pickle-js"); -/** @internal */ - - -class AsarPackager { - constructor(src, destination, options, unpackPattern) { - this.src = src; - this.destination = destination; - this.options = options; - this.unpackPattern = unpackPattern; - this.fs = new (_asar().AsarFilesystem)(this.src); - this.outFile = path.join(destination, "app.asar"); - this.unpackedDest = `${this.outFile}.unpacked`; - } // sort files to minimize file change (i.e. asar file is not changed dramatically on small change) - - - pack(fileSets, packager) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (_this.options.ordering != null) { - // ordering doesn't support transformed files, but ordering is not used functionality - wait user report to fix it - yield order(fileSets[0].files, _this.options.ordering, fileSets[0].src); - } - - yield (0, _fsExtraP().ensureDir)(path.dirname(_this.outFile)); - const unpackedFileIndexMap = new Map(); - - for (const fileSet of fileSets) { - unpackedFileIndexMap.set(fileSet, (yield _this.createPackageFromFiles(fileSet, packager.info))); - } - - yield _this.writeAsarFile(fileSets, unpackedFileIndexMap); - })(); - } - - createPackageFromFiles(fileSet, packager) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const metadata = fileSet.metadata; // search auto unpacked dir - - const unpackedDirs = new Set(); - const rootForAppFilesWithoutAsar = path.join(_this2.destination, "app"); - - if (_this2.options.smartUnpack !== false) { - yield (0, _unpackDetector().detectUnpackedDirs)(fileSet, unpackedDirs, _this2.unpackedDest, rootForAppFilesWithoutAsar); - } - - const dirToCreateForUnpackedFiles = new Set(unpackedDirs); - - const correctDirNodeUnpackedFlag = - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (filePathInArchive, dirNode) { - for (const dir of unpackedDirs) { - if (filePathInArchive.length > dir.length + 2 && filePathInArchive[dir.length] === path.sep && filePathInArchive.startsWith(dir)) { - dirNode.unpacked = true; - unpackedDirs.add(filePathInArchive); // not all dirs marked as unpacked after first iteration - because node module dir can be marked as unpacked after processing node module dir content - // e.g. node-notifier/example/advanced.js processed, but only on process vendor/terminal-notifier.app module will be marked as unpacked - - yield (0, _fsExtraP().ensureDir)(path.join(_this2.unpackedDest, filePathInArchive)); - break; - } - } - }); - - return function correctDirNodeUnpackedFlag(_x, _x2) { - return _ref.apply(this, arguments); - }; - }(); - - const transformedFiles = fileSet.transformedFiles; - const taskManager = new (_builderUtil().AsyncTaskManager)(packager.cancellationToken); - const fileCopier = new (_fs().FileCopier)(); - let currentDirNode = null; - let currentDirPath = null; - const unpackedFileIndexSet = new Set(); - - for (let i = 0, n = fileSet.files.length; i < n; i++) { - const file = fileSet.files[i]; - const stat = metadata.get(file); - - if (stat == null) { - continue; - } - - const pathInArchive = path.relative(rootForAppFilesWithoutAsar, (0, _appFileCopier().getDestinationPath)(file, fileSet)); - - if (stat.isSymbolicLink()) { - const s = stat; - _this2.fs.getOrCreateNode(pathInArchive).link = s.relativeLink; - s.pathInArchive = pathInArchive; - unpackedFileIndexSet.add(i); - continue; - } - - let fileParent = path.dirname(pathInArchive); - - if (fileParent === ".") { - fileParent = ""; - } - - if (currentDirPath !== fileParent) { - if (fileParent.startsWith("..")) { - throw new Error(`Internal error: path must not start with "..": ${fileParent}`); - } - - currentDirPath = fileParent; - currentDirNode = _this2.fs.getOrCreateNode(fileParent); // do not check for root - - if (fileParent !== "" && !currentDirNode.unpacked) { - if (unpackedDirs.has(fileParent)) { - currentDirNode.unpacked = true; - } else { - yield correctDirNodeUnpackedFlag(fileParent, currentDirNode); - } - } - } - - const dirNode = currentDirNode; - const newData = transformedFiles == null ? null : transformedFiles.get(i); - - const isUnpacked = dirNode.unpacked || _this2.unpackPattern != null && _this2.unpackPattern(file, stat); - - _this2.fs.addFileNode(file, dirNode, newData == null ? stat.size : Buffer.byteLength(newData), isUnpacked, stat); - - if (isUnpacked) { - if (!dirNode.unpacked && !dirToCreateForUnpackedFiles.has(fileParent)) { - dirToCreateForUnpackedFiles.add(fileParent); - yield (0, _fsExtraP().ensureDir)(path.join(_this2.unpackedDest, fileParent)); - } - - const unpackedFile = path.join(_this2.unpackedDest, pathInArchive); - taskManager.addTask(copyFileOrData(fileCopier, newData, file, unpackedFile, stat)); - - if (taskManager.tasks.length > _fs().MAX_FILE_REQUESTS) { - yield taskManager.awaitTasks(); - } - - unpackedFileIndexSet.add(i); - } - } - - if (taskManager.tasks.length > 0) { - yield taskManager.awaitTasks(); - } - - return unpackedFileIndexSet; - })(); - } - - writeAsarFile(fileSets, unpackedFileIndexMap) { - return new Promise((resolve, reject) => { - const headerPickle = pickle.createEmpty(); - headerPickle.writeString(JSON.stringify(this.fs.header)); - const headerBuf = headerPickle.toBuffer(); - const sizePickle = pickle.createEmpty(); - sizePickle.writeUInt32(headerBuf.length); - const sizeBuf = sizePickle.toBuffer(); - const writeStream = (0, _fsExtraP().createWriteStream)(this.outFile); - writeStream.on("error", reject); - writeStream.on("close", resolve); - writeStream.write(sizeBuf); - let fileSetIndex = 0; - let files = fileSets[0].files; - let metadata = fileSets[0].metadata; - let transformedFiles = fileSets[0].transformedFiles; - let unpackedFileIndexSet = unpackedFileIndexMap.get(fileSets[0]); - - const w = index => { - while (true) { - if (index >= files.length) { - if (++fileSetIndex >= fileSets.length) { - writeStream.end(); - return; - } else { - files = fileSets[fileSetIndex].files; - metadata = fileSets[fileSetIndex].metadata; - transformedFiles = fileSets[fileSetIndex].transformedFiles; - unpackedFileIndexSet = unpackedFileIndexMap.get(fileSets[fileSetIndex]); - index = 0; - } - } - - if (!unpackedFileIndexSet.has(index)) { - break; - } else { - const stat = metadata.get(files[index]); - - if (stat != null && stat.isSymbolicLink()) { - (0, _fs2().symlink)(stat.linkRelativeToFile, path.join(this.unpackedDest, stat.pathInArchive), () => w(index + 1)); - return; - } - } - - index++; - } - - const data = transformedFiles == null ? null : transformedFiles.get(index); - const file = files[index]; - - if (data !== null && data !== undefined) { - writeStream.write(data, () => w(index + 1)); - return; - } // https://github.com/yarnpkg/yarn/pull/3539 - - - const stat = metadata.get(file); - - if (stat != null && stat.size < 2 * 1024 * 1024) { - (0, _fsExtraP().readFile)(file).then(it => { - writeStream.write(it, () => w(index + 1)); - }).catch(e => reject(`Cannot read file ${file}: ${e.stack || e}`)); - } else { - const readStream = (0, _fsExtraP().createReadStream)(file); - readStream.on("error", reject); - readStream.once("end", () => w(index + 1)); - readStream.pipe(writeStream, { - end: false - }); - } - }; - - writeStream.write(headerBuf, () => w(0)); - }); - } - -} - -exports.AsarPackager = AsarPackager; - -function order(_x3, _x4, _x5) { - return _order.apply(this, arguments); -} - -function _order() { - _order = (0, _bluebirdLst().coroutine)(function* (filenames, orderingFile, src) { - const orderingFiles = (yield (0, _fsExtraP().readFile)(orderingFile, "utf8")).split("\n").map(line => { - if (line.indexOf(":") !== -1) { - line = line.split(":").pop(); - } - - line = line.trim(); - - if (line[0] === "/") { - line = line.slice(1); - } - - return line; - }); - const ordering = []; - - for (const file of orderingFiles) { - const pathComponents = file.split(path.sep); - - for (const pathComponent of pathComponents) { - ordering.push(path.join(src, pathComponent)); - } - } - - const sortedFiles = []; - let missing = 0; - const total = filenames.length; - - for (const file of ordering) { - if (!sortedFiles.includes(file) && filenames.includes(file)) { - sortedFiles.push(file); - } - } - - for (const file of filenames) { - if (!sortedFiles.includes(file)) { - sortedFiles.push(file); - missing += 1; - } - } - - _builderUtil().log.info({ - coverage: (total - missing) / total * 100 - }, "ordering files in ASAR archive"); - - return sortedFiles; - }); - return _order.apply(this, arguments); -} - -function copyFileOrData(fileCopier, data, source, destination, stats) { - if (data == null) { - return fileCopier.copy(source, destination, stats); - } else { - return (0, _fsExtraP().writeFile)(destination, data); - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=asarUtil.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/asar/asarUtil.js.map b/node_modules/app-builder-lib/out/asar/asarUtil.js.map deleted file mode 100644 index 33b9145..0000000 --- a/node_modules/app-builder-lib/out/asar/asarUtil.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/asar/asarUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;A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CAAxD;;AACA,WAAO,WAAP;AACD,G;;;;AAED,SAAS,cAAT,CAAwB,UAAxB,EAAgD,IAAhD,EAA0F,MAA1F,EAA0G,WAA1G,EAA+H,KAA/H,EAA2I;AACzI,MAAI,IAAI,IAAI,IAAZ,EAAkB;AAChB,WAAO,UAAU,CAAC,IAAX,CAAgB,MAAhB,EAAwB,WAAxB,EAAqC,KAArC,CAAP;AACD,GAFD,MAGK;AACH,WAAO,2BAAU,WAAV,EAAuB,IAAvB,CAAP;AACD;AACF,C","sourcesContent":["import { AsyncTaskManager, log } from \"builder-util\"\nimport { FileCopier, Filter, MAX_FILE_REQUESTS } from \"builder-util/out/fs\"\nimport { symlink } from \"fs\"\nimport { createReadStream, createWriteStream, ensureDir, readFile, Stats, writeFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { AsarOptions } from \"..\"\nimport { Packager } from \"../packager\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { getDestinationPath, ResolvedFileSet } from \"../util/appFileCopier\"\nimport { AsarFilesystem, Node } from \"./asar\"\nimport { detectUnpackedDirs } from \"./unpackDetector\"\n\nconst pickle = require(\"chromium-pickle-js\")\n\n/** @internal */\nexport class AsarPackager {\n private readonly fs = new AsarFilesystem(this.src)\n private readonly outFile: string\n private readonly unpackedDest: string\n\n constructor(private readonly src: string, private readonly destination: string, private readonly options: AsarOptions, private readonly unpackPattern: Filter | null) {\n this.outFile = path.join(destination, \"app.asar\")\n this.unpackedDest = `${this.outFile}.unpacked`\n }\n\n // sort files to minimize file change (i.e. asar file is not changed dramatically on small change)\n async pack(fileSets: Array, packager: PlatformPackager) {\n if (this.options.ordering != null) {\n // ordering doesn't support transformed files, but ordering is not used functionality - wait user report to fix it\n await order(fileSets[0].files, this.options.ordering, fileSets[0].src)\n }\n await ensureDir(path.dirname(this.outFile))\n const unpackedFileIndexMap = new Map>()\n for (const fileSet of fileSets) {\n unpackedFileIndexMap.set(fileSet, await this.createPackageFromFiles(fileSet, packager.info))\n }\n await this.writeAsarFile(fileSets, unpackedFileIndexMap)\n }\n\n private async createPackageFromFiles(fileSet: ResolvedFileSet, packager: Packager) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const unpackedDirs = new Set()\n const rootForAppFilesWithoutAsar = path.join(this.destination, \"app\")\n\n if (this.options.smartUnpack !== false) {\n await detectUnpackedDirs(fileSet, unpackedDirs, this.unpackedDest, rootForAppFilesWithoutAsar)\n }\n\n const dirToCreateForUnpackedFiles = new Set(unpackedDirs)\n\n const correctDirNodeUnpackedFlag = async (filePathInArchive: string, dirNode: Node) => {\n for (const dir of unpackedDirs) {\n if (filePathInArchive.length > (dir.length + 2) && filePathInArchive[dir.length] === path.sep && filePathInArchive.startsWith(dir)) {\n dirNode.unpacked = true\n unpackedDirs.add(filePathInArchive)\n // not all dirs marked as unpacked after first iteration - because node module dir can be marked as unpacked after processing node module dir content\n // e.g. node-notifier/example/advanced.js processed, but only on process vendor/terminal-notifier.app module will be marked as unpacked\n await ensureDir(path.join(this.unpackedDest, filePathInArchive))\n break\n }\n }\n }\n\n const transformedFiles = fileSet.transformedFiles\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const fileCopier = new FileCopier()\n\n let currentDirNode: Node | null = null\n let currentDirPath: string | null = null\n\n const unpackedFileIndexSet = new Set()\n\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const file = fileSet.files[i]\n const stat = metadata.get(file)\n if (stat == null) {\n continue\n }\n\n const pathInArchive = path.relative(rootForAppFilesWithoutAsar, getDestinationPath(file, fileSet))\n\n if (stat.isSymbolicLink()) {\n const s = (stat as any)\n this.fs.getOrCreateNode(pathInArchive).link = s.relativeLink\n s.pathInArchive = pathInArchive\n unpackedFileIndexSet.add(i)\n continue\n }\n\n let fileParent = path.dirname(pathInArchive)\n if (fileParent === \".\") {\n fileParent = \"\"\n }\n\n if (currentDirPath !== fileParent) {\n if (fileParent.startsWith(\"..\")) {\n throw new Error(`Internal error: path must not start with \"..\": ${fileParent}`)\n }\n\n currentDirPath = fileParent\n currentDirNode = this.fs.getOrCreateNode(fileParent)\n // do not check for root\n if (fileParent !== \"\" && !currentDirNode.unpacked) {\n if (unpackedDirs.has(fileParent)) {\n currentDirNode.unpacked = true\n }\n else {\n await correctDirNodeUnpackedFlag(fileParent, currentDirNode)\n }\n }\n }\n\n const dirNode = currentDirNode!\n const newData = transformedFiles == null ? null : transformedFiles.get(i)\n const isUnpacked = dirNode.unpacked || (this.unpackPattern != null && this.unpackPattern(file, stat))\n this.fs.addFileNode(file, dirNode, newData == null ? stat.size : Buffer.byteLength(newData), isUnpacked, stat)\n if (isUnpacked) {\n if (!dirNode.unpacked && !dirToCreateForUnpackedFiles.has(fileParent)) {\n dirToCreateForUnpackedFiles.add(fileParent)\n await ensureDir(path.join(this.unpackedDest, fileParent))\n }\n\n const unpackedFile = path.join(this.unpackedDest, pathInArchive)\n taskManager.addTask(copyFileOrData(fileCopier, newData, file, unpackedFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n\n unpackedFileIndexSet.add(i)\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n\n return unpackedFileIndexSet\n }\n\n private writeAsarFile(fileSets: Array, unpackedFileIndexMap: Map>): Promise {\n return new Promise((resolve, reject) => {\n const headerPickle = pickle.createEmpty()\n headerPickle.writeString(JSON.stringify(this.fs.header))\n const headerBuf = headerPickle.toBuffer()\n\n const sizePickle = pickle.createEmpty()\n sizePickle.writeUInt32(headerBuf.length)\n\n const sizeBuf = sizePickle.toBuffer()\n const writeStream = createWriteStream(this.outFile)\n writeStream.on(\"error\", reject)\n writeStream.on(\"close\", resolve)\n writeStream.write(sizeBuf)\n\n let fileSetIndex = 0\n\n let files = fileSets[0].files\n let metadata = fileSets[0].metadata\n let transformedFiles = fileSets[0].transformedFiles\n let unpackedFileIndexSet = unpackedFileIndexMap.get(fileSets[0])!!\n const w = (index: number) => {\n while (true) {\n if (index >= files.length) {\n if (++fileSetIndex >= fileSets.length) {\n writeStream.end()\n return\n }\n else {\n files = fileSets[fileSetIndex].files\n metadata = fileSets[fileSetIndex].metadata\n transformedFiles = fileSets[fileSetIndex].transformedFiles\n unpackedFileIndexSet = unpackedFileIndexMap.get(fileSets[fileSetIndex])!!\n index = 0\n }\n }\n\n if (!unpackedFileIndexSet.has(index)) {\n break\n }\n else {\n const stat = metadata.get(files[index])\n if (stat != null && stat.isSymbolicLink()) {\n symlink((stat as any).linkRelativeToFile, path.join(this.unpackedDest, (stat as any).pathInArchive), () => w(index + 1))\n return\n }\n }\n index++\n }\n\n const data = transformedFiles == null ? null : transformedFiles.get(index)\n const file = files[index]\n if (data !== null && data !== undefined) {\n writeStream.write(data, () => w(index + 1))\n return\n }\n\n // https://github.com/yarnpkg/yarn/pull/3539\n const stat = metadata.get(file)\n if (stat != null && stat.size < (2 * 1024 * 1024)) {\n readFile(file)\n .then(it => {\n writeStream.write(it, () => w(index + 1))\n })\n .catch(e => reject(`Cannot read file ${file}: ${e.stack || e}`))\n }\n else {\n const readStream = createReadStream(file)\n readStream.on(\"error\", reject)\n readStream.once(\"end\", () => w(index + 1))\n readStream.pipe(writeStream, {\n end: false\n })\n }\n }\n\n writeStream.write(headerBuf, () => w(0))\n })\n }\n}\n\nasync function order(filenames: Array, orderingFile: string, src: string) {\n const orderingFiles = (await readFile(orderingFile, \"utf8\")).split(\"\\n\").map(line => {\n if (line.indexOf(\":\") !== -1) {\n line = line.split(\":\").pop()!\n }\n line = line.trim()\n if (line[0] === \"/\") {\n line = line.slice(1)\n }\n return line\n })\n\n const ordering: Array = []\n for (const file of orderingFiles) {\n const pathComponents = file.split(path.sep)\n for (const pathComponent of pathComponents) {\n ordering.push(path.join(src, pathComponent))\n }\n }\n\n const sortedFiles: Array = []\n let missing = 0\n const total = filenames.length\n for (const file of ordering) {\n if (!sortedFiles.includes(file) && filenames.includes(file)) {\n sortedFiles.push(file)\n }\n }\n for (const file of filenames) {\n if (!sortedFiles.includes(file)) {\n sortedFiles.push(file)\n missing += 1\n }\n }\n log.info({coverage: ((total - missing) / total * 100)}, \"ordering files in ASAR archive\")\n return sortedFiles\n}\n\nfunction copyFileOrData(fileCopier: FileCopier, data: string | Buffer | undefined | null, source: string, destination: string, stats: Stats) {\n if (data == null) {\n return fileCopier.copy(source, destination, stats)\n }\n else {\n return writeFile(destination, data)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/asar/integrity.d.ts b/node_modules/app-builder-lib/out/asar/integrity.d.ts deleted file mode 100644 index a1f2106..0000000 --- a/node_modules/app-builder-lib/out/asar/integrity.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface AsarIntegrityOptions { - /** - * Allows external asar files. - * - * @default false - */ - readonly externalAllowed?: boolean; -} -export interface AsarIntegrity extends AsarIntegrityOptions { - checksums: { - [key: string]: string; - }; -} -export declare function computeData(resourcesPath: string, options?: AsarIntegrityOptions | null): Promise; diff --git a/node_modules/app-builder-lib/out/asar/integrity.js b/node_modules/app-builder-lib/out/asar/integrity.js deleted file mode 100644 index dac9c8b..0000000 --- a/node_modules/app-builder-lib/out/asar/integrity.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.computeData = computeData; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function computeData(_x, _x2) { - return _computeData.apply(this, arguments); -} - -function _computeData() { - _computeData = (0, _bluebirdLst().coroutine)(function* (resourcesPath, options) { - // sort to produce constant result - const names = (yield (0, _fsExtraP().readdir)(resourcesPath)).filter(it => it.endsWith(".asar")).sort(); - const checksums = yield _bluebirdLst().default.map(names, it => hashFile(path.join(resourcesPath, it))); - const result = {}; - - for (let i = 0; i < names.length; i++) { - result[names[i]] = checksums[i]; - } - - return Object.assign({ - checksums: result - }, options); - }); - return _computeData.apply(this, arguments); -} - -function hashFile(file, algorithm = "sha512", encoding = "base64") { - return new Promise((resolve, reject) => { - const hash = (0, _crypto().createHash)(algorithm); - hash.on("error", reject).setEncoding(encoding); - (0, _fs().createReadStream)(file).on("error", reject).on("end", () => { - hash.end(); - resolve(hash.read()); - }).pipe(hash, { - end: false - }); - }); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=integrity.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/asar/integrity.js.map b/node_modules/app-builder-lib/out/asar/integrity.js.map deleted file mode 100644 index 71d84a4..0000000 --- a/node_modules/app-builder-lib/out/asar/integrity.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/asar/integrity.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;SAesB,W;;;;;+CAAf,WAA2B,aAA3B,EAAkD,OAAlD,EAAuF;AAC5F;AACA,UAAM,KAAK,GAAG,OAAO,yBAAQ,aAAR,CAAP,EAA+B,MAA/B,CAAsC,EAAE,IAAI,EAAE,CAAC,QAAH,CAAY,OAAZ,CAA5C,EAAkE,IAAlE,EAAd;AACA,UAAM,SAAS,SAAS,uBAAgB,GAAhB,CAAoB,KAApB,EAA2B,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAL,CAAU,aAAV,EAAyB,EAAzB,CAAD,CAAzC,CAAxB;AAEA,UAAM,MAAM,GAA+B,EAA3C;;AACA,SAAK,IAAI,CAAC,GAAG,CAAb,EAAgB,CAAC,GAAG,KAAK,CAAC,MAA1B,EAAkC,CAAC,EAAnC,EAAuC;AACrC,MAAA,MAAM,CAAC,KAAK,CAAC,CAAD,CAAN,CAAN,GAAmB,SAAS,CAAC,CAAD,CAA5B;AACD;;AACD,WAAA,MAAA,CAAA,MAAA,CAAA;AAAQ,MAAA,SAAS,EAAE;AAAnB,KAAA,EAA8B,OAA9B,CAAA;AACD,G;;;;AAED,SAAS,QAAT,CAAkB,IAAlB,EAAgC,SAAA,GAAoB,QAApD,EAA8D,QAAA,GAAwC,QAAtG,EAA8G;AAC5G,SAAO,IAAI,OAAJ,CAAoB,CAAC,OAAD,EAAU,MAAV,KAAoB;AAC7C,UAAM,IAAI,GAAG,0BAAW,SAAX,CAAb;AACA,IAAA,IAAI,CACD,EADH,CACM,OADN,EACe,MADf,EAEG,WAFH,CAEe,QAFf;AAIA,gCAAiB,IAAjB,EACG,EADH,CACM,OADN,EACe,MADf,EAEG,EAFH,CAEM,KAFN,EAEa,MAAK;AACd,MAAA,IAAI,CAAC,GAAL;AACA,MAAA,OAAO,CAAC,IAAI,CAAC,IAAL,EAAD,CAAP;AACD,KALH,EAMG,IANH,CAMQ,IANR,EAMc;AAAC,MAAA,GAAG,EAAE;AAAN,KANd;AAOD,GAbM,CAAP;AAcD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { createHash } from \"crypto\"\nimport { createReadStream } from \"fs\"\nimport { readdir } from \"fs-extra-p\"\nimport * as path from \"path\"\n\nexport interface AsarIntegrityOptions {\n /**\n * Allows external asar files.\n *\n * @default false\n */\n readonly externalAllowed?: boolean\n}\n\nexport interface AsarIntegrity extends AsarIntegrityOptions {\n checksums: { [key: string]: string; }\n}\n\nexport async function computeData(resourcesPath: string, options?: AsarIntegrityOptions | null): Promise {\n // sort to produce constant result\n const names = (await readdir(resourcesPath)).filter(it => it.endsWith(\".asar\")).sort()\n const checksums = await BluebirdPromise.map(names, it => hashFile(path.join(resourcesPath, it)))\n\n const result: { [key: string]: string; } = {}\n for (let i = 0; i < names.length; i++) {\n result[names[i]] = checksums[i]\n }\n return {checksums: result, ...options}\n}\n\nfunction hashFile(file: string, algorithm: string = \"sha512\", encoding: \"hex\" | \"base64\" | \"latin1\" = \"base64\") {\n return new Promise((resolve, reject) => {\n const hash = createHash(algorithm)\n hash\n .on(\"error\", reject)\n .setEncoding(encoding)\n\n createReadStream(file)\n .on(\"error\", reject)\n .on(\"end\", () => {\n hash.end()\n resolve(hash.read() as string)\n })\n .pipe(hash, {end: false})\n })\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/asar/unpackDetector.d.ts b/node_modules/app-builder-lib/out/asar/unpackDetector.d.ts deleted file mode 100644 index e7e2d19..0000000 --- a/node_modules/app-builder-lib/out/asar/unpackDetector.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isLibOrExe(file: string): boolean; diff --git a/node_modules/app-builder-lib/out/asar/unpackDetector.js b/node_modules/app-builder-lib/out/asar/unpackDetector.js deleted file mode 100644 index 4ae3eb0..0000000 --- a/node_modules/app-builder-lib/out/asar/unpackDetector.js +++ /dev/null @@ -1,207 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isLibOrExe = isLibOrExe; -exports.detectUnpackedDirs = detectUnpackedDirs; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _fileTransformer() { - const data = require("../fileTransformer"); - - _fileTransformer = function () { - return data; - }; - - return data; -} - -function _appFileCopier() { - const data = require("../util/appFileCopier"); - - _appFileCopier = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const isBinaryFile = _bluebirdLst().default.promisify(require("isbinaryfile")); - -function addValue(map, key, value) { - let list = map.get(key); - - if (list == null) { - list = [value]; - map.set(key, list); - } else { - list.push(value); - } -} - -function isLibOrExe(file) { - return file.endsWith(".dll") || file.endsWith(".exe") || file.endsWith(".dylib") || file.endsWith(".so"); -} -/** @internal */ - - -function detectUnpackedDirs(_x, _x2, _x3, _x4) { - return _detectUnpackedDirs.apply(this, arguments); -} function _detectUnpackedDirs() { - _detectUnpackedDirs = (0, _bluebirdLst().coroutine)(function* (fileSet, autoUnpackDirs, unpackedDest, rootForAppFilesWithoutAsar) { - const dirToCreate = new Map(); - const metadata = fileSet.metadata; - - function addParents(child, root) { - child = path.dirname(child); - - if (autoUnpackDirs.has(child)) { - return; - } - - do { - autoUnpackDirs.add(child); - const p = path.dirname(child); // create parent dir to be able to copy file later without directory existence check - - addValue(dirToCreate, p, path.basename(child)); - - if (child === root || p === root || autoUnpackDirs.has(p)) { - break; - } - - child = p; - } while (true); - - autoUnpackDirs.add(root); - } - - for (let i = 0, n = fileSet.files.length; i < n; i++) { - const file = fileSet.files[i]; - const index = file.lastIndexOf(_fileTransformer().NODE_MODULES_PATTERN); - - if (index < 0) { - continue; - } - - let nextSlashIndex = file.indexOf(path.sep, index + _fileTransformer().NODE_MODULES_PATTERN.length + 1); - - if (nextSlashIndex < 0) { - continue; - } - - if (file[index + _fileTransformer().NODE_MODULES_PATTERN.length] === "@") { - nextSlashIndex = file.indexOf(path.sep, nextSlashIndex + 1); - } - - if (!metadata.get(file).isFile()) { - continue; - } - - const packageDir = file.substring(0, nextSlashIndex); - const packageDirPathInArchive = path.relative(rootForAppFilesWithoutAsar, (0, _appFileCopier().getDestinationPath)(packageDir, fileSet)); - const pathInArchive = path.relative(rootForAppFilesWithoutAsar, (0, _appFileCopier().getDestinationPath)(file, fileSet)); - - if (autoUnpackDirs.has(packageDirPathInArchive)) { - // if package dir is unpacked, any file also unpacked - addParents(pathInArchive, packageDirPathInArchive); - continue; - } // https://github.com/electron-userland/electron-builder/issues/2679 - - - let shouldUnpack = false; // ffprobe-static and ffmpeg-static are known packages to always unpack - - const moduleName = path.basename(packageDir); - - if (moduleName === "ffprobe-static" || moduleName === "ffmpeg-static" || isLibOrExe(file)) { - shouldUnpack = true; - } else if (!file.includes(".", nextSlashIndex) && path.extname(file) === "") { - shouldUnpack = yield isBinaryFile(file); - } - - if (!shouldUnpack) { - continue; - } - - if (_builderUtil().log.isDebugEnabled) { - _builderUtil().log.debug({ - file: pathInArchive, - reason: "contains executable code" - }, "not packed into asar archive"); - } - - addParents(pathInArchive, packageDirPathInArchive); - } - - if (dirToCreate.size > 0) { - yield (0, _fsExtraP().ensureDir)(unpackedDest + path.sep + "node_modules"); // child directories should be not created asynchronously - parent directories should be created first - - yield _bluebirdLst().default.map(dirToCreate.keys(), - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (parentDir) { - const base = unpackedDest + path.sep + parentDir; - yield (0, _fsExtraP().ensureDir)(base); - yield _bluebirdLst().default.each(dirToCreate.get(parentDir), it => { - if (dirToCreate.has(parentDir + path.sep + it)) { - // already created - return null; - } else { - return (0, _fsExtraP().ensureDir)(base + path.sep + it); - } - }); - }); - - return function (_x5) { - return _ref.apply(this, arguments); - }; - }(), _fs().CONCURRENCY); - } - }); - return _detectUnpackedDirs.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=unpackDetector.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/asar/unpackDetector.js.map b/node_modules/app-builder-lib/out/asar/unpackDetector.js.map deleted file mode 100644 index a98df22..0000000 --- a/node_modules/app-builder-lib/out/asar/unpackDetector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/asar/unpackDetector.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM,YAAY,GAAQ,uBAAgB,SAAhB,CAA0B,OAAO,CAAC,cAAD,CAAjC,CAA1B;;AAEA,SAAS,QAAT,CAAkB,GAAlB,EAAmD,GAAnD,EAAgE,KAAhE,EAA6E;AAC3E,MAAI,IAAI,GAAG,GAAG,CAAC,GAAJ,CAAQ,GAAR,CAAX;;AACA,MAAI,IAAI,IAAI,IAAZ,EAAkB;AAChB,IAAA,IAAI,GAAG,CAAC,KAAD,CAAP;AACA,IAAA,GAAG,CAAC,GAAJ,CAAQ,GAAR,EAAa,IAAb;AACD,GAHD,MAIK;AACH,IAAA,IAAI,CAAC,IAAL,CAAU,KAAV;AACD;AACF;;AAEK,SAAU,UAAV,CAAqB,IAArB,EAAiC;AACrC,SAAO,IAAI,CAAC,QAAL,CAAc,MAAd,KAAyB,IAAI,CAAC,QAAL,CAAc,MAAd,CAAzB,IAAkD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AsE;AACzE,QAAA,YAAY,SAAS,YAAY,CAAC,IAAD,CAAjC;AACD;;AAED,UAAI,CAAC,YAAL,EAAmB;AACjB;AACD;;AAED,UAAI,mBAAI,cAAR,EAAwB;AACtB,2BAAI,KAAJ,CAAU;AAAC,UAAA,IAAI,EAAE,aAAP;AAAsB,UAAA,MAAM,EAAE;AAA9B,SAAV,EAAqE,8BAArE;AACD;;AAED,MAAA,UAAU,CAAC,aAAD,EAAgB,uBAAhB,CAAV;AACD;;AAED,QAAI,WAAW,CAAC,IAAZ,GAAmB,CAAvB,EAA0B;AACxB,YAAM,2BAAU,YAAY,GAAG,IAAI,CAAC,GAApB,GAA0B,cAApC,CAAN,CADwB,CAExB;;AACA,YAAM,uBAAgB,GAAhB,CAAoB,WAAW,CAAC,IAAZ,EAApB;AAAA;AAAA;AAAA,iDAAwC,WAAM,SAAN,EAAkB;AAC9D,gBAAM,IAAI,GAAG,YAAY,GAAG,IAAI,CAAC,GAApB,GAA0B,SAAvC;AACA,gBAAM,2BAAU,IAAV,CAAN;AACA,gBAAM,uBAAgB,IAAhB,CAAqB,WAAW,CAAC,GAAZ,CAAgB,SAAhB,CAArB,EAAmD,EAAD,IAAY;AAClE,gBAAI,WAAW,CAAC,GAAZ,CAAgB,SAAS,GAAG,IAAI,CAAC,GAAjB,GAAuB,EAAvC,CAAJ,EAAgD;AAC9C;AACA,qBAAO,IAAP;AACD,aAHD,MAIK;AACH,qBAAO,2BAAU,IAAI,GAAG,IAAI,CAAC,GAAZ,GAAkB,EAA5B,CAAP;AACD;AACF,WARK,CAAN;AASD,SAZK;;AAAA;AAAA;AAAA;AAAA,WAYH,iBAZG,CAAN;AAaD;AACF,G","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { log } from \"builder-util\"\nimport { CONCURRENCY } from \"builder-util/out/fs\"\nimport { ensureDir } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { NODE_MODULES_PATTERN } from \"../fileTransformer\"\nimport { getDestinationPath, ResolvedFileSet } from \"../util/appFileCopier\"\n\nconst isBinaryFile: any = BluebirdPromise.promisify(require(\"isbinaryfile\"))\n\nfunction addValue(map: Map>, key: string, value: string) {\n let list = map.get(key)\n if (list == null) {\n list = [value]\n map.set(key, list)\n }\n else {\n list.push(value)\n }\n}\n\nexport function isLibOrExe(file: string): boolean {\n return file.endsWith(\".dll\") || file.endsWith(\".exe\") || file.endsWith(\".dylib\") || file.endsWith(\".so\")\n}\n\n/** @internal */\nexport async function detectUnpackedDirs(fileSet: ResolvedFileSet, autoUnpackDirs: Set, unpackedDest: string, rootForAppFilesWithoutAsar: string) {\n const dirToCreate = new Map>()\n const metadata = fileSet.metadata\n\n function addParents(child: string, root: string) {\n child = path.dirname(child)\n if (autoUnpackDirs.has(child)) {\n return\n }\n\n do {\n autoUnpackDirs.add(child)\n const p = path.dirname(child)\n // create parent dir to be able to copy file later without directory existence check\n addValue(dirToCreate, p, path.basename(child))\n\n if (child === root || p === root || autoUnpackDirs.has(p)) {\n break\n }\n child = p\n }\n while (true)\n\n autoUnpackDirs.add(root)\n }\n\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const file = fileSet.files[i]\n const index = file.lastIndexOf(NODE_MODULES_PATTERN)\n if (index < 0) {\n continue\n }\n\n let nextSlashIndex = file.indexOf(path.sep, index + NODE_MODULES_PATTERN.length + 1)\n if (nextSlashIndex < 0) {\n continue\n }\n\n if (file[index + NODE_MODULES_PATTERN.length] === \"@\") {\n nextSlashIndex = file.indexOf(path.sep, nextSlashIndex + 1)\n }\n\n if (!metadata.get(file)!.isFile()) {\n continue\n }\n\n const packageDir = file.substring(0, nextSlashIndex)\n const packageDirPathInArchive = path.relative(rootForAppFilesWithoutAsar, getDestinationPath(packageDir, fileSet))\n const pathInArchive = path.relative(rootForAppFilesWithoutAsar, getDestinationPath(file, fileSet))\n if (autoUnpackDirs.has(packageDirPathInArchive)) {\n // if package dir is unpacked, any file also unpacked\n addParents(pathInArchive, packageDirPathInArchive)\n continue\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2679\n let shouldUnpack = false\n // ffprobe-static and ffmpeg-static are known packages to always unpack\n const moduleName = path.basename(packageDir)\n if (moduleName === \"ffprobe-static\" || moduleName === \"ffmpeg-static\" || isLibOrExe(file)) {\n shouldUnpack = true\n }\n else if (!file.includes(\".\", nextSlashIndex) && path.extname(file) === \"\") {\n shouldUnpack = await isBinaryFile(file)\n }\n\n if (!shouldUnpack) {\n continue\n }\n\n if (log.isDebugEnabled) {\n log.debug({file: pathInArchive, reason: \"contains executable code\"}, \"not packed into asar archive\")\n }\n\n addParents(pathInArchive, packageDirPathInArchive)\n }\n\n if (dirToCreate.size > 0) {\n await ensureDir(unpackedDest + path.sep + \"node_modules\")\n // child directories should be not created asynchronously - parent directories should be created first\n await BluebirdPromise.map(dirToCreate.keys(), async parentDir => {\n const base = unpackedDest + path.sep + parentDir\n await ensureDir(base)\n await BluebirdPromise.each(dirToCreate.get(parentDir)!, (it): any => {\n if (dirToCreate.has(parentDir + path.sep + it)) {\n // already created\n return null\n }\n else {\n return ensureDir(base + path.sep + it)\n }\n })\n }, CONCURRENCY)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/binDownload.d.ts b/node_modules/app-builder-lib/out/binDownload.d.ts deleted file mode 100644 index ab70a09..0000000 --- a/node_modules/app-builder-lib/out/binDownload.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function download(url: string, output: string, checksum?: string | null): Promise; -export declare function getBinFromGithub(name: string, version: string, checksum: string): Promise; -export declare function getBin(name: string, url?: string | null, checksum?: string | null): Promise; diff --git a/node_modules/app-builder-lib/out/binDownload.js b/node_modules/app-builder-lib/out/binDownload.js deleted file mode 100644 index e3ea7e7..0000000 --- a/node_modules/app-builder-lib/out/binDownload.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.download = download; -exports.getBinFromGithub = getBinFromGithub; -exports.getBin = getBin; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -const versionToPromise = new Map(); - -function download(url, output, checksum) { - const args = ["download", "--url", url, "--output", output]; - - if (checksum != null) { - args.push("--sha512", checksum); - } - - return (0, _builderUtil().executeAppBuilder)(args); -} - -function getBinFromGithub(name, version, checksum) { - const dirName = `${name}-${version}`; - return getBin(dirName, `https://github.com/electron-userland/electron-builder-binaries/releases/download/${dirName}/${dirName}.7z`, checksum); -} - -function getBin(name, url, checksum) { - let promise = versionToPromise.get(name); // if rejected, we will try to download again - - if (promise != null) { - return promise; - } - - promise = doGetBin(name, url, checksum); - versionToPromise.set(name, promise); - return promise; -} - -function doGetBin(name, url, checksum) { - const args = ["download-artifact", "--name", name]; - - if (url != null) { - args.push("--url", url); - } - - if (checksum != null) { - args.push("--sha512", checksum); - } - - return (0, _builderUtil().executeAppBuilder)(args); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=binDownload.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/binDownload.js.map b/node_modules/app-builder-lib/out/binDownload.js.map deleted file mode 100644 index 93252bb..0000000 --- a/node_modules/app-builder-lib/out/binDownload.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/binDownload.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA,MAAM,gBAAgB,GAAG,IAAI,GAAJ,EAAzB;;AAEM,SAAU,QAAV,CAAmB,GAAnB,EAAgC,MAAhC,EAAgD,QAAhD,EAAwE;AAC5E,QAAM,IAAI,GAAG,CAAC,UAAD,EAAa,OAAb,EAAsB,GAAtB,EAA2B,UAA3B,EAAuC,MAAvC,CAAb;;AACA,MAAI,QAAQ,IAAI,IAAhB,EAAsB;AACpB,IAAA,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,QAAtB;AACD;;AACD,SAAO,sCAAkB,IAAlB,CAAP;AACD;;AAEK,SAAU,gBAAV,CAA2B,IAA3B,EAAyC,OAAzC,EAA0D,QAA1D,EAA0E;AAC9E,QAAM,OAAO,GAAG,GAAG,IAAI,IAAI,OAAO,EAAlC;AACA,SAAO,MAAM,CAAC,OAAD,EAAU,oFAAoF,OAAO,IAAI,OAAO,KAAhH,EAAuH,QAAvH,CAAb;AACD;;AAEK,SAAU,MAAV,CAAiB,IAAjB,EAA+B,GAA/B,EAAoD,QAApD,EAA4E;AAChF,MAAI,OAAO,GAAG,gBAAgB,CAAC,GAAjB,CAAqB,IAArB,CAAd,CADgF,CAEhF;;AACA,MAAI,OAAO,IAAI,IAAf,EAAqB;AACnB,WAAO,OAAP;AACD;;AAED,EAAA,OAAO,GAAG,QAAQ,CAAC,IAAD,EAAO,GAAP,EAAY,QAAZ,CAAlB;AACA,EAAA,gBAAgB,CAAC,GAAjB,CAAqB,IAArB,EAA2B,OAA3B;AACA,SAAO,OAAP;AACD;;AAED,SAAS,QAAT,CAAkB,IAAlB,EAAgC,GAAhC,EAAgE,QAAhE,EAAmG;AACjG,QAAM,IAAI,GAAG,CAAC,mBAAD,EAAsB,QAAtB,EAAgC,IAAhC,CAAb;;AACA,MAAI,GAAG,IAAI,IAAX,EAAiB;AACf,IAAA,IAAI,CAAC,IAAL,CAAU,OAAV,EAAmB,GAAnB;AACD;;AACD,MAAI,QAAQ,IAAI,IAAhB,EAAsB;AACpB,IAAA,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,QAAtB;AACD;;AACD,SAAO,sCAAkB,IAAlB,CAAP;AACD,C","sourcesContent":["import { executeAppBuilder } from \"builder-util\"\n\nconst versionToPromise = new Map>()\n\nexport function download(url: string, output: string, checksum?: string | null): Promise {\n const args = [\"download\", \"--url\", url, \"--output\", output]\n if (checksum != null) {\n args.push(\"--sha512\", checksum)\n }\n return executeAppBuilder(args) as Promise\n}\n\nexport function getBinFromGithub(name: string, version: string, checksum: string): Promise {\n const dirName = `${name}-${version}`\n return getBin(dirName, `https://github.com/electron-userland/electron-builder-binaries/releases/download/${dirName}/${dirName}.7z`, checksum)\n}\n\nexport function getBin(name: string, url?: string | null, checksum?: string | null): Promise {\n let promise = versionToPromise.get(name)\n // if rejected, we will try to download again\n if (promise != null) {\n return promise\n }\n\n promise = doGetBin(name, url, checksum)\n versionToPromise.set(name, promise)\n return promise\n}\n\nfunction doGetBin(name: string, url: string | undefined | null, checksum: string | null | undefined): Promise {\n const args = [\"download-artifact\", \"--name\", name]\n if (url != null) {\n args.push(\"--url\", url)\n }\n if (checksum != null) {\n args.push(\"--sha512\", checksum)\n }\n return executeAppBuilder(args)\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/codeSign/codesign.d.ts b/node_modules/app-builder-lib/out/codeSign/codesign.d.ts deleted file mode 100644 index b35fe61..0000000 --- a/node_modules/app-builder-lib/out/codeSign/codesign.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TmpDir } from "temp-file"; -/** @private */ -export declare function downloadCertificate(urlOrBase64: string, tmpDir: TmpDir, currentDir: string): Promise; diff --git a/node_modules/app-builder-lib/out/codeSign/codesign.js b/node_modules/app-builder-lib/out/codeSign/codesign.js deleted file mode 100644 index 45254ff..0000000 --- a/node_modules/app-builder-lib/out/codeSign/codesign.js +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.downloadCertificate = downloadCertificate; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _os() { - const data = require("os"); - - _os = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _binDownload() { - const data = require("../binDownload"); - - _binDownload = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/** @private */ -function downloadCertificate(_x, _x2, _x3) { - return _downloadCertificate.apply(this, arguments); -} function _downloadCertificate() { - _downloadCertificate = (0, _bluebirdLst().coroutine)(function* (urlOrBase64, tmpDir, currentDir) { - urlOrBase64 = urlOrBase64.trim(); - let file = null; - - if (urlOrBase64.length > 3 && urlOrBase64[1] === ":" || urlOrBase64.startsWith("/") || urlOrBase64.startsWith(".")) { - file = urlOrBase64; - } else if (urlOrBase64.startsWith("file://")) { - file = urlOrBase64.substring("file://".length); - } else if (urlOrBase64.startsWith("~/")) { - file = path.join((0, _os().homedir)(), urlOrBase64.substring("~/".length)); - } else { - const isUrl = urlOrBase64.startsWith("https://"); - - if (isUrl || urlOrBase64.length > 2048 || urlOrBase64.endsWith("=")) { - const tempFile = yield tmpDir.getTempFile({ - suffix: ".p12" - }); - - if (isUrl) { - yield (0, _binDownload().download)(urlOrBase64, tempFile); - } else { - yield (0, _fsExtraP().outputFile)(tempFile, Buffer.from(urlOrBase64, "base64")); - } - - return tempFile; - } else { - file = urlOrBase64; - } - } - - file = path.resolve(currentDir, file); - const stat = yield (0, _fs().statOrNull)(file); - - if (stat == null) { - throw new (_builderUtil().InvalidConfigurationError)(`${file} doesn't exist`); - } else if (!stat.isFile()) { - throw new (_builderUtil().InvalidConfigurationError)(`${file} not a file`); - } else { - return file; - } - }); - return _downloadCertificate.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=codesign.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/codeSign/codesign.js.map b/node_modules/app-builder-lib/out/codeSign/codesign.js.map deleted file mode 100644 index d7140b4..0000000 --- a/node_modules/app-builder-lib/out/codeSign/codesign.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/codeSign/codesign.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;SACsB,mB;;;;;;uDAAf,WAAmC,WAAnC,EAAwD,MAAxD,EAAwE,UAAxE,EAA0F;AAC/F,IAAA,WAAW,GAAG,WAAW,CAAC,IAAZ,EAAd;AAEA,QAAI,IAAI,GAAkB,IAA1B;;AACA,QAAK,WAAW,CAAC,MAAZ,GAAqB,CAArB,IAA0B,WAAW,CAAC,CAAD,CAAX,KAAmB,GAA9C,IAAsD,WAAW,CAAC,UAAZ,CAAuB,GAAvB,CAAtD,IAAqF,WAAW,CAAC,UAAZ,CAAuB,GAAvB,CAAzF,EAAsH;AACpH,MAAA,IAAI,GAAG,WAAP;AACD,KAFD,MAGK,IAAI,WAAW,CAAC,UAAZ,CAAuB,SAAvB,CAAJ,EAAuC;AAC1C,MAAA,IAAI,GAAG,WAAW,CAAC,SAAZ,CAAsB,UAAU,MAAhC,CAAP;AACD,KAFI,MAGA,IAAI,WAAW,CAAC,UAAZ,CAAuB,IAAvB,CAAJ,EAAkC;AACrC,MAAA,IAAI,GAAG,IAAI,CAAC,IAAL,CAAU,oBAAV,EAAqB,WAAW,CAAC,SAAZ,CAAsB,KAAK,MAA3B,CAArB,CAAP;AACD,KAFI,MAGA;AACH,YAAM,KAAK,GAAG,WAAW,CAAC,UAAZ,CAAuB,UAAvB,CAAd;;AACA,UAAI,KAAK,IAAI,WAAW,CAAC,MAAZ,GAAqB,IAA9B,IAAsC,WAAW,CAAC,QAAZ,CAAqB,GAArB,CAA1C,EAAqE;AACnE,cAAM,QAAQ,SAAS,MAAM,CAAC,WAAP,CAAmB;AAAC,UAAA,MAAM,EAAE;AAAT,SAAnB,CAAvB;;AACA,YAAI,KAAJ,EAAW;AACT,gBAAM,6BAAS,WAAT,EAAsB,QAAtB,CAAN;AACD,SAFD,MAGK;AACH,gBAAM,4BAAW,QAAX,EAAqB,MAAM,CAAC,IAAP,CAAY,WAAZ,EAAyB,QAAzB,CAArB,CAAN;AACD;;AACD,eAAO,QAAP;AACD,OATD,MAUK;AACH,QAAA,IAAI,GAAG,WAAP;AACD;AACF;;AAED,IAAA,IAAI,GAAG,IAAI,CAAC,OAAL,CAAa,UAAb,EAAyB,IAAzB,CAAP;AACA,UAAM,IAAI,SAAS,sBAAW,IAAX,CAAnB;;AACA,QAAI,IAAI,IAAI,IAAZ,EAAkB;AAChB,YAAM,KAAI,wCAAJ,EAA8B,GAAG,IAAI,gBAArC,CAAN;AACD,KAFD,MAGK,IAAI,CAAC,IAAI,CAAC,MAAL,EAAL,EAAoB;AACvB,YAAM,KAAI,wCAAJ,EAA8B,GAAG,IAAI,aAArC,CAAN;AACD,KAFI,MAGA;AACH,aAAO,IAAP;AACD;AACF,G","sourcesContent":["import { outputFile } from \"fs-extra-p\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { TmpDir } from \"temp-file\"\nimport { InvalidConfigurationError } from \"builder-util\"\nimport { statOrNull } from \"builder-util/out/fs\"\nimport { download } from \"../binDownload\"\n\n/** @private */\nexport async function downloadCertificate(urlOrBase64: string, tmpDir: TmpDir, currentDir: string): Promise {\n urlOrBase64 = urlOrBase64.trim()\n\n let file: string | null = null\n if ((urlOrBase64.length > 3 && urlOrBase64[1] === \":\") || urlOrBase64.startsWith(\"/\") || urlOrBase64.startsWith(\".\")) {\n file = urlOrBase64\n }\n else if (urlOrBase64.startsWith(\"file://\")) {\n file = urlOrBase64.substring(\"file://\".length)\n }\n else if (urlOrBase64.startsWith(\"~/\")) {\n file = path.join(homedir(), urlOrBase64.substring(\"~/\".length))\n }\n else {\n const isUrl = urlOrBase64.startsWith(\"https://\")\n if (isUrl || urlOrBase64.length > 2048 || urlOrBase64.endsWith(\"=\")) {\n const tempFile = await tmpDir.getTempFile({suffix: \".p12\"})\n if (isUrl) {\n await download(urlOrBase64, tempFile)\n }\n else {\n await outputFile(tempFile, Buffer.from(urlOrBase64, \"base64\"))\n }\n return tempFile\n }\n else {\n file = urlOrBase64\n }\n }\n\n file = path.resolve(currentDir, file)\n const stat = await statOrNull(file)\n if (stat == null) {\n throw new InvalidConfigurationError(`${file} doesn't exist`)\n }\n else if (!stat.isFile()) {\n throw new InvalidConfigurationError(`${file} not a file`)\n }\n else {\n return file\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/codeSign/macCodeSign.d.ts b/node_modules/app-builder-lib/out/codeSign/macCodeSign.d.ts deleted file mode 100644 index 95ab0f7..0000000 --- a/node_modules/app-builder-lib/out/codeSign/macCodeSign.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { TmpDir } from "builder-util/out/util"; -export declare const appleCertificatePrefixes: string[]; -export declare type CertType = "Developer ID Application" | "Developer ID Installer" | "3rd Party Mac Developer Application" | "3rd Party Mac Developer Installer" | "Mac Developer"; -export interface CodeSigningInfo { - keychainName?: string | null; -} -export declare function isSignAllowed(isPrintWarn?: boolean): boolean; -export declare function reportError(isMas: boolean, certificateType: CertType, qualifier: string | null | undefined, keychainName: string | null | undefined, isForceCodeSigning: boolean): Promise; -export interface CreateKeychainOptions { - tmpDir: TmpDir; - cscLink: string; - cscKeyPassword: string; - cscILink?: string | null; - cscIKeyPassword?: string | null; - currentDir: string; -} -export declare function createKeychain({ tmpDir, cscLink, cscKeyPassword, cscILink, cscIKeyPassword, currentDir }: CreateKeychainOptions): Promise; -/** @private */ -export declare function sign(path: string, name: string, keychain: string): Promise; -export declare let findIdentityRawResult: Promise> | null; -export declare class Identity { - readonly name: string; - readonly hash: string; - constructor(name: string, hash: string); -} -export declare function findIdentity(certType: CertType, qualifier?: string | null, keychain?: string | null): Promise; diff --git a/node_modules/app-builder-lib/out/codeSign/macCodeSign.js b/node_modules/app-builder-lib/out/codeSign/macCodeSign.js deleted file mode 100644 index 84477ee..0000000 --- a/node_modules/app-builder-lib/out/codeSign/macCodeSign.js +++ /dev/null @@ -1,472 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isSignAllowed = isSignAllowed; -exports.reportError = reportError; -exports.createKeychain = createKeychain; -exports.sign = sign; -exports.findIdentity = findIdentity; -exports.findIdentityRawResult = exports.appleCertificatePrefixes = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _util() { - const data = require("builder-util/out/util"); - - _util = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _log() { - const data = require("builder-util/out/log"); - - _log = function () { - return data; - }; - - return data; -} - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -function _os() { - const data = require("os"); - - _os = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _tempFile() { - const data = require("temp-file"); - - _tempFile = function () { - return data; - }; - - return data; -} - -function _flags() { - const data = require("../util/flags"); - - _flags = function () { - return data; - }; - - return data; -} - -function _macosVersion() { - const data = require("../util/macosVersion"); - - _macosVersion = function () { - return data; - }; - - return data; -} - -function _codesign() { - const data = require("./codesign"); - - _codesign = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const appleCertificatePrefixes = ["Developer ID Application:", "Developer ID Installer:", "3rd Party Mac Developer Application:", "3rd Party Mac Developer Installer:"]; -exports.appleCertificatePrefixes = appleCertificatePrefixes; - -function isSignAllowed(isPrintWarn = true) { - if (process.platform !== "darwin") { - if (isPrintWarn) { - _util().log.warn({ - reason: "supported only on macOS" - }, "skipped macOS application code signing"); - } - - return false; - } - - const buildForPrWarning = "There are serious security concerns with CSC_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)" + "\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you."; - - if ((0, _util().isPullRequest)()) { - if ((0, _util().isEnvTrue)(process.env.CSC_FOR_PULL_REQUEST)) { - if (isPrintWarn) { - _util().log.warn(buildForPrWarning); - } - } else { - if (isPrintWarn) { - // https://github.com/electron-userland/electron-builder/issues/1524 - _util().log.warn("Current build is a part of pull request, code signing will be skipped." + "\nSet env CSC_FOR_PULL_REQUEST to true to force code signing." + `\n${buildForPrWarning}`); - } - - return false; - } - } - - return true; -} - -function reportError(_x, _x2, _x3, _x4, _x5) { - return _reportError.apply(this, arguments); -} // "Note that filename will not be searched to resolve the signing identity's certificate chain unless it is also on the user's keychain search list." -// but "security list-keychains" doesn't support add - we should 1) get current list 2) set new list - it is very bad http://stackoverflow.com/questions/10538942/add-a-keychain-to-search-list -// "overly complicated and introduces a race condition." -// https://github.com/electron-userland/electron-builder/issues/398 - - -function _reportError() { - _reportError = (0, _bluebirdLst().coroutine)(function* (isMas, certificateType, qualifier, keychainName, isForceCodeSigning) { - const logFields = {}; - - if (qualifier == null) { - logFields.reason = ""; - - if ((0, _flags().isAutoDiscoveryCodeSignIdentity)()) { - logFields.reason += `cannot find valid "${certificateType}" identity${isMas ? "" : ` or custom non-Apple code signing certificate`}`; - } - - logFields.reason += ", see https://electron.build/code-signing"; - - if (!(0, _flags().isAutoDiscoveryCodeSignIdentity)()) { - logFields.CSC_IDENTITY_AUTO_DISCOVERY = false; - } - } else { - logFields.reason = "Identity name is specified, but no valid identity with this name in the keychain"; - logFields.identity = qualifier; - } - - const args = ["find-identity"]; - - if (keychainName != null) { - args.push(keychainName); - } - - if (qualifier != null || (0, _flags().isAutoDiscoveryCodeSignIdentity)()) { - logFields.allIdentities = (yield (0, _util().exec)("security", args)).trim().split("\n").filter(it => !(it.includes("Policy: X.509 Basic") || it.includes("Matching identities"))).join("\n"); - } - - if (isMas || isForceCodeSigning) { - throw new Error(_log().Logger.createMessage("skipped macOS application code signing", logFields, "error", it => it)); - } else { - _util().log.warn(logFields, "skipped macOS application code signing"); - } - }); - return _reportError.apply(this, arguments); -} - -const bundledCertKeychainAdded = new (_lazyVal().Lazy)( -/*#__PURE__*/ -(0, _bluebirdLst().coroutine)(function* () { - // copy to temp and then atomic rename to final path - const cacheDir = getCacheDirectory(); - const tmpKeychainPath = path.join(cacheDir, (0, _tempFile().getTempName)("electron-builder-root-certs")); - const keychainPath = path.join(cacheDir, "electron-builder-root-certs.keychain"); - const results = yield Promise.all([listUserKeychains(), (0, _fs().copyFile)(path.join(__dirname, "..", "..", "certs", "root_certs.keychain"), tmpKeychainPath).then(() => (0, _fsExtraP().rename)(tmpKeychainPath, keychainPath))]); - const list = results[0]; - - if (!list.includes(keychainPath)) { - yield (0, _util().exec)("security", ["list-keychains", "-d", "user", "-s", keychainPath].concat(list)); - } -})); - -function getCacheDirectory() { - const env = process.env.ELECTRON_BUILDER_CACHE; - return (0, _util().isEmptyOrSpaces)(env) ? path.join((0, _os().homedir)(), "Library", "Caches", "electron-builder") : path.resolve(env); -} - -function listUserKeychains() { - return (0, _util().exec)("security", ["list-keychains", "-d", "user"]).then(it => it.split("\n").map(it => { - const r = it.trim(); - return r.substring(1, r.length - 1); - }).filter(it => it.length > 0)); -} - -function removeKeychain(_x6) { - return _removeKeychain.apply(this, arguments); -} - -function _removeKeychain() { - _removeKeychain = (0, _bluebirdLst().coroutine)(function* (keychainFile) { - try { - yield (0, _util().exec)("security", ["delete-keychain", keychainFile]); - } catch (e) { - console.warn(`Cannot delete keychain ${keychainFile}: ${e.stack || e}`); - yield (0, _fs().unlinkIfExists)(keychainFile); - } - }); - return _removeKeychain.apply(this, arguments); -} - -function createKeychain(_x7) { - return _createKeychain.apply(this, arguments); -} - -function _createKeychain() { - _createKeychain = (0, _bluebirdLst().coroutine)(function* ({ - tmpDir, - cscLink, - cscKeyPassword, - cscILink, - cscIKeyPassword, - currentDir - }) { - // travis has correct AppleWWDRCA cert - if (process.env.TRAVIS !== "true") { - yield bundledCertKeychainAdded.value; - } - - const keychainFile = yield tmpDir.getTempFile({ - suffix: ".keychain", - disposer: removeKeychain - }); - const certLinks = [cscLink]; - - if (cscILink != null) { - certLinks.push(cscILink); - } - - const certPaths = new Array(certLinks.length); - const keychainPassword = (0, _crypto().randomBytes)(8).toString("base64"); - const securityCommands = [["create-keychain", "-p", keychainPassword, keychainFile], ["unlock-keychain", "-p", keychainPassword, keychainFile], ["set-keychain-settings", keychainFile]]; // https://stackoverflow.com/questions/42484678/codesign-keychain-gets-ignored - // https://github.com/electron-userland/electron-builder/issues/1457 - - const list = yield listUserKeychains(); - - if (!list.includes(keychainFile)) { - securityCommands.push(["list-keychains", "-d", "user", "-s", keychainFile].concat(list)); - } - - yield Promise.all([// we do not clear downloaded files - will be removed on tmpDir cleanup automatically. not a security issue since in any case data is available as env variables and protected by password. - _bluebirdLst().default.map(certLinks, (link, i) => (0, _codesign().downloadCertificate)(link, tmpDir, currentDir).then(it => certPaths[i] = it)), _bluebirdLst().default.mapSeries(securityCommands, it => (0, _util().exec)("security", it))]); - return yield importCerts(keychainFile, certPaths, [cscKeyPassword, cscIKeyPassword].filter(it => it != null)); - }); - return _createKeychain.apply(this, arguments); -} - -function importCerts(_x8, _x9, _x10) { - return _importCerts.apply(this, arguments); -} -/** @private */ - - -function _importCerts() { - _importCerts = (0, _bluebirdLst().coroutine)(function* (keychainName, paths, keyPasswords) { - for (let i = 0; i < paths.length; i++) { - const password = keyPasswords[i]; - yield (0, _util().exec)("security", ["import", paths[i], "-k", keychainName, "-T", "/usr/bin/codesign", "-T", "/usr/bin/productbuild", "-P", password]); // https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p - // https://github.com/electron-userland/electron-packager/issues/701#issuecomment-322315996 - - if (yield (0, _macosVersion().isMacOsSierra)()) { - yield (0, _util().exec)("security", ["set-key-partition-list", "-S", "apple-tool:,apple:", "-s", "-k", password, keychainName]); - } - } - - return { - keychainName - }; - }); - return _importCerts.apply(this, arguments); -} - -function sign(path, name, keychain) { - const args = ["--deep", "--force", "--sign", name, path]; - - if (keychain != null) { - args.push("--keychain", keychain); - } - - return (0, _util().exec)("codesign", args); -} - -let findIdentityRawResult = null; -exports.findIdentityRawResult = findIdentityRawResult; - -function getValidIdentities(_x11) { - return _getValidIdentities.apply(this, arguments); -} - -function _getValidIdentities() { - _getValidIdentities = (0, _bluebirdLst().coroutine)(function* (keychain) { - function addKeychain(args) { - if (keychain != null) { - args.push(keychain); - } - - return args; - } - - let result = findIdentityRawResult; - - if (result == null || keychain != null) { - // https://github.com/electron-userland/electron-builder/issues/481 - // https://github.com/electron-userland/electron-builder/issues/535 - result = Promise.all([(0, _util().exec)("security", addKeychain(["find-identity", "-v"])).then(it => it.trim().split("\n").filter(it => { - for (const prefix of appleCertificatePrefixes) { - if (it.includes(prefix)) { - return true; - } - } - - return false; - })), (0, _util().exec)("security", addKeychain(["find-identity", "-v", "-p", "codesigning"])).then(it => it.trim().split("\n"))]).then(it => { - const array = it[0].concat(it[1]).filter(it => !it.includes("(Missing required extension)") && !it.includes("valid identities found") && !it.includes("iPhone ") && !it.includes("com.apple.idms.appleid.prd.")) // remove 1) - .map(it => it.substring(it.indexOf(")") + 1).trim()); - return Array.from(new Set(array)); - }); - - if (keychain == null) { - exports.findIdentityRawResult = findIdentityRawResult = result; - } - } - - return result; - }); - return _getValidIdentities.apply(this, arguments); -} - -function _findIdentity(_x12, _x13, _x14) { - return _findIdentity2.apply(this, arguments); -} - -function _findIdentity2() { - _findIdentity2 = (0, _bluebirdLst().coroutine)(function* (type, qualifier, keychain) { - // https://github.com/electron-userland/electron-builder/issues/484 - //noinspection SpellCheckingInspection - const lines = yield getValidIdentities(keychain); - const namePrefix = `${type}:`; - - for (const line of lines) { - if (qualifier != null && !line.includes(qualifier)) { - continue; - } - - if (line.includes(namePrefix)) { - return parseIdentity(line); - } - } - - if (type === "Developer ID Application") { - // find non-Apple certificate - // https://github.com/electron-userland/electron-builder/issues/458 - l: for (const line of lines) { - if (qualifier != null && !line.includes(qualifier)) { - continue; - } - - if (line.includes("Mac Developer:")) { - continue; - } - - for (const prefix of appleCertificatePrefixes) { - if (line.includes(prefix)) { - continue l; - } - } - - return parseIdentity(line); - } - } - - return null; - }); - return _findIdentity2.apply(this, arguments); -} - -const _Identity = require("electron-osx-sign/util-identities").Identity; - -function parseIdentity(line) { - const firstQuoteIndex = line.indexOf('"'); - const name = line.substring(firstQuoteIndex + 1, line.lastIndexOf('"')); - const hash = line.substring(0, firstQuoteIndex - 1); - return new _Identity(name, hash); -} - -function findIdentity(certType, qualifier, keychain) { - let identity = qualifier || process.env.CSC_NAME; - - if ((0, _util().isEmptyOrSpaces)(identity)) { - if ((0, _flags().isAutoDiscoveryCodeSignIdentity)()) { - return _findIdentity(certType, null, keychain); - } else { - return Promise.resolve(null); - } - } else { - identity = identity.trim(); - - for (const prefix of appleCertificatePrefixes) { - checkPrefix(identity, prefix); - } - - return _findIdentity(certType, identity, keychain); - } -} - -function checkPrefix(name, prefix) { - if (name.startsWith(prefix)) { - throw new (_util().InvalidConfigurationError)(`Please remove prefix "${prefix}" from the specified name — appropriate certificate will be chosen automatically`); - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=macCodeSign.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/codeSign/macCodeSign.js.map b/node_modules/app-builder-lib/out/codeSign/macCodeSign.js.map deleted file mode 100644 index 7d3db87..0000000 --- a/node_modules/app-builder-lib/out/codeSign/macCodeSign.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/codeSign/macCodeSign.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEO,MAAM,wBAAwB,GAAG,CAAC,2BAAD,EAA8B,yBAA9B,EAAyD,sCAAzD,EAAiG,oCAAjG,CAAjC;;;AAQD,SAAU,aAAV,CAAwB,WAAW,GAAG,IAAtC,EAA0C;AAC9C,MAAI,OAAO,CAAC,QAAR,KAAqB,QAAzB,EAAmC;AACjC,QAAI,WAAJ,EAAiB;AACf,kBAAI,IAAJ,CAAS;AAAC,QAAA,MAAM,EAAE;AAAT,OAAT,EAA8C,wCAA9C;AACD;;AACD,WAAO,KAAP;AACD;;AAED,QAAM,iBAAiB,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["import BluebirdPromise from \"bluebird-lst\"\nimport { exec, InvalidConfigurationError, isEmptyOrSpaces, isEnvTrue, isPullRequest, log, TmpDir } from \"builder-util/out/util\"\nimport { copyFile, unlinkIfExists } from \"builder-util/out/fs\"\nimport { Fields, Logger } from \"builder-util/out/log\"\nimport { randomBytes } from \"crypto\"\nimport { rename } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { getTempName } from \"temp-file\"\nimport { isAutoDiscoveryCodeSignIdentity } from \"../util/flags\"\nimport { isMacOsSierra } from \"../util/macosVersion\"\nimport { downloadCertificate } from \"./codesign\"\n\nexport const appleCertificatePrefixes = [\"Developer ID Application:\", \"Developer ID Installer:\", \"3rd Party Mac Developer Application:\", \"3rd Party Mac Developer Installer:\"]\n\nexport type CertType = \"Developer ID Application\" | \"Developer ID Installer\" | \"3rd Party Mac Developer Application\" | \"3rd Party Mac Developer Installer\" | \"Mac Developer\"\n\nexport interface CodeSigningInfo {\n keychainName?: string | null\n}\n\nexport function isSignAllowed(isPrintWarn = true): boolean {\n if (process.platform !== \"darwin\") {\n if (isPrintWarn) {\n log.warn({reason: \"supported only on macOS\"}, \"skipped macOS application code signing\")\n }\n return false\n }\n\n const buildForPrWarning = \"There are serious security concerns with CSC_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)\" +\n \"\\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.\"\n\n if (isPullRequest()) {\n if (isEnvTrue(process.env.CSC_FOR_PULL_REQUEST)) {\n if (isPrintWarn) {\n log.warn(buildForPrWarning)\n }\n }\n else {\n if (isPrintWarn) {\n // https://github.com/electron-userland/electron-builder/issues/1524\n log.warn(\"Current build is a part of pull request, code signing will be skipped.\" +\n \"\\nSet env CSC_FOR_PULL_REQUEST to true to force code signing.\" +\n `\\n${buildForPrWarning}`)\n }\n return false\n }\n }\n return true\n}\n\nexport async function reportError(isMas: boolean, certificateType: CertType, qualifier: string | null | undefined, keychainName: string | null | undefined, isForceCodeSigning: boolean) {\n const logFields: Fields = {}\n if (qualifier == null) {\n logFields.reason = \"\"\n if (isAutoDiscoveryCodeSignIdentity()) {\n logFields.reason += `cannot find valid \"${certificateType}\" identity${(isMas ? \"\" : ` or custom non-Apple code signing certificate`)}`\n }\n logFields.reason += \", see https://electron.build/code-signing\"\n if (!isAutoDiscoveryCodeSignIdentity()) {\n logFields.CSC_IDENTITY_AUTO_DISCOVERY = false\n }\n }\n else {\n logFields.reason = \"Identity name is specified, but no valid identity with this name in the keychain\"\n logFields.identity = qualifier\n }\n\n const args = [\"find-identity\"]\n if (keychainName != null) {\n args.push(keychainName)\n }\n\n if (qualifier != null || isAutoDiscoveryCodeSignIdentity()) {\n logFields.allIdentities = (await exec(\"security\", args))\n .trim()\n .split(\"\\n\")\n .filter(it => !(it.includes(\"Policy: X.509 Basic\") || it.includes(\"Matching identities\")))\n .join(\"\\n\")\n }\n\n if (isMas || isForceCodeSigning) {\n throw new Error(Logger.createMessage(\"skipped macOS application code signing\", logFields, \"error\", it => it))\n }\n else {\n log.warn(logFields, \"skipped macOS application code signing\")\n }\n}\n\n// \"Note that filename will not be searched to resolve the signing identity's certificate chain unless it is also on the user's keychain search list.\"\n// but \"security list-keychains\" doesn't support add - we should 1) get current list 2) set new list - it is very bad http://stackoverflow.com/questions/10538942/add-a-keychain-to-search-list\n// \"overly complicated and introduces a race condition.\"\n// https://github.com/electron-userland/electron-builder/issues/398\nconst bundledCertKeychainAdded = new Lazy(async () => {\n // copy to temp and then atomic rename to final path\n const cacheDir = getCacheDirectory()\n const tmpKeychainPath = path.join(cacheDir, getTempName(\"electron-builder-root-certs\"))\n const keychainPath = path.join(cacheDir, \"electron-builder-root-certs.keychain\")\n const results = await Promise.all([\n listUserKeychains(),\n copyFile(path.join(__dirname, \"..\", \"..\", \"certs\", \"root_certs.keychain\"), tmpKeychainPath)\n .then(() => rename(tmpKeychainPath, keychainPath)),\n ])\n const list = results[0]\n if (!list.includes(keychainPath)) {\n await exec(\"security\", [\"list-keychains\", \"-d\", \"user\", \"-s\", keychainPath].concat(list))\n }\n})\n\nfunction getCacheDirectory(): string {\n const env = process.env.ELECTRON_BUILDER_CACHE\n return isEmptyOrSpaces(env) ? path.join(homedir(), \"Library\", \"Caches\", \"electron-builder\") : path.resolve(env!!)\n}\n\nfunction listUserKeychains(): Promise> {\n return exec(\"security\", [\"list-keychains\", \"-d\", \"user\"])\n .then(it => it\n .split(\"\\n\")\n .map(it => {\n const r = it.trim()\n return r.substring(1, r.length - 1)\n })\n .filter(it => it.length > 0))\n}\n\nexport interface CreateKeychainOptions {\n tmpDir: TmpDir\n cscLink: string\n cscKeyPassword: string\n cscILink?: string | null\n cscIKeyPassword?: string | null\n currentDir: string\n}\n\nasync function removeKeychain(keychainFile: string) {\n try {\n await exec(\"security\", [\"delete-keychain\", keychainFile])\n }\n catch (e) {\n console.warn(`Cannot delete keychain ${keychainFile}: ${e.stack || e}`)\n await unlinkIfExists(keychainFile)\n }\n}\n\nexport async function createKeychain({tmpDir, cscLink, cscKeyPassword, cscILink, cscIKeyPassword, currentDir}: CreateKeychainOptions): Promise {\n // travis has correct AppleWWDRCA cert\n if (process.env.TRAVIS !== \"true\") {\n await bundledCertKeychainAdded.value\n }\n\n const keychainFile = await tmpDir.getTempFile({suffix: \".keychain\", disposer: removeKeychain})\n\n const certLinks = [cscLink]\n if (cscILink != null) {\n certLinks.push(cscILink)\n }\n\n const certPaths = new Array(certLinks.length)\n const keychainPassword = randomBytes(8).toString(\"base64\")\n const securityCommands = [\n [\"create-keychain\", \"-p\", keychainPassword, keychainFile],\n [\"unlock-keychain\", \"-p\", keychainPassword, keychainFile],\n [\"set-keychain-settings\", keychainFile]\n ]\n\n // https://stackoverflow.com/questions/42484678/codesign-keychain-gets-ignored\n // https://github.com/electron-userland/electron-builder/issues/1457\n const list = await listUserKeychains()\n if (!list.includes(keychainFile)) {\n securityCommands.push([\"list-keychains\", \"-d\", \"user\", \"-s\", keychainFile].concat(list))\n }\n\n await Promise.all([\n // we do not clear downloaded files - will be removed on tmpDir cleanup automatically. not a security issue since in any case data is available as env variables and protected by password.\n BluebirdPromise.map(certLinks, (link, i) => downloadCertificate(link, tmpDir, currentDir).then(it => certPaths[i] = it)),\n BluebirdPromise.mapSeries(securityCommands, it => exec(\"security\", it))\n ])\n return await importCerts(keychainFile, certPaths, [cscKeyPassword, cscIKeyPassword].filter(it => it != null) as Array)\n}\n\nasync function importCerts(keychainName: string, paths: Array, keyPasswords: Array): Promise {\n for (let i = 0; i < paths.length; i++) {\n const password = keyPasswords[i]\n await exec(\"security\", [\"import\", paths[i], \"-k\", keychainName, \"-T\", \"/usr/bin/codesign\", \"-T\", \"/usr/bin/productbuild\", \"-P\", password])\n\n // https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p\n // https://github.com/electron-userland/electron-packager/issues/701#issuecomment-322315996\n if (await isMacOsSierra()) {\n await exec(\"security\", [\"set-key-partition-list\", \"-S\", \"apple-tool:,apple:\", \"-s\", \"-k\", password, keychainName])\n }\n }\n\n return {\n keychainName,\n }\n}\n\n/** @private */\nexport function sign(path: string, name: string, keychain: string): Promise {\n const args = [\"--deep\", \"--force\", \"--sign\", name, path]\n if (keychain != null) {\n args.push(\"--keychain\", keychain)\n }\n return exec(\"codesign\", args)\n}\n\nexport let findIdentityRawResult: Promise> | null = null\n\nasync function getValidIdentities(keychain?: string | null): Promise> {\n function addKeychain(args: Array) {\n if (keychain != null) {\n args.push(keychain)\n }\n return args\n }\n\n let result = findIdentityRawResult\n if (result == null || keychain != null) {\n // https://github.com/electron-userland/electron-builder/issues/481\n // https://github.com/electron-userland/electron-builder/issues/535\n result = Promise.all>([\n exec(\"security\", addKeychain([\"find-identity\", \"-v\"]))\n .then(it => it.trim().split(\"\\n\").filter(it => {\n for (const prefix of appleCertificatePrefixes) {\n if (it.includes(prefix)) {\n return true\n }\n }\n return false\n })),\n exec(\"security\", addKeychain([\"find-identity\", \"-v\", \"-p\", \"codesigning\"]))\n .then(it => it.trim().split((\"\\n\"))),\n ])\n .then(it => {\n const array = it[0].concat(it[1])\n .filter(it => !it.includes(\"(Missing required extension)\") && !it.includes(\"valid identities found\") && !it.includes(\"iPhone \") && !it.includes(\"com.apple.idms.appleid.prd.\"))\n // remove 1)\n .map(it => it.substring(it.indexOf(\")\") + 1).trim())\n return Array.from(new Set(array))\n })\n\n if (keychain == null) {\n findIdentityRawResult = result\n }\n }\n return result\n}\n\nasync function _findIdentity(type: CertType, qualifier?: string | null, keychain?: string | null): Promise {\n // https://github.com/electron-userland/electron-builder/issues/484\n //noinspection SpellCheckingInspection\n const lines = await getValidIdentities(keychain)\n const namePrefix = `${type}:`\n for (const line of lines) {\n if (qualifier != null && !line.includes(qualifier)) {\n continue\n }\n\n if (line.includes(namePrefix)) {\n return parseIdentity(line)\n }\n }\n\n if (type === \"Developer ID Application\") {\n // find non-Apple certificate\n // https://github.com/electron-userland/electron-builder/issues/458\n l: for (const line of lines) {\n if (qualifier != null && !line.includes(qualifier)) {\n continue\n }\n\n if (line.includes(\"Mac Developer:\")) {\n continue\n }\n\n for (const prefix of appleCertificatePrefixes) {\n if (line.includes(prefix)) {\n continue l\n }\n }\n\n return parseIdentity(line)\n }\n }\n return null\n}\n\nexport declare class Identity {\n readonly name: string\n readonly hash: string\n\n constructor(name: string, hash: string)\n}\n\nconst _Identity = require(\"electron-osx-sign/util-identities\").Identity\n\nfunction parseIdentity(line: string): Identity {\n const firstQuoteIndex = line.indexOf('\"')\n const name = line.substring(firstQuoteIndex + 1, line.lastIndexOf('\"'))\n const hash = line.substring(0, firstQuoteIndex - 1)\n return new _Identity(name, hash)\n}\n\nexport function findIdentity(certType: CertType, qualifier?: string | null, keychain?: string | null): Promise {\n let identity = qualifier || process.env.CSC_NAME\n if (isEmptyOrSpaces(identity)) {\n if (isAutoDiscoveryCodeSignIdentity()) {\n return _findIdentity(certType, null, keychain)\n }\n else {\n return Promise.resolve(null)\n }\n }\n else {\n identity = identity!.trim()\n for (const prefix of appleCertificatePrefixes) {\n checkPrefix(identity, prefix)\n }\n return _findIdentity(certType, identity, keychain)\n }\n}\n\nfunction checkPrefix(name: string, prefix: string) {\n if (name.startsWith(prefix)) {\n throw new InvalidConfigurationError(`Please remove prefix \"${prefix}\" from the specified name — appropriate certificate will be chosen automatically`)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.d.ts b/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.d.ts deleted file mode 100644 index 54cbddb..0000000 --- a/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { WindowsConfiguration } from ".."; -import { VmManager } from "../vm/vm"; -import { WinPackager } from "../winPackager"; -export declare function getSignVendorPath(): Promise; -export declare type CustomWindowsSign = (configuration: CustomWindowsSignTaskConfiguration) => Promise; -export interface WindowsSignOptions { - readonly path: string; - readonly name?: string | null; - readonly cscInfo?: FileCodeSigningInfo | CertificateFromStoreInfo | null; - readonly site?: string | null; - readonly options: WindowsConfiguration; -} -export interface WindowsSignTaskConfiguration extends WindowsSignOptions { - resultOutputPath?: string; - hash: string; - isNest: boolean; -} -export interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration { - computeSignToolArgs(isWin: boolean): Array; -} -export declare function sign(options: WindowsSignOptions, packager: WinPackager): Promise; -export interface FileCodeSigningInfo { - readonly file: string; - readonly password: string | null; -} -export declare function getCertInfo(file: string, password: string): Promise; -export interface CertificateInfo { - readonly commonName: string; - readonly bloodyMicrosoftSubjectDn: string; -} -export interface CertificateFromStoreInfo { - thumbprint: string; - subject: string; - store: string; - isLocalMachineStore: boolean; -} -export declare function getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise; diff --git a/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js b/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js deleted file mode 100644 index 196dcc4..0000000 --- a/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js +++ /dev/null @@ -1,445 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getSignVendorPath = getSignVendorPath; -exports.sign = sign; -exports.getCertInfo = getCertInfo; -exports.getCertificateFromStoreInfo = getCertificateFromStoreInfo; -exports.isOldWin6 = isOldWin6; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _util() { - const data = require("builder-util/out/util"); - - _util = function () { - return data; - }; - - return data; -} - -function _binDownload() { - const data = require("../binDownload"); - - _binDownload = function () { - return data; - }; - - return data; -} - -function _appBuilder() { - const data = require("../util/appBuilder"); - - _appBuilder = function () { - return data; - }; - - return data; -} - -function _bundledTool() { - const data = require("../util/bundledTool"); - - _bundledTool = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function os() { - const data = _interopRequireWildcard(require("os")); - - os = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _platformPackager() { - const data = require("../platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _flags() { - const data = require("../util/flags"); - - _flags = function () { - return data; - }; - - return data; -} - -function _vm() { - const data = require("../vm/vm"); - - _vm = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getSignVendorPath() { - return (0, _binDownload().getBin)("winCodeSign"); -} - -function sign(_x, _x2) { - return _sign.apply(this, arguments); -} - -function _sign() { - _sign = (0, _bluebirdLst().coroutine)(function* (options, packager) { - let hashes = options.options.signingHashAlgorithms; // msi does not support dual-signing - - if (options.path.endsWith(".msi")) { - hashes = [hashes != null && !hashes.includes("sha1") ? "sha256" : "sha1"]; - } else if (options.path.endsWith(".appx")) { - hashes = ["sha256"]; - } else if (hashes == null) { - hashes = ["sha1", "sha256"]; - } else { - hashes = Array.isArray(hashes) ? hashes : [hashes]; - } - - function defaultExecutor(configuration) { - return doSign(configuration, packager); - } - - const executor = (0, _platformPackager().resolveFunction)(options.options.sign, "sign") || defaultExecutor; - let isNest = false; - - for (const hash of hashes) { - const taskConfiguration = Object.assign({}, options, { - hash, - isNest - }); - yield executor(Object.assign({}, taskConfiguration, { - computeSignToolArgs: isWin => computeSignToolArgs(taskConfiguration, isWin) - })); - isNest = true; - - if (taskConfiguration.resultOutputPath != null) { - yield (0, _fsExtraP().rename)(taskConfiguration.resultOutputPath, options.path); - } - } - }); - return _sign.apply(this, arguments); -} - -function getCertInfo(_x3, _x4) { - return _getCertInfo.apply(this, arguments); -} - -function _getCertInfo() { - _getCertInfo = (0, _bluebirdLst().coroutine)(function* (file, password) { - let result = null; - - try { - result = yield (0, _appBuilder().executeAppBuilderAsJson)(["certificate-info", "--input", file, "--password", password]); - } catch (e) { - throw new Error(`Cannot extract publisher name from code signing certificate, please file issue. As workaround, set win.publisherName: ${e.stack || e}`); - } - - if (result.error != null) { - // noinspection ExceptionCaughtLocallyJS - throw new (_util().InvalidConfigurationError)(`Cannot extract publisher name from code signing certificate: ${result.error}`); - } - - return result; - }); - return _getCertInfo.apply(this, arguments); -} - -function getCertificateFromStoreInfo(_x5, _x6) { - return _getCertificateFromStoreInfo.apply(this, arguments); -} - -function _getCertificateFromStoreInfo() { - _getCertificateFromStoreInfo = (0, _bluebirdLst().coroutine)(function* (options, vm) { - const certificateSubjectName = options.certificateSubjectName; - const certificateSha1 = options.certificateSha1; // ExcludeProperty doesn't work, so, we cannot exclude RawData, it is ok - // powershell can return object if the only item - - const rawResult = yield vm.exec("powershell.exe", ["Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress"]); - const certList = rawResult.length === 0 ? [] : (0, _util().asArray)(JSON.parse(rawResult)); - - for (const certInfo of certList) { - if (certificateSubjectName != null) { - if (!certInfo.Subject.includes(certificateSubjectName)) { - continue; - } - } else if (certInfo.Thumbprint !== certificateSha1) { - continue; - } - - const parentPath = certInfo.PSParentPath; - const store = parentPath.substring(parentPath.lastIndexOf("\\") + 1); - - _util().log.debug({ - store, - PSParentPath: parentPath - }, "auto-detect certificate store"); // https://github.com/electron-userland/electron-builder/issues/1717 - - - const isLocalMachineStore = parentPath.includes("Certificate::LocalMachine"); - - _util().log.debug(null, "auto-detect using of LocalMachine store"); - - return { - thumbprint: certInfo.Thumbprint, - subject: certInfo.Subject, - store, - isLocalMachineStore - }; - } - - throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`); - }); - return _getCertificateFromStoreInfo.apply(this, arguments); -} - -function doSign(_x7, _x8) { - return _doSign.apply(this, arguments); -} // on windows be aware of http://stackoverflow.com/a/32640183/1910191 - - -function _doSign() { - _doSign = (0, _bluebirdLst().coroutine)(function* (configuration, packager) { - // https://github.com/electron-userland/electron-builder/pull/1944 - const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT, 10) || 10 * 60 * 1000; - let tool; - let args; - let env = process.env; - let vm; - - if (configuration.path.endsWith(".appx") || !("file" in configuration.cscInfo) - /* certificateSubjectName and other such options */ - ) { - vm = yield packager.vm.value; - tool = getWinSignTool((yield getSignVendorPath())); - args = computeSignToolArgs(configuration, true, vm); - } else { - vm = new (_vm().VmManager)(); - const toolInfo = yield getToolPath(); - tool = toolInfo.path; - args = configuration.computeSignToolArgs(process.platform === "win32"); - - if (toolInfo.env != null) { - env = toolInfo.env; - } - } - - try { - yield vm.exec(tool, args, { - timeout, - env - }); - } catch (e) { - if (e.message.includes("The file is being used by another process") || e.message.includes("The specified timestamp server either could not be reached")) { - _util().log.warn(`First attempt to code sign failed, another attempt will be made in 2 seconds: ${e.message}`); - - yield new Promise((resolve, reject) => { - setTimeout(() => { - vm.exec(tool, args, { - timeout, - env - }).then(resolve).catch(reject); - }, 2000); - }); - } - - throw e; - } - }); - return _doSign.apply(this, arguments); -} - -function computeSignToolArgs(options, isWin, vm = new (_vm().VmManager)()) { - const inputFile = vm.toVmFile(options.path); - const outputPath = isWin ? inputFile : getOutputPath(inputFile, options.hash); - - if (!isWin) { - options.resultOutputPath = outputPath; - } - - const args = isWin ? ["sign"] : ["-in", inputFile, "-out", outputPath]; - - if (process.env.ELECTRON_BUILDER_OFFLINE !== "true") { - const timestampingServiceUrl = options.options.timeStampServer || "http://timestamp.verisign.com/scripts/timstamp.dll"; - - if (isWin) { - args.push(options.isNest || options.hash === "sha256" ? "/tr" : "/t", options.isNest || options.hash === "sha256" ? options.options.rfc3161TimeStampServer || "http://timestamp.comodoca.com/rfc3161" : timestampingServiceUrl); - } else { - args.push("-t", timestampingServiceUrl); - } - } - - const certificateFile = options.cscInfo.file; - - if (certificateFile == null) { - const cscInfo = options.cscInfo; - const subjectName = cscInfo.thumbprint; - - if (!isWin) { - throw new Error(`${subjectName == null ? "certificateSha1" : "certificateSubjectName"} supported only on Windows`); - } - - args.push("/sha1", cscInfo.thumbprint); - args.push("/s", cscInfo.store); - - if (cscInfo.isLocalMachineStore) { - args.push("/sm"); - } - } else { - const certExtension = path.extname(certificateFile); - - if (certExtension === ".p12" || certExtension === ".pfx") { - args.push(isWin ? "/f" : "-pkcs12", vm.toVmFile(certificateFile)); - } else { - throw new Error(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`); - } - } - - if (!isWin || options.hash !== "sha1") { - args.push(isWin ? "/fd" : "-h", options.hash); - - if (isWin && process.env.ELECTRON_BUILDER_OFFLINE !== "true") { - args.push("/td", "sha256"); - } - } - - if (options.name) { - args.push(isWin ? "/d" : "-n", options.name); - } - - if (options.site) { - args.push(isWin ? "/du" : "-i", options.site); - } // msi does not support dual-signing - - - if (options.isNest) { - args.push(isWin ? "/as" : "-nest"); - } - - const password = options.cscInfo == null ? null : options.cscInfo.password; - - if (password) { - args.push(isWin ? "/p" : "-pass", password); - } - - if (options.options.additionalCertificateFile) { - args.push(isWin ? "/ac" : "-ac", vm.toVmFile(options.options.additionalCertificateFile)); - } - - const httpsProxyFromEnv = process.env.HTTPS_PROXY; - - if (!isWin && httpsProxyFromEnv != null && httpsProxyFromEnv.length) { - args.push("-p", httpsProxyFromEnv); - } - - if (isWin) { - // https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610 - args.push("/debug"); // must be last argument - - args.push(inputFile); - } - - return args; -} - -function getOutputPath(inputPath, hash) { - const extension = path.extname(inputPath); - return path.join(path.dirname(inputPath), `${path.basename(inputPath, extension)}-signed-${hash}${extension}`); -} -/** @internal */ - - -function isOldWin6() { - const winVersion = os().release(); - return winVersion.startsWith("6.") && !winVersion.startsWith("6.3"); -} - -function getWinSignTool(vendorPath) { - // use modern signtool on Windows Server 2012 R2 to be able to sign AppX - if (isOldWin6()) { - return path.join(vendorPath, "windows-6", "signtool.exe"); - } else { - return path.join(vendorPath, "windows-10", process.arch, "signtool.exe"); - } -} - -function getToolPath() { - return _getToolPath.apply(this, arguments); -} function _getToolPath() { - _getToolPath = (0, _bluebirdLst().coroutine)(function* () { - if ((0, _flags().isUseSystemSigncode)()) { - return { - path: "osslsigncode" - }; - } - - const result = process.env.SIGNTOOL_PATH; - - if (result) { - return { - path: result - }; - } - - const vendorPath = yield getSignVendorPath(); - - if (process.platform === "win32") { - // use modern signtool on Windows Server 2012 R2 to be able to sign AppX - return { - path: getWinSignTool(vendorPath) - }; - } else if (process.platform === "darwin") { - const toolDirPath = path.join(vendorPath, process.platform, "10.12"); - return { - path: path.join(toolDirPath, "osslsigncode"), - env: (0, _bundledTool().computeToolEnv)([path.join(toolDirPath, "lib")]) - }; - } else { - return { - path: path.join(vendorPath, process.platform, "osslsigncode") - }; - } - }); - return _getToolPath.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=windowsCodeSign.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js.map b/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js.map deleted file mode 100644 index c693fc7..0000000 --- a/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/codeSign/windowsCodeSign.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGM,SAAU,iBAAV,GAA2B;AAC/B,SAAO,2BAAO,aAAP,CAAP;AACD;;SA0BqB,I;;;;;wCAAf,WAAoB,OAApB,EAAiD,QAAjD,EAAsE;AAC3E,QAAI,MAAM,GAAG,OAAO,CAAC,OAAR,CAAgB,qBAA7B,CAD2E,CAE3E;;AACA,QAAI,OAAO,CAAC,IAAR,CAAa,QAAb,CAAsB,MAAtB,CAAJ,EAAmC;AACjC,MAAA,MAAM,GAAG,CAAC,MAAM,IAAI,IAAV,IAAkB,CAAC,MAAM,CAAC,QAAP,CAAgB,MAAhB,CAAnB,GAA6C,QAA7C,GAAwD,MAAzD,CAAT;AACD,KAFD,M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I,EAAE;AAAP,OAAP;AACD;;AAED,UAAM,MAAM,GAAG,OAAO,CAAC,GAAR,CAAY,aAA3B;;AACA,QAAI,MAAJ,EAAY;AACV,aAAO;AAAC,QAAA,IAAI,EAAE;AAAP,OAAP;AACD;;AAED,UAAM,UAAU,SAAS,iBAAiB,EAA1C;;AACA,QAAI,OAAO,CAAC,QAAR,KAAqB,OAAzB,EAAkC;AAChC;AACA,aAAO;AAAC,QAAA,IAAI,EAAE,cAAc,CAAC,UAAD;AAArB,OAAP;AACD,KAHD,MAIK,IAAI,OAAO,CAAC,QAAR,KAAqB,QAAzB,EAAmC;AACtC,YAAM,WAAW,GAAG,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,OAAO,CAAC,QAA9B,EAAwC,OAAxC,CAApB;AACA,aAAO;AACL,QAAA,IAAI,EAAE,IAAI,CAAC,IAAL,CAAU,WAAV,EAAuB,cAAvB,CADD;AAEL,QAAA,GAAG,EAAE,mCAAe,CAAC,IAAI,CAAC,IAAL,CAAU,WAAV,EAAuB,KAAvB,CAAD,CAAf;AAFA,OAAP;AAID,KANI,MAOA;AACH,aAAO;AAAC,QAAA,IAAI,EAAE,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,OAAO,CAAC,QAA9B,EAAwC,cAAxC;AAAP,OAAP;AACD;AACF,G","sourcesContent":["import { InvalidConfigurationError, asArray, log } from \"builder-util/out/util\"\nimport { getBin } from \"../binDownload\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { computeToolEnv, ToolInfo } from \"../util/bundledTool\"\nimport { rename } from \"fs-extra-p\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport { WindowsConfiguration } from \"..\"\nimport { resolveFunction } from \"../platformPackager\"\nimport { isUseSystemSigncode } from \"../util/flags\"\nimport { VmManager } from \"../vm/vm\"\nimport { WinPackager } from \"../winPackager\"\n\nexport function getSignVendorPath() {\n return getBin(\"winCodeSign\")\n}\n\nexport type CustomWindowsSign = (configuration: CustomWindowsSignTaskConfiguration) => Promise\n\nexport interface WindowsSignOptions {\n readonly path: string\n\n readonly name?: string | null\n readonly cscInfo?: FileCodeSigningInfo | CertificateFromStoreInfo | null\n readonly site?: string | null\n\n readonly options: WindowsConfiguration\n}\n\nexport interface WindowsSignTaskConfiguration extends WindowsSignOptions {\n // set if output path differs from input (e.g. osslsigncode cannot sign file inplace)\n resultOutputPath?: string\n\n hash: string\n isNest: boolean\n}\n\nexport interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration {\n computeSignToolArgs(isWin: boolean): Array\n}\n\nexport async function sign(options: WindowsSignOptions, packager: WinPackager) {\n let hashes = options.options.signingHashAlgorithms\n // msi does not support dual-signing\n if (options.path.endsWith(\".msi\")) {\n hashes = [hashes != null && !hashes.includes(\"sha1\") ? \"sha256\" : \"sha1\"]\n }\n else if (options.path.endsWith(\".appx\")) {\n hashes = [\"sha256\"]\n }\n else if (hashes == null) {\n hashes = [\"sha1\", \"sha256\"]\n }\n else {\n hashes = Array.isArray(hashes) ? hashes : [hashes]\n }\n\n function defaultExecutor(configuration: CustomWindowsSignTaskConfiguration) {\n return doSign(configuration, packager)\n }\n\n const executor = resolveFunction(options.options.sign, \"sign\") || defaultExecutor\n let isNest = false\n for (const hash of hashes) {\n const taskConfiguration: WindowsSignTaskConfiguration = {...options, hash, isNest}\n await executor({\n ...taskConfiguration,\n computeSignToolArgs: isWin => computeSignToolArgs(taskConfiguration, isWin)\n })\n isNest = true\n if (taskConfiguration.resultOutputPath != null) {\n await rename(taskConfiguration.resultOutputPath, options.path)\n }\n }\n}\n\nexport interface FileCodeSigningInfo {\n readonly file: string\n readonly password: string | null\n}\n\nexport async function getCertInfo(file: string, password: string): Promise {\n let result: any = null\n try {\n result = await executeAppBuilderAsJson([\"certificate-info\", \"--input\", file, \"--password\", password])\n }\n catch (e) {\n throw new Error(`Cannot extract publisher name from code signing certificate, please file issue. As workaround, set win.publisherName: ${e.stack || e}`)\n }\n\n if (result.error != null) {\n // noinspection ExceptionCaughtLocallyJS\n throw new InvalidConfigurationError(`Cannot extract publisher name from code signing certificate: ${result.error}`)\n }\n return result\n}\n\nexport interface CertificateInfo {\n readonly commonName: string\n readonly bloodyMicrosoftSubjectDn: string\n}\n\nexport interface CertificateFromStoreInfo {\n thumbprint: string\n subject: string\n store: string\n isLocalMachineStore: boolean\n}\n\nexport async function getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise {\n const certificateSubjectName = options.certificateSubjectName\n const certificateSha1 = options.certificateSha1\n // ExcludeProperty doesn't work, so, we cannot exclude RawData, it is ok\n // powershell can return object if the only item\n const rawResult = await vm.exec(\"powershell.exe\", [\"Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress\"])\n const certList = rawResult.length === 0 ? [] : asArray(JSON.parse(rawResult))\n for (const certInfo of certList) {\n if (certificateSubjectName != null) {\n if (!certInfo.Subject.includes(certificateSubjectName)) {\n continue\n }\n }\n else if (certInfo.Thumbprint !== certificateSha1) {\n continue\n }\n\n const parentPath = certInfo.PSParentPath\n const store = parentPath.substring(parentPath.lastIndexOf(\"\\\\\") + 1)\n log.debug({store, PSParentPath: parentPath}, \"auto-detect certificate store\")\n // https://github.com/electron-userland/electron-builder/issues/1717\n const isLocalMachineStore = (parentPath.includes(\"Certificate::LocalMachine\"))\n log.debug(null, \"auto-detect using of LocalMachine store\")\n return {\n thumbprint: certInfo.Thumbprint,\n subject: certInfo.Subject,\n store,\n isLocalMachineStore\n }\n }\n\n throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`)\n}\n\nasync function doSign(configuration: CustomWindowsSignTaskConfiguration, packager: WinPackager) {\n // https://github.com/electron-userland/electron-builder/pull/1944\n const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT as any, 10) || 10 * 60 * 1000\n\n let tool: string\n let args: Array\n let env = process.env\n let vm: VmManager\n if (configuration.path.endsWith(\".appx\") || !(\"file\" in configuration.cscInfo!!) /* certificateSubjectName and other such options */) {\n vm = await packager.vm.value\n tool = getWinSignTool(await getSignVendorPath())\n args = computeSignToolArgs(configuration, true, vm)\n }\n else {\n vm = new VmManager()\n const toolInfo = await getToolPath()\n tool = toolInfo.path\n args = configuration.computeSignToolArgs(process.platform === \"win32\")\n if (toolInfo.env != null) {\n env = toolInfo.env\n }\n }\n\n try {\n await vm.exec(tool, args, {timeout, env})\n }\n catch (e) {\n if (e.message.includes(\"The file is being used by another process\") || e.message.includes(\"The specified timestamp server either could not be reached\")) {\n log.warn(`First attempt to code sign failed, another attempt will be made in 2 seconds: ${e.message}`)\n await new Promise((resolve, reject) => {\n setTimeout(() => {\n vm.exec(tool, args, {timeout, env})\n .then(resolve)\n .catch(reject)\n }, 2000)\n })\n }\n throw e\n }\n}\n\ninterface CertInfo {\n Subject: string\n Thumbprint: string\n PSParentPath: string\n}\n\n// on windows be aware of http://stackoverflow.com/a/32640183/1910191\nfunction computeSignToolArgs(options: WindowsSignTaskConfiguration, isWin: boolean, vm: VmManager = new VmManager()): Array {\n const inputFile = vm.toVmFile(options.path)\n const outputPath = isWin ? inputFile : getOutputPath(inputFile, options.hash)\n if (!isWin) {\n options.resultOutputPath = outputPath\n }\n\n const args = isWin ? [\"sign\"] : [\"-in\", inputFile, \"-out\", outputPath]\n\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n const timestampingServiceUrl = options.options.timeStampServer || \"http://timestamp.verisign.com/scripts/timstamp.dll\"\n if (isWin) {\n args.push(options.isNest || options.hash === \"sha256\" ? \"/tr\" : \"/t\", options.isNest || options.hash === \"sha256\" ? (options.options.rfc3161TimeStampServer || \"http://timestamp.comodoca.com/rfc3161\") : timestampingServiceUrl)\n }\n else {\n args.push(\"-t\", timestampingServiceUrl)\n }\n }\n\n const certificateFile = (options.cscInfo as FileCodeSigningInfo).file\n if (certificateFile == null) {\n const cscInfo = (options.cscInfo as CertificateFromStoreInfo)\n const subjectName = cscInfo.thumbprint\n if (!isWin) {\n throw new Error(`${subjectName == null ? \"certificateSha1\" : \"certificateSubjectName\"} supported only on Windows`)\n }\n\n args.push(\"/sha1\", cscInfo.thumbprint)\n args.push(\"/s\", cscInfo.store)\n if (cscInfo.isLocalMachineStore) {\n args.push(\"/sm\")\n }\n }\n else {\n const certExtension = path.extname(certificateFile)\n if (certExtension === \".p12\" || certExtension === \".pfx\") {\n args.push(isWin ? \"/f\" : \"-pkcs12\", vm.toVmFile(certificateFile))\n }\n else {\n throw new Error(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`)\n }\n }\n\n if (!isWin || options.hash !== \"sha1\") {\n args.push(isWin ? \"/fd\" : \"-h\", options.hash)\n if (isWin && process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n args.push(\"/td\", \"sha256\")\n }\n }\n\n if (options.name) {\n args.push(isWin ? \"/d\" : \"-n\", options.name)\n }\n\n if (options.site) {\n args.push(isWin ? \"/du\" : \"-i\", options.site)\n }\n\n // msi does not support dual-signing\n if (options.isNest) {\n args.push(isWin ? \"/as\" : \"-nest\")\n }\n\n const password = options.cscInfo == null ? null : (options.cscInfo as FileCodeSigningInfo).password\n if (password) {\n args.push(isWin ? \"/p\" : \"-pass\", password)\n }\n\n if (options.options.additionalCertificateFile) {\n args.push(isWin ? \"/ac\" : \"-ac\", vm.toVmFile(options.options.additionalCertificateFile))\n }\n\n const httpsProxyFromEnv = process.env.HTTPS_PROXY\n if (!isWin && httpsProxyFromEnv != null && httpsProxyFromEnv.length) {\n args.push(\"-p\", httpsProxyFromEnv)\n }\n\n if (isWin) {\n // https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610\n args.push(\"/debug\")\n // must be last argument\n args.push(inputFile)\n }\n\n return args\n}\n\nfunction getOutputPath(inputPath: string, hash: string) {\n const extension = path.extname(inputPath)\n return path.join(path.dirname(inputPath), `${path.basename(inputPath, extension)}-signed-${hash}${extension}`)\n}\n\n/** @internal */\nexport function isOldWin6() {\n const winVersion = os.release()\n return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n\nfunction getWinSignTool(vendorPath: string): string {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n if (isOldWin6()) {\n return path.join(vendorPath, \"windows-6\", \"signtool.exe\")\n }\n else {\n return path.join(vendorPath, \"windows-10\", process.arch, \"signtool.exe\")\n }\n}\n\nasync function getToolPath(): Promise {\n if (isUseSystemSigncode()) {\n return {path: \"osslsigncode\"}\n }\n\n const result = process.env.SIGNTOOL_PATH\n if (result) {\n return {path: result}\n }\n\n const vendorPath = await getSignVendorPath()\n if (process.platform === \"win32\") {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n return {path: getWinSignTool(vendorPath)}\n }\n else if (process.platform === \"darwin\") {\n const toolDirPath = path.join(vendorPath, process.platform, \"10.12\")\n return {\n path: path.join(toolDirPath, \"osslsigncode\"),\n env: computeToolEnv([path.join(toolDirPath, \"lib\")]),\n }\n }\n else {\n return {path: path.join(vendorPath, process.platform, \"osslsigncode\")}\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/configuration.d.ts b/node_modules/app-builder-lib/out/configuration.d.ts deleted file mode 100644 index 46e2a9a..0000000 --- a/node_modules/app-builder-lib/out/configuration.d.ts +++ /dev/null @@ -1,241 +0,0 @@ -import { Arch } from "builder-util"; -import { BeforeBuildContext, Target } from "./core"; -import { ElectronDownloadOptions } from "./electron/ElectronFramework"; -import { AppXOptions } from "./options/AppXOptions"; -import { AppImageOptions, DebOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from "./options/linuxOptions"; -import { DmgOptions, MacConfiguration, MasConfiguration } from "./options/macOptions"; -import { MsiOptions } from "./options/MsiOptions"; -import { PkgOptions } from "./options/pkgOptions"; -import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions"; -import { SnapOptions } from "./options/SnapOptions"; -import { SquirrelWindowsOptions } from "./options/SquirrelWindowsOptions"; -import { WindowsConfiguration } from "./options/winOptions"; -import { BuildResult } from "./packager"; -import { ArtifactBuildStarted, ArtifactCreated } from "./packagerApi"; -import { PlatformPackager } from "./platformPackager"; -import { NsisOptions, NsisWebOptions, PortableOptions } from "./targets/nsis/nsisOptions"; -/** - * Configuration Options - */ -export interface Configuration extends PlatformSpecificBuildOptions { - /** - * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as - * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set. - * @default com.electron.${name} - */ - readonly appId?: string | null; - /** - * As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name). - */ - readonly productName?: string | null; - /** - * The human-readable copyright line for the app. - * @default Copyright © year ${author} - */ - readonly copyright?: string | null; - readonly directories?: MetadataDirectories | null; - /** - * Options related to how build macOS targets. - */ - readonly mac?: MacConfiguration | null; - /** - * MAS (Mac Application Store) options. - */ - readonly mas?: MasConfiguration | null; - /** - * macOS DMG options. - */ - readonly dmg?: DmgOptions | null; - /** - * macOS PKG options. - */ - readonly pkg?: PkgOptions | null; - /** - * Options related to how build Windows targets. - */ - readonly win?: WindowsConfiguration | null; - readonly nsis?: NsisOptions | null; - readonly nsisWeb?: NsisWebOptions | null; - readonly portable?: PortableOptions | null; - readonly appx?: AppXOptions | null; - /** @private */ - readonly msi?: MsiOptions | null; - readonly squirrelWindows?: SquirrelWindowsOptions | null; - /** - * Options related to how build Linux targets. - */ - readonly linux?: LinuxConfiguration | null; - /** - * Debian package options. - */ - readonly deb?: DebOptions | null; - /** - * Snap options. - */ - readonly snap?: SnapOptions | null; - /** - * AppImage options. - */ - readonly appImage?: AppImageOptions | null; - readonly pacman?: LinuxTargetSpecificOptions | null; - readonly rpm?: LinuxTargetSpecificOptions | null; - readonly freebsd?: LinuxTargetSpecificOptions | null; - readonly p5p?: LinuxTargetSpecificOptions | null; - readonly apk?: LinuxTargetSpecificOptions | null; - /** - * Whether to build the application native dependencies from source. - * @default false - */ - buildDependenciesFromSource?: boolean; - /** - * Whether to execute `node-gyp rebuild` before starting to package the app. - * - * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead. - * @default false - */ - readonly nodeGypRebuild?: boolean; - /** - * Additional command line arguments to use when installing app native deps. - */ - readonly npmArgs?: Array | string | null; - /** - * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app. - * @default true - */ - readonly npmRebuild?: boolean; - /** - * @deprecated Please use npmBuildFromSource. - * @private - */ - readonly npmSkipBuildFromSource?: boolean; - /** - * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`. - * If `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_NUMBER` or `bamboo.buildNumber` env defined, it will be used as a build version (`version.build_number`). - */ - readonly buildVersion?: string | null; - /** - * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified. - */ - readonly electronCompile?: boolean; - /** - * The path to custom Electron build (e.g. `~/electron/out/R`). - */ - readonly electronDist?: string; - /** - * The [electron-download](https://github.com/electron-userland/electron-download#usage) options. - */ - readonly electronDownload?: ElectronDownloadOptions; - /** - * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency. - */ - electronVersion?: string | null; - /** - * The name of a built-in configuration preset or path to config file (relative to project dir). Currently, only `react-cra` is supported. - * - * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection. - */ - extends?: string | null; - /** - * Inject properties to `package.json`. - */ - readonly extraMetadata?: any; - /** - * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct). - * @default false - */ - readonly?: boolean; - /** - * The version of muon you are packaging for. - */ - readonly muonVersion?: string | null; - /** - * *libui-based frameworks only* The version of NodeJS you are packaging for. - * You can set it to `current` to set the Node.js version that you use to run. - */ - readonly nodeVersion?: string | null; - /** - * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version. - */ - readonly launchUiVersion?: boolean | string | null; - /** - * @private - * @deprecated Set framework and nodeVersion if need. - */ - readonly protonNodeVersion?: string | null; - /** - * The framework name. One of `electron`, `proton-native`, `libui`. Defaults to `electron`. - */ - readonly framework?: string | null; - /** - * The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign). - */ - readonly afterPack?: ((context: AfterPackContext) => Promise | any) | string | null; - /** - * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format). - */ - readonly afterSign?: ((context: AfterPackContext) => Promise | any) | string | null; - /** - * The function (or path to file or module id) to be run on artifact build start. - */ - readonly artifactBuildStarted?: ((context: ArtifactBuildStarted) => Promise | any) | string | null; - /** - * The function (or path to file or module id) to be run on artifact build completed. - */ - readonly artifactBuildCompleted?: ((context: ArtifactCreated) => Promise | any) | string | null; - /** - * The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild). - */ - readonly afterAllArtifactBuild?: ((context: BuildResult) => Promise> | Array) | string | null; - /** - * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. - */ - readonly onNodeModuleFile?: ((file: string) => void) | string | null; - /** - * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild. - * - * If provided and `node_modules` are missing, it will not invoke production dependencies check. - */ - readonly beforeBuild?: ((context: BeforeBuildContext) => Promise) | string | null; - /** - * Whether to build using Electron Build Service if target not supported on current OS. - * @default true - */ - readonly remoteBuild?: boolean; - /** - * Whether to include PDB files. - * @default false - */ - readonly includePdb?: boolean; - /** - * Whether to remove `scripts` field from `package.json` files. - * - * @default true - */ - readonly removePackageScripts?: boolean; -} -export interface AfterPackContext { - readonly outDir: string; - readonly appOutDir: string; - readonly packager: PlatformPackager; - readonly electronPlatformName: string; - readonly arch: Arch; - readonly targets: Array; -} -export interface MetadataDirectories { - /** - * The path to build resources. - * - * Please note — build resources is not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `"files": ["**\/*", "build/icon.*"]` - * @default build - */ - readonly buildResources?: string | null; - /** - * The output directory. [File macros](/file-patterns#file-macros) are supported. - * @default dist - */ - readonly output?: string | null; - /** - * The application directory (containing the application package.json), defaults to `app`, `www` or working directory. - */ - readonly app?: string | null; -} diff --git a/node_modules/app-builder-lib/out/configuration.js b/node_modules/app-builder-lib/out/configuration.js deleted file mode 100644 index 33c52fa..0000000 --- a/node_modules/app-builder-lib/out/configuration.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=configuration.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/configuration.js.map b/node_modules/app-builder-lib/out/configuration.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/configuration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/core.d.ts b/node_modules/app-builder-lib/out/core.d.ts deleted file mode 100644 index e6fd119..0000000 --- a/node_modules/app-builder-lib/out/core.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/// -import { Arch, ArchType } from "builder-util"; -import { Publish } from "builder-util-runtime"; -export declare type TargetConfigType = Array | string | TargetConfiguration | null; -export interface TargetConfiguration { - /** - * The target name. e.g. `snap`. - */ - readonly target: string; - /** - * The arch or list of archs. - */ - readonly arch?: Array | ArchType; -} -export declare class Platform { - name: string; - buildConfigurationKey: string; - nodeName: NodeJS.Platform; - static MAC: Platform; - static LINUX: Platform; - static WINDOWS: Platform; - constructor(name: string, buildConfigurationKey: string, nodeName: NodeJS.Platform); - toString(): string; - createTarget(type?: string | Array | null, ...archs: Array): Map>>; - static current(): Platform; - static fromString(name: string): Platform; -} -export declare abstract class Target { - readonly name: string; - readonly isAsyncSupported: boolean; - abstract readonly outDir: string; - abstract readonly options: TargetSpecificOptions | null | undefined; - protected constructor(name: string, isAsyncSupported?: boolean); - checkOptions(): Promise; - abstract build(appOutDir: string, arch: Arch): Promise; - finishBuild(): Promise; -} -export interface TargetSpecificOptions { - /** - The [artifact file name template](/configuration/configuration#artifact-file-name-template). - */ - readonly artifactName?: string | null; - publish?: Publish; -} -export declare const DEFAULT_TARGET = "default"; -export declare const DIR_TARGET = "dir"; -export declare type CompressionLevel = "store" | "normal" | "maximum"; -export interface BeforeBuildContext { - readonly appDir: string; - readonly electronVersion: string; - readonly platform: Platform; - readonly arch: string; -} -export interface SourceRepositoryInfo { - type?: string; - domain?: string; - user: string; - project: string; -} diff --git a/node_modules/app-builder-lib/out/core.js b/node_modules/app-builder-lib/out/core.js deleted file mode 100644 index 2d6fc12..0000000 --- a/node_modules/app-builder-lib/out/core.js +++ /dev/null @@ -1,111 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.DIR_TARGET = exports.DEFAULT_TARGET = exports.Target = exports.Platform = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -class Platform { - constructor(name, buildConfigurationKey, nodeName) { - this.name = name; - this.buildConfigurationKey = buildConfigurationKey; - this.nodeName = nodeName; - } - - toString() { - return this.name; - } - - createTarget(type, ...archs) { - if (type == null && (archs == null || archs.length === 0)) { - return new Map([[this, new Map()]]); - } - - const archToType = new Map(); - - if (this === Platform.MAC) { - archs = [_builderUtil().Arch.x64]; - } - - for (const arch of archs == null || archs.length === 0 ? [(0, _builderUtil().archFromString)(process.arch)] : archs) { - archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type]); - } - - return new Map([[this, archToType]]); - } - - static current() { - return Platform.fromString(process.platform); - } - - static fromString(name) { - name = name.toLowerCase(); - - switch (name) { - case Platform.MAC.nodeName: - case Platform.MAC.name: - return Platform.MAC; - - case Platform.WINDOWS.nodeName: - case Platform.WINDOWS.name: - case Platform.WINDOWS.buildConfigurationKey: - return Platform.WINDOWS; - - case Platform.LINUX.nodeName: - return Platform.LINUX; - - default: - throw new Error(`Unknown platform: ${name}`); - } - } - -} - -exports.Platform = Platform; -Platform.MAC = new Platform("mac", "mac", "darwin"); -Platform.LINUX = new Platform("linux", "linux", "linux"); -Platform.WINDOWS = new Platform("windows", "win", "win32"); - -class Target { - constructor(name, isAsyncSupported = true) { - this.name = name; - this.isAsyncSupported = isAsyncSupported; - } - - checkOptions() {// ignore - - return (0, _bluebirdLst().coroutine)(function* () {})(); - } - - finishBuild() { - return Promise.resolve(); - } - -} - -exports.Target = Target; -const DEFAULT_TARGET = "default"; -exports.DEFAULT_TARGET = DEFAULT_TARGET; -const DIR_TARGET = "dir"; exports.DIR_TARGET = DIR_TARGET; -// __ts-babel@6.0.4 -//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/core.js.map b/node_modules/app-builder-lib/out/core.js.map deleted file mode 100644 index f6374b0..0000000 --- a/node_modules/app-builder-lib/out/core.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAiBM,MAAO,QAAP,CAAe;AAKnB,EAAA,WAAA,CAAmB,IAAnB,EAAwC,qBAAxC,EAA8E,QAA9E,EAAuG;AAApF,SAAA,IAAA,GA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CAAa,IAAlB;AACE,eAAO,QAAQ,CAAC,GAAhB;;AAEF,WAAK,QAAQ,CAAC,OAAT,CAAiB,QAAtB;AACA,WAAK,QAAQ,CAAC,OAAT,CAAiB,IAAtB;AACA,WAAK,QAAQ,CAAC,OAAT,CAAiB,qBAAtB;AACE,eAAO,QAAQ,CAAC,OAAhB;;AAEF,WAAK,QAAQ,CAAC,KAAT,CAAe,QAApB;AACE,eAAO,QAAQ,CAAC,KAAhB;;AAEF;AACE,cAAM,IAAI,KAAJ,CAAU,qBAAqB,IAAI,EAAnC,CAAN;AAdJ;AAgBD;;AAlDkB;;;AACZ,QAAA,CAAA,GAAA,GAAM,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB,EAA2B,QAA3B,CAAN;AACA,QAAA,CAAA,KAAA,GAAQ,IAAI,QAAJ,CAAa,OAAb,EAAsB,OAAtB,EAA+B,OAA/B,CAAR;AACA,QAAA,CAAA,OAAA,GAAU,IAAI,QAAJ,CAAa,SAAb,EAAwB,KAAxB,EAA+B,OAA/B,CAAV;;AAkDH,MAAgB,MAAhB,CAAsB;AAI1B,EAAA,WAAA,CAA+B,IAA/B,EAAsD,gBAAA,GAA4B,IAAlF,EAAsF;AAAvD,SAAA,IAAA,GAAA,IAAA;AAAuB,SAAA,gBAAA,GAAA,gBAAA;AACrD;;AAEK,EAAA,YAAN,GAAkB,CAChB;;AADgB;AAEjB;;AAID,EAAA,WAAW,GAAA;AACT,WAAO,OAAO,CAAC,OAAR,EAAP;AACD;;AAfyB;;;AA2BrB,MAAM,cAAc,GAAG,SAAvB;;AACA,MAAM,UAAU,GAAG,KAAnB,C","sourcesContent":["import { Arch, archFromString, ArchType } from \"builder-util\"\nimport { Publish } from \"builder-util-runtime\"\n\nexport type TargetConfigType = Array | string | TargetConfiguration | null\n\nexport interface TargetConfiguration {\n /**\n * The target name. e.g. `snap`.\n */\n readonly target: string\n\n /**\n * The arch or list of archs.\n */\n readonly arch?: Array | ArchType\n}\n\nexport class Platform {\n static MAC = new Platform(\"mac\", \"mac\", \"darwin\")\n static LINUX = new Platform(\"linux\", \"linux\", \"linux\")\n static WINDOWS = new Platform(\"windows\", \"win\", \"win32\")\n\n constructor(public name: string, public buildConfigurationKey: string, public nodeName: NodeJS.Platform) {\n }\n\n toString() {\n return this.name\n }\n\n createTarget(type?: string | Array | null, ...archs: Array): Map>> {\n if (type == null && (archs == null || archs.length === 0)) {\n return new Map([[this, new Map()]])\n }\n\n const archToType = new Map()\n if (this === Platform.MAC) {\n archs = [Arch.x64]\n }\n\n for (const arch of (archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs)) {\n archToType.set(arch, type == null ? [] : (Array.isArray(type) ? type : [type]))\n }\n return new Map([[this, archToType]])\n }\n\n static current(): Platform {\n return Platform.fromString(process.platform)\n }\n\n static fromString(name: string): Platform {\n name = name.toLowerCase()\n switch (name) {\n case Platform.MAC.nodeName:\n case Platform.MAC.name:\n return Platform.MAC\n\n case Platform.WINDOWS.nodeName:\n case Platform.WINDOWS.name:\n case Platform.WINDOWS.buildConfigurationKey:\n return Platform.WINDOWS\n\n case Platform.LINUX.nodeName:\n return Platform.LINUX\n\n default:\n throw new Error(`Unknown platform: ${name}`)\n }\n }\n}\n\nexport abstract class Target {\n abstract readonly outDir: string\n abstract readonly options: TargetSpecificOptions | null | undefined\n\n protected constructor(readonly name: string, readonly isAsyncSupported: boolean = true) {\n }\n\n async checkOptions(): Promise {\n // ignore\n }\n\n abstract build(appOutDir: string, arch: Arch): Promise\n\n finishBuild(): Promise {\n return Promise.resolve()\n }\n}\n\nexport interface TargetSpecificOptions {\n /**\n The [artifact file name template](/configuration/configuration#artifact-file-name-template).\n */\n readonly artifactName?: string | null\n\n publish?: Publish\n}\n\nexport const DEFAULT_TARGET = \"default\"\nexport const DIR_TARGET = \"dir\"\n\nexport type CompressionLevel = \"store\" | \"normal\" | \"maximum\"\n\nexport interface BeforeBuildContext {\n readonly appDir: string\n readonly electronVersion: string\n readonly platform: Platform\n readonly arch: string\n}\n\nexport interface SourceRepositoryInfo {\n type?: string\n domain?: string\n user: string\n project: string\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/electron/ElectronFramework.d.ts b/node_modules/app-builder-lib/out/electron/ElectronFramework.d.ts deleted file mode 100644 index 83b447d..0000000 --- a/node_modules/app-builder-lib/out/electron/ElectronFramework.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Configuration } from "../configuration"; -import { Framework } from "../Framework"; -import { ElectronPlatformName, Packager } from "../index"; -export declare type ElectronPlatformName = "darwin" | "linux" | "win32" | "mas"; -export interface ElectronDownloadOptions { - version?: string; - /** - * The [cache location](https://github.com/electron-userland/electron-download#cache-location). - */ - cache?: string | null; - /** - * The mirror. - */ - mirror?: string | null; - /** @private */ - customDir?: string | null; - /** @private */ - customFilename?: string | null; - strictSSL?: boolean; - isVerifyChecksum?: boolean; - platform?: ElectronPlatformName; - arch?: string; -} -export declare function createElectronFrameworkSupport(configuration: Configuration, packager: Packager): Promise; diff --git a/node_modules/app-builder-lib/out/electron/ElectronFramework.js b/node_modules/app-builder-lib/out/electron/ElectronFramework.js deleted file mode 100644 index a7aa174..0000000 --- a/node_modules/app-builder-lib/out/electron/ElectronFramework.js +++ /dev/null @@ -1,310 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createElectronFrameworkSupport = createElectronFrameworkSupport; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function semver() { - const data = _interopRequireWildcard(require("semver")); - - semver = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("../index"); - - _index = function () { - return data; - }; - - return data; -} - -function _pathManager() { - const data = require("../util/pathManager"); - - _pathManager = function () { - return data; - }; - - return data; -} - -function _electronMac() { - const data = require("./electronMac"); - - _electronMac = function () { - return data; - }; - - return data; -} - -function _electronVersion() { - const data = require("./electronVersion"); - - _electronVersion = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function createDownloadOpts(opts, platform, arch, electronVersion) { - return Object.assign({ - platform, - arch, - version: electronVersion - }, opts.electronDownload); -} - -function beforeCopyExtraFiles(_x, _x2) { - return _beforeCopyExtraFiles.apply(this, arguments); -} - -function _beforeCopyExtraFiles() { - _beforeCopyExtraFiles = (0, _bluebirdLst().coroutine)(function* (options, isClearExecStack) { - const packager = options.packager; - const appOutDir = options.appOutDir; - - if (packager.platform === _index().Platform.LINUX) { - const linuxPackager = packager; - const executable = path.join(appOutDir, linuxPackager.executableName); - yield (0, _fsExtraP().rename)(path.join(appOutDir, packager.electronDistExecutableName), executable); - - if (isClearExecStack) { - try { - yield (0, _builderUtil().executeAppBuilder)(["clear-exec-stack", "--input", executable]); - } catch (e) { - _builderUtil().log.debug({ - error: e - }, "cannot clear exec stack"); - } - } - } else if (packager.platform === _index().Platform.WINDOWS) { - const executable = path.join(appOutDir, `${packager.appInfo.productFilename}.exe`); - yield (0, _fsExtraP().rename)(path.join(appOutDir, `${packager.electronDistExecutableName}.exe`), executable); - } else { - yield (0, _electronMac().createMacApp)(packager, appOutDir, options.asarIntegrity, options.platformName === "mas"); - const wantedLanguages = (0, _builderUtil().asArray)(packager.platformSpecificBuildOptions.electronLanguages); - - if (wantedLanguages.length === 0) { - return; - } // noinspection SpellCheckingInspection - - - const langFileExt = ".lproj"; - const resourcesDir = packager.getResourcesDir(appOutDir); - yield _bluebirdLst().default.map((0, _fsExtraP().readdir)(resourcesDir), file => { - if (!file.endsWith(langFileExt)) { - return; - } - - const language = file.substring(0, file.length - langFileExt.length); - - if (!wantedLanguages.includes(language)) { - return (0, _fsExtraP().remove)(path.join(resourcesDir, file)); - } - - return; - }, _fs().CONCURRENCY); - } - }); - return _beforeCopyExtraFiles.apply(this, arguments); -} - -class ElectronFramework { - constructor(name, version, distMacOsAppName) { - this.name = name; - this.version = version; - this.distMacOsAppName = distMacOsAppName; // noinspection JSUnusedGlobalSymbols - - this.macOsDefaultTargets = ["zip", "dmg"]; // noinspection JSUnusedGlobalSymbols - - this.defaultAppIdPrefix = "com.electron."; // noinspection JSUnusedGlobalSymbols - - this.isCopyElevateHelper = true; // noinspection JSUnusedGlobalSymbols - - this.isNpmRebuildRequired = true; - } - - getDefaultIcon(platform) { - if (platform === _index().Platform.LINUX) { - return path.join((0, _pathManager().getTemplatePath)("icons"), "electron-linux"); - } else { - // default icon is embedded into app skeleton - return null; - } - } - - prepareApplicationStageDirectory(options) { - return unpack(options, createDownloadOpts(options.packager.config, options.platformName, options.arch, this.version), this.distMacOsAppName); - } - - beforeCopyExtraFiles(options) { - return beforeCopyExtraFiles(options, this.name === "electron" && semver().lte(this.version || "1.8.3", "1.8.3")); - } - -} - -class MuonFramework extends ElectronFramework { - constructor(version) { - super("muon", version, "Brave.app"); - } - - prepareApplicationStageDirectory(options) { - return unpack(options, Object.assign({ - mirror: "https://github.com/brave/muon/releases/download/v", - customFilename: `brave-v${options.version}-${options.platformName}-${options.arch}.zip`, - isVerifyChecksum: false - }, createDownloadOpts(options.packager.config, options.platformName, options.arch, options.version)), this.distMacOsAppName); - } - -} - -function createElectronFrameworkSupport(_x3, _x4) { - return _createElectronFrameworkSupport.apply(this, arguments); -} - -function _createElectronFrameworkSupport() { - _createElectronFrameworkSupport = (0, _bluebirdLst().coroutine)(function* (configuration, packager) { - if (configuration.muonVersion != null) { - return new MuonFramework(configuration.muonVersion); - } - - let version = configuration.electronVersion; - - if (version == null) { - // for prepacked app asar no dev deps in the app.asar - if (packager.isPrepackedAppAsar) { - version = yield (0, _electronVersion().getElectronVersionFromInstalled)(packager.projectDir); - - if (version == null) { - throw new Error(`Cannot compute electron version for prepacked asar`); - } - } else { - version = yield (0, _electronVersion().computeElectronVersion)(packager.projectDir, new (_lazyVal().Lazy)(() => Promise.resolve(packager.metadata))); - } - - configuration.electronVersion = version; - } - - return new ElectronFramework("electron", version, "Electron.app"); - }); - return _createElectronFrameworkSupport.apply(this, arguments); -} - -function unpack(_x5, _x6, _x7) { - return _unpack.apply(this, arguments); -} - -function _unpack() { - _unpack = (0, _bluebirdLst().coroutine)(function* (prepareOptions, options, distMacOsAppName) { - const packager = prepareOptions.packager; - const out = prepareOptions.appOutDir; - let dist = packager.config.electronDist; - - if (dist != null) { - const zipFile = `electron-v${options.version}-${prepareOptions.platformName}-${options.arch}.zip`; - const resolvedDist = path.resolve(packager.projectDir, dist); - - if ((yield (0, _fs().statOrNull)(path.join(resolvedDist, zipFile))) != null) { - options.cache = resolvedDist; - dist = null; - } - } - - let isFullCleanup = false; - - if (dist == null) { - yield (0, _builderUtil().executeAppBuilder)(["unpack-electron", "--configuration", JSON.stringify([options]), "--output", out, "--distMacOsAppName", distMacOsAppName]); - } else { - isFullCleanup = true; - const source = packager.getElectronSrcDir(dist); - const destination = packager.getElectronDestinationDir(out); - - _builderUtil().log.info({ - source, - destination - }, "copying Electron"); - - yield (0, _fsExtraP().emptyDir)(out); - yield (0, _fs().copyDir)(source, destination, { - isUseHardLink: _fs().DO_NOT_USE_HARD_LINKS - }); - } - - yield cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup); - }); - return _unpack.apply(this, arguments); -} - -function cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup) { - const out = prepareOptions.appOutDir; - - const isMac = prepareOptions.packager.platform === _index().Platform.MAC; - - const resourcesPath = isMac ? path.join(out, distMacOsAppName, "Contents", "Resources") : path.join(out, "resources"); - return Promise.all([isFullCleanup ? (0, _fs().unlinkIfExists)(path.join(resourcesPath, "default_app.asar")) : Promise.resolve(), isFullCleanup ? (0, _fs().unlinkIfExists)(path.join(out, "version")) : Promise.resolve(), isMac ? Promise.resolve() : (0, _fsExtraP().rename)(path.join(out, "LICENSE"), path.join(out, "LICENSE.electron.txt")).catch(() => {})]); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=ElectronFramework.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/electron/ElectronFramework.js.map b/node_modules/app-builder-lib/out/electron/ElectronFramework.js.map deleted file mode 100644 index 2353eb1..0000000 --- a/node_modules/app-builder-lib/out/electron/ElectronFramework.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/electron/ElectronFramework.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AA+BA,SAAS,kBAAT,CAA4B,IAA5B,EAAiD,QAAjD,EAAiF,IAAjF,EAA+F,eAA/F,EAAsH;AACpH,SAAA,MAAA,CAAA,MAAA,CAAA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AO,CAAC,OAAR,EAD9D,EAEjB,aAAa,GAAG,0BAAe,IAAI,CAAC,IAAL,CAAU,GAAV,EAAe,SAAf,CAAf,CAAH,GAA+C,OAAO,CAAC,OAAR,EAF3C,EAGjB,KAAK,GAAG,OAAO,CAAC,OAAR,EAAH,GAAuB,wBAAO,IAAI,CAAC,IAAL,CAAU,GAAV,EAAe,SAAf,CAAP,EAAkC,IAAI,CAAC,IAAL,CAAU,GAAV,EAAe,sBAAf,CAAlC,EAA0E,KAA1E,CAAgF,MAAK,CAAe,CAApG,CAHX,CAAZ,CAAP;AAKD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { asArray, executeAppBuilder, log } from \"builder-util\"\nimport { CONCURRENCY, copyDir, DO_NOT_USE_HARD_LINKS, statOrNull, unlinkIfExists } from \"builder-util/out/fs\"\nimport { emptyDir, readdir, remove, rename } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Configuration } from \"../configuration\"\nimport { BeforeCopyExtraFilesOptions, Framework, PrepareApplicationStageDirectoryOptions } from \"../Framework\"\nimport { ElectronPlatformName, Packager, Platform } from \"../index\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport MacPackager from \"../macPackager\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { createMacApp } from \"./electronMac\"\nimport { computeElectronVersion, getElectronVersionFromInstalled } from \"./electronVersion\"\n\nexport type ElectronPlatformName = \"darwin\" | \"linux\" | \"win32\" | \"mas\"\n\nexport interface ElectronDownloadOptions {\n // https://github.com/electron-userland/electron-builder/issues/3077\n // must be optional\n version?: string\n\n /**\n * The [cache location](https://github.com/electron-userland/electron-download#cache-location).\n */\n cache?: string | null\n\n /**\n * The mirror.\n */\n mirror?: string | null\n\n /** @private */\n customDir?: string | null\n /** @private */\n customFilename?: string | null\n\n strictSSL?: boolean\n isVerifyChecksum?: boolean\n\n platform?: ElectronPlatformName\n arch?: string\n}\n\nfunction createDownloadOpts(opts: Configuration, platform: ElectronPlatformName, arch: string, electronVersion: string): ElectronDownloadOptions {\n return {\n platform,\n arch,\n version: electronVersion,\n ...opts.electronDownload,\n }\n}\n\nasync function beforeCopyExtraFiles(options: BeforeCopyExtraFilesOptions, isClearExecStack: boolean) {\n const packager = options.packager\n const appOutDir = options.appOutDir\n if (packager.platform === Platform.LINUX) {\n const linuxPackager = (packager as LinuxPackager)\n const executable = path.join(appOutDir, linuxPackager.executableName)\n await rename(path.join(appOutDir, packager.electronDistExecutableName), executable)\n\n if (isClearExecStack) {\n try {\n await executeAppBuilder([\"clear-exec-stack\", \"--input\", executable])\n }\n catch (e) {\n log.debug({error: e}, \"cannot clear exec stack\")\n }\n }\n }\n else if (packager.platform === Platform.WINDOWS) {\n const executable = path.join(appOutDir, `${packager.appInfo.productFilename}.exe`)\n await rename(path.join(appOutDir, `${packager.electronDistExecutableName}.exe`), executable)\n }\n else {\n await createMacApp(packager as MacPackager, appOutDir, options.asarIntegrity, (options.platformName as ElectronPlatformName) === \"mas\")\n\n const wantedLanguages = asArray(packager.platformSpecificBuildOptions.electronLanguages)\n if (wantedLanguages.length === 0) {\n return\n }\n\n // noinspection SpellCheckingInspection\n const langFileExt = \".lproj\"\n const resourcesDir = packager.getResourcesDir(appOutDir)\n await BluebirdPromise.map(readdir(resourcesDir), file => {\n if (!file.endsWith(langFileExt)) {\n return\n }\n\n const language = file.substring(0, file.length - langFileExt.length)\n if (!wantedLanguages.includes(language)) {\n return remove(path.join(resourcesDir, file))\n }\n return\n }, CONCURRENCY)\n }\n}\n\nclass ElectronFramework implements Framework {\n // noinspection JSUnusedGlobalSymbols\n readonly macOsDefaultTargets = [\"zip\", \"dmg\"]\n // noinspection JSUnusedGlobalSymbols\n readonly defaultAppIdPrefix = \"com.electron.\"\n // noinspection JSUnusedGlobalSymbols\n readonly isCopyElevateHelper = true\n // noinspection JSUnusedGlobalSymbols\n readonly isNpmRebuildRequired = true\n\n constructor(readonly name: string, readonly version: string, readonly distMacOsAppName: string) {\n }\n\n getDefaultIcon(platform: Platform) {\n if (platform === Platform.LINUX) {\n return path.join(getTemplatePath(\"icons\"), \"electron-linux\")\n }\n else {\n // default icon is embedded into app skeleton\n return null\n }\n }\n\n prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n return unpack(options, createDownloadOpts(options.packager.config, options.platformName, options.arch, this.version), this.distMacOsAppName)\n }\n\n beforeCopyExtraFiles(options: BeforeCopyExtraFilesOptions) {\n return beforeCopyExtraFiles(options, this.name === \"electron\" && semver.lte(this.version || \"1.8.3\", \"1.8.3\"))\n }\n}\n\nclass MuonFramework extends ElectronFramework {\n constructor(version: string) {\n super(\"muon\", version, \"Brave.app\")\n }\n\n prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n return unpack(options, {\n mirror: \"https://github.com/brave/muon/releases/download/v\",\n customFilename: `brave-v${options.version}-${options.platformName}-${options.arch}.zip`,\n isVerifyChecksum: false,\n ...createDownloadOpts(options.packager.config, options.platformName, options.arch, options.version),\n }, this.distMacOsAppName)\n }\n}\n\nexport async function createElectronFrameworkSupport(configuration: Configuration, packager: Packager): Promise {\n if (configuration.muonVersion != null) {\n return new MuonFramework(configuration.muonVersion!!)\n }\n\n let version = configuration.electronVersion\n if (version == null) {\n // for prepacked app asar no dev deps in the app.asar\n if (packager.isPrepackedAppAsar) {\n version = await getElectronVersionFromInstalled(packager.projectDir)\n if (version == null) {\n throw new Error(`Cannot compute electron version for prepacked asar`)\n }\n }\n else {\n version = await computeElectronVersion(packager.projectDir, new Lazy(() => Promise.resolve(packager.metadata)))\n }\n configuration.electronVersion = version\n }\n\n return new ElectronFramework(\"electron\", version, \"Electron.app\")\n}\n\nasync function unpack(prepareOptions: PrepareApplicationStageDirectoryOptions, options: ElectronDownloadOptions, distMacOsAppName: string) {\n const packager = prepareOptions.packager\n const out = prepareOptions.appOutDir\n\n let dist: string | null | undefined = packager.config.electronDist\n if (dist != null) {\n const zipFile = `electron-v${options.version}-${prepareOptions.platformName}-${options.arch}.zip`\n const resolvedDist = path.resolve(packager.projectDir, dist)\n if ((await statOrNull(path.join(resolvedDist, zipFile))) != null) {\n options.cache = resolvedDist\n dist = null\n }\n }\n\n let isFullCleanup = false\n if (dist == null) {\n await executeAppBuilder([\"unpack-electron\", \"--configuration\", JSON.stringify([options]), \"--output\", out, \"--distMacOsAppName\", distMacOsAppName])\n }\n else {\n isFullCleanup = true\n const source = packager.getElectronSrcDir(dist)\n const destination = packager.getElectronDestinationDir(out)\n log.info({source, destination}, \"copying Electron\")\n await emptyDir(out)\n await copyDir(source, destination, {\n isUseHardLink: DO_NOT_USE_HARD_LINKS,\n })\n }\n\n await cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup)\n}\n\nfunction cleanupAfterUnpack(prepareOptions: PrepareApplicationStageDirectoryOptions, distMacOsAppName: string, isFullCleanup: boolean) {\n const out = prepareOptions.appOutDir\n const isMac = prepareOptions.packager.platform === Platform.MAC\n const resourcesPath = isMac ? path.join(out, distMacOsAppName, \"Contents\", \"Resources\") : path.join(out, \"resources\")\n\n return Promise.all([\n isFullCleanup ? unlinkIfExists(path.join(resourcesPath, \"default_app.asar\")) : Promise.resolve(),\n isFullCleanup ? unlinkIfExists(path.join(out, \"version\")) : Promise.resolve(),\n isMac ? Promise.resolve() : rename(path.join(out, \"LICENSE\"), path.join(out, \"LICENSE.electron.txt\")).catch(() => {/* ignore */}),\n ])\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/electron/electronMac.d.ts b/node_modules/app-builder-lib/out/electron/electronMac.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/electron/electronMac.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/electron/electronMac.js b/node_modules/app-builder-lib/out/electron/electronMac.js deleted file mode 100644 index e280064..0000000 --- a/node_modules/app-builder-lib/out/electron/electronMac.js +++ /dev/null @@ -1,297 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createMacApp = createMacApp; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _plist() { - const data = require("plist"); - - _plist = function () { - return data; - }; - - return data; -} - -function _appInfo() { - const data = require("../appInfo"); - - _appInfo = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("../platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function doRename(basePath, oldName, newName) { - return (0, _fsExtraP().rename)(path.join(basePath, oldName), path.join(basePath, newName)); -} - -function moveHelpers(helperSuffixes, frameworksPath, appName, prefix) { - return _bluebirdLst().default.map(helperSuffixes, suffix => { - const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, "Contents", "MacOS"); - return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`)); - }); -} - -function getAvailableHelperSuffixes(helperEHPlist, helperNPPlist) { - const result = [" Helper"]; - - if (helperEHPlist != null) { - result.push(" Helper EH"); - } - - if (helperNPPlist != null) { - result.push(" Helper NP"); - } - - return result; -} -/** @internal */ - - -function createMacApp(_x, _x2, _x3, _x4) { - return _createMacApp.apply(this, arguments); -} - -function _createMacApp() { - _createMacApp = (0, _bluebirdLst().coroutine)(function* (packager, appOutDir, asarIntegrity, isMas) { - const appInfo = packager.appInfo; - const appFilename = appInfo.productFilename; - const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, "Contents"); - const frameworksPath = path.join(contentsPath, "Frameworks"); - const loginItemPath = path.join(contentsPath, "Library", "LoginItems"); - const appPlistFilename = path.join(contentsPath, "Info.plist"); - const helperPlistFilename = path.join(frameworksPath, `${packager.electronDistMacOsExecutableName} Helper.app`, "Contents", "Info.plist"); - const helperEHPlistFilename = path.join(frameworksPath, `${packager.electronDistMacOsExecutableName} Helper EH.app`, "Contents", "Info.plist"); - const helperNPPlistFilename = path.join(frameworksPath, `${packager.electronDistMacOsExecutableName} Helper NP.app`, "Contents", "Info.plist"); - const helperLoginPlistFilename = path.join(loginItemPath, `${packager.electronDistMacOsExecutableName} Login Helper.app`, "Contents", "Info.plist"); - const buildMetadata = packager.config; - const fileContents = yield _bluebirdLst().default.map([appPlistFilename, helperPlistFilename, helperEHPlistFilename, helperNPPlistFilename, helperLoginPlistFilename, buildMetadata["extend-info"]], it => it == null ? it : (0, _promise().orIfFileNotExist)((0, _fsExtraP().readFile)(it, "utf8"), null)); - const appPlist = (0, _plist().parse)(fileContents[0]); - const helperPlist = (0, _plist().parse)(fileContents[1]); - const helperEHPlist = fileContents[2] == null ? null : (0, _plist().parse)(fileContents[2]); - const helperNPPlist = fileContents[3] == null ? null : (0, _plist().parse)(fileContents[3]); - const helperLoginPlist = fileContents[4] == null ? null : (0, _plist().parse)(fileContents[4]); // if an extend-info file was supplied, copy its contents in first - - if (fileContents[5] != null) { - Object.assign(appPlist, (0, _plist().parse)(fileContents[5])); - } - - const oldHelperBundleId = buildMetadata["helper-bundle-id"]; - - if (oldHelperBundleId != null) { - _builderUtil().log.warn("build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId"); - } - - const helperBundleIdentifier = (0, _appInfo().filterCFBundleIdentifier)(packager.platformSpecificBuildOptions.helperBundleId || oldHelperBundleId || `${appInfo.macBundleIdentifier}.helper`); - yield packager.applyCommonInfo(appPlist, contentsPath); // required for electron-updater proxy - - if (!isMas) { - configureLocalhostAts(appPlist); - } - - helperPlist.CFBundleExecutable = `${appFilename} Helper`; - helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`; - helperPlist.CFBundleIdentifier = helperBundleIdentifier; - helperPlist.CFBundleVersion = appPlist.CFBundleVersion; - - function configureHelper(helper, postfix) { - helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`; - helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`; - helper.CFBundleIdentifier = `${helperBundleIdentifier}.${postfix}`; - helper.CFBundleVersion = appPlist.CFBundleVersion; - } - - if (helperEHPlist != null) { - configureHelper(helperEHPlist, "EH"); - } - - if (helperNPPlist != null) { - configureHelper(helperNPPlist, "NP"); - } - - if (helperLoginPlist != null) { - helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`; - helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`; // noinspection SpellCheckingInspection - - helperLoginPlist.CFBundleIdentifier = `${appInfo.macBundleIdentifier}.loginhelper`; - helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion; - } - - const protocols = (0, _builderUtil().asArray)(buildMetadata.protocols).concat((0, _builderUtil().asArray)(packager.platformSpecificBuildOptions.protocols)); - - if (protocols.length > 0) { - appPlist.CFBundleURLTypes = protocols.map(protocol => { - const schemes = (0, _builderUtil().asArray)(protocol.schemes); - - if (schemes.length === 0) { - throw new (_builderUtil().InvalidConfigurationError)(`Protocol "${protocol.name}": must be at least one scheme specified`); - } - - return { - CFBundleURLName: protocol.name, - CFBundleTypeRole: protocol.role || "Editor", - CFBundleURLSchemes: schemes.slice() - }; - }); - } - - const fileAssociations = packager.fileAssociations; - - if (fileAssociations.length > 0) { - appPlist.CFBundleDocumentTypes = yield _bluebirdLst().default.map(fileAssociations, - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (fileAssociation) { - const extensions = (0, _builderUtil().asArray)(fileAssociation.ext).map(_platformPackager().normalizeExt); - const customIcon = yield packager.getResource((0, _builderUtil().getPlatformIconFileName)(fileAssociation.icon, true), `${extensions[0]}.icns`); - let iconFile = appPlist.CFBundleIconFile; - - if (customIcon != null) { - iconFile = path.basename(customIcon); - yield (0, _fs().copyOrLinkFile)(customIcon, path.join(path.join(contentsPath, "Resources"), iconFile)); - } - - const result = { - CFBundleTypeExtensions: extensions, - CFBundleTypeName: fileAssociation.name || extensions[0], - CFBundleTypeRole: fileAssociation.role || "Editor", - CFBundleTypeIconFile: iconFile - }; - - if (fileAssociation.isPackage) { - result.LSTypeIsPackage = true; - } - - return result; - }); - - return function (_x5) { - return _ref.apply(this, arguments); - }; - }()); - } - - if (asarIntegrity != null) { - appPlist.AsarIntegrity = JSON.stringify(asarIntegrity); - } - - yield Promise.all([(0, _fsExtraP().writeFile)(appPlistFilename, (0, _plist().build)(appPlist)), (0, _fsExtraP().writeFile)(helperPlistFilename, (0, _plist().build)(helperPlist)), helperEHPlist == null ? Promise.resolve() : (0, _fsExtraP().writeFile)(helperEHPlistFilename, (0, _plist().build)(helperEHPlist)), helperNPPlist == null ? Promise.resolve() : (0, _fsExtraP().writeFile)(helperNPPlistFilename, (0, _plist().build)(helperNPPlist)), helperLoginPlist == null ? Promise.resolve() : (0, _fsExtraP().writeFile)(helperLoginPlistFilename, (0, _plist().build)(helperLoginPlist)), doRename(path.join(contentsPath, "MacOS"), packager.electronDistMacOsExecutableName, appPlist.CFBundleExecutable), (0, _fs().unlinkIfExists)(path.join(appOutDir, "LICENSE")), (0, _fs().unlinkIfExists)(path.join(appOutDir, "LICENSES.chromium.html"))]); - yield moveHelpers(getAvailableHelperSuffixes(helperEHPlist, helperNPPlist), frameworksPath, appFilename, packager.electronDistMacOsExecutableName); - - if (helperLoginPlist != null) { - const prefix = packager.electronDistMacOsExecutableName; - const suffix = " Login Helper"; - const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, "Contents", "MacOS"); - yield doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`)); - } - - const appPath = path.join(appOutDir, `${appFilename}.app`); - yield (0, _fsExtraP().rename)(path.dirname(contentsPath), appPath); // https://github.com/electron-userland/electron-builder/issues/840 - - const now = Date.now() / 1000; - yield (0, _fsExtraP().utimes)(appPath, now, now); - }); - return _createMacApp.apply(this, arguments); -} - -function configureLocalhostAts(appPlist) { - // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/ - let ats = appPlist.NSAppTransportSecurity; - - if (ats == null) { - ats = {}; - appPlist.NSAppTransportSecurity = ats; - } - - ats.NSAllowsLocalNetworking = true; // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814 - - ats.NSAllowsArbitraryLoads = true; - let exceptionDomains = ats.NSExceptionDomains; - - if (exceptionDomains == null) { - exceptionDomains = {}; - ats.NSExceptionDomains = exceptionDomains; - } - - if (exceptionDomains.localhost == null) { - const allowHttp = { - NSTemporaryExceptionAllowsInsecureHTTPSLoads: false, - NSIncludesSubdomains: false, - NSTemporaryExceptionAllowsInsecureHTTPLoads: true, - NSTemporaryExceptionMinimumTLSVersion: "1.0", - NSTemporaryExceptionRequiresForwardSecrecy: false - }; - exceptionDomains.localhost = allowHttp; - exceptionDomains["127.0.0.1"] = allowHttp; - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=electronMac.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/electron/electronMac.js.map b/node_modules/app-builder-lib/out/electron/electronMac.js.map deleted file mode 100644 index 7113f21..0000000 --- a/node_modules/app-builder-lib/out/electron/electronMac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources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;AAED,SAAS,qBAAT,CAA+B,QAA/B,EAA4C;AAC1C;AACA,MAAI,GAAG,GAAG,QAAQ,CAAC,sBAAnB;;AACA,MAAI,GAAG,IAAI,IAAX,EAAiB;AACf,IAAA,GAAG,GAAG,EAAN;AACA,IAAA,QAAQ,CAAC,sBAAT,GAAkC,GAAlC;AACD;;AAED,EAAA,GAAG,CAAC,uBAAJ,GAA8B,IAA9B,CAR0C,CAS1C;;AACA,EAAA,GAAG,CAAC,sBAAJ,GAA6B,IAA7B;AAEA,MAAI,gBAAgB,GAAG,GAAG,CAAC,kBAA3B;;AACA,MAAI,gBAAgB,IAAI,IAAxB,EAA8B;AAC5B,IAAA,gBAAgB,GAAG,EAAnB;AACA,IAAA,GAAG,CAAC,kBAAJ,GAAyB,gBAAzB;AACD;;AAED,MAAI,gBAAgB,CAAC,SAAjB,IAA8B,IAAlC,EAAwC;AACtC,UAAM,SAAS,GAAG;AAChB,MAAA,4CAA4C,EAAE,KAD9B;AAEhB,MAAA,oBAAoB,EAAE,KAFN;AAGhB,MAAA,2CAA2C,EAAE,IAH7B;AAIhB,MAAA,qCAAqC,EAAE,KAJvB;AAKhB,MAAA,0CAA0C,EAAE;AAL5B,KAAlB;AAOA,IAAA,gBAAgB,CAAC,SAAjB,GAA6B,SAA7B;AACA,IAAA,gBAAgB,CAAC,WAAD,CAAhB,GAAgC,SAAhC;AACD;AACF,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { asArray, getPlatformIconFileName, InvalidConfigurationError, log } from \"builder-util\"\nimport { copyOrLinkFile, unlinkIfExists } from \"builder-util/out/fs\"\nimport { orIfFileNotExist } from \"builder-util/out/promise\"\nimport { readFile, rename, utimes, writeFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { build as buildPlist, parse as parsePlist } from \"plist\"\nimport { filterCFBundleIdentifier } from \"../appInfo\"\nimport { AsarIntegrity } from \"../asar/integrity\"\nimport MacPackager from \"../macPackager\"\nimport { normalizeExt } from \"../platformPackager\"\n\nfunction doRename(basePath: string, oldName: string, newName: string) {\n return rename(path.join(basePath, oldName), path.join(basePath, newName))\n}\n\nfunction moveHelpers(helperSuffixes: Array, frameworksPath: string, appName: string, prefix: string): Promise {\n return BluebirdPromise.map(helperSuffixes, suffix => {\n const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix)\n .then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`))\n })\n}\n\nfunction getAvailableHelperSuffixes(helperEHPlist: string | null, helperNPPlist: string | null) {\n const result = [\" Helper\"]\n if (helperEHPlist != null) {\n result.push(\" Helper EH\")\n }\n if (helperNPPlist != null) {\n result.push(\" Helper NP\")\n }\n return result\n}\n\n/** @internal */\nexport async function createMacApp(packager: MacPackager, appOutDir: string, asarIntegrity: AsarIntegrity | null, isMas: boolean) {\n const appInfo = packager.appInfo\n const appFilename = appInfo.productFilename\n\n const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, \"Contents\")\n const frameworksPath = path.join(contentsPath, \"Frameworks\")\n const loginItemPath = path.join(contentsPath, \"Library\", \"LoginItems\")\n\n const appPlistFilename = path.join(contentsPath, \"Info.plist\")\n const helperPlistFilename = path.join(frameworksPath, `${packager.electronDistMacOsExecutableName} Helper.app`, \"Contents\", \"Info.plist\")\n const helperEHPlistFilename = path.join(frameworksPath, `${packager.electronDistMacOsExecutableName} Helper EH.app`, \"Contents\", \"Info.plist\")\n const helperNPPlistFilename = path.join(frameworksPath, `${packager.electronDistMacOsExecutableName} Helper NP.app`, \"Contents\", \"Info.plist\")\n const helperLoginPlistFilename = path.join(loginItemPath, `${packager.electronDistMacOsExecutableName} Login Helper.app`, \"Contents\", \"Info.plist\")\n\n const buildMetadata = packager.config!\n const fileContents: Array = await BluebirdPromise.map([\n appPlistFilename,\n helperPlistFilename,\n helperEHPlistFilename,\n helperNPPlistFilename,\n helperLoginPlistFilename,\n (buildMetadata as any)[\"extend-info\"]\n ], it => it == null ? it : orIfFileNotExist(readFile(it, \"utf8\"), null))\n const appPlist = parsePlist(fileContents[0]!!)\n const helperPlist = parsePlist(fileContents[1]!!)\n const helperEHPlist = fileContents[2] == null ? null : parsePlist(fileContents[2]!!)\n const helperNPPlist = fileContents[3] == null ? null : parsePlist(fileContents[3]!!)\n const helperLoginPlist = fileContents[4] == null ? null : parsePlist(fileContents[4]!!)\n\n // if an extend-info file was supplied, copy its contents in first\n if (fileContents[5] != null) {\n Object.assign(appPlist, parsePlist(fileContents[5]!!))\n }\n\n const oldHelperBundleId = (buildMetadata as any)[\"helper-bundle-id\"]\n if (oldHelperBundleId != null) {\n log.warn(\"build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId\")\n }\n const helperBundleIdentifier = filterCFBundleIdentifier(packager.platformSpecificBuildOptions.helperBundleId || oldHelperBundleId || `${appInfo.macBundleIdentifier}.helper`)\n\n await packager.applyCommonInfo(appPlist, contentsPath)\n\n // required for electron-updater proxy\n if (!isMas) {\n configureLocalhostAts(appPlist)\n }\n\n helperPlist.CFBundleExecutable = `${appFilename} Helper`\n helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`\n helperPlist.CFBundleIdentifier = helperBundleIdentifier\n helperPlist.CFBundleVersion = appPlist.CFBundleVersion\n\n function configureHelper(helper: any, postfix: string) {\n helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`\n helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`\n helper.CFBundleIdentifier = `${helperBundleIdentifier}.${postfix}`\n helper.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n if (helperEHPlist != null) {\n configureHelper(helperEHPlist, \"EH\")\n }\n if (helperNPPlist != null) {\n configureHelper(helperNPPlist, \"NP\")\n }\n if (helperLoginPlist != null) {\n helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`\n helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`\n // noinspection SpellCheckingInspection\n helperLoginPlist.CFBundleIdentifier = `${appInfo.macBundleIdentifier}.loginhelper`\n helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n const protocols = asArray(buildMetadata.protocols).concat(asArray(packager.platformSpecificBuildOptions.protocols))\n if (protocols.length > 0) {\n appPlist.CFBundleURLTypes = protocols.map(protocol => {\n const schemes = asArray(protocol.schemes)\n if (schemes.length === 0) {\n throw new InvalidConfigurationError(`Protocol \"${protocol.name}\": must be at least one scheme specified`)\n }\n return {\n CFBundleURLName: protocol.name,\n CFBundleTypeRole: protocol.role || \"Editor\",\n CFBundleURLSchemes: schemes.slice()\n }\n })\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length > 0) {\n appPlist.CFBundleDocumentTypes = await BluebirdPromise.map(fileAssociations, async fileAssociation => {\n const extensions = asArray(fileAssociation.ext).map(normalizeExt)\n const customIcon = await packager.getResource(getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`)\n let iconFile = appPlist.CFBundleIconFile\n if (customIcon != null) {\n iconFile = path.basename(customIcon)\n await copyOrLinkFile(customIcon, path.join(path.join(contentsPath, \"Resources\"), iconFile))\n }\n\n const result = {\n CFBundleTypeExtensions: extensions,\n CFBundleTypeName: fileAssociation.name || extensions[0],\n CFBundleTypeRole: fileAssociation.role || \"Editor\",\n CFBundleTypeIconFile: iconFile\n } as any\n\n if (fileAssociation.isPackage) {\n result.LSTypeIsPackage = true\n }\n return result\n })\n }\n\n if (asarIntegrity != null) {\n appPlist.AsarIntegrity = JSON.stringify(asarIntegrity)\n }\n\n await Promise.all([\n writeFile(appPlistFilename, buildPlist(appPlist)),\n writeFile(helperPlistFilename, buildPlist(helperPlist)),\n helperEHPlist == null ? Promise.resolve() : writeFile(helperEHPlistFilename, buildPlist(helperEHPlist)),\n helperNPPlist == null ? Promise.resolve() : writeFile(helperNPPlistFilename, buildPlist(helperNPPlist)),\n helperLoginPlist == null ? Promise.resolve() : writeFile(helperLoginPlistFilename, buildPlist(helperLoginPlist)),\n doRename(path.join(contentsPath, \"MacOS\"), packager.electronDistMacOsExecutableName, appPlist.CFBundleExecutable),\n unlinkIfExists(path.join(appOutDir, \"LICENSE\")),\n unlinkIfExists(path.join(appOutDir, \"LICENSES.chromium.html\")),\n ])\n\n await moveHelpers(getAvailableHelperSuffixes(helperEHPlist, helperNPPlist), frameworksPath, appFilename, packager.electronDistMacOsExecutableName)\n\n if (helperLoginPlist != null) {\n const prefix = packager.electronDistMacOsExecutableName\n const suffix = \" Login Helper\"\n const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix)\n .then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`))\n }\n\n const appPath = path.join(appOutDir, `${appFilename}.app`)\n await rename(path.dirname(contentsPath), appPath)\n // https://github.com/electron-userland/electron-builder/issues/840\n const now = Date.now() / 1000\n await utimes(appPath, now, now)\n}\n\nfunction configureLocalhostAts(appPlist: any) {\n // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/\n let ats = appPlist.NSAppTransportSecurity\n if (ats == null) {\n ats = {}\n appPlist.NSAppTransportSecurity = ats\n }\n\n ats.NSAllowsLocalNetworking = true\n // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814\n ats.NSAllowsArbitraryLoads = true\n\n let exceptionDomains = ats.NSExceptionDomains\n if (exceptionDomains == null) {\n exceptionDomains = {}\n ats.NSExceptionDomains = exceptionDomains\n }\n\n if (exceptionDomains.localhost == null) {\n const allowHttp = {\n NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,\n NSIncludesSubdomains: false,\n NSTemporaryExceptionAllowsInsecureHTTPLoads: true,\n NSTemporaryExceptionMinimumTLSVersion: \"1.0\",\n NSTemporaryExceptionRequiresForwardSecrecy: false\n }\n exceptionDomains.localhost = allowHttp\n exceptionDomains[\"127.0.0.1\"] = allowHttp\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/electron/electronVersion.d.ts b/node_modules/app-builder-lib/out/electron/electronVersion.d.ts deleted file mode 100644 index a8953e5..0000000 --- a/node_modules/app-builder-lib/out/electron/electronVersion.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Lazy } from "lazy-val"; -import { Configuration } from "../configuration"; -export declare type MetadataValue = Lazy<{ - [key: string]: any; -} | null>; -export declare function getElectronVersion(projectDir: string, config?: Configuration, projectMetadata?: MetadataValue): Promise; -export declare function getElectronVersionFromInstalled(projectDir: string): Promise; diff --git a/node_modules/app-builder-lib/out/electron/electronVersion.js b/node_modules/app-builder-lib/out/electron/electronVersion.js deleted file mode 100644 index 2af8f28..0000000 --- a/node_modules/app-builder-lib/out/electron/electronVersion.js +++ /dev/null @@ -1,199 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getElectronVersion = getElectronVersion; -exports.getElectronVersionFromInstalled = getElectronVersionFromInstalled; -exports.computeElectronVersion = computeElectronVersion; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _nodeHttpExecutor() { - const data = require("builder-util/out/nodeHttpExecutor"); - - _nodeHttpExecutor = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function semver() { - const data = _interopRequireWildcard(require("semver")); - - semver = function () { - return data; - }; - - return data; -} - -function _readConfigFile() { - const data = require("read-config-file"); - - _readConfigFile = function () { - return data; - }; - - return data; -} - -function _config() { - const data = require("../util/config"); - - _config = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getElectronVersion(_x, _x2) { - return _getElectronVersion.apply(this, arguments); -} - -function _getElectronVersion() { - _getElectronVersion = (0, _bluebirdLst().coroutine)(function* (projectDir, config, projectMetadata = new (_lazyVal().Lazy)(() => (0, _readConfigFile().orNullIfFileNotExist)((0, _fsExtraP().readJson)(path.join(projectDir, "package.json"))))) { - if (config == null) { - config = yield (0, _config().getConfig)(projectDir, null, null); - } - - if (config.electronVersion != null) { - return config.electronVersion; - } - - return yield computeElectronVersion(projectDir, projectMetadata); - }); - return _getElectronVersion.apply(this, arguments); -} - -function getElectronVersionFromInstalled(_x3) { - return _getElectronVersionFromInstalled.apply(this, arguments); -} -/** @internal */ - - -function _getElectronVersionFromInstalled() { - _getElectronVersionFromInstalled = (0, _bluebirdLst().coroutine)(function* (projectDir) { - for (const name of ["electron", "electron-prebuilt", "electron-prebuilt-compile"]) { - try { - return (yield (0, _fsExtraP().readJson)(path.join(projectDir, "node_modules", name, "package.json"))).version; - } catch (e) { - if (e.code !== "ENOENT") { - _builderUtil().log.warn({ - name, - error: e - }, `cannot read electron version package.json`); - } - } - } - - return null; - }); - return _getElectronVersionFromInstalled.apply(this, arguments); -} - -function computeElectronVersion(_x4, _x5) { - return _computeElectronVersion.apply(this, arguments); -} - -function _computeElectronVersion() { - _computeElectronVersion = (0, _bluebirdLst().coroutine)(function* (projectDir, projectMetadata) { - const result = yield getElectronVersionFromInstalled(projectDir); - - if (result != null) { - return result; - } - - const electronPrebuiltDep = findFromElectronPrebuilt((yield projectMetadata.value)); - - if (electronPrebuiltDep == null || electronPrebuiltDep === "latest") { - try { - const releaseInfo = JSON.parse((yield _nodeHttpExecutor().httpExecutor.request({ - hostname: "github.com", - path: "/electron/electron/releases/latest", - headers: { - accept: "application/json" - } - }))); - return releaseInfo.tag_name.startsWith("v") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name; - } catch (e) { - _builderUtil().log.warn(e); - } - - throw new Error(`Cannot find electron dependency to get electron version in the '${path.join(projectDir, "package.json")}'`); - } - - const version = semver().coerce(electronPrebuiltDep); - - if (version == null) { - throw new Error("cannot compute electron version"); - } - - return version.toString(); - }); - return _computeElectronVersion.apply(this, arguments); -} - -function findFromElectronPrebuilt(packageData) { - for (const name of ["electron", "electron-prebuilt", "electron-prebuilt-compile"]) { - const devDependencies = packageData.devDependencies; - let dep = devDependencies == null ? null : devDependencies[name]; - - if (dep == null) { - const dependencies = packageData.dependencies; - dep = dependencies == null ? null : dependencies[name]; - } - - if (dep != null) { - return dep; - } - } - - return null; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=electronVersion.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/electron/electronVersion.js.map b/node_modules/app-builder-lib/out/electron/electronVersion.js.map deleted file mode 100644 index 686d2a2..0000000 --- a/node_modules/app-builder-lib/out/electron/electronVersion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/electron/electronVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;SAIsB,kB;;;;;sDAAf,WAAkC,UAAlC,EAAsD,MAAtD,EAA8E,eAAA,GAAiC,KAAI,eAAJ,EAAS,MA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\nimport { httpExecutor } from \"builder-util/out/nodeHttpExecutor\"\nimport { readJson } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { orNullIfFileNotExist } from \"read-config-file\"\nimport { Configuration } from \"../configuration\"\nimport { getConfig } from \"../util/config\"\n\nexport type MetadataValue = Lazy<{ [key: string]: any } | null>\n\nexport async function getElectronVersion(projectDir: string, config?: Configuration, projectMetadata: MetadataValue = new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, \"package.json\"))))): Promise {\n if (config == null) {\n config = await getConfig(projectDir, null, null)\n }\n if (config.electronVersion != null) {\n return config.electronVersion\n }\n return await computeElectronVersion(projectDir, projectMetadata)\n}\n\nexport async function getElectronVersionFromInstalled(projectDir: string) {\n for (const name of [\"electron\", \"electron-prebuilt\", \"electron-prebuilt-compile\"]) {\n try {\n return (await readJson(path.join(projectDir, \"node_modules\", name, \"package.json\"))).version\n }\n catch (e) {\n if (e.code !== \"ENOENT\") {\n log.warn({name, error: e}, `cannot read electron version package.json`)\n }\n }\n }\n return null\n}\n\n/** @internal */\nexport async function computeElectronVersion(projectDir: string, projectMetadata: MetadataValue): Promise {\n const result = await getElectronVersionFromInstalled(projectDir)\n if (result != null) {\n return result\n }\n\n const electronPrebuiltDep = findFromElectronPrebuilt(await projectMetadata!!.value)\n if (electronPrebuiltDep == null || electronPrebuiltDep === \"latest\") {\n try {\n const releaseInfo = JSON.parse((await httpExecutor.request({\n hostname: \"github.com\",\n path: \"/electron/electron/releases/latest\",\n headers: {\n accept: \"application/json\",\n },\n }))!!)\n return (releaseInfo.tag_name.startsWith(\"v\")) ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name\n }\n catch (e) {\n log.warn(e)\n }\n\n throw new Error(`Cannot find electron dependency to get electron version in the '${path.join(projectDir, \"package.json\")}'`)\n }\n\n const version = semver.coerce(electronPrebuiltDep)\n if (version == null) {\n throw new Error(\"cannot compute electron version\")\n }\n return version.toString()\n}\n\nfunction findFromElectronPrebuilt(packageData: any): any {\n for (const name of [\"electron\", \"electron-prebuilt\", \"electron-prebuilt-compile\"]) {\n const devDependencies = packageData.devDependencies\n let dep = devDependencies == null ? null : devDependencies[name]\n if (dep == null) {\n const dependencies = packageData.dependencies\n dep = dependencies == null ? null : dependencies[name]\n }\n if (dep != null) {\n return dep\n }\n }\n return null\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/errorMessages.d.ts b/node_modules/app-builder-lib/out/errorMessages.d.ts deleted file mode 100644 index 4804242..0000000 --- a/node_modules/app-builder-lib/out/errorMessages.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const authorEmailIsMissed = "Please specify author 'email' in the application package.json\n\nSee https://docs.npmjs.com/files/package.json#people-fields-author-contributors\n\nIt is required to set Linux .deb package maintainer. Or you can set maintainer in the custom linux options.\n(see https://www.electron.build/configuration/linux).\n"; diff --git a/node_modules/app-builder-lib/out/errorMessages.js b/node_modules/app-builder-lib/out/errorMessages.js deleted file mode 100644 index f69f354..0000000 --- a/node_modules/app-builder-lib/out/errorMessages.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.authorEmailIsMissed = void 0; -const authorEmailIsMissed = `Please specify author 'email' in the application package.json - -See https://docs.npmjs.com/files/package.json#people-fields-author-contributors - -It is required to set Linux .deb package maintainer. Or you can set maintainer in the custom linux options. -(see https://www.electron.build/configuration/linux). -`; exports.authorEmailIsMissed = authorEmailIsMissed; -// __ts-babel@6.0.4 -//# sourceMappingURL=errorMessages.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/errorMessages.js.map b/node_modules/app-builder-lib/out/errorMessages.js.map deleted file mode 100644 index 8bb7d23..0000000 --- a/node_modules/app-builder-lib/out/errorMessages.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/errorMessages.ts"],"names":[],"mappings":";;;;;;AAAO,MAAM,mBAAmB,GAAG;;;;;;CAA5B,C","sourcesContent":["export const authorEmailIsMissed = `Please specify author 'email' in the application package.json\n\nSee https://docs.npmjs.com/files/package.json#people-fields-author-contributors\n\nIt is required to set Linux .deb package maintainer. Or you can set maintainer in the custom linux options.\n(see https://www.electron.build/configuration/linux).\n`"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/fileMatcher.d.ts b/node_modules/app-builder-lib/out/fileMatcher.d.ts deleted file mode 100644 index 6213bc4..0000000 --- a/node_modules/app-builder-lib/out/fileMatcher.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { PlatformSpecificBuildOptions } from "./index"; -export declare const excludedNames: string; -export declare const excludedExts = "iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts"; -export interface GetFileMatchersOptions { - readonly macroExpander: (pattern: string) => string; - readonly customBuildOptions: PlatformSpecificBuildOptions; - readonly globalOutDir: string; - readonly defaultSrc: string; -} diff --git a/node_modules/app-builder-lib/out/fileMatcher.js b/node_modules/app-builder-lib/out/fileMatcher.js deleted file mode 100644 index a0a7294..0000000 --- a/node_modules/app-builder-lib/out/fileMatcher.js +++ /dev/null @@ -1,415 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getMainFileMatchers = getMainFileMatchers; -exports.getNodeModuleFileMatcher = getNodeModuleFileMatcher; -exports.getFileMatchers = getFileMatchers; -exports.copyFiles = copyFiles; -exports.FileMatcher = exports.excludedExts = exports.excludedNames = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _minimatch() { - const data = require("minimatch"); - - _minimatch = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _filter() { - const data = require("./util/filter"); - - _filter = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -// https://github.com/electron-userland/electron-builder/issues/733 -const minimatchOptions = { - dot: true -}; // noinspection SpellCheckingInspection - -const excludedNames = ".git,.hg,.svn,CVS,RCS,SCCS," + "__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore," + ".idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci," + ".yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log," + "appveyor.yml,.travis.yml,circle.yml,.nyc_output"; -exports.excludedNames = excludedNames; -const excludedExts = "iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts"; -exports.excludedExts = excludedExts; - -function ensureNoEndSlash(file) { - if (path.sep !== "/") { - file = file.replace(/\//g, path.sep); - } - - if (path.sep !== "\\") { - file = file.replace(/\\/g, path.sep); - } - - if (file.endsWith(path.sep)) { - return file.substring(0, file.length - 1); - } else { - return file; - } -} -/** @internal */ - - -class FileMatcher { - constructor(from, to, macroExpander, patterns) { - this.macroExpander = macroExpander; - this.excludePatterns = null; - this.from = ensureNoEndSlash(macroExpander(from)); - this.to = ensureNoEndSlash(macroExpander(to)); - this.patterns = (0, _builderUtil().asArray)(patterns).map(it => this.normalizePattern(it)); - this.isSpecifiedAsEmptyArray = Array.isArray(patterns) && patterns.length === 0; - } - - normalizePattern(pattern) { - if (pattern.startsWith("./")) { - pattern = pattern.substring("./".length); - } - - return path.posix.normalize(this.macroExpander(pattern.replace(/\\/g, "/"))); - } - - addPattern(pattern) { - this.patterns.push(this.normalizePattern(pattern)); - } - - prependPattern(pattern) { - this.patterns.unshift(this.normalizePattern(pattern)); - } - - isEmpty() { - return this.patterns.length === 0; - } - - containsOnlyIgnore() { - return !this.isEmpty() && this.patterns.find(it => !it.startsWith("!")) == null; - } - - computeParsedPatterns(result, fromDir) { - const relativeFrom = fromDir == null ? null : path.relative(fromDir, this.from); - - if (this.patterns.length === 0 && relativeFrom != null) { - // file mappings, from here is a file - result.push(new (_minimatch().Minimatch)(relativeFrom, minimatchOptions)); - return; - } - - for (let pattern of this.patterns) { - if (relativeFrom != null) { - pattern = path.join(relativeFrom, pattern); - } - - const parsedPattern = new (_minimatch().Minimatch)(pattern, minimatchOptions); - result.push(parsedPattern); // do not add if contains dot (possibly file if has extension) - - if (!pattern.includes(".") && !(0, _filter().hasMagic)(parsedPattern)) { - // https://github.com/electron-userland/electron-builder/issues/545 - // add **/* - result.push(new (_minimatch().Minimatch)(`${pattern}/**/*`, minimatchOptions)); - } - } - } - - createFilter() { - const parsedPatterns = []; - this.computeParsedPatterns(parsedPatterns); - return (0, _filter().createFilter)(this.from, parsedPatterns, this.excludePatterns); - } - - toString() { - return `from: ${this.from}, to: ${this.to}, patterns: ${this.patterns.join(", ")}`; - } - -} -/** @internal */ - - -exports.FileMatcher = FileMatcher; - -function getMainFileMatchers(appDir, destination, macroExpander, platformSpecificBuildOptions, platformPackager, outDir, isElectronCompile) { - const packager = platformPackager.info; - const buildResourceDir = path.resolve(packager.projectDir, packager.buildResourcesDir); - let matchers = packager.isPrepackedAppAsar ? null : getFileMatchers(packager.config, "files", destination, { - macroExpander, - customBuildOptions: platformSpecificBuildOptions, - globalOutDir: outDir, - defaultSrc: appDir - }); - - if (matchers == null) { - matchers = [new FileMatcher(appDir, destination, macroExpander)]; - } - - const matcher = matchers[0]; // add default patterns, but only if from equals to app dir - - if (matcher.from !== appDir) { - return matchers; - } // https://github.com/electron-userland/electron-builder/issues/1741#issuecomment-311111418 so, do not use inclusive patterns - - - const patterns = matcher.patterns; - const customFirstPatterns = []; // electron-webpack - we need to copy only package.json and node_modules from root dir (and these files are added by default), so, explicit empty array is specified - - if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) { - customFirstPatterns.push("**/*"); - } else if (!patterns.includes("package.json")) { - patterns.push("package.json"); - } // https://github.com/electron-userland/electron-builder/issues/1482 - - - const relativeBuildResourceDir = path.relative(matcher.from, buildResourceDir); - - if (relativeBuildResourceDir.length !== 0 && !relativeBuildResourceDir.startsWith(".")) { - customFirstPatterns.push(`!${relativeBuildResourceDir}{,/**/*}`); - } - - const relativeOutDir = matcher.normalizePattern(path.relative(packager.projectDir, outDir)); - - if (!relativeOutDir.startsWith(".")) { - customFirstPatterns.push(`!${relativeOutDir}{,/**/*}`); - } // add our default exclusions after last user possibly defined "all"/permissive pattern - - - let insertIndex = 0; - - for (let i = patterns.length - 1; i >= 0; i--) { - if (patterns[i].startsWith("**/")) { - insertIndex = i + 1; - break; - } - } - - patterns.splice(insertIndex, 0, ...customFirstPatterns); - patterns.push(`!**/*.{${excludedExts}${packager.config.includePdb === true ? "" : ",pdb"}`); - patterns.push("!**/._*"); - patterns.push("!**/electron-builder.{yaml,yml,json,json5,toml}"); - patterns.push(`!**/{${excludedNames}}`); - - if (isElectronCompile) { - patterns.push("!.cache{,/**/*}"); - } // https://github.com/electron-userland/electron-builder/issues/1969 - // exclude ony for app root, use .yarnclean to clean node_modules - - - patterns.push("!.editorconfig"); - const debugLogger = packager.debugLogger; - - if (debugLogger.isEnabled) { - //tslint:disable-next-line:no-invalid-template-strings - debugLogger.add(`${macroExpander("${arch}")}.firstOrDefaultFilePatterns`, patterns); - } - - return matchers; -} -/** @internal */ - - -function getNodeModuleFileMatcher(appDir, destination, macroExpander, platformSpecificBuildOptions, packager) { - // https://github.com/electron-userland/electron-builder/pull/2948#issuecomment-392241632 - // grab only excludes - const matcher = new FileMatcher(appDir, destination, macroExpander); - - function addPatterns(patterns) { - if (patterns == null) { - return; - } else if (!Array.isArray(patterns)) { - if (typeof patterns === "string" && patterns.startsWith("!")) { - matcher.addPattern(patterns); - return; - } // ignore object form - - - return; - } - - for (const pattern of patterns) { - if (typeof pattern === "string") { - if (pattern.startsWith("!")) { - matcher.addPattern(pattern); - } - } else { - const fileSet = pattern; - - if (fileSet.from == null || fileSet.from === ".") { - for (const p of (0, _builderUtil().asArray)(fileSet.filter)) { - matcher.addPattern(p); - } - } - } - } - } - - addPatterns(packager.config.files); - addPatterns(platformSpecificBuildOptions.files); - - if (!matcher.isEmpty()) { - matcher.prependPattern("**/*"); - } - - const debugLogger = packager.debugLogger; - - if (debugLogger.isEnabled) { - //tslint:disable-next-line:no-invalid-template-strings - debugLogger.add(`${macroExpander("${arch}")}.nodeModuleFilePatterns`, matcher.patterns); - } - - return matcher; -} -/** @internal */ - - -function getFileMatchers(config, name, defaultDestination, options) { - const defaultMatcher = new FileMatcher(options.defaultSrc, defaultDestination, options.macroExpander); - const fileMatchers = []; - - function addPatterns(patterns) { - if (patterns == null) { - return; - } else if (!Array.isArray(patterns)) { - if (typeof patterns === "string") { - defaultMatcher.addPattern(patterns); - return; - } - - patterns = [patterns]; - } - - for (const pattern of patterns) { - if (typeof pattern === "string") { - // use normalize to transform ./foo to foo - defaultMatcher.addPattern(pattern); - } else if (name === "asarUnpack") { - throw new Error(`Advanced file copying not supported for "${name}"`); - } else { - const from = pattern.from == null ? options.defaultSrc : path.resolve(options.defaultSrc, pattern.from); - const to = pattern.to == null ? defaultDestination : path.resolve(defaultDestination, pattern.to); - fileMatchers.push(new FileMatcher(from, to, options.macroExpander, pattern.filter)); - } - } - } - - if (name !== "extraDistFiles") { - addPatterns(config[name]); - } - - addPatterns(options.customBuildOptions[name]); - - if (!defaultMatcher.isEmpty()) { - // default matcher should be first in the array - fileMatchers.unshift(defaultMatcher); - } // we cannot exclude the whole out dir, because sometimes users want to use some file in the out dir in the patterns - - - const relativeOutDir = defaultMatcher.normalizePattern(path.relative(options.defaultSrc, options.globalOutDir)); - - if (!relativeOutDir.startsWith(".")) { - defaultMatcher.addPattern(`!${relativeOutDir}/*-unpacked{,/**/*}`); - } - - return fileMatchers.length === 0 ? null : fileMatchers; -} -/** @internal */ - - -function copyFiles(matchers, transformer, isUseHardLink) { - if (matchers == null || matchers.length === 0) { - return Promise.resolve(); - } - - return _bluebirdLst().default.map(matchers, - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (matcher) { - const fromStat = yield (0, _fs().statOrNull)(matcher.from); - - if (fromStat == null) { - _builderUtil().log.warn({ - from: matcher.from - }, `file source doesn't exist`); - - return; - } - - if (fromStat.isFile()) { - const toStat = yield (0, _fs().statOrNull)(matcher.to); // https://github.com/electron-userland/electron-builder/issues/1245 - - if (toStat != null && toStat.isDirectory()) { - return yield (0, _fs().copyOrLinkFile)(matcher.from, path.join(matcher.to, path.basename(matcher.from)), fromStat, isUseHardLink); - } - - yield (0, _fsExtraP().ensureDir)(path.dirname(matcher.to)); - return yield (0, _fs().copyOrLinkFile)(matcher.from, matcher.to, fromStat); - } - - if (matcher.isEmpty() || matcher.containsOnlyIgnore()) { - matcher.prependPattern("**/*"); - } - - _builderUtil().log.debug({ - matcher - }, "copying files using pattern"); - - return yield (0, _fs().copyDir)(matcher.from, matcher.to, { - filter: matcher.createFilter(), - transformer, - isUseHardLink: isUseHardLink ? _fs().USE_HARD_LINKS : null - }); - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=fileMatcher.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/fileMatcher.js.map b/node_modules/app-builder-lib/out/fileMatcher.js.map deleted file mode 100644 index 1cde80e..0000000 --- a/node_modules/app-builder-lib/out/fileMatcher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fileMatcher.ts"],"names":[],"mappings":";;;;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H,GAAoB;AAA9F,OAAlC,CAAb;AACD,KAvBM;;AAAA;AAAA;AAAA;AAAA,MAAP;AAwBD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { asArray, log } from \"builder-util\"\nimport { copyDir, copyOrLinkFile, Filter, statOrNull, FileTransformer, USE_HARD_LINKS } from \"builder-util/out/fs\"\nimport { ensureDir } from \"fs-extra-p\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport { Configuration, FileSet, Packager, PlatformSpecificBuildOptions } from \"./index\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { createFilter, hasMagic } from \"./util/filter\"\n\n// https://github.com/electron-userland/electron-builder/issues/733\nconst minimatchOptions = {dot: true}\n\n// noinspection SpellCheckingInspection\nexport const excludedNames = \".git,.hg,.svn,CVS,RCS,SCCS,\" +\n \"__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore,\" +\n \".idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci,\" +\n \".yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log,\" +\n \"appveyor.yml,.travis.yml,circle.yml,.nyc_output\"\n\nexport const excludedExts = \"iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts\"\n\nfunction ensureNoEndSlash(file: string): string {\n if (path.sep !== \"/\") {\n file = file.replace(/\\//g, path.sep)\n }\n if (path.sep !== \"\\\\\") {\n file = file.replace(/\\\\/g, path.sep)\n }\n\n if (file.endsWith(path.sep)) {\n return file.substring(0, file.length - 1)\n }\n else {\n return file\n }\n}\n\n/** @internal */\nexport class FileMatcher {\n readonly from: string\n readonly to: string\n\n readonly patterns: Array\n\n excludePatterns: Array | null = null\n\n readonly isSpecifiedAsEmptyArray: boolean\n\n constructor(from: string, to: string, readonly macroExpander: (pattern: string) => string, patterns?: Array | string | null | undefined) {\n this.from = ensureNoEndSlash(macroExpander(from))\n this.to = ensureNoEndSlash(macroExpander(to))\n this.patterns = asArray(patterns).map(it => this.normalizePattern(it))\n this.isSpecifiedAsEmptyArray = Array.isArray(patterns) && patterns.length === 0\n }\n\n normalizePattern(pattern: string) {\n if (pattern.startsWith(\"./\")) {\n pattern = pattern.substring(\"./\".length)\n }\n return path.posix.normalize(this.macroExpander(pattern.replace(/\\\\/g, \"/\")))\n }\n\n addPattern(pattern: string) {\n this.patterns.push(this.normalizePattern(pattern))\n }\n\n prependPattern(pattern: string) {\n this.patterns.unshift(this.normalizePattern(pattern))\n }\n\n isEmpty() {\n return this.patterns.length === 0\n }\n\n containsOnlyIgnore(): boolean {\n return !this.isEmpty() && this.patterns.find(it => !it.startsWith(\"!\")) == null\n }\n\n computeParsedPatterns(result: Array, fromDir?: string): void {\n const relativeFrom = fromDir == null ? null : path.relative(fromDir, this.from)\n\n if (this.patterns.length === 0 && relativeFrom != null) {\n // file mappings, from here is a file\n result.push(new Minimatch(relativeFrom, minimatchOptions))\n return\n }\n\n for (let pattern of this.patterns) {\n if (relativeFrom != null) {\n pattern = path.join(relativeFrom, pattern)\n }\n\n const parsedPattern = new Minimatch(pattern, minimatchOptions)\n result.push(parsedPattern)\n\n // do not add if contains dot (possibly file if has extension)\n if (!pattern.includes(\".\") && !hasMagic(parsedPattern)) {\n // https://github.com/electron-userland/electron-builder/issues/545\n // add **/*\n result.push(new Minimatch(`${pattern}/**/*`, minimatchOptions))\n }\n }\n }\n\n createFilter(): Filter {\n const parsedPatterns: Array = []\n this.computeParsedPatterns(parsedPatterns)\n return createFilter(this.from, parsedPatterns, this.excludePatterns)\n }\n\n toString() {\n return `from: ${this.from}, to: ${this.to}, patterns: ${this.patterns.join(\", \")}`\n }\n}\n\n/** @internal */\nexport function getMainFileMatchers(appDir: string, destination: string, macroExpander: (pattern: string) => string, platformSpecificBuildOptions: PlatformSpecificBuildOptions, platformPackager: PlatformPackager, outDir: string, isElectronCompile: boolean): Array {\n const packager = platformPackager.info\n const buildResourceDir = path.resolve(packager.projectDir, packager.buildResourcesDir)\n\n let matchers = packager.isPrepackedAppAsar ? null : getFileMatchers(packager.config, \"files\", destination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: outDir,\n defaultSrc: appDir,\n })\n if (matchers == null) {\n matchers = [new FileMatcher(appDir, destination, macroExpander)]\n }\n\n const matcher = matchers[0]\n // add default patterns, but only if from equals to app dir\n if (matcher.from !== appDir) {\n return matchers\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1741#issuecomment-311111418 so, do not use inclusive patterns\n const patterns = matcher.patterns\n\n const customFirstPatterns: Array = []\n // electron-webpack - we need to copy only package.json and node_modules from root dir (and these files are added by default), so, explicit empty array is specified\n if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {\n customFirstPatterns.push(\"**/*\")\n }\n else if (!patterns.includes(\"package.json\")) {\n patterns.push(\"package.json\")\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1482\n const relativeBuildResourceDir = path.relative(matcher.from, buildResourceDir)\n if (relativeBuildResourceDir.length !== 0 && !relativeBuildResourceDir.startsWith(\".\")) {\n customFirstPatterns.push(`!${relativeBuildResourceDir}{,/**/*}`)\n }\n\n const relativeOutDir = matcher.normalizePattern(path.relative(packager.projectDir, outDir))\n if (!relativeOutDir.startsWith(\".\")) {\n customFirstPatterns.push(`!${relativeOutDir}{,/**/*}`)\n }\n\n // add our default exclusions after last user possibly defined \"all\"/permissive pattern\n let insertIndex = 0\n for (let i = patterns.length - 1; i >= 0; i--) {\n if (patterns[i].startsWith(\"**/\")) {\n insertIndex = i + 1\n break\n }\n }\n patterns.splice(insertIndex, 0, ...customFirstPatterns)\n\n patterns.push(`!**/*.{${excludedExts}${packager.config.includePdb === true ? \"\" : \",pdb\"}`)\n patterns.push(\"!**/._*\")\n patterns.push(\"!**/electron-builder.{yaml,yml,json,json5,toml}\")\n patterns.push(`!**/{${excludedNames}}`)\n\n if (isElectronCompile) {\n patterns.push(\"!.cache{,/**/*}\")\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1969\n // exclude ony for app root, use .yarnclean to clean node_modules\n patterns.push(\"!.editorconfig\")\n\n const debugLogger = packager.debugLogger\n if (debugLogger.isEnabled) {\n //tslint:disable-next-line:no-invalid-template-strings\n debugLogger.add(`${macroExpander(\"${arch}\")}.firstOrDefaultFilePatterns`, patterns)\n }\n return matchers\n}\n\n/** @internal */\nexport function getNodeModuleFileMatcher(appDir: string, destination: string, macroExpander: (pattern: string) => string, platformSpecificBuildOptions: PlatformSpecificBuildOptions, packager: Packager): FileMatcher {\n // https://github.com/electron-userland/electron-builder/pull/2948#issuecomment-392241632\n // grab only excludes\n const matcher = new FileMatcher(appDir, destination, macroExpander)\n\n function addPatterns(patterns: Array | string | null | undefined | FileSet) {\n if (patterns == null) {\n return\n }\n else if (!Array.isArray(patterns)) {\n if (typeof patterns === \"string\" && patterns.startsWith(\"!\")) {\n matcher.addPattern(patterns)\n return\n }\n // ignore object form\n return\n }\n\n for (const pattern of patterns) {\n if (typeof pattern === \"string\") {\n if (pattern.startsWith(\"!\")) {\n matcher.addPattern(pattern)\n }\n }\n else {\n const fileSet = (pattern as FileSet)\n if (fileSet.from == null || fileSet.from === \".\") {\n for (const p of asArray(fileSet.filter)) {\n matcher.addPattern(p)\n }\n }\n }\n }\n }\n\n addPatterns(packager.config.files)\n addPatterns(platformSpecificBuildOptions.files)\n\n if (!matcher.isEmpty()) {\n matcher.prependPattern(\"**/*\")\n }\n\n const debugLogger = packager.debugLogger\n if (debugLogger.isEnabled) {\n //tslint:disable-next-line:no-invalid-template-strings\n debugLogger.add(`${macroExpander(\"${arch}\")}.nodeModuleFilePatterns`, matcher.patterns)\n }\n\n return matcher\n}\n\nexport interface GetFileMatchersOptions {\n readonly macroExpander: (pattern: string) => string\n readonly customBuildOptions: PlatformSpecificBuildOptions\n readonly globalOutDir: string\n\n readonly defaultSrc: string\n}\n\n/** @internal */\nexport function getFileMatchers(config: Configuration, name: \"files\" | \"extraFiles\" | \"extraResources\" | \"asarUnpack\" | \"extraDistFiles\", defaultDestination: string, options: GetFileMatchersOptions): Array | null {\n const defaultMatcher = new FileMatcher(options.defaultSrc, defaultDestination, options.macroExpander)\n const fileMatchers: Array = []\n\n function addPatterns(patterns: Array | string | null | undefined | FileSet) {\n if (patterns == null) {\n return\n }\n else if (!Array.isArray(patterns)) {\n if (typeof patterns === \"string\") {\n defaultMatcher.addPattern(patterns)\n return\n }\n patterns = [patterns]\n }\n\n for (const pattern of patterns) {\n if (typeof pattern === \"string\") {\n // use normalize to transform ./foo to foo\n defaultMatcher.addPattern(pattern)\n }\n else if (name === \"asarUnpack\") {\n throw new Error(`Advanced file copying not supported for \"${name}\"`)\n }\n else {\n const from = pattern.from == null ? options.defaultSrc : path.resolve(options.defaultSrc, pattern.from)\n const to = pattern.to == null ? defaultDestination : path.resolve(defaultDestination, pattern.to)\n fileMatchers.push(new FileMatcher(from, to, options.macroExpander, pattern.filter))\n }\n }\n }\n\n if (name !== \"extraDistFiles\") {\n addPatterns((config as any)[name])\n }\n addPatterns((options.customBuildOptions as any)[name])\n\n if (!defaultMatcher.isEmpty()) {\n // default matcher should be first in the array\n fileMatchers.unshift(defaultMatcher)\n }\n\n // we cannot exclude the whole out dir, because sometimes users want to use some file in the out dir in the patterns\n const relativeOutDir = defaultMatcher.normalizePattern(path.relative(options.defaultSrc, options.globalOutDir))\n if (!relativeOutDir.startsWith(\".\")) {\n defaultMatcher.addPattern(`!${relativeOutDir}/*-unpacked{,/**/*}`)\n }\n\n return fileMatchers.length === 0 ? null : fileMatchers\n}\n\n/** @internal */\nexport function copyFiles(matchers: Array | null, transformer: FileTransformer | null, isUseHardLink?: boolean): Promise {\n if (matchers == null || matchers.length === 0) {\n return Promise.resolve()\n }\n\n return BluebirdPromise.map(matchers, async (matcher: FileMatcher) => {\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.warn({from: matcher.from}, `file source doesn't exist`)\n return\n }\n\n if (fromStat.isFile()) {\n const toStat = await statOrNull(matcher.to)\n // https://github.com/electron-userland/electron-builder/issues/1245\n if (toStat != null && toStat.isDirectory()) {\n return await copyOrLinkFile(matcher.from, path.join(matcher.to, path.basename(matcher.from)), fromStat, isUseHardLink)\n }\n\n await ensureDir(path.dirname(matcher.to))\n return await copyOrLinkFile(matcher.from, matcher.to, fromStat)\n }\n\n if (matcher.isEmpty() || matcher.containsOnlyIgnore()) {\n matcher.prependPattern(\"**/*\")\n }\n log.debug({matcher}, \"copying files using pattern\")\n return await copyDir(matcher.from, matcher.to, {filter: matcher.createFilter(), transformer, isUseHardLink: isUseHardLink ? USE_HARD_LINKS : null})\n })\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/fileTransformer.d.ts b/node_modules/app-builder-lib/out/fileTransformer.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/fileTransformer.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/fileTransformer.js b/node_modules/app-builder-lib/out/fileTransformer.js deleted file mode 100644 index 45be5fa..0000000 --- a/node_modules/app-builder-lib/out/fileTransformer.js +++ /dev/null @@ -1,154 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isElectronCompileUsed = isElectronCompileUsed; -exports.hasDep = hasDep; -exports.createTransformer = createTransformer; -exports.createElectronCompilerHost = createElectronCompilerHost; -exports.NODE_MODULES_PATTERN = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/** @internal */ -const NODE_MODULES_PATTERN = `${path.sep}node_modules${path.sep}`; -/** @internal */ - -exports.NODE_MODULES_PATTERN = NODE_MODULES_PATTERN; - -function isElectronCompileUsed(info) { - if (info.config.electronCompile != null) { - return info.config.electronCompile; - } // if in devDependencies - it means that babel is used for precompilation or for some reason user decided to not use electron-compile for production - - - return hasDep("electron-compile", info); -} -/** @internal */ - - -function hasDep(name, info) { - const deps = info.metadata.dependencies; - return deps != null && name in deps; -} -/** @internal */ - - -function createTransformer(srcDir, configuration, extraMetadata, extraTransformer) { - const mainPackageJson = path.join(srcDir, "package.json"); - const isRemovePackageScripts = configuration.removePackageScripts !== false; - const packageJson = path.sep + "package.json"; - return file => { - if (file === mainPackageJson) { - return modifyMainPackageJson(file, extraMetadata, isRemovePackageScripts); - } - - if (file.endsWith(packageJson) && file.includes(NODE_MODULES_PATTERN)) { - return (0, _fsExtraP().readFile)(file, "utf-8").then(it => cleanupPackageJson(JSON.parse(it), { - isMain: false, - isRemovePackageScripts - })).catch(e => _builderUtil().log.warn(e)); - } else if (extraTransformer != null) { - return extraTransformer(file); - } else { - return null; - } - }; -} -/** @internal */ - - -function createElectronCompilerHost(projectDir, cacheDir) { - const electronCompilePath = path.join(projectDir, "node_modules", "electron-compile", "lib"); - return require(path.join(electronCompilePath, "config-parser")).createCompilerHostFromProjectRoot(projectDir, cacheDir); -} - -const ignoredPackageMetadataProperties = new Set(["dist", "gitHead", "keywords", "build", "jspm", "ava", "xo", "nyc", "eslintConfig", "contributors", "bundleDependencies", "tags"]); - -function cleanupPackageJson(data, options) { - const deps = data.dependencies; // https://github.com/electron-userland/electron-builder/issues/507#issuecomment-312772099 - - const isRemoveBabel = deps != null && typeof deps === "object" && !Object.getOwnPropertyNames(deps).some(it => it.startsWith("babel")); - - try { - let changed = false; - - for (const prop of Object.getOwnPropertyNames(data)) { - // removing devDependencies from package.json breaks levelup in electron, so, remove it only from main package.json - if (prop[0] === "_" || ignoredPackageMetadataProperties.has(prop) || options.isRemovePackageScripts && prop === "scripts" || options.isMain && prop === "devDependencies" || !options.isMain && prop === "bugs" || isRemoveBabel && prop === "babel") { - delete data[prop]; - changed = true; - } - } - - if (changed) { - return JSON.stringify(data, null, 2); - } - } catch (e) { - (0, _builderUtil().debug)(e); - } - - return null; -} - -function modifyMainPackageJson(_x, _x2, _x3) { - return _modifyMainPackageJson.apply(this, arguments); -} function _modifyMainPackageJson() { - _modifyMainPackageJson = (0, _bluebirdLst().coroutine)(function* (file, extraMetadata, isRemovePackageScripts) { - const mainPackageData = JSON.parse((yield (0, _fsExtraP().readFile)(file, "utf-8"))); - - if (extraMetadata != null) { - (0, _builderUtil().deepAssign)(mainPackageData, extraMetadata); - } // https://github.com/electron-userland/electron-builder/issues/1212 - - - const serializedDataIfChanged = cleanupPackageJson(mainPackageData, { - isMain: true, - isRemovePackageScripts - }); - - if (serializedDataIfChanged != null) { - return serializedDataIfChanged; - } else if (extraMetadata != null) { - return JSON.stringify(mainPackageData, null, 2); - } - - return null; - }); - return _modifyMainPackageJson.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=fileTransformer.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/fileTransformer.js.map b/node_modules/app-builder-lib/out/fileTransformer.js.map deleted file mode 100644 index bb69ad3..0000000 --- a/node_modules/app-builder-lib/out/fileTransformer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fileTransformer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAIA;AACO,MAAM,oBAAoB,GAAG,GAAG,IA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kC,IAAI,KAAK,SAF1C,IAGD,OAAO,CAAC,MAAR,IAAkB,IAAI,KAAK,iBAH1B,IAID,CAAC,OAAO,CAAC,MAAT,IAAmB,IAAI,KAAK,MAJ3B,IAKD,aAAa,IAAI,IAAI,KAAK,OAL7B,EAKuC;AACrC,eAAO,IAAI,CAAC,IAAD,CAAX;AACA,QAAA,OAAO,GAAG,IAAV;AACD;AACF;;AAED,QAAI,OAAJ,EAAa;AACX,aAAO,IAAI,CAAC,SAAL,CAAe,IAAf,EAAqB,IAArB,EAA2B,CAA3B,CAAP;AACD;AACF,GAlBD,CAmBA,OAAO,CAAP,EAAU;AACR,8BAAM,CAAN;AACD;;AAED,SAAO,IAAP;AACD;;SAEc,qB;;;;;;yDAAf,WAAqC,IAArC,EAAmD,aAAnD,EAAuE,sBAAvE,EAAsG;AACpG,UAAM,eAAe,GAAG,IAAI,CAAC,KAAL,QAAiB,0BAAS,IAAT,EAAe,OAAf,CAAjB,EAAxB;;AACA,QAAI,aAAa,IAAI,IAArB,EAA2B;AACzB,qCAAW,eAAX,EAA4B,aAA5B;AACD,KAJmG,CAMpG;;;AACA,UAAM,uBAAuB,GAAG,kBAAkB,CAAC,eAAD,EAAkB;AAClE,MAAA,MAAM,EAAE,IAD0D;AAElE,MAAA;AAFkE,KAAlB,CAAlD;;AAIA,QAAI,uBAAuB,IAAI,IAA/B,EAAqC;AACnC,aAAO,uBAAP;AACD,KAFD,MAGK,IAAI,aAAa,IAAI,IAArB,EAA2B;AAC9B,aAAO,IAAI,CAAC,SAAL,CAAe,eAAf,EAAgC,IAAhC,EAAsC,CAAtC,CAAP;AACD;;AACD,WAAO,IAAP;AACD,G","sourcesContent":["import { debug, log, deepAssign } from \"builder-util\"\nimport { FileTransformer } from \"builder-util/out/fs\"\nimport { readFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { Configuration } from \"./configuration\"\nimport { Packager } from \"./packager\"\n\n/** @internal */\nexport const NODE_MODULES_PATTERN = `${path.sep}node_modules${path.sep}`\n\n/** @internal */\nexport function isElectronCompileUsed(info: Packager): boolean {\n if (info.config.electronCompile != null) {\n return info.config.electronCompile\n }\n\n // if in devDependencies - it means that babel is used for precompilation or for some reason user decided to not use electron-compile for production\n return hasDep(\"electron-compile\", info)\n}\n\n/** @internal */\nexport function hasDep(name: string, info: Packager) {\n const deps = info.metadata.dependencies\n return deps != null && name in deps\n}\n\n/** @internal */\nexport function createTransformer(srcDir: string, configuration: Configuration, extraMetadata: any, extraTransformer: FileTransformer | null): FileTransformer {\n const mainPackageJson = path.join(srcDir, \"package.json\")\n const isRemovePackageScripts = configuration.removePackageScripts !== false\n const packageJson = path.sep + \"package.json\"\n return file => {\n if (file === mainPackageJson) {\n return modifyMainPackageJson(file, extraMetadata, isRemovePackageScripts)\n }\n\n if (file.endsWith(packageJson) && file.includes(NODE_MODULES_PATTERN)) {\n return readFile(file, \"utf-8\")\n .then(it => cleanupPackageJson(JSON.parse(it), {\n isMain: false,\n isRemovePackageScripts,\n }))\n .catch(e => log.warn(e))\n }\n else if (extraTransformer != null) {\n return extraTransformer(file)\n }\n else {\n return null\n }\n }\n}\n\n/** @internal */\nexport interface CompilerHost {\n compile(file: string): any\n\n saveConfiguration(): Promise\n}\n\n/** @internal */\nexport function createElectronCompilerHost(projectDir: string, cacheDir: string): Promise {\n const electronCompilePath = path.join(projectDir, \"node_modules\", \"electron-compile\", \"lib\")\n return require(path.join(electronCompilePath, \"config-parser\")).createCompilerHostFromProjectRoot(projectDir, cacheDir)\n}\n\nconst ignoredPackageMetadataProperties = new Set([\"dist\", \"gitHead\", \"keywords\", \"build\", \"jspm\", \"ava\", \"xo\", \"nyc\", \"eslintConfig\", \"contributors\", \"bundleDependencies\", \"tags\"])\n\ninterface CleanupPackageFileOptions {\n readonly isRemovePackageScripts: boolean\n readonly isMain: boolean\n}\n\nfunction cleanupPackageJson(data: any, options: CleanupPackageFileOptions): any {\n const deps = data.dependencies\n // https://github.com/electron-userland/electron-builder/issues/507#issuecomment-312772099\n const isRemoveBabel = deps != null && typeof deps === \"object\" && !Object.getOwnPropertyNames(deps).some(it => it.startsWith(\"babel\"))\n try {\n let changed = false\n for (const prop of Object.getOwnPropertyNames(data)) {\n // removing devDependencies from package.json breaks levelup in electron, so, remove it only from main package.json\n if (prop[0] === \"_\" ||\n ignoredPackageMetadataProperties.has(prop) ||\n (options.isRemovePackageScripts && prop === \"scripts\") ||\n (options.isMain && prop === \"devDependencies\") ||\n (!options.isMain && prop === \"bugs\") ||\n (isRemoveBabel && prop === \"babel\")) {\n delete data[prop]\n changed = true\n }\n }\n\n if (changed) {\n return JSON.stringify(data, null, 2)\n }\n }\n catch (e) {\n debug(e)\n }\n\n return null\n}\n\nasync function modifyMainPackageJson(file: string, extraMetadata: any, isRemovePackageScripts: boolean) {\n const mainPackageData = JSON.parse(await readFile(file, \"utf-8\"))\n if (extraMetadata != null) {\n deepAssign(mainPackageData, extraMetadata)\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1212\n const serializedDataIfChanged = cleanupPackageJson(mainPackageData, {\n isMain: true,\n isRemovePackageScripts,\n })\n if (serializedDataIfChanged != null) {\n return serializedDataIfChanged\n }\n else if (extraMetadata != null) {\n return JSON.stringify(mainPackageData, null, 2)\n }\n return null\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/forge-maker.d.ts b/node_modules/app-builder-lib/out/forge-maker.d.ts deleted file mode 100644 index a24495b..0000000 --- a/node_modules/app-builder-lib/out/forge-maker.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { PackagerOptions } from "./packagerApi"; -export interface ForgeOptions { - readonly dir: string; -} -export declare function buildForge(forgeOptions: ForgeOptions, options: PackagerOptions): Promise; diff --git a/node_modules/app-builder-lib/out/forge-maker.js b/node_modules/app-builder-lib/out/forge-maker.js deleted file mode 100644 index dcb640c..0000000 --- a/node_modules/app-builder-lib/out/forge-maker.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.buildForge = buildForge; - -var path = _interopRequireWildcard(require("path")); - -function _index() { - const data = require("./index"); - - _index = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function buildForge(forgeOptions, options) { - const appDir = forgeOptions.dir; - return (0, _index().build)(Object.assign({ - prepackaged: appDir, - config: { - directories: { - // https://github.com/electron-userland/electron-forge/blob/master/src/makers/generic/zip.js - output: path.resolve(appDir, "..", "make") - } - } - }, options)); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=forge-maker.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/forge-maker.js.map b/node_modules/app-builder-lib/out/forge-maker.js.map deleted file mode 100644 index 13310a8..0000000 --- a/node_modules/app-builder-lib/out/forge-maker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/forge-maker.ts"],"names":[],"mappings":";;;;;;;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAOM,SAAU,UAAV,CAAqB,YAArB,EAAiD,OAAjD,EAAyE;AAC7E,QAAM,MAAM,GAAG,YAAY,CAAC,GAA5B;AACA,SAAO,oBAAK,MAAA,CAAA,MAAA,CAAA;AACV,IAAA,WAAW,EAAE,MADH;AAEV,IAAA,MAAM,EAAE;AACN,MAAA,WAAW,EAAE;AACX;AACA,QAAA,MAAM,EAAE,IAAI,CAAC,OAAL,CAAa,MAAb,EAAqB,IAArB,EAA2B,MAA3B;AAFG;AADP;AAFE,GAAA,EAQP,OARO,CAAL,CAAP;AAUD,C","sourcesContent":["import * as path from \"path\"\nimport { build } from \"./index\"\nimport { PackagerOptions } from \"./packagerApi\"\n\nexport interface ForgeOptions {\n readonly dir: string\n}\n\nexport function buildForge(forgeOptions: ForgeOptions, options: PackagerOptions) {\n const appDir = forgeOptions.dir\n return build({\n prepackaged: appDir,\n config: {\n directories: {\n // https://github.com/electron-userland/electron-forge/blob/master/src/makers/generic/zip.js\n output: path.resolve(appDir, \"..\", \"make\"),\n },\n },\n ...options\n })\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/frameworks/LibUiFramework.d.ts b/node_modules/app-builder-lib/out/frameworks/LibUiFramework.d.ts deleted file mode 100644 index 22a99d6..0000000 --- a/node_modules/app-builder-lib/out/frameworks/LibUiFramework.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { AfterPackContext } from "../configuration"; -import { Platform } from "../core"; -import { Framework, PrepareApplicationStageDirectoryOptions } from "../Framework"; -export declare class LibUiFramework implements Framework { - readonly version: string; - readonly distMacOsAppName: string; - protected readonly isUseLaunchUi: boolean; - readonly name: string; - readonly macOsDefaultTargets: string[]; - readonly defaultAppIdPrefix: string; - readonly isCopyElevateHelper = false; - readonly isNpmRebuildRequired = false; - constructor(version: string, distMacOsAppName: string, isUseLaunchUi: boolean); - prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise; - private prepareMacosApplicationStageDirectory; - private prepareLinuxApplicationStageDirectory; - afterPack(context: AfterPackContext): Promise; - getMainFile(platform: Platform): string | null; - private isUseLaunchUiForPlatform; - getExcludedDependencies(platform: Platform): Array | null; -} diff --git a/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js b/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js deleted file mode 100644 index bd7de2f..0000000 --- a/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js +++ /dev/null @@ -1,183 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.LibUiFramework = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _plist() { - const data = require("plist"); - - _plist = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class LibUiFramework { - constructor(version, distMacOsAppName, isUseLaunchUi) { - this.version = version; - this.distMacOsAppName = distMacOsAppName; - this.isUseLaunchUi = isUseLaunchUi; - this.name = "libui"; // noinspection JSUnusedGlobalSymbols - - this.macOsDefaultTargets = ["dmg"]; - this.defaultAppIdPrefix = "com.libui."; // noinspection JSUnusedGlobalSymbols - - this.isCopyElevateHelper = false; // noinspection JSUnusedGlobalSymbols - - this.isNpmRebuildRequired = false; - } - - prepareApplicationStageDirectory(options) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - yield (0, _fsExtraP().emptyDir)(options.appOutDir); - const packager = options.packager; - const platform = packager.platform; - - if (_this.isUseLaunchUiForPlatform(platform)) { - const appOutDir = options.appOutDir; - yield (0, _builderUtil().executeAppBuilder)(["proton-native", "--node-version", _this.version, "--use-launch-ui", "--platform", platform.nodeName, "--arch", options.arch, "--stage", appOutDir, "--executable", `${packager.appInfo.productFilename}${platform === _core().Platform.WINDOWS ? ".exe" : ""}`]); - return; - } - - if (platform === _core().Platform.MAC) { - yield _this.prepareMacosApplicationStageDirectory(packager, options); - } else if (platform === _core().Platform.LINUX) { - yield _this.prepareLinuxApplicationStageDirectory(options); - } - })(); - } - - prepareMacosApplicationStageDirectory(packager, options) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appContentsDir = path.join(options.appOutDir, _this2.distMacOsAppName, "Contents"); - yield (0, _fsExtraP().ensureDir)(path.join(appContentsDir, "Resources")); - yield (0, _fsExtraP().ensureDir)(path.join(appContentsDir, "MacOS")); - yield (0, _builderUtil().executeAppBuilder)(["proton-native", "--node-version", _this2.version, "--platform", "darwin", "--stage", path.join(appContentsDir, "MacOS")]); - const appPlist = { - // https://github.com/albe-rosado/create-proton-app/issues/13 - NSHighResolutionCapable: true - }; - yield packager.applyCommonInfo(appPlist, appContentsDir); - yield Promise.all([(0, _fsExtraP().writeFile)(path.join(appContentsDir, "Info.plist"), (0, _plist().build)(appPlist)), writeExecutableMain(path.join(appContentsDir, "MacOS", appPlist.CFBundleExecutable), `#!/bin/sh - DIR=$(dirname "$0") - "$DIR/node" "$DIR/../Resources/app/${options.packager.info.metadata.main || "index.js"}" - `)]); - })(); - } - - prepareLinuxApplicationStageDirectory(options) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appOutDir = options.appOutDir; - yield (0, _builderUtil().executeAppBuilder)(["proton-native", "--node-version", _this3.version, "--platform", "linux", "--arch", options.arch, "--stage", appOutDir]); - const mainPath = path.join(appOutDir, options.packager.executableName); - yield writeExecutableMain(mainPath, `#!/bin/sh - DIR=$(dirname "$0") - "$DIR/node" "$DIR/app/${options.packager.info.metadata.main || "index.js"}" - `); - })(); - } - - afterPack(context) { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = context.packager; - - if (!_this4.isUseLaunchUiForPlatform(packager.platform)) { - return; - } // LaunchUI requires main.js, rename if need - - - const userMain = packager.info.metadata.main || "index.js"; - - if (userMain === "main.js") { - return; - } - - yield (0, _fsExtraP().rename)(path.join(context.appOutDir, "app", userMain), path.join(context.appOutDir, "app", "main.js")); - })(); - } - - getMainFile(platform) { - return this.isUseLaunchUiForPlatform(platform) ? "main.js" : null; - } - - isUseLaunchUiForPlatform(platform) { - return platform === _core().Platform.WINDOWS || this.isUseLaunchUi && platform === _core().Platform.LINUX; - } - - getExcludedDependencies(platform) { - // part of launchui - return this.isUseLaunchUiForPlatform(platform) ? ["libui-node"] : null; - } - -} - -exports.LibUiFramework = LibUiFramework; - -function writeExecutableMain(_x, _x2) { - return _writeExecutableMain.apply(this, arguments); -} function _writeExecutableMain() { - _writeExecutableMain = (0, _bluebirdLst().coroutine)(function* (file, content) { - yield (0, _fsExtraP().writeFile)(file, content, { - mode: 0o755 - }); - yield (0, _fsExtraP().chmod)(file, 0o755); - }); - return _writeExecutableMain.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=LibUiFramework.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js.map b/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js.map deleted file mode 100644 index 98a3c8b..0000000 --- a/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/frameworks/LibUiFramework.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAKM,MAAO,cAAP,CAAqB;AAazB,EAAA,WAAA,CAAqB,OAArB,EAA+C,gBAA/C,EAA4F,aAA5F,EAAkH;AAA7F,SAAA,OAAA,GAAA,OAAA;AAA0B,SAAA,gBAAA,GAAA,gBAAA;AAA6C,SAAA,aAAA,GAAA,aAAA;AAZnF,SAAA,IAAA,GAAe,OAAf,CAYyG,CAXlH;;AACS,SAAA,mBAAA,GAAsB,CAAC,KAAD,CAAtB;AAEA,SAAA,kBAAA,G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":["import { chmod, emptyDir, ensureDir, rename, writeFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { build as buildPlist } from \"plist\"\nimport { executeAppBuilder } from \"builder-util\"\nimport { AfterPackContext } from \"../configuration\"\nimport { Platform } from \"../core\"\nimport { Framework, PrepareApplicationStageDirectoryOptions } from \"../Framework\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport MacPackager from \"../macPackager\"\n\nexport class LibUiFramework implements Framework {\n readonly name: string = \"libui\"\n // noinspection JSUnusedGlobalSymbols\n readonly macOsDefaultTargets = [\"dmg\"]\n\n readonly defaultAppIdPrefix: string = \"com.libui.\"\n\n // noinspection JSUnusedGlobalSymbols\n readonly isCopyElevateHelper = false\n\n // noinspection JSUnusedGlobalSymbols\n readonly isNpmRebuildRequired = false\n\n constructor(readonly version: string, readonly distMacOsAppName: string, protected readonly isUseLaunchUi: boolean) {\n }\n\n async prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n await emptyDir(options.appOutDir)\n\n const packager = options.packager\n const platform = packager.platform\n\n if (this.isUseLaunchUiForPlatform(platform)) {\n const appOutDir = options.appOutDir\n await executeAppBuilder([\"proton-native\",\n \"--node-version\", this.version,\n \"--use-launch-ui\",\n \"--platform\", platform.nodeName,\n \"--arch\", options.arch,\n \"--stage\", appOutDir,\n \"--executable\", `${packager.appInfo.productFilename}${platform === Platform.WINDOWS ? \".exe\" : \"\"}`,\n ])\n return\n }\n\n if (platform === Platform.MAC) {\n await this.prepareMacosApplicationStageDirectory(packager as MacPackager, options)\n }\n else if (platform === Platform.LINUX) {\n await this.prepareLinuxApplicationStageDirectory(options)\n }\n }\n\n private async prepareMacosApplicationStageDirectory(packager: MacPackager, options: PrepareApplicationStageDirectoryOptions) {\n const appContentsDir = path.join(options.appOutDir, this.distMacOsAppName, \"Contents\")\n await ensureDir(path.join(appContentsDir, \"Resources\"))\n await ensureDir(path.join(appContentsDir, \"MacOS\"))\n await executeAppBuilder([\"proton-native\", \"--node-version\", this.version, \"--platform\", \"darwin\", \"--stage\", path.join(appContentsDir, \"MacOS\")])\n\n const appPlist: any = {\n // https://github.com/albe-rosado/create-proton-app/issues/13\n NSHighResolutionCapable: true,\n }\n await packager.applyCommonInfo(appPlist, appContentsDir)\n await Promise.all([\n writeFile(path.join(appContentsDir, \"Info.plist\"), buildPlist(appPlist)),\n writeExecutableMain(path.join(appContentsDir, \"MacOS\", appPlist.CFBundleExecutable), `#!/bin/sh\n DIR=$(dirname \"$0\")\n \"$DIR/node\" \"$DIR/../Resources/app/${options.packager.info.metadata.main || \"index.js\"}\"\n `),\n ])\n }\n\n private async prepareLinuxApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n const appOutDir = options.appOutDir\n await executeAppBuilder([\"proton-native\", \"--node-version\", this.version, \"--platform\", \"linux\", \"--arch\", options.arch, \"--stage\", appOutDir])\n const mainPath = path.join(appOutDir, (options.packager as LinuxPackager).executableName)\n await writeExecutableMain(mainPath, `#!/bin/sh\n DIR=$(dirname \"$0\")\n \"$DIR/node\" \"$DIR/app/${options.packager.info.metadata.main || \"index.js\"}\"\n `)\n }\n\n async afterPack(context: AfterPackContext) {\n const packager = context.packager\n if (!this.isUseLaunchUiForPlatform(packager.platform)) {\n return\n }\n\n // LaunchUI requires main.js, rename if need\n const userMain = packager.info.metadata.main || \"index.js\"\n if (userMain === \"main.js\") {\n return\n }\n\n await rename(path.join(context.appOutDir, \"app\", userMain), path.join(context.appOutDir, \"app\", \"main.js\"))\n }\n\n getMainFile(platform: Platform): string | null {\n return this.isUseLaunchUiForPlatform(platform) ? \"main.js\" : null\n }\n\n private isUseLaunchUiForPlatform(platform: Platform) {\n return platform === Platform.WINDOWS || (this.isUseLaunchUi && platform === Platform.LINUX)\n }\n\n getExcludedDependencies(platform: Platform): Array | null {\n // part of launchui\n return this.isUseLaunchUiForPlatform(platform) ? [\"libui-node\"] : null\n }\n}\n\nasync function writeExecutableMain(file: string, content: string) {\n await writeFile(file, content, {mode: 0o755})\n await chmod(file, 0o755)\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/index.d.ts b/node_modules/app-builder-lib/out/index.d.ts deleted file mode 100644 index f571d8f..0000000 --- a/node_modules/app-builder-lib/out/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { PublishOptions } from "electron-publish/out/publisher"; -import { Packager } from "./packager"; -import { PackagerOptions } from "./packagerApi"; -export { Packager, BuildResult } from "./packager"; -export { PackagerOptions, ArtifactCreated, ArtifactBuildStarted } from "./packagerApi"; -export { TargetConfiguration, Platform, Target, DIR_TARGET, BeforeBuildContext, SourceRepositoryInfo, TargetSpecificOptions, TargetConfigType, DEFAULT_TARGET, CompressionLevel } from "./core"; -export { getArchSuffix, Arch, archFromString } from "builder-util"; -export { Configuration, AfterPackContext, MetadataDirectories } from "./configuration"; -export { ElectronDownloadOptions, ElectronPlatformName } from "./electron/ElectronFramework"; -export { PlatformSpecificBuildOptions, AsarOptions, FileSet, Protocol, ReleaseInfo } from "./options/PlatformSpecificBuildOptions"; -export { FileAssociation } from "./options/FileAssociation"; -export { MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, DmgContent, DmgWindow } from "./options/macOptions"; -export { PkgOptions, PkgBackgroundOptions, BackgroundAlignment, BackgroundScaling } from "./options/pkgOptions"; -export { WindowsConfiguration } from "./options/winOptions"; -export { AppXOptions } from "./options/AppXOptions"; -export { MsiOptions } from "./options/MsiOptions"; -export { CommonWindowsInstallerConfiguration } from "./options/CommonWindowsInstallerConfiguration"; -export { NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions } from "./targets/nsis/nsisOptions"; -export { LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions } from "./options/linuxOptions"; -export { SnapOptions } from "./options/SnapOptions"; -export { Metadata, AuthorMetadata, RepositoryInfo } from "./options/metadata"; -export { AppInfo } from "./appInfo"; -export { SquirrelWindowsOptions } from "./options/SquirrelWindowsOptions"; -export { WindowsSignOptions, CustomWindowsSignTaskConfiguration, WindowsSignTaskConfiguration, CustomWindowsSign, FileCodeSigningInfo, CertificateFromStoreInfo } from "./codeSign/windowsCodeSign"; -export { CancellationToken, ProgressInfo } from "builder-util-runtime"; -export { PublishOptions, UploadTask } from "electron-publish"; -export { PublishManager } from "./publish/PublishManager"; -export { PlatformPackager } from "./platformPackager"; -export { Framework, PrepareApplicationStageDirectoryOptions } from "./Framework"; -export { buildForge, ForgeOptions } from "./forge-maker"; -export declare function checkBuildRequestOptions(options: PackagerOptions & PublishOptions): void; -export declare function build(options: PackagerOptions & PublishOptions, packager?: Packager): Promise>; diff --git a/node_modules/app-builder-lib/out/index.js b/node_modules/app-builder-lib/out/index.js deleted file mode 100644 index 2fab255..0000000 --- a/node_modules/app-builder-lib/out/index.js +++ /dev/null @@ -1,261 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.checkBuildRequestOptions = checkBuildRequestOptions; -exports.build = build; -Object.defineProperty(exports, "getArchSuffix", { - enumerable: true, - get: function () { - return _builderUtil().getArchSuffix; - } -}); -Object.defineProperty(exports, "Arch", { - enumerable: true, - get: function () { - return _builderUtil().Arch; - } -}); -Object.defineProperty(exports, "archFromString", { - enumerable: true, - get: function () { - return _builderUtil().archFromString; - } -}); -Object.defineProperty(exports, "CancellationToken", { - enumerable: true, - get: function () { - return _builderUtilRuntime().CancellationToken; - } -}); -Object.defineProperty(exports, "Packager", { - enumerable: true, - get: function () { - return _packager().Packager; - } -}); -Object.defineProperty(exports, "PlatformPackager", { - enumerable: true, - get: function () { - return _platformPackager().PlatformPackager; - } -}); -Object.defineProperty(exports, "PublishManager", { - enumerable: true, - get: function () { - return _PublishManager().PublishManager; - } -}); -Object.defineProperty(exports, "Platform", { - enumerable: true, - get: function () { - return _core().Platform; - } -}); -Object.defineProperty(exports, "Target", { - enumerable: true, - get: function () { - return _core().Target; - } -}); -Object.defineProperty(exports, "DIR_TARGET", { - enumerable: true, - get: function () { - return _core().DIR_TARGET; - } -}); -Object.defineProperty(exports, "DEFAULT_TARGET", { - enumerable: true, - get: function () { - return _core().DEFAULT_TARGET; - } -}); -Object.defineProperty(exports, "AppInfo", { - enumerable: true, - get: function () { - return _appInfo().AppInfo; - } -}); -Object.defineProperty(exports, "buildForge", { - enumerable: true, - get: function () { - return _forgeMaker().buildForge; - } -}); - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _packager() { - const data = require("./packager"); - - _packager = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("./platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _PublishManager() { - const data = require("./publish/PublishManager"); - - _PublishManager = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("./core"); - - _core = function () { - return data; - }; - - return data; -} - -function _appInfo() { - const data = require("./appInfo"); - - _appInfo = function () { - return data; - }; - - return data; -} - -function _forgeMaker() { - const data = require("./forge-maker"); - - _forgeMaker = function () { - return data; - }; - - return data; -} - -const expectedOptions = new Set(["publish", "targets", "mac", "win", "linux", "projectDir", "platformPackagerFactory", "config", "effectiveOptionComputed", "prepackaged"]); - -function checkBuildRequestOptions(options) { - for (const optionName of Object.keys(options)) { - if (!expectedOptions.has(optionName) && options[optionName] !== undefined) { - throw new (_builderUtil().InvalidConfigurationError)(`Unknown option "${optionName}"`); - } - } -} - -function build(options, packager = new (_packager().Packager)(options)) { - checkBuildRequestOptions(options); - const publishManager = new (_PublishManager().PublishManager)(packager, options); - - const sigIntHandler = () => { - _builderUtil().log.warn("cancelled by SIGINT"); - - packager.cancellationToken.cancel(); - publishManager.cancelTasks(); - }; - - process.once("SIGINT", sigIntHandler); - const promise = packager.build().then( - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (buildResult) { - const afterAllArtifactBuild = (0, _platformPackager().resolveFunction)(buildResult.configuration.afterAllArtifactBuild, "afterAllArtifactBuild"); - - if (afterAllArtifactBuild != null) { - const newArtifacts = (0, _builderUtilRuntime().asArray)((yield Promise.resolve(afterAllArtifactBuild(buildResult)))); - - if (newArtifacts.length === 0 || !publishManager.isPublish) { - return buildResult.artifactPaths; - } - - const publishConfigurations = yield publishManager.getGlobalPublishConfigurations(); - - if (publishConfigurations == null || publishConfigurations.length === 0) { - return buildResult.artifactPaths; - } - - for (const newArtifact of newArtifacts) { - buildResult.artifactPaths.push(newArtifact); - - for (const publishConfiguration of publishConfigurations) { - publishManager.scheduleUpload(publishConfiguration, { - file: newArtifact, - arch: null - }, packager.appInfo); - } - } - } - - return buildResult.artifactPaths; - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); - return (0, _promise().executeFinally)(promise, isErrorOccurred => { - let promise; - - if (isErrorOccurred) { - publishManager.cancelTasks(); - promise = Promise.resolve(null); - } else { - promise = publishManager.awaitTasks(); - } - - return promise.then(() => process.removeListener("SIGINT", sigIntHandler)); - }); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/index.js.map b/node_modules/app-builder-lib/out/index.js.map deleted file mode 100644 index aec540b..0000000 --- a/node_modules/app-builder-lib/out/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA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;AAED,WAAO,OAAO,CACX,IADI,CACC,MAAM,OAAO,CAAC,cAAR,CAAuB,QAAvB,EAAiC,aAAjC,CADP,CAAP;AAED,GAZM,CAAP;AAaD,C","sourcesContent":["import { executeFinally } from \"builder-util/out/promise\"\nimport { PublishOptions } from \"electron-publish/out/publisher\"\nimport { log, InvalidConfigurationError } from \"builder-util\"\nimport { asArray } from \"builder-util-runtime\"\nimport { Packager } from \"./packager\"\nimport { PackagerOptions } from \"./packagerApi\"\nimport { resolveFunction } from \"./platformPackager\"\nimport { PublishManager } from \"./publish/PublishManager\"\n\nexport { Packager, BuildResult } from \"./packager\"\nexport { PackagerOptions, ArtifactCreated, ArtifactBuildStarted } from \"./packagerApi\"\nexport { TargetConfiguration, Platform, Target, DIR_TARGET, BeforeBuildContext, SourceRepositoryInfo, TargetSpecificOptions, TargetConfigType, DEFAULT_TARGET, CompressionLevel } from \"./core\"\nexport { getArchSuffix, Arch, archFromString } from \"builder-util\"\nexport { Configuration, AfterPackContext, MetadataDirectories } from \"./configuration\"\nexport { ElectronDownloadOptions, ElectronPlatformName } from \"./electron/ElectronFramework\"\nexport { PlatformSpecificBuildOptions, AsarOptions, FileSet, Protocol, ReleaseInfo } from \"./options/PlatformSpecificBuildOptions\"\nexport { FileAssociation } from \"./options/FileAssociation\"\nexport { MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, DmgContent, DmgWindow } from \"./options/macOptions\"\nexport { PkgOptions, PkgBackgroundOptions, BackgroundAlignment, BackgroundScaling } from \"./options/pkgOptions\"\nexport { WindowsConfiguration } from \"./options/winOptions\"\nexport { AppXOptions } from \"./options/AppXOptions\"\nexport { MsiOptions } from \"./options/MsiOptions\"\nexport { CommonWindowsInstallerConfiguration } from \"./options/CommonWindowsInstallerConfiguration\"\nexport { NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions } from \"./targets/nsis/nsisOptions\"\nexport { LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions } from \"./options/linuxOptions\"\nexport { SnapOptions } from \"./options/SnapOptions\"\nexport { Metadata, AuthorMetadata, RepositoryInfo } from \"./options/metadata\"\nexport { AppInfo } from \"./appInfo\"\nexport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nexport { WindowsSignOptions, CustomWindowsSignTaskConfiguration, WindowsSignTaskConfiguration, CustomWindowsSign, FileCodeSigningInfo, CertificateFromStoreInfo } from \"./codeSign/windowsCodeSign\"\nexport { CancellationToken, ProgressInfo } from \"builder-util-runtime\"\nexport { PublishOptions, UploadTask } from \"electron-publish\"\nexport { PublishManager } from \"./publish/PublishManager\"\nexport { PlatformPackager } from \"./platformPackager\"\nexport { Framework, PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nexport { buildForge, ForgeOptions } from \"./forge-maker\"\n\nconst expectedOptions = new Set([\"publish\", \"targets\", \"mac\", \"win\", \"linux\", \"projectDir\", \"platformPackagerFactory\", \"config\", \"effectiveOptionComputed\", \"prepackaged\"])\n\nexport function checkBuildRequestOptions(options: PackagerOptions & PublishOptions) {\n for (const optionName of Object.keys(options)) {\n if (!expectedOptions.has(optionName) && (options as any)[optionName] !== undefined) {\n throw new InvalidConfigurationError(`Unknown option \"${optionName}\"`)\n }\n }\n}\n\nexport function build(options: PackagerOptions & PublishOptions, packager: Packager = new Packager(options)): Promise> {\n checkBuildRequestOptions(options)\n\n const publishManager = new PublishManager(packager, options)\n const sigIntHandler = () => {\n log.warn(\"cancelled by SIGINT\")\n packager.cancellationToken.cancel()\n publishManager.cancelTasks()\n }\n process.once(\"SIGINT\", sigIntHandler)\n\n const promise = packager.build()\n .then(async buildResult => {\n const afterAllArtifactBuild = resolveFunction(buildResult.configuration.afterAllArtifactBuild, \"afterAllArtifactBuild\")\n if (afterAllArtifactBuild != null) {\n const newArtifacts = asArray(await Promise.resolve(afterAllArtifactBuild(buildResult)))\n if (newArtifacts.length === 0 || !publishManager.isPublish) {\n return buildResult.artifactPaths\n }\n\n const publishConfigurations = await publishManager.getGlobalPublishConfigurations()\n if (publishConfigurations == null || publishConfigurations.length === 0) {\n return buildResult.artifactPaths\n }\n\n for (const newArtifact of newArtifacts) {\n buildResult.artifactPaths.push(newArtifact)\n for (const publishConfiguration of publishConfigurations) {\n publishManager.scheduleUpload(publishConfiguration, {\n file: newArtifact,\n arch: null\n }, packager.appInfo)\n }\n }\n }\n return buildResult.artifactPaths\n })\n\n return executeFinally(promise, isErrorOccurred => {\n let promise: Promise\n if (isErrorOccurred) {\n publishManager.cancelTasks()\n promise = Promise.resolve(null)\n }\n else {\n promise = publishManager.awaitTasks()\n }\n\n return promise\n .then(() => process.removeListener(\"SIGINT\", sigIntHandler))\n })\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/linuxPackager.d.ts b/node_modules/app-builder-lib/out/linuxPackager.d.ts deleted file mode 100644 index 74aa026..0000000 --- a/node_modules/app-builder-lib/out/linuxPackager.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Arch } from "builder-util"; -import { Target } from "./core"; -import { LinuxConfiguration } from "./options/linuxOptions"; -import { Packager } from "./packager"; -import { PlatformPackager } from "./platformPackager"; -export declare class LinuxPackager extends PlatformPackager { - readonly executableName: string; - constructor(info: Packager); - readonly defaultTarget: Array; - createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void; -} -export declare function toAppImageOrSnapArch(arch: Arch): string; diff --git a/node_modules/app-builder-lib/out/linuxPackager.js b/node_modules/app-builder-lib/out/linuxPackager.js deleted file mode 100644 index 2856511..0000000 --- a/node_modules/app-builder-lib/out/linuxPackager.js +++ /dev/null @@ -1,236 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.toAppImageOrSnapArch = toAppImageOrSnapArch; -exports.LinuxPackager = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _sanitizeFilename() { - const data = _interopRequireDefault(require("sanitize-filename")); - - _sanitizeFilename = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("./core"); - - _core = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("./platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _RemoteBuilder() { - const data = require("./remoteBuilder/RemoteBuilder"); - - _RemoteBuilder = function () { - return data; - }; - - return data; -} - -function _LinuxTargetHelper() { - const data = require("./targets/LinuxTargetHelper"); - - _LinuxTargetHelper = function () { - return data; - }; - - return data; -} - -function _targetFactory() { - const data = require("./targets/targetFactory"); - - _targetFactory = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -class LinuxPackager extends _platformPackager().PlatformPackager { - constructor(info) { - super(info, _core().Platform.LINUX); - const executableName = this.platformSpecificBuildOptions.executableName; - this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : (0, _sanitizeFilename().default)(executableName); - } - - get defaultTarget() { - return ["snap", "appimage"]; - } - - createTargets(targets, mapper) { - let helper; - - const getHelper = () => { - if (helper == null) { - helper = new (_LinuxTargetHelper().LinuxTargetHelper)(this); - } - - return helper; - }; - - let remoteBuilder = null; - - for (const name of targets) { - if (name === _core().DIR_TARGET) { - continue; - } - - const targetClass = (() => { - switch (name) { - case "appimage": - return require("./targets/AppImageTarget").default; - - case "snap": - return require("./targets/snap").default; - - case "deb": - case "rpm": - case "sh": - case "freebsd": - case "pacman": - case "apk": - case "p5p": - return require("./targets/fpm").default; - - default: - return null; - } - })(); - - mapper(name, outDir => { - if (targetClass === null) { - return (0, _targetFactory().createCommonTarget)(name, outDir, this); - } - - const target = new targetClass(name, this, getHelper(), outDir); - - if (process.platform === "win32" || process.env._REMOTE_BUILD) { - if (remoteBuilder == null) { - remoteBuilder = new (_RemoteBuilder().RemoteBuilder)(this); - } // return remoteBuilder.buildTarget(this, arch, appOutDir, this.packager) - - - return new RemoteTarget(target, remoteBuilder); - } - - return target; - }); - } - } - -} - -exports.LinuxPackager = LinuxPackager; - -class RemoteTarget extends _core().Target { - constructor(target, remoteBuilder) { - super(target.name, true - /* all must be scheduled in time (so, on finishBuild RemoteBuilder will have all targets added - so, we must set isAsyncSupported to true (resolved promise is returned)) */ - ); - this.target = target; - this.remoteBuilder = remoteBuilder; - this.buildTaskManager = new (_builderUtil().AsyncTaskManager)(this.remoteBuilder.packager.info.cancellationToken); - } - - get options() { - return this.target.options; - } - - get outDir() { - return this.target.outDir; - } - - finishBuild() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - yield _this.buildTaskManager.awaitTasks(); - yield _this.remoteBuilder.build(); - })(); - } - - build(appOutDir, arch) { - const promise = this.doBuild(appOutDir, arch); - this.buildTaskManager.addTask(promise); - return promise; - } - - doBuild(appOutDir, arch) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - _builderUtil().log.info({ - target: _this2.target.name, - arch: _builderUtil().Arch[arch] - }, "scheduling remote build"); - - yield _this2.target.checkOptions(); - - _this2.remoteBuilder.scheduleBuild(_this2.target, arch, appOutDir); - })(); - } - -} - -function toAppImageOrSnapArch(arch) { - switch (arch) { - case _builderUtil().Arch.x64: - return "x86_64"; - - case _builderUtil().Arch.ia32: - return "i386"; - - case _builderUtil().Arch.armv7l: - return "arm"; - - case _builderUtil().Arch.arm64: - return "arm_aarch64"; - - default: - throw new Error(`Unsupported arch ${arch}`); - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=linuxPackager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/linuxPackager.js.map b/node_modules/app-builder-lib/out/linuxPackager.js.map deleted file mode 100644 index 2498271..0000000 --- a/node_modules/app-builder-lib/out/linuxPackager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/linuxPackager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA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,MAAL,CAAY,MAAnB;AACD;;AAMK,EAAA,WAAN,GAAiB;AAAA;;AAAA;AACf,YAAM,KAAI,CAAC,gBAAL,CAAsB,UAAtB,EAAN;AACA,YAAM,KAAI,CAAC,aAAL,CAAmB,KAAnB,EAAN;AAFe;AAGhB;;AAED,EAAA,KAAK,CAAC,SAAD,EAAoB,IAApB,EAA8B;AACjC,UAAM,OAAO,GAAG,KAAK,OAAL,CAAa,SAAb,EAAwB,IAAxB,CAAhB;AACA,SAAK,gBAAL,CAAsB,OAAtB,CAA8B,OAA9B;AACA,WAAO,OAAP;AACD;;AAEa,EAAA,OAAN,CAAc,SAAd,EAAiC,IAAjC,EAA2C;AAAA;;AAAA;AACjD,yBAAI,IAAJ,CAAS;AAAC,QAAA,MAAM,EAAE,MAAI,CAAC,MAAL,CAAY,IAArB;AAA2B,QAAA,IAAI,EAAE,oBAAK,IAAL;AAAjC,OAAT,EAAuD,yBAAvD;;AACA,YAAM,MAAI,CAAC,MAAL,CAAY,YAAZ,EAAN;;AACA,MAAA,MAAI,CAAC,aAAL,CAAmB,aAAnB,CAAiC,MAAI,CAAC,MAAtC,EAA8C,IAA9C,EAAoD,SAApD;AAHiD;AAIlD;;AA9B8B;;AAiC3B,SAAU,oBAAV,CAA+B,IAA/B,EAAyC;AAC7C,UAAQ,IAAR;AACE,SAAK,oBAAK,GAAV;AACE,aAAO,QAAP;;AACF,SAAK,oBAAK,IAAV;AACE,aAAO,MAAP;;AACF,SAAK,oBAAK,MAAV;AACE,aAAO,KAAP;;AACF,SAAK,oBAAK,KAAV;AACE,aAAO,aAAP;;AAEF;AACE,YAAM,IAAI,KAAJ,CAAU,oBAAoB,IAAI,EAAlC,CAAN;AAXJ;AAaD,C","sourcesContent":["import { Arch, AsyncTaskManager, log } from \"builder-util\"\nimport sanitizeFileName from \"sanitize-filename\"\nimport { DIR_TARGET, Platform, Target, TargetSpecificOptions } from \"./core\"\nimport { LinuxConfiguration } from \"./options/linuxOptions\"\nimport { Packager } from \"./packager\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { RemoteBuilder } from \"./remoteBuilder/RemoteBuilder\"\nimport AppImageTarget from \"./targets/AppImageTarget\"\nimport FpmTarget from \"./targets/fpm\"\nimport { LinuxTargetHelper } from \"./targets/LinuxTargetHelper\"\nimport SnapTarget from \"./targets/snap\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\n\nexport class LinuxPackager extends PlatformPackager {\n readonly executableName: string\n\n constructor(info: Packager) {\n super(info, Platform.LINUX)\n\n const executableName = this.platformSpecificBuildOptions.executableName\n this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : sanitizeFileName(executableName)\n }\n\n get defaultTarget(): Array {\n return [\"snap\", \"appimage\"]\n }\n\n createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let helper: LinuxTargetHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new LinuxTargetHelper(this)\n }\n return helper\n }\n\n let remoteBuilder: RemoteBuilder | null = null\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n const targetClass: typeof AppImageTarget | typeof SnapTarget | typeof FpmTarget | null = (() => {\n switch (name) {\n case \"appimage\":\n return require(\"./targets/AppImageTarget\").default\n case \"snap\":\n return require(\"./targets/snap\").default\n case \"deb\":\n case \"rpm\":\n case \"sh\":\n case \"freebsd\":\n case \"pacman\":\n case \"apk\":\n case \"p5p\":\n return require(\"./targets/fpm\").default\n default:\n return null\n }\n })()\n\n mapper(name, outDir => {\n if (targetClass === null) {\n return createCommonTarget(name, outDir, this)\n }\n\n const target = new targetClass(name, this, getHelper(), outDir)\n if (process.platform === \"win32\" || process.env._REMOTE_BUILD) {\n if (remoteBuilder == null) {\n remoteBuilder = new RemoteBuilder(this)\n }\n // return remoteBuilder.buildTarget(this, arch, appOutDir, this.packager)\n return new RemoteTarget(target, remoteBuilder)\n }\n return target\n })\n }\n }\n}\n\nclass RemoteTarget extends Target {\n private buildTaskManager = new AsyncTaskManager(this.remoteBuilder.packager.info.cancellationToken)\n\n get options(): TargetSpecificOptions | null | undefined {\n return this.target.options\n }\n\n get outDir(): string {\n return this.target.outDir\n }\n\n constructor(private readonly target: Target, private readonly remoteBuilder: RemoteBuilder) {\n super(target.name, true /* all must be scheduled in time (so, on finishBuild RemoteBuilder will have all targets added - so, we must set isAsyncSupported to true (resolved promise is returned)) */)\n }\n\n async finishBuild() {\n await this.buildTaskManager.awaitTasks()\n await this.remoteBuilder.build()\n }\n\n build(appOutDir: string, arch: Arch) {\n const promise = this.doBuild(appOutDir, arch)\n this.buildTaskManager.addTask(promise)\n return promise\n }\n\n private async doBuild(appOutDir: string, arch: Arch) {\n log.info({target: this.target.name, arch: Arch[arch]}, \"scheduling remote build\")\n await this.target.checkOptions()\n this.remoteBuilder.scheduleBuild(this.target, arch, appOutDir)\n }\n}\n\nexport function toAppImageOrSnapArch(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64\"\n case Arch.ia32:\n return \"i386\"\n case Arch.armv7l:\n return \"arm\"\n case Arch.arm64:\n return \"arm_aarch64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/macPackager.d.ts b/node_modules/app-builder-lib/out/macPackager.d.ts deleted file mode 100644 index 250aa3f..0000000 --- a/node_modules/app-builder-lib/out/macPackager.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Arch, AsyncTaskManager } from "builder-util"; -import { SignOptions } from "electron-osx-sign"; -import { Lazy } from "lazy-val"; -import { AppInfo } from "./appInfo"; -import { CodeSigningInfo, Identity } from "./codeSign/macCodeSign"; -import { Target } from "./core"; -import { MacConfiguration } from "./options/macOptions"; -import { Packager } from "./packager"; -import { PlatformPackager } from "./platformPackager"; -export default class MacPackager extends PlatformPackager { - readonly codeSigningInfo: Lazy; - private _iconPath; - constructor(info: Packager); - readonly defaultTarget: Array; - protected prepareAppInfo(appInfo: AppInfo): AppInfo; - getIconPath(): Promise; - createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void; - pack(outDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): Promise; - private sign; - private adjustSignOptions; - protected doSign(opts: SignOptions): Promise; - protected doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | null | undefined): Promise; - getElectronSrcDir(dist: string): string; - getElectronDestinationDir(appOutDir: string): string; - applyCommonInfo(appPlist: any, contentsPath: string): Promise; -} diff --git a/node_modules/app-builder-lib/out/macPackager.js b/node_modules/app-builder-lib/out/macPackager.js deleted file mode 100644 index f19af72..0000000 --- a/node_modules/app-builder-lib/out/macPackager.js +++ /dev/null @@ -1,481 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _electronOsxSign() { - const data = require("electron-osx-sign"); - - _electronOsxSign = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _appInfo() { - const data = require("./appInfo"); - - _appInfo = function () { - return data; - }; - - return data; -} - -function _macCodeSign() { - const data = require("./codeSign/macCodeSign"); - - _macCodeSign = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("./core"); - - _core = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("./platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _ArchiveTarget() { - const data = require("./targets/ArchiveTarget"); - - _ArchiveTarget = function () { - return data; - }; - - return data; -} - -function _pkg() { - const data = require("./targets/pkg"); - - _pkg = function () { - return data; - }; - - return data; -} - -function _targetFactory() { - const data = require("./targets/targetFactory"); - - _targetFactory = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class MacPackager extends _platformPackager().PlatformPackager { - constructor(info) { - super(info, _core().Platform.MAC); - this.codeSigningInfo = new (_lazyVal().Lazy)(() => { - const cscLink = this.getCscLink(); - - if (cscLink == null || process.platform !== "darwin") { - return Promise.resolve({ - keychainName: process.env.CSC_KEYCHAIN || null - }); - } - - return (0, _macCodeSign().createKeychain)({ - tmpDir: this.info.tempDirManager, - cscLink, - cscKeyPassword: this.getCscPassword(), - cscILink: (0, _platformPackager().chooseNotNull)(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK), - cscIKeyPassword: (0, _platformPackager().chooseNotNull)(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD), - currentDir: this.projectDir - }); - }); - this._iconPath = new (_lazyVal().Lazy)(() => this.getOrConvertIcon("icns")); - } - - get defaultTarget() { - return this.info.framework.macOsDefaultTargets; - } - - prepareAppInfo(appInfo) { - return new (_appInfo().AppInfo)(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions); - } - - getIconPath() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - return _this._iconPath.value; - })(); - } - - createTargets(targets, mapper) { - for (const name of targets) { - switch (name) { - case _core().DIR_TARGET: - break; - - case "dmg": - const { - DmgTarget - } = require("dmg-builder"); - - mapper(name, outDir => new DmgTarget(this, outDir)); - break; - - case "zip": - // https://github.com/electron-userland/electron-builder/issues/2313 - mapper(name, outDir => new (_ArchiveTarget().ArchiveTarget)(name, outDir, this, true)); - break; - - case "pkg": - mapper(name, outDir => new (_pkg().PkgTarget)(this, outDir)); - break; - - default: - mapper(name, outDir => name === "mas" || name === "mas-dev" ? new (_targetFactory().NoOpTarget)(name) : (0, _targetFactory().createCommonTarget)(name, outDir, this)); - break; - } - } - } - - pack(outDir, arch, targets, taskManager) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - let nonMasPromise = null; - const hasMas = targets.length !== 0 && targets.some(it => it.name === "mas" || it.name === "mas-dev"); - const prepackaged = _this2.packagerOptions.prepackaged; - - if (!hasMas || targets.length > 1) { - const appPath = prepackaged == null ? path.join(_this2.computeAppOutDir(outDir, arch), `${_this2.appInfo.productFilename}.app`) : prepackaged; - nonMasPromise = (prepackaged ? Promise.resolve() : _this2.doPack(outDir, path.dirname(appPath), _this2.platform.nodeName, arch, _this2.platformSpecificBuildOptions, targets)).then(() => _this2.sign(appPath, null, null)).then(() => _this2.packageInDistributableFormat(appPath, _builderUtil().Arch.x64, targets, taskManager)); - } - - for (const target of targets) { - const targetName = target.name; - - if (!(targetName === "mas" || targetName === "mas-dev")) { - continue; - } - - const masBuildOptions = (0, _builderUtil().deepAssign)({}, _this2.platformSpecificBuildOptions, _this2.config.mas); - - if (targetName === "mas-dev") { - (0, _builderUtil().deepAssign)(masBuildOptions, _this2.config[targetName], { - type: "development" - }); - } - - const targetOutDir = path.join(outDir, targetName); - - if (prepackaged == null) { - yield _this2.doPack(outDir, targetOutDir, "mas", arch, masBuildOptions, [target]); - yield _this2.sign(path.join(targetOutDir, `${_this2.appInfo.productFilename}.app`), targetOutDir, masBuildOptions); - } else { - yield _this2.sign(prepackaged, targetOutDir, masBuildOptions); - } - } - - if (nonMasPromise != null) { - yield nonMasPromise; - } - })(); - } - - sign(appPath, outDir, masOptions) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (!(0, _macCodeSign().isSignAllowed)()) { - return; - } - - const isMas = masOptions != null; - const macOptions = _this3.platformSpecificBuildOptions; - const qualifier = (isMas ? masOptions.identity : null) || macOptions.identity; - - if (!isMas && qualifier === null) { - if (_this3.forceCodeSigning) { - throw new (_builderUtil().InvalidConfigurationError)("identity explicitly is set to null, but forceCodeSigning is set to true"); - } - - _builderUtil().log.info({ - reason: "identity explicitly is set to null" - }, "skipped macOS code signing"); - - return; - } - - const keychainName = (yield _this3.codeSigningInfo.value).keychainName; - const explicitType = isMas ? masOptions.type : macOptions.type; - const type = explicitType || "distribution"; - const isDevelopment = type === "development"; - const certificateType = getCertificateType(isMas, isDevelopment); - let identity = yield (0, _macCodeSign().findIdentity)(certificateType, qualifier, keychainName); - - if (identity == null) { - if (!isMas && !isDevelopment && explicitType !== "distribution") { - identity = yield (0, _macCodeSign().findIdentity)("Mac Developer", qualifier, keychainName); - - if (identity != null) { - _builderUtil().log.warn("Mac Developer is used to sign app — it is only for development and testing, not for production"); - } - } - - if (identity == null) { - yield (0, _macCodeSign().reportError)(isMas, certificateType, qualifier, keychainName, _this3.forceCodeSigning); - return; - } - } - - const signOptions = { - "identity-validation": false, - // https://github.com/electron-userland/electron-builder/issues/1699 - // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext. - ignore: file => { - return file.endsWith(".kext") || file.startsWith("/Contents/PlugIns", appPath.length) || // https://github.com/electron-userland/electron-builder/issues/2010 - file.includes("/node_modules/puppeteer/.local-chromium"); - }, - identity: identity, - type, - platform: isMas ? "mas" : "darwin", - version: _this3.config.electronVersion, - app: appPath, - keychain: keychainName || undefined, - binaries: (isMas && masOptions != null ? masOptions.binaries : macOptions.binaries) || undefined, - requirements: isMas || macOptions.requirements == null ? undefined : yield _this3.getResource(macOptions.requirements), - "gatekeeper-assess": _macCodeSign().appleCertificatePrefixes.find(it => identity.name.startsWith(it)) != null - }; - yield _this3.adjustSignOptions(signOptions, masOptions); - - _builderUtil().log.info({ - file: _builderUtil().log.filePath(appPath), - identityName: identity.name, - identityHash: identity.hash, - provisioningProfile: signOptions["provisioning-profile"] || "none" - }, "signing"); - - yield _this3.doSign(signOptions); // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209 - - if (masOptions != null && !isDevelopment) { - const certType = isDevelopment ? "Mac Developer" : "3rd Party Mac Developer Installer"; - const masInstallerIdentity = yield (0, _macCodeSign().findIdentity)(certType, masOptions.identity, keychainName); - - if (masInstallerIdentity == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Cannot find valid "${certType}" identity to sign MAS installer, please see https://electron.build/code-signing`); - } // mas uploaded to AppStore, so, use "-" instead of space for name - - - const artifactName = _this3.expandArtifactNamePattern(masOptions, "pkg"); - - const artifactPath = path.join(outDir, artifactName); - yield _this3.doFlat(appPath, artifactPath, masInstallerIdentity, keychainName); - yield _this3.dispatchArtifactCreated(artifactPath, null, _builderUtil().Arch.x64, _this3.computeSafeArtifactName(artifactName, "pkg")); - } - })(); - } - - adjustSignOptions(signOptions, masOptions) { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const resourceList = yield _this4.resourceList; - - if (resourceList.includes(`entitlements.osx.plist`)) { - throw new (_builderUtil().InvalidConfigurationError)("entitlements.osx.plist is deprecated name, please use entitlements.mac.plist"); - } - - if (resourceList.includes(`entitlements.osx.inherit.plist`)) { - throw new (_builderUtil().InvalidConfigurationError)("entitlements.osx.inherit.plist is deprecated name, please use entitlements.mac.inherit.plist"); - } - - const customSignOptions = masOptions || _this4.platformSpecificBuildOptions; - const entitlementsSuffix = masOptions == null ? "mac" : "mas"; - - if (customSignOptions.entitlements == null) { - const p = `entitlements.${entitlementsSuffix}.plist`; - - if (resourceList.includes(p)) { - signOptions.entitlements = path.join(_this4.info.buildResourcesDir, p); - } - } else { - signOptions.entitlements = customSignOptions.entitlements; - } - - if (customSignOptions.entitlementsInherit == null) { - const p = `entitlements.${entitlementsSuffix}.inherit.plist`; - - if (resourceList.includes(p)) { - signOptions["entitlements-inherit"] = path.join(_this4.info.buildResourcesDir, p); - } - } else { - signOptions["entitlements-inherit"] = customSignOptions.entitlementsInherit; - } - - if (customSignOptions.provisioningProfile != null) { - signOptions["provisioning-profile"] = customSignOptions.provisioningProfile; - } - })(); - } //noinspection JSMethodCanBeStatic - - - doSign(opts) { - return (0, _bluebirdLst().coroutine)(function* () { - return (0, _electronOsxSign().signAsync)(opts); - })(); - } //noinspection JSMethodCanBeStatic - - - doFlat(appPath, outFile, identity, keychain) { - return (0, _bluebirdLst().coroutine)(function* () { - // productbuild doesn't created directory for out file - yield (0, _fsExtraP().ensureDir)(path.dirname(outFile)); - const args = (0, _pkg().prepareProductBuildArgs)(identity, keychain); - args.push("--component", appPath, "/Applications"); - args.push(outFile); - return yield (0, _builderUtil().exec)("productbuild", args); - })(); - } - - getElectronSrcDir(dist) { - return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName); - } - - getElectronDestinationDir(appOutDir) { - return path.join(appOutDir, this.info.framework.distMacOsAppName); - } // todo fileAssociations - - - applyCommonInfo(appPlist, contentsPath) { - var _this5 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appInfo = _this5.appInfo; - const appFilename = appInfo.productFilename; // https://github.com/electron-userland/electron-builder/issues/1278 - - appPlist.CFBundleExecutable = appFilename.endsWith(" Helper") ? appFilename.substring(0, appFilename.length - " Helper".length) : appFilename; - const icon = yield _this5.getIconPath(); - - if (icon != null) { - const oldIcon = appPlist.CFBundleIconFile; - const resourcesPath = path.join(contentsPath, "Resources"); - - if (oldIcon != null) { - yield (0, _fs().unlinkIfExists)(path.join(resourcesPath, oldIcon)); - } - - const iconFileName = `${appFilename}.icns`; - appPlist.CFBundleIconFile = iconFileName; - yield (0, _fs().copyFile)(icon, path.join(resourcesPath, iconFileName)); - } - - appPlist.CFBundleName = appInfo.productName; - appPlist.CFBundleDisplayName = appInfo.productName; - const minimumSystemVersion = _this5.platformSpecificBuildOptions.minimumSystemVersion; - - if (minimumSystemVersion != null) { - appPlist.LSMinimumSystemVersion = minimumSystemVersion; - } - - appPlist.CFBundleIdentifier = appInfo.macBundleIdentifier; - appPlist.CFBundleShortVersionString = _this5.platformSpecificBuildOptions.bundleShortVersion || appInfo.version; - appPlist.CFBundleVersion = appInfo.buildVersion; - (0, _builderUtil().use)(_this5.platformSpecificBuildOptions.category || _this5.config.category, it => appPlist.LSApplicationCategoryType = it); - appPlist.NSHumanReadableCopyright = appInfo.copyright; - - if (_this5.platformSpecificBuildOptions.darkModeSupport) { - appPlist.NSRequiresAquaSystemAppearance = false; - } - - const extendInfo = _this5.platformSpecificBuildOptions.extendInfo; - - if (extendInfo != null) { - Object.assign(appPlist, extendInfo); - } - })(); - } - -} - -exports.default = MacPackager; - -function getCertificateType(isMas, isDevelopment) { - if (isDevelopment) { - return "Mac Developer"; - } - - return isMas ? "3rd Party Mac Developer Application" : "Developer ID Application"; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=macPackager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/macPackager.js.map b/node_modules/app-builder-lib/out/macPackager.js.map deleted file mode 100644 index c763205..0000000 --- a/node_modules/app-builder-lib/out/macPackager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/macPackager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AA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BAAtC;AAEA,MAAA,QAAQ,CAAC,0BAAT,GAAsC,MAAI,CAAC,4BAAL,CAAkC,kBAAlC,IAAwD,OAAO,CAAC,OAAtG;AACA,MAAA,QAAQ,CAAC,eAAT,GAA2B,OAAO,CAAC,YAAnC;AAEA,8BAAI,MAAI,CAAC,4BAAL,CAAkC,QAAlC,IAA+C,MAAI,CAAC,MAAL,CAAoB,QAAvE,EAAiF,EAAE,IAAI,QAAQ,CAAC,yBAAT,GAAqC,EAA5H;AACA,MAAA,QAAQ,CAAC,wBAAT,GAAoC,OAAO,CAAC,SAA5C;;AAEA,UAAI,MAAI,CAAC,4BAAL,CAAkC,eAAtC,EAAuD;AACrD,QAAA,QAAQ,CAAC,8BAAT,GAA0C,KAA1C;AACD;;AAED,YAAM,UAAU,GAAG,MAAI,CAAC,4BAAL,CAAkC,UAArD;;AACA,UAAI,UAAU,IAAI,IAAlB,EAAwB;AACtB,QAAA,MAAM,CAAC,MAAP,CAAc,QAAd,EAAwB,UAAxB;AACD;AAzCsD;AA0CxD;;AAhSwE;;;;AAmS3E,SAAS,kBAAT,CAA4B,KAA5B,EAA4C,aAA5C,EAAkE;AAChE,MAAI,aAAJ,EAAmB;AACjB,WAAO,eAAP;AACD;;AACD,SAAO,KAAK,GAAG,qCAAH,GAA2C,0BAAvD;AACD,C","sourcesContent":["import { deepAssign, Arch, AsyncTaskManager, exec, InvalidConfigurationError, log, use } from \"builder-util\"\nimport { signAsync, SignOptions } from \"electron-osx-sign\"\nimport { ensureDir } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { copyFile, unlinkIfExists } from \"builder-util/out/fs\"\nimport { AppInfo } from \"./appInfo\"\nimport { appleCertificatePrefixes, CertType, CodeSigningInfo, createKeychain, findIdentity, Identity, isSignAllowed, reportError } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { ElectronPlatformName } from \"./index\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/pkg\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory\"\n\nexport default class MacPackager extends PlatformPackager {\n readonly codeSigningInfo = new Lazy(() => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return Promise.resolve({keychainName: process.env.CSC_KEYCHAIN || null})\n }\n\n return createKeychain({\n tmpDir: this.info.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir\n })\n })\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array {\n return this.info.framework.macOsDefaultTargets\n }\n\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n }\n\n async getIconPath(): Promise {\n return this._iconPath.value\n }\n\n createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\":\n const { DmgTarget } = require(\"dmg-builder\")\n mapper(name, outDir => new DmgTarget(this, outDir))\n break\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => name === \"mas\" || name === \"mas-dev\" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this))\n break\n }\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): Promise {\n let nonMasPromise: Promise | null = null\n\n const hasMas = targets.length !== 0 && targets.some(it => it.name === \"mas\" || it.name === \"mas-dev\")\n const prepackaged = this.packagerOptions.prepackaged\n\n if (!hasMas || targets.length > 1) {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged\n nonMasPromise = (prepackaged ? Promise.resolve() : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName as ElectronPlatformName, arch, this.platformSpecificBuildOptions, targets))\n .then(() => this.sign(appPath, null, null))\n .then(() => this.packageInDistributableFormat(appPath, Arch.x64, targets, taskManager))\n }\n\n for (const target of targets) {\n const targetName = target.name\n if (!(targetName === \"mas\" || targetName === \"mas-dev\")) {\n continue\n }\n\n const masBuildOptions = deepAssign({}, this.platformSpecificBuildOptions, (this.config as any).mas)\n if (targetName === \"mas-dev\") {\n deepAssign(masBuildOptions, (this.config as any)[targetName], {\n type: \"development\",\n })\n }\n\n const targetOutDir = path.join(outDir, targetName)\n if (prepackaged == null) {\n await this.doPack(outDir, targetOutDir, \"mas\", arch, masBuildOptions, [target])\n await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions)\n }\n else {\n await this.sign(prepackaged, targetOutDir, masBuildOptions)\n }\n }\n\n if (nonMasPromise != null) {\n await nonMasPromise\n }\n }\n\n private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null): Promise {\n if (!isSignAllowed()) {\n return\n }\n\n const isMas = masOptions != null\n const macOptions = this.platformSpecificBuildOptions\n const qualifier = (isMas ? masOptions!.identity : null) || macOptions.identity\n\n if (!isMas && qualifier === null) {\n if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({reason: \"identity explicitly is set to null\"}, \"skipped macOS code signing\")\n return\n }\n\n const keychainName = (await this.codeSigningInfo.value).keychainName\n const explicitType = isMas ? masOptions!.type : macOptions.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n const certificateType = getCertificateType(isMas, isDevelopment)\n let identity = await findIdentity(certificateType, qualifier, keychainName)\n if (identity == null) {\n if (!isMas && !isDevelopment && explicitType !== \"distribution\") {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainName)\n if (identity != null) {\n log.warn(\"Mac Developer is used to sign app — it is only for development and testing, not for production\")\n }\n }\n\n if (identity == null) {\n await reportError(isMas, certificateType, qualifier, keychainName, this.forceCodeSigning)\n return\n }\n }\n\n const signOptions: any = {\n \"identity-validation\": false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n return file.endsWith(\".kext\") || file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n // https://github.com/electron-userland/electron-builder/issues/2010\n file.includes(\"/node_modules/puppeteer/.local-chromium\")\n },\n identity: identity!,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.config.electronVersion,\n app: appPath,\n keychain: keychainName || undefined,\n binaries: (isMas && masOptions != null ? masOptions.binaries : macOptions.binaries) || undefined,\n requirements: isMas || macOptions.requirements == null ? undefined : await this.getResource(macOptions.requirements),\n \"gatekeeper-assess\": appleCertificatePrefixes.find(it => identity!.name.startsWith(it)) != null\n }\n\n await this.adjustSignOptions(signOptions, masOptions)\n log.info({\n file: log.filePath(appPath),\n identityName: identity.name,\n identityHash: identity.hash,\n provisioningProfile: signOptions[\"provisioning-profile\"] || \"none\",\n }, \"signing\")\n await this.doSign(signOptions)\n\n // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209\n if (masOptions != null && !isDevelopment) {\n const certType = isDevelopment ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainName)\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n const artifactName = this.expandArtifactNamePattern(masOptions, \"pkg\")\n const artifactPath = path.join(outDir!, artifactName)\n await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainName)\n await this.dispatchArtifactCreated(artifactPath, null, Arch.x64, this.computeSafeArtifactName(artifactName, \"pkg\"))\n }\n }\n\n private async adjustSignOptions(signOptions: any, masOptions: MasConfiguration | null) {\n const resourceList = await this.resourceList\n if (resourceList.includes(`entitlements.osx.plist`)) {\n throw new InvalidConfigurationError(\"entitlements.osx.plist is deprecated name, please use entitlements.mac.plist\")\n }\n if (resourceList.includes(`entitlements.osx.inherit.plist`)) {\n throw new InvalidConfigurationError(\"entitlements.osx.inherit.plist is deprecated name, please use entitlements.mac.inherit.plist\")\n }\n\n const customSignOptions = masOptions || this.platformSpecificBuildOptions\n const entitlementsSuffix = masOptions == null ? \"mac\" : \"mas\"\n if (customSignOptions.entitlements == null) {\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n signOptions.entitlements = path.join(this.info.buildResourcesDir, p)\n }\n }\n else {\n signOptions.entitlements = customSignOptions.entitlements\n }\n\n if (customSignOptions.entitlementsInherit == null) {\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n signOptions[\"entitlements-inherit\"] = path.join(this.info.buildResourcesDir, p)\n }\n }\n else {\n signOptions[\"entitlements-inherit\"] = customSignOptions.entitlementsInherit\n }\n\n if (customSignOptions.provisioningProfile != null) {\n signOptions[\"provisioning-profile\"] = customSignOptions.provisioningProfile\n }\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions): Promise {\n return signAsync(opts)\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | null | undefined): Promise {\n // productbuild doesn't created directory for out file\n await ensureDir(path.dirname(outFile))\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", appPath, \"/Applications\")\n args.push(outFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string) {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const icon = await this.getIconPath()\n if (icon != null) {\n const oldIcon = appPlist.CFBundleIconFile\n const resourcesPath = path.join(contentsPath, \"Resources\")\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = `${appFilename}.icns`\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(icon, path.join(resourcesPath, iconFileName))\n }\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n appPlist.CFBundleIdentifier = appInfo.macBundleIdentifier\n\n appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => appPlist.LSApplicationCategoryType = it)\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n Object.assign(appPlist, extendInfo)\n }\n }\n}\n\nfunction getCertificateType(isMas: boolean, isDevelopment: boolean): CertType {\n if (isDevelopment) {\n return \"Mac Developer\"\n }\n return isMas ? \"3rd Party Mac Developer Application\" : \"Developer ID Application\"\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/AppXOptions.d.ts b/node_modules/app-builder-lib/out/options/AppXOptions.d.ts deleted file mode 100644 index 3b94a07..0000000 --- a/node_modules/app-builder-lib/out/options/AppXOptions.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { TargetSpecificOptions } from "../core"; -export interface AppXOptions extends TargetSpecificOptions { - /** - * The application id. Defaults to `identityName`. Can’t start with numbers. - */ - readonly applicationId?: string; - /** - * The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx). - * @default #464646 - */ - readonly backgroundColor?: string | null; - /** - * A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx). - * Defaults to the application product name. - */ - readonly displayName?: string | null; - /** - * The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](/configuration/configuration#Metadata-name). - */ - readonly identityName?: string | null; - /** - * The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below. - */ - readonly publisher?: string | null; - /** - * A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx). - * Defaults to company name from the application metadata. - */ - readonly publisherDisplayName?: string | null; - /** - * The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store. - * The first entry (index 0) will be the default language. - * Defaults to en-US if omitted. - */ - readonly languages?: Array | string | null; - /** - * Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies. - */ - readonly addAutoLaunchExtension?: boolean; - /** - * @private - * @default false - */ - readonly electronUpdaterAware?: boolean; - /** @private */ - readonly makeappxArgs?: Array | null; -} diff --git a/node_modules/app-builder-lib/out/options/AppXOptions.js b/node_modules/app-builder-lib/out/options/AppXOptions.js deleted file mode 100644 index f651174..0000000 --- a/node_modules/app-builder-lib/out/options/AppXOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=AppXOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/AppXOptions.js.map b/node_modules/app-builder-lib/out/options/AppXOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/AppXOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.d.ts b/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.d.ts deleted file mode 100644 index 20589f3..0000000 --- a/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { WinPackager } from "../winPackager"; -export interface CommonWindowsInstallerConfiguration { - readonly oneClick?: boolean; - /** - * Whether to install per all users (per-machine). - * @default false - */ - readonly perMachine?: boolean; - /** - * Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed. - * @default true - */ - readonly runAfterFinish?: boolean; - /** - * Whether to create desktop shortcut. Set to `always` if to recreate also on reinstall (even if removed by user). - * @default true - */ - readonly createDesktopShortcut?: boolean | "always"; - /** - * Whether to create start menu shortcut. - * @default true - */ - readonly createStartMenuShortcut?: boolean; - /** - * Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value. - * @default false - */ - readonly menuCategory?: boolean | string; - /** - * The name that will be used for all shortcuts. Defaults to the application name. - */ - readonly shortcutName?: string | null; -} -export interface FinalCommonWindowsInstallerOptions { - isAssisted: boolean; - isPerMachine: boolean; - shortcutName: string; - menuCategory: string | null; - isCreateDesktopShortcut: DesktopShortcutCreationPolicy; - isCreateStartMenuShortcut: boolean; -} -export declare function getEffectiveOptions(options: CommonWindowsInstallerConfiguration, packager: WinPackager): FinalCommonWindowsInstallerOptions; -export declare enum DesktopShortcutCreationPolicy { - FRESH_INSTALL = 0, - ALWAYS = 1, - NEVER = 2 -} diff --git a/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js b/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js deleted file mode 100644 index 0d96eaa..0000000 --- a/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getEffectiveOptions = getEffectiveOptions; -exports.DesktopShortcutCreationPolicy = void 0; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _sanitizeFilename() { - const data = _interopRequireDefault(require("sanitize-filename")); - - _sanitizeFilename = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getEffectiveOptions(options, packager) { - const appInfo = packager.appInfo; - let menuCategory = null; - - if (options.menuCategory != null && options.menuCategory !== false) { - if (options.menuCategory === true) { - const companyName = packager.appInfo.companyName; - - if (companyName == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Please specify "author" in the application package.json — it is required because "menuCategory" is set to true.`); - } - - menuCategory = (0, _sanitizeFilename().default)(companyName); - } else { - menuCategory = options.menuCategory.split(/[\/\\]/).map(it => (0, _sanitizeFilename().default)(it)).join("\\"); - } - } - - return { - isPerMachine: options.perMachine === true, - isAssisted: options.oneClick === false, - shortcutName: (0, _builderUtil().isEmptyOrSpaces)(options.shortcutName) ? appInfo.productFilename : packager.expandMacro(options.shortcutName), - isCreateDesktopShortcut: convertToDesktopShortcutCreationPolicy(options.createDesktopShortcut), - isCreateStartMenuShortcut: options.createStartMenuShortcut !== false, - menuCategory - }; -} - -function convertToDesktopShortcutCreationPolicy(value) { - if (value === false) { - return DesktopShortcutCreationPolicy.NEVER; - } else if (value === "always") { - return DesktopShortcutCreationPolicy.ALWAYS; - } else { - return DesktopShortcutCreationPolicy.FRESH_INSTALL; - } -} - -var DesktopShortcutCreationPolicy; -exports.DesktopShortcutCreationPolicy = DesktopShortcutCreationPolicy; - -(function (DesktopShortcutCreationPolicy) { - DesktopShortcutCreationPolicy[DesktopShortcutCreationPolicy["FRESH_INSTALL"] = 0] = "FRESH_INSTALL"; - DesktopShortcutCreationPolicy[DesktopShortcutCreationPolicy["ALWAYS"] = 1] = "ALWAYS"; - DesktopShortcutCreationPolicy[DesktopShortcutCreationPolicy["NEVER"] = 2] = "NEVER"; -})(DesktopShortcutCreationPolicy || (exports.DesktopShortcutCreationPolicy = DesktopShortcutCreationPolicy = {})); -// __ts-babel@6.0.4 -//# sourceMappingURL=CommonWindowsInstallerConfiguration.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js.map b/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js.map deleted file mode 100644 index c91648f..0000000 --- a/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/options/CommonWindowsInstallerConfiguration.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAqDM,SAAU,mBAAV,CAA8B,OAA9B,EAA4E,QAA5E,EAAiG;AACrG,QAAM,OAAO,GAAG,QAAQ,CAAC,OAAzB;AAEA,MAAI,YAAY,GAAkB,IAAlC;;AACA,MAAI,OAAO,CAAC,YAAR,IAAwB,IAAxB,IAAgC,OAAO,CAAC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AA,GAAA,CAAA,CAAA,GAAA,eAAA;AAAe,EAAA,6BAAA,CAAA,6BAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA;AAAQ,EAAA,6BAAA,CAAA,6BAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AACxB,CAFD,EAAY,6BAA6B,6CAA7B,6BAA6B,GAAA,EAAA,CAAzC,E","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces } from \"builder-util\"\nimport sanitizeFileName from \"sanitize-filename\"\nimport { WinPackager } from \"../winPackager\"\n\nexport interface CommonWindowsInstallerConfiguration {\n readonly oneClick?: boolean\n\n /**\n * Whether to install per all users (per-machine).\n * @default false\n */\n readonly perMachine?: boolean\n\n /**\n * Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.\n * @default true\n */\n readonly runAfterFinish?: boolean\n\n /**\n * Whether to create desktop shortcut. Set to `always` if to recreate also on reinstall (even if removed by user).\n * @default true\n */\n readonly createDesktopShortcut?: boolean | \"always\"\n\n /**\n * Whether to create start menu shortcut.\n * @default true\n */\n readonly createStartMenuShortcut?: boolean\n\n /**\n * Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value.\n * @default false\n */\n readonly menuCategory?: boolean | string\n\n /**\n * The name that will be used for all shortcuts. Defaults to the application name.\n */\n readonly shortcutName?: string | null\n}\n\nexport interface FinalCommonWindowsInstallerOptions {\n isAssisted: boolean\n isPerMachine: boolean\n\n shortcutName: string\n menuCategory: string | null\n\n isCreateDesktopShortcut: DesktopShortcutCreationPolicy\n isCreateStartMenuShortcut: boolean\n}\n\nexport function getEffectiveOptions(options: CommonWindowsInstallerConfiguration, packager: WinPackager): FinalCommonWindowsInstallerOptions {\n const appInfo = packager.appInfo\n\n let menuCategory: string | null = null\n if (options.menuCategory != null && options.menuCategory !== false) {\n if (options.menuCategory === true) {\n const companyName = packager.appInfo.companyName\n if (companyName == null) {\n throw new InvalidConfigurationError(`Please specify \"author\" in the application package.json — it is required because \"menuCategory\" is set to true.`)\n }\n menuCategory = sanitizeFileName(companyName)\n }\n else {\n menuCategory = (options.menuCategory as string).split(/[\\/\\\\]/).map(it => sanitizeFileName(it)).join(\"\\\\\")\n }\n }\n\n return {\n isPerMachine: options.perMachine === true,\n isAssisted: options.oneClick === false,\n\n shortcutName: isEmptyOrSpaces(options.shortcutName) ? appInfo.productFilename : packager.expandMacro(options.shortcutName!!),\n isCreateDesktopShortcut: convertToDesktopShortcutCreationPolicy(options.createDesktopShortcut),\n isCreateStartMenuShortcut: options.createStartMenuShortcut !== false,\n menuCategory,\n }\n}\n\nfunction convertToDesktopShortcutCreationPolicy(value: boolean | undefined | string): DesktopShortcutCreationPolicy {\n if (value === false) {\n return DesktopShortcutCreationPolicy.NEVER\n }\n else if (value === \"always\") {\n return DesktopShortcutCreationPolicy.ALWAYS\n }\n else {\n return DesktopShortcutCreationPolicy.FRESH_INSTALL\n }\n}\n\nexport enum DesktopShortcutCreationPolicy {\n FRESH_INSTALL, ALWAYS, NEVER\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/FileAssociation.d.ts b/node_modules/app-builder-lib/out/options/FileAssociation.d.ts deleted file mode 100644 index b18d73b..0000000 --- a/node_modules/app-builder-lib/out/options/FileAssociation.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * File associations. - * - * macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)) and NSIS only. - * - * On Windows works only if [nsis.perMachine](https://electron.build/configuration/configuration#NsisOptions-perMachine) is set to `true`. - */ -export interface FileAssociation { - /** - * The extension (minus the leading period). e.g. `png`. - */ - readonly ext: string | Array; - /** - * The name. e.g. `PNG`. Defaults to `ext`. - */ - readonly name?: string | null; - /** - * *windows-only.* The description. - */ - readonly description?: string | null; - /** - * *linux-only.* The mime-type. - */ - readonly mimeType?: string | null; - /** - * The path to icon (`.icns` for MacOS and `.ico` for Windows), relative to `build` (build resources directory). Defaults to `${firstExt}.icns`/`${firstExt}.ico` (if several extensions specified, first is used) or to application icon. - * - * Not supported on Linux, file issue if need (default icon will be `x-office-document`). - */ - readonly icon?: string | null; - /** - * *macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`. - * @default Editor - */ - readonly role?: string; - /** - * *macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`. - */ - readonly isPackage?: boolean; -} diff --git a/node_modules/app-builder-lib/out/options/FileAssociation.js b/node_modules/app-builder-lib/out/options/FileAssociation.js deleted file mode 100644 index afd96ba..0000000 --- a/node_modules/app-builder-lib/out/options/FileAssociation.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=FileAssociation.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/FileAssociation.js.map b/node_modules/app-builder-lib/out/options/FileAssociation.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/FileAssociation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/MsiOptions.d.ts b/node_modules/app-builder-lib/out/options/MsiOptions.d.ts deleted file mode 100644 index f0ca726..0000000 --- a/node_modules/app-builder-lib/out/options/MsiOptions.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TargetSpecificOptions } from "../core"; -import { CommonWindowsInstallerConfiguration } from "./CommonWindowsInstallerConfiguration"; -export interface MsiOptions extends CommonWindowsInstallerConfiguration, TargetSpecificOptions { - /** - * One-click installation. - * @default true - */ - readonly oneClick?: boolean; - /** - * The [upgrade code](https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx). Optional, by default generated using app id. - */ - readonly upgradeCode?: string | null; - /** - * If `warningsAsErrors` is `true` (default): treat warnings as errors. If `warningsAsErrors` is `false`: allow warnings. - * @default true - */ - readonly warningsAsErrors?: boolean; -} diff --git a/node_modules/app-builder-lib/out/options/MsiOptions.js b/node_modules/app-builder-lib/out/options/MsiOptions.js deleted file mode 100644 index 1ad98d7..0000000 --- a/node_modules/app-builder-lib/out/options/MsiOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=MsiOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/MsiOptions.js.map b/node_modules/app-builder-lib/out/options/MsiOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/MsiOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.d.ts b/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.d.ts deleted file mode 100644 index 5920a8e..0000000 --- a/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { AsarIntegrityOptions } from "../asar/integrity"; -import { CompressionLevel, TargetConfiguration, TargetSpecificOptions } from "../core"; -import { FileAssociation } from "./FileAssociation"; -import { Publish } from "builder-util-runtime"; -export interface FileSet { - /** - * The source path relative to the project directory. - */ - from?: string; - /** - * The destination path relative to the app's content directory for `extraFiles` and the app's resource directory for `extraResources`. - */ - to?: string; - /** - * The [glob patterns](/file-patterns). - */ - filter?: Array | string; -} -export interface AsarOptions extends AsarIntegrityOptions { - /** - * Whether to automatically unpack executables files. - * @default true - */ - smartUnpack?: boolean; - ordering?: string | null; -} -export interface PlatformSpecificBuildOptions extends TargetSpecificOptions { - /** - * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as - * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set. - * @default com.electron.${name} - */ - readonly appId?: string | null; - /** - * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options). - */ - readonly artifactName?: string | null; - /** - * The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time. - * @default normal - */ - readonly compression?: CompressionLevel | null; - files?: Array | FileSet | string | null; - extraResources?: Array | FileSet | string | null; - extraFiles?: Array | FileSet | string | null; - /** - * Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/). - * - * Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work. - * @default true - */ - readonly asar?: AsarOptions | boolean | null; - /** - * A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive. - */ - readonly asarUnpack?: Array | string | null; - /** @private */ - readonly icon?: string | null; - /** - * The file associations. - */ - readonly fileAssociations?: Array | FileAssociation; - /** - * The URL protocol schemes. - */ - readonly protocols?: Array | Protocol; - /** - * Whether to fail if app will be not code signed. - */ - readonly forceCodeSigning?: boolean; - /** - * The [electron-updater compatibility](/auto-update#compatibility) semver range. - */ - readonly electronUpdaterCompatibility?: string | null; - publish?: Publish; - /** - * Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`. - * @default true - */ - readonly detectUpdateChannel?: boolean; - /** - * Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139). - * @default false - */ - readonly generateUpdatesFilesForAllChannels?: boolean; - /** - * The release info. Intended for command line usage: - * - * ``` - * -c.releaseInfo.releaseNotes="new features" - * ``` - */ - readonly releaseInfo?: ReleaseInfo; - readonly target?: Array | string | TargetConfiguration | null; - /** @private */ - cscLink?: string | null; - /** @private */ - cscKeyPassword?: string | null; -} -export interface ReleaseInfo { - /** - * The release name. - */ - releaseName?: string | null; - /** - * The release notes. - */ - releaseNotes?: string | null; - /** - * The path to release notes file. Defaults to `release-notes-${platform}.md` (where `platform` it is current platform — `mac`, `linux` or `windows`) or `release-notes.md` in the [build resources](#MetadataDirectories-buildResources). - */ - releaseNotesFile?: string | null; - /** - * The release date. - */ - releaseDate?: string; -} -/** - * URL Protocol Schemes. Protocols to associate the app with. macOS only. - * - * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos). - */ -export interface Protocol { - /** - * The name. e.g. `IRC server URL`. - */ - readonly name: string; - /** - * The schemes. e.g. `["irc", "ircs"]`. - */ - readonly schemes: Array; - /** - * *macOS-only* The app’s role with respect to the type. - * @default Editor - */ - readonly role?: "Editor" | "Viewer" | "Shell" | "None"; -} diff --git a/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js b/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js deleted file mode 100644 index 48d1340..0000000 --- a/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=PlatformSpecificBuildOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js.map b/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/SnapOptions.d.ts b/node_modules/app-builder-lib/out/options/SnapOptions.d.ts deleted file mode 100644 index d3f4cf1..0000000 --- a/node_modules/app-builder-lib/out/options/SnapOptions.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { TargetSpecificOptions } from "../core"; -import { CommonLinuxOptions } from "./linuxOptions"; -export interface SnapOptions extends CommonLinuxOptions, TargetSpecificOptions { - /** - * The type of [confinement](https://snapcraft.io/docs/reference/confinement) supported by the snap. - * @default strict - */ - readonly confinement?: "devmode" | "strict" | "classic" | null; - /** - * The custom environment. Defaults to `{"TMPDIR: "$XDG_RUNTIME_DIR"}`. If you set custom, it will be merged with default. - */ - readonly environment?: object | null; - /** - * The 78 character long summary. Defaults to [productName](/configuration/configuration#Configuration-productName). - */ - readonly summary?: string | null; - /** - * The quality grade of the snap. It can be either `devel` (i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels). - * @default stable - */ - readonly grade?: "devel" | "stable" | null; - /** - * The list of features that must be supported by the core in order for this snap to install. - */ - readonly assumes?: Array | string | null; - /** - * The list of debian packages needs to be installed for building this snap. - */ - readonly buildPackages?: Array | null; - /** - * The list of Ubuntu packages to use that are needed to support the `app` part creation. Like `depends` for `deb`. - * Defaults to `["libasound2", "libgconf2-4", "libnotify4", "libnspr4", "libnss3", "libpcre3", "libpulse0", "libxss1", "libxtst6"]`. - * - * If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom package `foo` in addition to defaults. - */ - readonly stagePackages?: Array | null; - /** - * The [hooks](https://docs.snapcraft.io/build-snaps/hooks) directory, relative to `build` (build resources directory). - * @default build/snap-hooks - */ - readonly hooks?: string | null; - /** - * The list of [plugs](https://snapcraft.io/docs/reference/interfaces). - * Defaults to `["desktop", "desktop-legacy", "home", "x11", "unity7", "browser-support", "network", "gsettings", "pulseaudio", "opengl"]`. - * - * If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom plug `foo` in addition to defaults. - * - * Additional attributes can be specified using object instead of just name of plug: - * ``` - *[ - * { - * "browser-sandbox": { - * "interface": "browser-support", - * "allow-sandbox": true - * }, - * }, - * "another-simple-plug-name" - *] - * ``` - */ - readonly plugs?: Array | PlugDescriptor | null; - /** - * Specifies any [parts](https://snapcraft.io/docs/reference/parts) that should be built before this part. - * Defaults to `["desktop-gtk2""]`. - * - * If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom parts `foo` in addition to defaults. - */ - readonly after?: Array | null; - /** - * Whether to use template snap. Defaults to `true` if `stagePackages` not specified. - */ - readonly useTemplateApp?: boolean; -} -export interface PlugDescriptor { - [key: string]: { - [key: string]: any; - } | null; -} diff --git a/node_modules/app-builder-lib/out/options/SnapOptions.js b/node_modules/app-builder-lib/out/options/SnapOptions.js deleted file mode 100644 index 090ba5f..0000000 --- a/node_modules/app-builder-lib/out/options/SnapOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=SnapOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/SnapOptions.js.map b/node_modules/app-builder-lib/out/options/SnapOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/SnapOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.d.ts b/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.d.ts deleted file mode 100644 index e8ace81..0000000 --- a/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Squirrel.Windows options. - */ -import { TargetSpecificOptions } from "../core"; -export interface SquirrelWindowsOptions extends TargetSpecificOptions { - /** - * A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). Defaults to the Electron icon. - * - * Please note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http. - * - * If you don't plan to build windows installer, you can omit it. - * If your project repository is public on GitHub, it will be `https://github.com/${u}/${p}/blob/master/build/icon.ico?raw=true` by default. - */ - readonly iconUrl?: string | null; - /** - * The path to a .gif file to display during install. `build/install-spinner.gif` will be used if exists (it is a recommended way to set) - * (otherwise [default](https://github.com/electron/windows-installer/blob/master/resources/install-spinner.gif)). - */ - readonly loadingGif?: string | null; - /** - * Whether to create an MSI installer. Defaults to `false` (MSI is not created). - */ - readonly msi?: boolean; - /** - * A URL to your existing updates. Or `true` to automatically set to your GitHub repository. If given, these will be downloaded to create delta updates. - */ - readonly remoteReleases?: string | boolean | null; - /** - * Authentication token for remote updates - */ - readonly remoteToken?: string | null; - /** - * Use `appId` to identify package instead of `name`. - */ - readonly useAppIdAsId?: boolean; - /** - * https://github.com/electron-userland/electron-builder/issues/1743 - * @private - */ - readonly name?: string; -} diff --git a/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.js b/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.js deleted file mode 100644 index b8920a1..0000000 --- a/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=SquirrelWindowsOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.js.map b/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/linuxOptions.d.ts b/node_modules/app-builder-lib/out/options/linuxOptions.d.ts deleted file mode 100644 index 9c36a05..0000000 --- a/node_modules/app-builder-lib/out/options/linuxOptions.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { PlatformSpecificBuildOptions, TargetConfigType, TargetSpecificOptions } from "../index"; -export interface LinuxConfiguration extends CommonLinuxOptions, PlatformSpecificBuildOptions { - /** - * Target package type: list of `AppImage`, `snap`, `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. - * - * electron-builder [docker image](/multi-platform-build#docker) can be used to build Linux targets on any platform. - * - * Please [do not put an AppImage into another archive](https://github.com/probonopd/AppImageKit/wiki/Creating-AppImages#common-mistake) like a .zip or .tar.gz. - * @default AppImage - */ - readonly target?: TargetConfigType; - /** - * The maintainer. Defaults to [author](/configuration/configuration#Metadata-author). - */ - readonly maintainer?: string | null; - /** - * The vendor. Defaults to [author](/configuration/configuration#Metadata-author). - */ - readonly vendor?: string | null; - /** - * @deprecated - * @private - */ - readonly depends?: Array | null; - /** - * The executable name. Defaults to `productName`. - * Cannot be specified per target, allowed only in the `linux`. - */ - readonly executableName?: string | null; - /** - * The path to icon set directory or one png file, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. The icon filename must contain the size (e.g. 32x32.png) of the icon. - * By default will be generated automatically based on the macOS icns file. - */ - readonly icon?: string; - /** - * backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place - * @private - */ - readonly packageCategory?: string | null; -} -export interface CommonLinuxOptions { - /** - * The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description). - */ - readonly synopsis?: string | null; - /** - * As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux. - */ - readonly description?: string | null; - /** - * The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry). - */ - readonly category?: string | null; - /** - * The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing. - */ - readonly mimeTypes?: Array | null; - /** - * The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value). - */ - readonly desktop?: any | null; -} -export interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSpecificOptions { - /** - * Package dependencies. - */ - readonly depends?: Array | null; - /** - * The compression type. - * @default xz - */ - readonly compression?: "gz" | "bzip2" | "xz" | null; - readonly icon?: string; - /** - * The package category. - */ - readonly packageCategory?: string | null; - readonly vendor?: string | null; - readonly maintainer?: string | null; - readonly afterInstall?: string | null; - readonly afterRemove?: string | null; - /** - * *Advanced only* The [fpm](https://github.com/jordansissel/fpm/wiki#usage) options. - * - * Example: `["--before-install=build/deb-preinstall.sh", "--after-upgrade=build/deb-postinstall.sh"]` - */ - readonly fpm?: Array | null; -} -export interface DebOptions extends LinuxTargetSpecificOptions { - /** - * Package dependencies. Defaults to `["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"]`. - */ - readonly depends?: Array | null; - /** - * The [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section). - */ - readonly packageCategory?: string | null; - /** - * The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute. - */ - readonly priority?: string | null; -} -export interface AppImageOptions extends CommonLinuxOptions, TargetSpecificOptions { - /** - * The system integration installation. - * @default ask - */ - readonly systemIntegration?: "ask" | "doNotAsk"; - /** - * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported. - */ - readonly license?: string | null; -} diff --git a/node_modules/app-builder-lib/out/options/linuxOptions.js b/node_modules/app-builder-lib/out/options/linuxOptions.js deleted file mode 100644 index c66bea4..0000000 --- a/node_modules/app-builder-lib/out/options/linuxOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=linuxOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/linuxOptions.js.map b/node_modules/app-builder-lib/out/options/linuxOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/linuxOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/macOptions.d.ts b/node_modules/app-builder-lib/out/options/macOptions.d.ts deleted file mode 100644 index bee81c8..0000000 --- a/node_modules/app-builder-lib/out/options/macOptions.d.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from "../index"; -export declare type MacOsTargetName = "default" | "dmg" | "mas" | "mas-dev" | "pkg" | "7z" | "zip" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "dir"; -export interface MacConfiguration extends PlatformSpecificBuildOptions { - /** - * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory. - * - * For example, `"category": "public.app-category.developer-tools"` will set the application category to *Developer Tools*. - * - * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8). - */ - readonly category?: string | null; - /** - * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac). - */ - readonly target?: Array | MacOsTargetName | TargetConfiguration | null; - /** - * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option. - * MAS installer identity is specified in the [mas](/configuration/mas). - */ - readonly identity?: string | null; - /** - * The path to application icon. - * @default build/icon.icns - */ - readonly icon?: string | null; - /** - * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set). - * MAS entitlements is specified in the [mas](/configuration/mas). - */ - readonly entitlements?: string | null; - /** - * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set). - * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist). - * - * This option only applies when signing with `entitlements` provided. - */ - readonly entitlementsInherit?: string | null; - /** - * The path to the provisioning profile to use when signing, absolute or relative to the app root. - */ - readonly provisioningProfile?: string | null; - /** - * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643). - */ - readonly bundleVersion?: string | null; - /** - * The `CFBundleShortVersionString`. Do not use it unless you need to. - */ - readonly bundleShortVersion?: string | null; - /** - * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting. - * @default false - */ - readonly darkModeSupport?: boolean; - /** - * The bundle identifier to use in the application helper's plist. - * @default ${appBundleIdentifier}.helper - */ - readonly helperBundleId?: string | null; - /** - * Whether to sign app for development or for distribution. - * @default distribution - */ - readonly type?: "distribution" | "development" | null; - /** - * The extra entries for `Info.plist`. - */ - readonly extendInfo?: any; - /** - * Paths of any extra binaries that need to be signed. - */ - readonly binaries?: Array | null; - /** - * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`. - */ - readonly minimumSystemVersion?: string | null; - /** - * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS. - */ - readonly requirements?: string | null; - /** - * The electron locales. By default Electron locales used as is. - */ - readonly electronLanguages?: Array | string; - /** @private */ - readonly cscInstallerLink?: string | null; - /** @private */ - readonly cscInstallerKeyPassword?: string | null; - /** - * Extra files to put in archive. Not applicable for `tar.*`. - */ - readonly extraDistFiles?: Array | string | null; -} -export interface DmgOptions extends TargetSpecificOptions { - /** - * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window. - * If background is not specified, use `window.size`. Default locations expected background size to be 540x380. - * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191). - */ - background?: string | null; - /** - * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image. - */ - backgroundColor?: string | null; - /** - * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. - * Defaults to the application icon (`build/icon.icns`). - */ - readonly icon?: string | null; - /** - * The size of all the icons inside the DMG. - * @default 80 - */ - readonly iconSize?: number | null; - /** - * The size of all the icon texts inside the DMG. - * @default 12 - */ - readonly iconTextSize?: number | null; - /** - * The title of the produced DMG, which will be shown when mounted (volume name). - * - * Macro `${productName}`, `${version}` and `${name}` are supported. - * @default ${productName} ${version} - */ - readonly title?: string | null; - /** - * The content — to customize icon locations. - */ - contents?: Array; - /** - * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)). - * @default UDZO - */ - readonly format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO"; - /** - * The DMG windows position and size. - */ - window?: DmgWindow; - /** - * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file). - * @default false - */ - readonly internetEnabled?: boolean; -} -export interface DmgWindow { - /** - * The X position relative to left of the screen. - * @default 400 - */ - x?: number; - /** - * The Y position relative to top of the screen. - * @default 100 - */ - y?: number; - /** - * The width. Defaults to background image width or 540. - */ - width?: number; - /** - * The height. Defaults to background image height or 380. - */ - height?: number; -} -export interface DmgContent { - x: number; - y: number; - type?: "link" | "file" | "dir"; - /** - * The name of the file within the DMG. Defaults to basename of `path`. - */ - name?: string; - /** - * The path of the file within the DMG. - */ - path?: string; -} -export interface MasConfiguration extends MacConfiguration { - /** - * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set). - * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.plist). - */ - readonly entitlements?: string | null; - /** - * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set). - * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.inherit.plist). - */ - readonly entitlementsInherit?: string | null; - /** - * Paths of any extra binaries that need to be signed. - */ - readonly binaries?: Array | null; -} diff --git a/node_modules/app-builder-lib/out/options/macOptions.js b/node_modules/app-builder-lib/out/options/macOptions.js deleted file mode 100644 index 28a1ec2..0000000 --- a/node_modules/app-builder-lib/out/options/macOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=macOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/macOptions.js.map b/node_modules/app-builder-lib/out/options/macOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/macOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/metadata.d.ts b/node_modules/app-builder-lib/out/options/metadata.d.ts deleted file mode 100644 index 8d5ea4a..0000000 --- a/node_modules/app-builder-lib/out/options/metadata.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Configuration } from "../configuration"; -export interface Metadata { - /** - * The application name. - * @required - */ - readonly name?: string; - /** - * The application description. - */ - readonly description?: string; - /** - * The url to the project [homepage](https://docs.npmjs.com/files/package.json#homepage) (NuGet Package `projectUrl` (optional) or Linux Package URL (required)). - * - * If not specified and your project repository is public on GitHub, it will be `https://github.com/${user}/${project}` by default. - */ - readonly homepage?: string | null; - /** - * *linux-only.* The [license](https://docs.npmjs.com/files/package.json#license) name. - */ - readonly license?: string | null; - readonly author?: AuthorMetadata | null; - /** - * The [repository](https://docs.npmjs.com/files/package.json#repository). - */ - readonly repository?: string | RepositoryInfo | null; - /** - * The electron-builder configuration. - */ - readonly build?: Configuration; - /** @private */ - readonly dependencies?: { - [key: string]: string; - }; - /** @private */ - readonly version?: string; - /** @private */ - readonly productName?: string | null; - /** @private */ - readonly main?: string | null; -} -export interface AuthorMetadata { - readonly name: string; - readonly email?: string; -} -export interface RepositoryInfo { - readonly url: string; -} diff --git a/node_modules/app-builder-lib/out/options/metadata.js b/node_modules/app-builder-lib/out/options/metadata.js deleted file mode 100644 index 635853f..0000000 --- a/node_modules/app-builder-lib/out/options/metadata.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/metadata.js.map b/node_modules/app-builder-lib/out/options/metadata.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/pkgOptions.d.ts b/node_modules/app-builder-lib/out/options/pkgOptions.d.ts deleted file mode 100644 index 5ddaee1..0000000 --- a/node_modules/app-builder-lib/out/options/pkgOptions.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { TargetSpecificOptions } from "../core"; -export declare type BackgroundAlignment = "center" | "left" | "right" | "top" | "bottom" | "topleft" | "topright" | "bottomleft" | "bottomright"; -export declare type BackgroundScaling = "tofit" | "none" | "proportional"; -/** - * macOS product archive options. - */ -export interface PkgOptions extends TargetSpecificOptions { - /** - * The scripts directory, relative to `build` (build resources directory). - * The scripts can be in any language so long as the files are marked executable and have the appropriate shebang indicating the path to the interpreter. - * Scripts are required to be executable (`chmod +x file`). - * @default build/pkg-scripts - * @see [Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html). - */ - readonly scripts?: string | null; - /** - * should be not documented, only to experiment - * @private - */ - readonly productbuild?: Array | null; - /** - * The install location. [Do not use it](https://stackoverflow.com/questions/12863944/how-do-you-specify-a-default-install-location-to-home-with-pkgbuild) to create per-user package. - * Mostly never you will need to change this option. `/Applications` would install it as expected into `/Applications` if the local system domain is chosen, or into `$HOME/Applications` if the home installation is chosen. - * @default /Applications - */ - readonly installLocation?: string | null; - /** - * Whether can be installed at the root of any volume, including non-system volumes. Otherwise, it cannot be installed at the root of a volume. - * - * Corresponds to [enable_anywhere](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70). - * @default true - */ - readonly allowAnywhere?: boolean | null; - /** - * Whether can be installed into the current user’s home directory. - * A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory. - * If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory. - * - * Corresponds to [enable_currentUserHome](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70). - * @default true - */ - readonly allowCurrentUserHome?: boolean | null; - /** - * Whether can be installed into the root directory. Should usually be `true` unless the product can be installed only to the user’s home directory. - * - * Corresponds to [enable_localSystem](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70). - * @default true - */ - readonly allowRootDirectory?: boolean | null; - /** - * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option. - */ - readonly identity?: string | null; - /** - * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target="_blank"` for links). - */ - readonly license?: string | null; - /** - * Options for the background image for the installer. - */ - readonly background?: PkgBackgroundOptions | null; - /** - * The path to the welcome file. This may be used to customize the text on the Introduction page of the installer. - */ - readonly welcome?: string | null; - /** - * The path to the conclusion file. This may be used to customize the text on the final "Summary" page of the installer. - */ - readonly conclusion?: string | null; - /** - * Install bundle over previous version if moved by user? - * @default true - */ - readonly isRelocatable?: boolean | null; - /** - * Don't install bundle if newer version on disk? - * @default true - */ - readonly isVersionChecked?: boolean | null; - /** - * Require identical bundle identifiers at install path? - * @default true - */ - readonly hasStrictIdentifier?: boolean | null; - /** - * Specifies how an existing version of the bundle on disk should be handled when the version in - * the package is installed. - * - * If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk; - * this has the effect of deleting old paths that no longer exist in the new version of - * the bundle. - * - * If you specify update, the bundle in the package overwrites the version on disk, and any files - * not contained in the package will be left intact; this is appropriate when you are delivering - * an update-only package. - * - * Another effect of update is that the package bundle will not be installed at all if there is - * not already a version on disk; this allows a package to deliver an update for an app that - * the user might have deleted. - * - * @default upgrade - */ - readonly overwriteAction?: "upgrade" | "update" | null; -} -/** - * Options for the background image in a PKG installer - */ -export interface PkgBackgroundOptions { - /** - * Path to the image to use as an installer background. - */ - file?: string; - /** - * Alignment of the background image. - * Options are: center, left, right, top, bottom, topleft, topright, bottomleft, bottomright - * @default center - */ - alignment?: BackgroundAlignment | null; - /** - * Scaling of the background image. - * Options are: tofit, none, proportional - * @default tofit - */ - scaling?: BackgroundScaling | null; -} diff --git a/node_modules/app-builder-lib/out/options/pkgOptions.js b/node_modules/app-builder-lib/out/options/pkgOptions.js deleted file mode 100644 index 6cfe5b0..0000000 --- a/node_modules/app-builder-lib/out/options/pkgOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=pkgOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/pkgOptions.js.map b/node_modules/app-builder-lib/out/options/pkgOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/pkgOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/options/winOptions.d.ts b/node_modules/app-builder-lib/out/options/winOptions.d.ts deleted file mode 100644 index 453ffb1..0000000 --- a/node_modules/app-builder-lib/out/options/winOptions.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { PlatformSpecificBuildOptions, TargetConfigType } from "../index"; -import { CustomWindowsSign } from "../codeSign/windowsCodeSign"; -export interface WindowsConfiguration extends PlatformSpecificBuildOptions { - /** - * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable](/configuration/nsis#portable) app without installation), `appx`, `msi`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. - * AppX package can be built only on Windows 10. - * - * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency. - * - * @default nsis - */ - readonly target?: TargetConfigType; - /** - * The path to application icon. - * @default build/icon.ico - */ - readonly icon?: string | null; - /** - * The trademarks and registered trademarks. - */ - readonly legalTrademarks?: string | null; - /** - * Array of signing algorithms used. For AppX `sha256` is always used. - * @default ['sha1', 'sha256'] - */ - readonly signingHashAlgorithms?: Array<"sha1" | "sha256"> | null; - /** - * The custom function (or path to file or module id) to sign Windows executable. - */ - readonly sign?: CustomWindowsSign | string | null; - /** - * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason. - * Please see [Code Signing](/code-signing). - */ - readonly certificateFile?: string | null; - /** - * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason. - * Please see [Code Signing](/code-signing). - */ - readonly certificatePassword?: string | null; - /** - * The name of the subject of the signing certificate. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits). - */ - readonly certificateSubjectName?: string | null; - /** - * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits). - */ - readonly certificateSha1?: string | null; - /** - * The path to an additional certificate file you want to add to the signature block. - */ - readonly additionalCertificateFile?: string | null; - /** - * The URL of the RFC 3161 time stamp server. - * @default http://timestamp.comodoca.com/rfc3161 - */ - readonly rfc3161TimeStampServer?: string | null; - /** - * The URL of the time stamp server. - * @default http://timestamp.verisign.com/scripts/timstamp.dll - */ - readonly timeStampServer?: string | null; - /** - * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided. - * Defaults to common name from your code signing certificate. - */ - readonly publisherName?: string | Array | null; - /** - * Whether to verify the signature of an available update before installation. - * The [publisher name](#publisherName) will be used for the signature verification. - * - * @default true - */ - readonly verifyUpdateCodeSignature?: boolean; - /** - * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed. - * Cannot be specified per target, allowed only in the `win`. - * @default asInvoker - */ - readonly requestedExecutionLevel?: RequestedExecutionLevel | null; - /** - * Whether to sign and add metadata to executable. Advanced option. - * @default true - */ - readonly signAndEditExecutable?: boolean; - /** - * Whether to sign DLL files. Advanced option. - * @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384 - * @default false - */ - readonly signDlls?: boolean; -} -export declare type RequestedExecutionLevel = "asInvoker" | "highestAvailable" | "requireAdministrator"; diff --git a/node_modules/app-builder-lib/out/options/winOptions.js b/node_modules/app-builder-lib/out/options/winOptions.js deleted file mode 100644 index 3ca62ec..0000000 --- a/node_modules/app-builder-lib/out/options/winOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=winOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/options/winOptions.js.map b/node_modules/app-builder-lib/out/options/winOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/options/winOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/packager.d.ts b/node_modules/app-builder-lib/out/packager.d.ts deleted file mode 100644 index c2ecefe..0000000 --- a/node_modules/app-builder-lib/out/packager.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -/// -import { Arch, DebugLogger, TmpDir } from "builder-util"; -import { CancellationToken } from "builder-util-runtime"; -import { EventEmitter } from "events"; -import { AppInfo } from "./appInfo"; -import { AfterPackContext, Configuration, Framework, Platform, SourceRepositoryInfo, Target } from "./index"; -import { Metadata } from "./options/metadata"; -import { ArtifactBuildStarted, ArtifactCreated, PackagerOptions } from "./packagerApi"; -import { PlatformPackager } from "./platformPackager"; -export declare class Packager { - readonly cancellationToken: CancellationToken; - readonly projectDir: string; - private _appDir; - readonly appDir: string; - private _metadata; - readonly metadata: Metadata; - private _nodeModulesHandledExternally; - readonly areNodeModulesHandledExternally: boolean; - private _isPrepackedAppAsar; - readonly isPrepackedAppAsar: boolean; - private _devMetadata; - readonly devMetadata: Metadata | null; - private _configuration; - readonly config: Configuration; - isTwoPackageJsonProjectLayoutUsed: boolean; - readonly eventEmitter: EventEmitter; - _appInfo: AppInfo | null; - readonly appInfo: AppInfo; - readonly tempDirManager: TmpDir; - private _repositoryInfo; - private readonly afterPackHandlers; - readonly options: PackagerOptions; - readonly debugLogger: DebugLogger; - readonly repositoryInfo: Promise; - private _productionDeps; - private readonly productionDeps; - stageDirPathCustomizer: (target: Target, packager: PlatformPackager, arch: Arch) => string; - private _buildResourcesDir; - readonly buildResourcesDir: string; - readonly relativeBuildResourcesDirname: string; - private _framework; - readonly framework: Framework; - constructor(options: PackagerOptions, cancellationToken?: CancellationToken); - addAfterPackHandler(handler: (context: AfterPackContext) => Promise | null): void; - artifactCreated(handler: (event: ArtifactCreated) => void): Packager; - callArtifactBuildStarted(event: ArtifactBuildStarted, logFields?: any): Promise; - /** - * Only for sub artifacts (update info), for main artifacts use `callArtifactBuildCompleted`. - */ - dispatchArtifactCreated(event: ArtifactCreated): void; - callArtifactBuildCompleted(event: ArtifactCreated): Promise; - build(): Promise; - _build(configuration: Configuration, metadata: Metadata, devMetadata: Metadata | null, repositoryInfo?: SourceRepositoryInfo): Promise; - private readProjectMetadataIfTwoPackageStructureOrPrepacked; - private doBuild; - private createHelper; - private installAppDependencies; - afterPack(context: AfterPackContext): Promise; -} -export interface BuildResult { - readonly outDir: string; - readonly artifactPaths: Array; - readonly platformToTargets: Map>; - readonly configuration: Configuration; -} diff --git a/node_modules/app-builder-lib/out/packager.js b/node_modules/app-builder-lib/out/packager.js deleted file mode 100644 index e310ea0..0000000 --- a/node_modules/app-builder-lib/out/packager.js +++ /dev/null @@ -1,847 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Packager = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _events() { - const data = require("events"); - - _events = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _isCi() { - const data = _interopRequireDefault(require("is-ci")); - - _isCi = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _appInfo() { - const data = require("./appInfo"); - - _appInfo = function () { - return data; - }; - - return data; -} - -function _asar() { - const data = require("./asar/asar"); - - _asar = function () { - return data; - }; - - return data; -} - -function _ElectronFramework() { - const data = require("./electron/ElectronFramework"); - - _ElectronFramework = function () { - return data; - }; - - return data; -} - -function _LibUiFramework() { - const data = require("./frameworks/LibUiFramework"); - - _LibUiFramework = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("./index"); - - _index = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("./platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _ProtonFramework() { - const data = require("./ProtonFramework"); - - _ProtonFramework = function () { - return data; - }; - - return data; -} - -function _targetFactory() { - const data = require("./targets/targetFactory"); - - _targetFactory = function () { - return data; - }; - - return data; -} - -function _config() { - const data = require("./util/config"); - - _config = function () { - return data; - }; - - return data; -} - -function _macroExpander() { - const data = require("./util/macroExpander"); - - _macroExpander = function () { - return data; - }; - - return data; -} - -function _packageDependencies() { - const data = require("./util/packageDependencies"); - - _packageDependencies = function () { - return data; - }; - - return data; -} - -function _packageMetadata() { - const data = require("./util/packageMetadata"); - - _packageMetadata = function () { - return data; - }; - - return data; -} - -function _repositoryInfo() { - const data = require("./util/repositoryInfo"); - - _repositoryInfo = function () { - return data; - }; - - return data; -} - -function _yarn() { - const data = require("./util/yarn"); - - _yarn = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function addHandler(emitter, event, handler) { - emitter.on(event, handler); -} - -function createFrameworkInfo(_x, _x2) { - return _createFrameworkInfo.apply(this, arguments); -} - -function _createFrameworkInfo() { - _createFrameworkInfo = (0, _bluebirdLst().coroutine)(function* (configuration, packager) { - let framework = configuration.framework; - - if (framework != null) { - framework = framework.toLowerCase(); - } - - let nodeVersion = configuration.nodeVersion; // noinspection JSDeprecatedSymbols - - if (framework == null && configuration.protonNodeVersion != null) { - framework = "proton"; // noinspection JSDeprecatedSymbols - - nodeVersion = configuration.protonNodeVersion; - } - - if (framework === "electron" || framework == null) { - return yield (0, _ElectronFramework().createElectronFrameworkSupport)(configuration, packager); - } - - if (nodeVersion == null || nodeVersion === "current") { - nodeVersion = process.versions.node; - } - - const distMacOsName = `${packager.appInfo.productFilename}.app`; - const isUseLaunchUi = configuration.launchUiVersion !== false; - - if (framework === "proton") { - return new (_ProtonFramework().ProtonFramework)(nodeVersion, distMacOsName, isUseLaunchUi); - } else if (framework === "libui") { - return new (_LibUiFramework().LibUiFramework)(nodeVersion, distMacOsName, isUseLaunchUi); - } else { - throw new (_builderUtil().InvalidConfigurationError)(`Unknown framework: ${framework}`); - } - }); - return _createFrameworkInfo.apply(this, arguments); -} - -class Packager { - //noinspection JSUnusedGlobalSymbols - constructor(options, cancellationToken = new (_builderUtilRuntime().CancellationToken)()) { - this.cancellationToken = cancellationToken; - this._metadata = null; - this._nodeModulesHandledExternally = false; - this._isPrepackedAppAsar = false; - this._devMetadata = null; - this._configuration = null; - this.isTwoPackageJsonProjectLayoutUsed = false; - this.eventEmitter = new (_events().EventEmitter)(); - this._appInfo = null; - this.tempDirManager = new (_builderUtil().TmpDir)("packager"); - this._repositoryInfo = new (_lazyVal().Lazy)(() => (0, _repositoryInfo().getRepositoryInfo)(this.projectDir, this.metadata, this.devMetadata)); - this.afterPackHandlers = []; - this.debugLogger = new (_builderUtil().DebugLogger)(_builderUtil().log.isDebugEnabled); - this._productionDeps = null; - - this.stageDirPathCustomizer = (target, packager, arch) => { - return path.join(target.outDir, `__${target.name}-${_builderUtil().Arch[arch]}`); - }; - - this._buildResourcesDir = null; - this._framework = null; - - if ("devMetadata" in options) { - throw new (_builderUtil().InvalidConfigurationError)("devMetadata in the options is deprecated, please use config instead"); - } - - if ("extraMetadata" in options) { - throw new (_builderUtil().InvalidConfigurationError)("extraMetadata in the options is deprecated, please use config.extraMetadata instead"); - } - - const targets = options.targets || new Map(); - - if (options.targets == null) { - options.targets = targets; - } - - function processTargets(platform, types) { - function commonArch(currentIfNotSpecified) { - if (platform === _index().Platform.MAC) { - return currentIfNotSpecified ? [_builderUtil().Arch.x64] : []; - } - - const result = Array(); - return result.length === 0 && currentIfNotSpecified ? [(0, _builderUtil().archFromString)(process.arch)] : result; - } - - let archToType = targets.get(platform); - - if (archToType == null) { - archToType = new Map(); - targets.set(platform, archToType); - } - - if (types.length === 0) { - for (const arch of commonArch(false)) { - archToType.set(arch, []); - } - - return; - } - - for (const type of types) { - const suffixPos = type.lastIndexOf(":"); - - if (suffixPos > 0) { - (0, _builderUtil().addValue)(archToType, (0, _builderUtil().archFromString)(type.substring(suffixPos + 1)), type.substring(0, suffixPos)); - } else { - for (const arch of commonArch(true)) { - (0, _builderUtil().addValue)(archToType, arch, type); - } - } - } - } - - if (options.mac != null) { - processTargets(_index().Platform.MAC, options.mac); - } - - if (options.linux != null) { - processTargets(_index().Platform.LINUX, options.linux); - } - - if (options.win != null) { - processTargets(_index().Platform.WINDOWS, options.win); - } - - this.projectDir = options.projectDir == null ? process.cwd() : path.resolve(options.projectDir); - this._appDir = this.projectDir; - this.options = Object.assign({}, options, { - prepackaged: options.prepackaged == null ? null : path.resolve(this.projectDir, options.prepackaged) - }); - - try { - _builderUtil().log.info({ - version: "20.38.4" - }, "electron-builder"); - } catch (e) { - // error in dev mode without babel - if (!(e instanceof ReferenceError)) { - throw e; - } - } - } - - get appDir() { - return this._appDir; - } - - get metadata() { - return this._metadata; - } - - get areNodeModulesHandledExternally() { - return this._nodeModulesHandledExternally; - } - - get isPrepackedAppAsar() { - return this._isPrepackedAppAsar; - } - - get devMetadata() { - return this._devMetadata; - } - - get config() { - return this._configuration; - } - - get appInfo() { - return this._appInfo; - } - - get repositoryInfo() { - return this._repositoryInfo.value; - } - - get productionDeps() { - var _this = this; - - let result = this._productionDeps; - - if (result == null) { - // https://github.com/electron-userland/electron-builder/issues/2551 - result = new (_lazyVal().Lazy)( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - if (_this.config.beforeBuild == null || (yield (0, _fs().exists)(path.join(_this.appDir, "node_modules")))) { - return yield (0, _packageDependencies().getProductionDependencies)(_this.appDir); - } else { - return []; - } - })); - this._productionDeps = result; - } - - return result; - } - - get buildResourcesDir() { - let result = this._buildResourcesDir; - - if (result == null) { - result = path.resolve(this.projectDir, this.relativeBuildResourcesDirname); - this._buildResourcesDir = result; - } - - return result; - } - - get relativeBuildResourcesDirname() { - return this.config.directories.buildResources; - } - - get framework() { - return this._framework; - } - - addAfterPackHandler(handler) { - this.afterPackHandlers.push(handler); - } - - artifactCreated(handler) { - addHandler(this.eventEmitter, "artifactCreated", handler); - return this; - } - - callArtifactBuildStarted(event, logFields) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - _builderUtil().log.info(logFields || { - target: event.targetPresentableName, - arch: event.arch == null ? null : _builderUtil().Arch[event.arch], - file: _builderUtil().log.filePath(event.file) - }, "building"); - - const handler = (0, _platformPackager().resolveFunction)(_this2.config.artifactBuildStarted, "artifactBuildStarted"); - - if (handler != null) { - yield Promise.resolve(handler(event)); - } - })(); - } - /** - * Only for sub artifacts (update info), for main artifacts use `callArtifactBuildCompleted`. - */ - - - dispatchArtifactCreated(event) { - this.eventEmitter.emit("artifactCreated", event); - } - - callArtifactBuildCompleted(event) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - _this3.dispatchArtifactCreated(event); - - const handler = (0, _platformPackager().resolveFunction)(_this3.config.artifactBuildCompleted, "artifactBuildCompleted"); - - if (handler != null) { - yield Promise.resolve(handler(event)); - } - })(); - } - - build() { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - let configPath = null; - let configFromOptions = _this4.options.config; - - if (typeof configFromOptions === "string") { - // it is a path to config file - configPath = configFromOptions; - configFromOptions = null; - } else if (configFromOptions != null && configFromOptions.extends != null && configFromOptions.extends.includes(".")) { - configPath = configFromOptions.extends; - delete configFromOptions.extends; - } - - const projectDir = _this4.projectDir; - const devPackageFile = path.join(projectDir, "package.json"); - _this4._devMetadata = yield (0, _promise().orNullIfFileNotExist)((0, _packageMetadata().readPackageJson)(devPackageFile)); - const devMetadata = _this4.devMetadata; - const configuration = yield (0, _config().getConfig)(projectDir, configPath, configFromOptions, new (_lazyVal().Lazy)(() => Promise.resolve(devMetadata))); - - if (_builderUtil().log.isDebugEnabled) { - _builderUtil().log.debug({ - config: getSafeEffectiveConfig(configuration) - }, "effective config"); - } - - _this4._appDir = yield (0, _config().computeDefaultAppDirectory)(projectDir, configuration.directories.app); - _this4.isTwoPackageJsonProjectLayoutUsed = _this4._appDir !== projectDir; - const appPackageFile = _this4.isTwoPackageJsonProjectLayoutUsed ? path.join(_this4.appDir, "package.json") : devPackageFile; // tslint:disable:prefer-conditional-expression - - if (_this4.devMetadata != null && !_this4.isTwoPackageJsonProjectLayoutUsed) { - _this4._metadata = _this4.devMetadata; - } else { - _this4._metadata = yield _this4.readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile); - } - - (0, _builderUtil().deepAssign)(_this4.metadata, configuration.extraMetadata); - - if (_this4.isTwoPackageJsonProjectLayoutUsed) { - _builderUtil().log.debug({ - devPackageFile, - appPackageFile - }, "two package.json structure is used"); - } - - (0, _packageMetadata().checkMetadata)(_this4.metadata, _this4.devMetadata, appPackageFile, devPackageFile); - return yield _this4._build(configuration, _this4._metadata, _this4._devMetadata); - })(); - } // external caller of this method always uses isTwoPackageJsonProjectLayoutUsed=false and appDir=projectDir, no way (and need) to use another values - - - _build(configuration, metadata, devMetadata, repositoryInfo) { - var _this5 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - yield (0, _config().validateConfig)(configuration, _this5.debugLogger); - _this5._configuration = configuration; - _this5._metadata = metadata; - _this5._devMetadata = devMetadata; - - if (repositoryInfo != null) { - _this5._repositoryInfo.value = Promise.resolve(repositoryInfo); - } - - _this5._appInfo = new (_appInfo().AppInfo)(_this5, null); - _this5._framework = yield createFrameworkInfo(_this5.config, _this5); - const commonOutDirWithoutPossibleOsMacro = path.resolve(_this5.projectDir, (0, _macroExpander().expandMacro)(configuration.directories.output, null, _this5._appInfo, { - os: "" - })); - - if (!_isCi().default && process.stdout.isTTY) { - const effectiveConfigFile = path.join(commonOutDirWithoutPossibleOsMacro, "builder-effective-config.yaml"); - - _builderUtil().log.info({ - file: _builderUtil().log.filePath(effectiveConfigFile) - }, "writing effective config"); - - yield (0, _fsExtraP().outputFile)(effectiveConfigFile, getSafeEffectiveConfig(configuration)); - } // because artifact event maybe dispatched several times for different publish providers - - - const artifactPaths = new Set(); - - _this5.artifactCreated(event => { - if (event.file != null) { - artifactPaths.add(event.file); - } - }); - - const platformToTargets = yield (0, _promise().executeFinally)(_this5.doBuild(), - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - if (_this5.debugLogger.isEnabled) { - yield _this5.debugLogger.save(path.join(commonOutDirWithoutPossibleOsMacro, "builder-debug.yml")); - } - - yield _this5.tempDirManager.cleanup(); - })); - return { - outDir: commonOutDirWithoutPossibleOsMacro, - artifactPaths: Array.from(artifactPaths), - platformToTargets, - configuration - }; - })(); - } - - readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile) { - var _this6 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - let data = yield (0, _promise().orNullIfFileNotExist)((0, _packageMetadata().readPackageJson)(appPackageFile)); - - if (data != null) { - return data; - } - - data = yield (0, _promise().orNullIfFileNotExist)((0, _asar().readAsarJson)(path.join(_this6.projectDir, "app.asar"), "package.json")); - - if (data != null) { - _this6._isPrepackedAppAsar = true; - return data; - } - - throw new Error(`Cannot find package.json in the ${path.dirname(appPackageFile)}`); - })(); - } - - doBuild() { - var _this7 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const taskManager = new (_builderUtil().AsyncTaskManager)(_this7.cancellationToken); - const platformToTarget = new Map(); - const createdOutDirs = new Set(); - - for (const [platform, archToType] of _this7.options.targets) { - if (_this7.cancellationToken.cancelled) { - break; - } - - if (platform === _index().Platform.MAC && process.platform === _index().Platform.WINDOWS.nodeName) { - throw new (_builderUtil().InvalidConfigurationError)("Build for macOS is supported only on macOS, please see https://electron.build/multi-platform-build"); - } - - const packager = _this7.createHelper(platform); - - const nameToTarget = new Map(); - platformToTarget.set(platform, nameToTarget); - - for (const [arch, targetNames] of (0, _targetFactory().computeArchToTargetNamesMap)(archToType, packager.platformSpecificBuildOptions, platform)) { - if (_this7.cancellationToken.cancelled) { - break; - } - - yield _this7.installAppDependencies(platform, arch); - - if (_this7.cancellationToken.cancelled) { - break; - } // support os and arch macro in output value - - - const outDir = path.resolve(_this7.projectDir, packager.expandMacro(_this7._configuration.directories.output, _builderUtil().Arch[arch])); - const targetList = (0, _targetFactory().createTargets)(nameToTarget, targetNames.length === 0 ? packager.defaultTarget : targetNames, outDir, packager); - yield createOutDirIfNeed(targetList, createdOutDirs); - yield packager.pack(outDir, arch, targetList, taskManager); - } - - if (_this7.cancellationToken.cancelled) { - break; - } - - for (const target of nameToTarget.values()) { - taskManager.addTask(target.finishBuild()); - } - } - - yield taskManager.awaitTasks(); - return platformToTarget; - })(); - } - - createHelper(platform) { - if (this.options.platformPackagerFactory != null) { - return this.options.platformPackagerFactory(this, platform); - } - - switch (platform) { - case _index().Platform.MAC: - { - const helperClass = require("./macPackager").default; - - return new helperClass(this); - } - - case _index().Platform.WINDOWS: - { - const helperClass = require("./winPackager").WinPackager; - - return new helperClass(this); - } - - case _index().Platform.LINUX: - return new (require("./linuxPackager").LinuxPackager)(this); - - default: - throw new Error(`Unknown platform: ${platform}`); - } - } - - installAppDependencies(platform, arch) { - var _this8 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (_this8.options.prepackaged != null || _this8.framework.isNpmRebuildRequired !== true) { - return; - } - - const frameworkInfo = { - version: _this8.framework.version, - useCustomDist: _this8.config.muonVersion == null - }; - const config = _this8.config; - - if (config.nodeGypRebuild === true) { - _builderUtil().log.info({ - arch: _builderUtil().Arch[arch] - }, "executing node-gyp rebuild"); - - yield (0, _builderUtil().exec)(process.platform === "win32" ? "node-gyp.cmd" : "node-gyp", ["rebuild"], { - env: (0, _yarn().getGypEnv)(frameworkInfo, platform.nodeName, _builderUtil().Arch[arch], true) - }); - } - - if (config.npmRebuild === false) { - _builderUtil().log.info({ - reason: "npmRebuild is set to false" - }, "skipped app dependencies rebuild"); - - return; - } - - const beforeBuild = (0, _platformPackager().resolveFunction)(config.beforeBuild, "beforeBuild"); - - if (beforeBuild != null) { - const performDependenciesInstallOrRebuild = yield beforeBuild({ - appDir: _this8.appDir, - electronVersion: _this8.config.electronVersion, - platform, - arch: _builderUtil().Arch[arch] - }); // If beforeBuild resolves to false, it means that handling node_modules is done outside of electron-builder. - - _this8._nodeModulesHandledExternally = !performDependenciesInstallOrRebuild; - - if (!performDependenciesInstallOrRebuild) { - return; - } - } - - if (config.buildDependenciesFromSource === true && platform.nodeName !== process.platform) { - _builderUtil().log.info({ - reason: "platform is different and buildDependenciesFromSource is set to true" - }, "skipped app dependencies rebuild"); - } else { - yield (0, _yarn().installOrRebuild)(config, _this8.appDir, { - frameworkInfo, - platform: platform.nodeName, - arch: _builderUtil().Arch[arch], - productionDeps: _this8.productionDeps - }); - } - })(); - } - - afterPack(context) { - const afterPack = (0, _platformPackager().resolveFunction)(this.config.afterPack, "afterPack"); - const handlers = this.afterPackHandlers.slice(); - - if (afterPack != null) { - // user handler should be last - handlers.push(afterPack); - } - - return _bluebirdLst().default.each(handlers, it => it(context)); - } - -} - -exports.Packager = Packager; - -function createOutDirIfNeed(targetList, createdOutDirs) { - const ourDirs = new Set(); - - for (const target of targetList) { - // noinspection SuspiciousInstanceOfGuard - if (target instanceof _targetFactory().NoOpTarget) { - continue; - } - - const outDir = target.outDir; - - if (!createdOutDirs.has(outDir)) { - ourDirs.add(outDir); - } - } - - if (ourDirs.size > 0) { - return _bluebirdLst().default.map(Array.from(ourDirs).sort(), it => { - createdOutDirs.add(it); - return (0, _fsExtraP().ensureDir)(it); - }); - } - - return Promise.resolve(); -} - -function getSafeEffectiveConfig(configuration) { - const o = JSON.parse((0, _builderUtil().safeStringifyJson)(configuration)); - - if (o.cscLink != null) { - o.cscLink = ""; - } - - return (0, _builderUtil().serializeToYaml)(o, true); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=packager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/packager.js.map b/node_modules/app-builder-lib/out/packager.js.map deleted file mode 100644 index f871208..0000000 --- a/node_modules/app-builder-lib/out/packager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/packager.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAA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AACrB,IAAA,CAAC,CAAC,OAAF,GAAY,qBAAZ;AACD;;AACD,SAAO,oCAAgB,CAAhB,EAAmB,IAAnB,CAAP;AACD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { addValue, Arch, archFromString, AsyncTaskManager, DebugLogger, deepAssign, exec, InvalidConfigurationError, log, safeStringifyJson, serializeToYaml, TmpDir } from \"builder-util\"\nimport { CancellationToken } from \"builder-util-runtime\"\nimport { exists } from \"builder-util/out/fs\"\nimport { executeFinally, orNullIfFileNotExist } from \"builder-util/out/promise\"\nimport { EventEmitter } from \"events\"\nimport { ensureDir, outputFile } from \"fs-extra-p\"\nimport isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { readAsarJson } from \"./asar/asar\"\nimport { createElectronFrameworkSupport } from \"./electron/ElectronFramework\"\nimport { LibUiFramework } from \"./frameworks/LibUiFramework\"\nimport { AfterPackContext, Configuration, Framework, Platform, SourceRepositoryInfo, Target } from \"./index\"\nimport MacPackager from \"./macPackager\"\nimport { Metadata } from \"./options/metadata\"\nimport { ArtifactBuildStarted, ArtifactCreated, PackagerOptions } from \"./packagerApi\"\nimport { PlatformPackager, resolveFunction } from \"./platformPackager\"\nimport { ProtonFramework } from \"./ProtonFramework\"\nimport { computeArchToTargetNamesMap, createTargets, NoOpTarget } from \"./targets/targetFactory\"\nimport { computeDefaultAppDirectory, getConfig, validateConfig } from \"./util/config\"\nimport { expandMacro } from \"./util/macroExpander\"\nimport { Dependency, getProductionDependencies } from \"./util/packageDependencies\"\nimport { checkMetadata, readPackageJson } from \"./util/packageMetadata\"\nimport { getRepositoryInfo } from \"./util/repositoryInfo\"\nimport { getGypEnv, installOrRebuild } from \"./util/yarn\"\nimport { WinPackager } from \"./winPackager\"\n\nfunction addHandler(emitter: EventEmitter, event: string, handler: (...args: Array) => void) {\n emitter.on(event, handler)\n}\n\ndeclare const PACKAGE_VERSION: string\n\nasync function createFrameworkInfo(configuration: Configuration, packager: Packager): Promise {\n let framework = configuration.framework\n if (framework != null) {\n framework = framework.toLowerCase()\n }\n\n let nodeVersion = configuration.nodeVersion\n // noinspection JSDeprecatedSymbols\n if (framework == null && configuration.protonNodeVersion != null) {\n framework = \"proton\"\n // noinspection JSDeprecatedSymbols\n nodeVersion = configuration.protonNodeVersion\n }\n\n if (framework === \"electron\" || framework == null) {\n return await createElectronFrameworkSupport(configuration, packager)\n }\n\n if (nodeVersion == null || nodeVersion === \"current\") {\n nodeVersion = process.versions.node\n }\n\n const distMacOsName = `${packager.appInfo.productFilename}.app`\n const isUseLaunchUi = configuration.launchUiVersion !== false\n if (framework === \"proton\") {\n return new ProtonFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n }\n else if (framework === \"libui\") {\n return new LibUiFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n }\n else {\n throw new InvalidConfigurationError(`Unknown framework: ${framework}`)\n }\n}\n\nexport class Packager {\n readonly projectDir: string\n\n private _appDir: string\n get appDir(): string {\n return this._appDir\n }\n\n private _metadata: Metadata | null = null\n get metadata(): Metadata {\n return this._metadata!!\n }\n\n private _nodeModulesHandledExternally: boolean = false\n\n get areNodeModulesHandledExternally(): boolean {\n return this._nodeModulesHandledExternally\n }\n\n private _isPrepackedAppAsar: boolean = false\n\n get isPrepackedAppAsar(): boolean {\n return this._isPrepackedAppAsar\n }\n\n private _devMetadata: Metadata | null = null\n get devMetadata(): Metadata | null {\n return this._devMetadata\n }\n\n private _configuration: Configuration | null = null\n\n get config(): Configuration {\n return this._configuration!!\n }\n\n isTwoPackageJsonProjectLayoutUsed = false\n\n readonly eventEmitter = new EventEmitter()\n\n _appInfo: AppInfo | null = null\n get appInfo(): AppInfo {\n return this._appInfo!!\n }\n\n readonly tempDirManager = new TmpDir(\"packager\")\n\n private _repositoryInfo = new Lazy(() => getRepositoryInfo(this.projectDir, this.metadata, this.devMetadata))\n\n private readonly afterPackHandlers: Array<(context: AfterPackContext) => Promise | null> = []\n\n readonly options: PackagerOptions\n\n readonly debugLogger = new DebugLogger(log.isDebugEnabled)\n\n get repositoryInfo(): Promise {\n return this._repositoryInfo.value\n }\n\n private _productionDeps: Lazy> | null = null\n\n private get productionDeps(): Lazy> {\n let result = this._productionDeps\n if (result == null) {\n // https://github.com/electron-userland/electron-builder/issues/2551\n result = new Lazy(async () => {\n if (this.config.beforeBuild == null || (await exists(path.join(this.appDir, \"node_modules\")))) {\n return await getProductionDependencies(this.appDir)\n }\n else {\n return []\n }\n })\n this._productionDeps = result\n }\n return result\n }\n\n stageDirPathCustomizer: (target: Target, packager: PlatformPackager, arch: Arch) => string = (target, packager, arch) => {\n return path.join(target.outDir, `__${target.name}-${Arch[arch]}`)\n }\n\n private _buildResourcesDir: string | null = null\n\n get buildResourcesDir(): string {\n let result = this._buildResourcesDir\n if (result == null) {\n result = path.resolve(this.projectDir, this.relativeBuildResourcesDirname)\n this._buildResourcesDir = result\n }\n return result\n }\n\n get relativeBuildResourcesDirname(): string {\n return this.config.directories!!.buildResources!!\n }\n\n private _framework: Framework | null = null\n get framework(): Framework {\n return this._framework!!\n }\n\n //noinspection JSUnusedGlobalSymbols\n constructor(options: PackagerOptions, readonly cancellationToken = new CancellationToken()) {\n if (\"devMetadata\" in options) {\n throw new InvalidConfigurationError(\"devMetadata in the options is deprecated, please use config instead\")\n }\n if (\"extraMetadata\" in options) {\n throw new InvalidConfigurationError(\"extraMetadata in the options is deprecated, please use config.extraMetadata instead\")\n }\n\n const targets = options.targets || new Map>>()\n if (options.targets == null) {\n options.targets = targets\n }\n\n function processTargets(platform: Platform, types: Array) {\n function commonArch(currentIfNotSpecified: boolean): Array {\n if (platform === Platform.MAC) {\n return currentIfNotSpecified ? [Arch.x64] : []\n }\n\n const result = Array()\n return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result\n }\n\n let archToType = targets.get(platform)\n if (archToType == null) {\n archToType = new Map>()\n targets.set(platform, archToType)\n }\n\n if (types.length === 0) {\n for (const arch of commonArch(false)) {\n archToType.set(arch, [])\n }\n return\n }\n\n for (const type of types) {\n const suffixPos = type.lastIndexOf(\":\")\n if (suffixPos > 0) {\n addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos))\n }\n else {\n for (const arch of commonArch(true)) {\n addValue(archToType, arch, type)\n }\n }\n }\n }\n\n if (options.mac != null) {\n processTargets(Platform.MAC, options.mac)\n }\n if (options.linux != null) {\n processTargets(Platform.LINUX, options.linux)\n }\n if (options.win != null) {\n processTargets(Platform.WINDOWS, options.win)\n }\n\n this.projectDir = options.projectDir == null ? process.cwd() : path.resolve(options.projectDir)\n this._appDir = this.projectDir\n this.options = {\n ...options,\n prepackaged: options.prepackaged == null ? null : path.resolve(this.projectDir, options.prepackaged)\n }\n\n try {\n log.info({version: PACKAGE_VERSION}, \"electron-builder\")\n }\n catch (e) {\n // error in dev mode without babel\n if (!(e instanceof ReferenceError)) {\n throw e\n }\n }\n }\n\n addAfterPackHandler(handler: (context: AfterPackContext) => Promise | null) {\n this.afterPackHandlers.push(handler)\n }\n\n artifactCreated(handler: (event: ArtifactCreated) => void): Packager {\n addHandler(this.eventEmitter, \"artifactCreated\", handler)\n return this\n }\n\n async callArtifactBuildStarted(event: ArtifactBuildStarted, logFields?: any): Promise {\n log.info(logFields || {\n target: event.targetPresentableName,\n arch: event.arch == null ? null : Arch[event.arch],\n file: log.filePath(event.file),\n }, \"building\")\n const handler = resolveFunction(this.config.artifactBuildStarted, \"artifactBuildStarted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n }\n\n /**\n * Only for sub artifacts (update info), for main artifacts use `callArtifactBuildCompleted`.\n */\n dispatchArtifactCreated(event: ArtifactCreated): void {\n this.eventEmitter.emit(\"artifactCreated\", event)\n }\n\n async callArtifactBuildCompleted(event: ArtifactCreated): Promise {\n this.dispatchArtifactCreated(event)\n\n const handler = resolveFunction(this.config.artifactBuildCompleted, \"artifactBuildCompleted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n }\n\n async build(): Promise {\n let configPath: string | null = null\n let configFromOptions = this.options.config\n if (typeof configFromOptions === \"string\") {\n // it is a path to config file\n configPath = configFromOptions\n configFromOptions = null\n }\n else if (configFromOptions != null && configFromOptions.extends != null && configFromOptions.extends.includes(\".\")) {\n configPath = configFromOptions.extends\n delete configFromOptions.extends\n }\n\n const projectDir = this.projectDir\n\n const devPackageFile = path.join(projectDir, \"package.json\")\n this._devMetadata = await orNullIfFileNotExist(readPackageJson(devPackageFile))\n\n const devMetadata = this.devMetadata\n const configuration = await getConfig(projectDir, configPath, configFromOptions, new Lazy(() => Promise.resolve(devMetadata)))\n if (log.isDebugEnabled) {\n log.debug({config: getSafeEffectiveConfig(configuration)}, \"effective config\")\n }\n\n this._appDir = await computeDefaultAppDirectory(projectDir, configuration.directories!!.app)\n this.isTwoPackageJsonProjectLayoutUsed = this._appDir !== projectDir\n\n const appPackageFile = this.isTwoPackageJsonProjectLayoutUsed ? path.join(this.appDir, \"package.json\") : devPackageFile\n\n // tslint:disable:prefer-conditional-expression\n if (this.devMetadata != null && !this.isTwoPackageJsonProjectLayoutUsed) {\n this._metadata = this.devMetadata\n }\n else {\n this._metadata = await this.readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile)\n }\n deepAssign(this.metadata, configuration.extraMetadata)\n\n if (this.isTwoPackageJsonProjectLayoutUsed) {\n log.debug({devPackageFile, appPackageFile}, \"two package.json structure is used\")\n }\n checkMetadata(this.metadata, this.devMetadata, appPackageFile, devPackageFile)\n\n return await this._build(configuration, this._metadata, this._devMetadata)\n }\n\n // external caller of this method always uses isTwoPackageJsonProjectLayoutUsed=false and appDir=projectDir, no way (and need) to use another values\n async _build(configuration: Configuration, metadata: Metadata, devMetadata: Metadata | null, repositoryInfo?: SourceRepositoryInfo): Promise {\n await validateConfig(configuration, this.debugLogger)\n this._configuration = configuration\n this._metadata = metadata\n this._devMetadata = devMetadata\n\n if (repositoryInfo != null) {\n this._repositoryInfo.value = Promise.resolve(repositoryInfo)\n }\n\n this._appInfo = new AppInfo(this, null)\n this._framework = await createFrameworkInfo(this.config, this)\n\n const commonOutDirWithoutPossibleOsMacro = path.resolve(this.projectDir, expandMacro(configuration.directories!!.output!!, null, this._appInfo, {\n os: \"\",\n }))\n\n if (!isCI && (process.stdout as any).isTTY) {\n const effectiveConfigFile = path.join(commonOutDirWithoutPossibleOsMacro, \"builder-effective-config.yaml\")\n log.info({file: log.filePath(effectiveConfigFile)}, \"writing effective config\")\n await outputFile(effectiveConfigFile, getSafeEffectiveConfig(configuration))\n }\n\n // because artifact event maybe dispatched several times for different publish providers\n const artifactPaths = new Set()\n this.artifactCreated(event => {\n if (event.file != null) {\n artifactPaths.add(event.file)\n }\n })\n\n const platformToTargets = await executeFinally(this.doBuild(), async () => {\n if (this.debugLogger.isEnabled) {\n await this.debugLogger.save(path.join(commonOutDirWithoutPossibleOsMacro, \"builder-debug.yml\"))\n }\n await this.tempDirManager.cleanup()\n })\n\n return {\n outDir: commonOutDirWithoutPossibleOsMacro,\n artifactPaths: Array.from(artifactPaths),\n platformToTargets,\n configuration,\n }\n }\n\n private async readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile: string): Promise {\n let data = await orNullIfFileNotExist(readPackageJson(appPackageFile))\n if (data != null) {\n return data\n }\n\n data = await orNullIfFileNotExist(readAsarJson(path.join(this.projectDir, \"app.asar\"), \"package.json\"))\n if (data != null) {\n this._isPrepackedAppAsar = true\n return data\n }\n\n throw new Error(`Cannot find package.json in the ${path.dirname(appPackageFile)}`)\n }\n\n private async doBuild(): Promise>> {\n const taskManager = new AsyncTaskManager(this.cancellationToken)\n\n const platformToTarget = new Map>()\n const createdOutDirs = new Set()\n\n for (const [platform, archToType] of this.options.targets!) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n if (platform === Platform.MAC && process.platform === Platform.WINDOWS.nodeName) {\n throw new InvalidConfigurationError(\"Build for macOS is supported only on macOS, please see https://electron.build/multi-platform-build\")\n }\n\n const packager = this.createHelper(platform)\n const nameToTarget: Map = new Map()\n platformToTarget.set(platform, nameToTarget)\n\n for (const [arch, targetNames] of computeArchToTargetNamesMap(archToType, packager.platformSpecificBuildOptions, platform)) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n await this.installAppDependencies(platform, arch)\n\n if (this.cancellationToken.cancelled) {\n break\n }\n\n // support os and arch macro in output value\n const outDir = path.resolve(this.projectDir, packager.expandMacro(this._configuration!!.directories!!.output!!, Arch[arch]))\n const targetList = createTargets(nameToTarget, targetNames.length === 0 ? packager.defaultTarget : targetNames, outDir, packager)\n await createOutDirIfNeed(targetList, createdOutDirs)\n await packager.pack(outDir, arch, targetList, taskManager)\n }\n\n if (this.cancellationToken.cancelled) {\n break\n }\n\n for (const target of nameToTarget.values()) {\n taskManager.addTask(target.finishBuild())\n }\n }\n\n await taskManager.awaitTasks()\n return platformToTarget\n }\n\n private createHelper(platform: Platform): PlatformPackager {\n if (this.options.platformPackagerFactory != null) {\n return this.options.platformPackagerFactory!(this, platform)\n }\n\n switch (platform) {\n case Platform.MAC:\n {\n const helperClass: typeof MacPackager = require(\"./macPackager\").default\n return new helperClass(this)\n }\n\n case Platform.WINDOWS:\n {\n const helperClass: typeof WinPackager = require(\"./winPackager\").WinPackager\n return new helperClass(this)\n }\n\n case Platform.LINUX:\n return new (require(\"./linuxPackager\").LinuxPackager)(this)\n\n default:\n throw new Error(`Unknown platform: ${platform}`)\n }\n }\n\n private async installAppDependencies(platform: Platform, arch: Arch): Promise {\n if (this.options.prepackaged != null || this.framework.isNpmRebuildRequired !== true) {\n return\n }\n\n const frameworkInfo = {version: this.framework.version, useCustomDist: this.config.muonVersion == null}\n const config = this.config\n if (config.nodeGypRebuild === true) {\n log.info({arch: Arch[arch]}, \"executing node-gyp rebuild\")\n await exec(process.platform === \"win32\" ? \"node-gyp.cmd\" : \"node-gyp\", [\"rebuild\"], {\n env: getGypEnv(frameworkInfo, platform.nodeName, Arch[arch], true),\n })\n }\n\n if (config.npmRebuild === false) {\n log.info({reason: \"npmRebuild is set to false\"}, \"skipped app dependencies rebuild\")\n return\n }\n\n const beforeBuild = resolveFunction(config.beforeBuild, \"beforeBuild\")\n if (beforeBuild != null) {\n const performDependenciesInstallOrRebuild = await beforeBuild({\n appDir: this.appDir,\n electronVersion: this.config.electronVersion!,\n platform,\n arch: Arch[arch]\n })\n\n // If beforeBuild resolves to false, it means that handling node_modules is done outside of electron-builder.\n this._nodeModulesHandledExternally = !performDependenciesInstallOrRebuild\n if (!performDependenciesInstallOrRebuild) {\n return\n }\n }\n\n if (config.buildDependenciesFromSource === true && platform.nodeName !== process.platform) {\n log.info({reason: \"platform is different and buildDependenciesFromSource is set to true\"}, \"skipped app dependencies rebuild\")\n }\n else {\n await installOrRebuild(config, this.appDir, {\n frameworkInfo,\n platform: platform.nodeName,\n arch: Arch[arch],\n productionDeps: this.productionDeps,\n })\n }\n }\n\n afterPack(context: AfterPackContext): Promise {\n const afterPack = resolveFunction(this.config.afterPack, \"afterPack\")\n const handlers = this.afterPackHandlers.slice()\n if (afterPack != null) {\n // user handler should be last\n handlers.push(afterPack)\n }\n return BluebirdPromise.each(handlers, it => it(context))\n }\n}\n\nfunction createOutDirIfNeed(targetList: Array, createdOutDirs: Set): Promise {\n const ourDirs = new Set()\n for (const target of targetList) {\n // noinspection SuspiciousInstanceOfGuard\n if (target instanceof NoOpTarget) {\n continue\n }\n\n const outDir = (target as Target).outDir\n if (!createdOutDirs.has(outDir)) {\n ourDirs.add(outDir)\n }\n }\n\n if (ourDirs.size > 0) {\n return BluebirdPromise.map(Array.from(ourDirs).sort(), it => {\n createdOutDirs.add(it)\n return ensureDir(it)\n })\n }\n return Promise.resolve()\n}\n\nexport interface BuildResult {\n readonly outDir: string\n readonly artifactPaths: Array\n readonly platformToTargets: Map>\n readonly configuration: Configuration\n}\n\nfunction getSafeEffectiveConfig(configuration: Configuration): string {\n const o = JSON.parse(safeStringifyJson(configuration))\n if (o.cscLink != null) {\n o.cscLink = \"\"\n }\n return serializeToYaml(o, true)\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/packagerApi.d.ts b/node_modules/app-builder-lib/out/packagerApi.d.ts deleted file mode 100644 index acedda1..0000000 --- a/node_modules/app-builder-lib/out/packagerApi.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Arch } from "builder-util"; -import { PublishConfiguration } from "builder-util-runtime"; -import { Configuration } from "./configuration"; -import { Platform, Target } from "./core"; -import { Packager } from "./packager"; -import { PlatformPackager } from "./platformPackager"; -import { UploadTask } from "electron-publish"; -export interface PackagerOptions { - targets?: Map>>; - mac?: Array; - linux?: Array; - win?: Array; - projectDir?: string | null; - platformPackagerFactory?: ((info: Packager, platform: Platform) => PlatformPackager) | null; - readonly config?: Configuration | string | null; - readonly effectiveOptionComputed?: (options: any) => Promise; - readonly prepackaged?: string | null; -} -export interface ArtifactCreated extends UploadTask { - readonly packager: PlatformPackager; - readonly target: Target | null; - updateInfo?: any; - readonly safeArtifactName?: string | null; - readonly publishConfig?: PublishConfiguration; - readonly isWriteUpdateInfo?: boolean; -} -export interface ArtifactBuildStarted { - readonly targetPresentableName: string; - readonly file: string; - readonly arch: Arch | null; -} diff --git a/node_modules/app-builder-lib/out/packagerApi.js b/node_modules/app-builder-lib/out/packagerApi.js deleted file mode 100644 index 4fc1908..0000000 --- a/node_modules/app-builder-lib/out/packagerApi.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=packagerApi.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/packagerApi.js.map b/node_modules/app-builder-lib/out/packagerApi.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/packagerApi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/platformPackager.d.ts b/node_modules/app-builder-lib/out/platformPackager.d.ts deleted file mode 100644 index c790cfb..0000000 --- a/node_modules/app-builder-lib/out/platformPackager.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Arch, AsyncTaskManager, DebugLogger } from "builder-util"; -import { FileTransformer } from "builder-util/out/fs"; -import { AppInfo } from "./appInfo"; -import { GetFileMatchersOptions } from "./fileMatcher"; -import { AfterPackContext, CompressionLevel, Configuration, ElectronPlatformName, FileAssociation, Packager, PackagerOptions, Platform, PlatformSpecificBuildOptions, Target, TargetSpecificOptions } from "./index"; -export declare abstract class PlatformPackager { - readonly info: Packager; - readonly platform: Platform; - readonly packagerOptions: PackagerOptions; - readonly buildResourcesDir: string; - readonly projectDir: string; - readonly config: Configuration; - readonly platformSpecificBuildOptions: DC; - readonly resourceList: Promise>; - private readonly _resourceList; - readonly appInfo: AppInfo; - protected constructor(info: Packager, platform: Platform); - readonly compression: CompressionLevel; - readonly debugLogger: DebugLogger; - abstract readonly defaultTarget: Array; - protected prepareAppInfo(appInfo: AppInfo): AppInfo; - private static normalizePlatformSpecificBuildOptions; - abstract createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void; - protected getCscPassword(): string; - protected getCscLink(extraEnvName?: string | null): string | null | undefined; - protected doGetCscPassword(): string | null | undefined; - protected computeAppOutDir(outDir: string, arch: Arch): string; - dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): Promise; - pack(outDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): Promise; - protected packageInDistributableFormat(appOutDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): void; - private static buildAsyncTargets; - private getExtraFileMatchers; - readonly electronDistExecutableName: "electron" | "brave"; - readonly electronDistMacOsExecutableName: "Electron" | "Brave"; - createGetFileMatchersOptions(outDir: string, arch: Arch, customBuildOptions: PlatformSpecificBuildOptions): GetFileMatchersOptions; - protected doPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array): Promise; - protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null; - private copyAppFiles; - protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise; - getIconPath(): Promise; - private computeAsarOptions; - getElectronSrcDir(dist: string): string; - getElectronDestinationDir(appOutDir: string): string; - getResourcesDir(appOutDir: string): string; - getMacOsResourcesDir(appOutDir: string): string; - private checkFileInPackage; - private sanityCheckPackage; - computeSafeArtifactName(suggestedName: string | null, ext: string, arch?: Arch | null, skipArchIfX64?: boolean, safePattern?: string): string | null; - expandArtifactNamePattern(targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null, defaultPattern?: string, skipArchIfX64?: boolean): string; - expandArtifactBeautyNamePattern(targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null): string; - private computeArtifactName; - expandMacro(pattern: string, arch?: string | null, extra?: any, isProductNameSanitized?: boolean): string; - generateName2(ext: string | null, classifier: string | null | undefined, deployment: boolean): string; - getTempFile(suffix: string): Promise; - readonly fileAssociations: Array; - getResource(custom: string | null | undefined, ...names: Array): Promise; - readonly forceCodeSigning: boolean; - protected getOrConvertIcon(format: IconFormat): Promise; - getDefaultFrameworkIcon(): string | null; - resolveIcon(sources: Array, fallbackSources: Array, outputFormat: IconFormat): Promise>; -} -export interface IconInfo { - file: string; - size: number; -} -export declare type IconFormat = "icns" | "ico" | "set"; -export declare function isSafeGithubName(name: string): boolean; -export declare function normalizeExt(ext: string): string; -export declare function resolveFunction(executor: T | string, name: string): T; -export declare function chooseNotNull(v1: string | null | undefined, v2: string | null | undefined): string | null | undefined; diff --git a/node_modules/app-builder-lib/out/platformPackager.js b/node_modules/app-builder-lib/out/platformPackager.js deleted file mode 100644 index d9ab407..0000000 --- a/node_modules/app-builder-lib/out/platformPackager.js +++ /dev/null @@ -1,922 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isSafeGithubName = isSafeGithubName; -exports.normalizeExt = normalizeExt; -exports.resolveFunction = resolveFunction; -exports.chooseNotNull = chooseNotNull; -exports.PlatformPackager = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _appInfo() { - const data = require("./appInfo"); - - _appInfo = function () { - return data; - }; - - return data; -} - -function _asarFileChecker() { - const data = require("./asar/asarFileChecker"); - - _asarFileChecker = function () { - return data; - }; - - return data; -} - -function _asarUtil() { - const data = require("./asar/asarUtil"); - - _asarUtil = function () { - return data; - }; - - return data; -} - -function _integrity() { - const data = require("./asar/integrity"); - - _integrity = function () { - return data; - }; - - return data; -} - -function _fileMatcher() { - const data = require("./fileMatcher"); - - _fileMatcher = function () { - return data; - }; - - return data; -} - -function _fileTransformer() { - const data = require("./fileTransformer"); - - _fileTransformer = function () { - return data; - }; - - return data; -} - -function _Framework() { - const data = require("./Framework"); - - _Framework = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("./index"); - - _index = function () { - return data; - }; - - return data; -} - -function _appBuilder() { - const data = require("./util/appBuilder"); - - _appBuilder = function () { - return data; - }; - - return data; -} - -function _appFileCopier() { - const data = require("./util/appFileCopier"); - - _appFileCopier = function () { - return data; - }; - - return data; -} - -function _macroExpander() { - const data = require("./util/macroExpander"); - - _macroExpander = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class PlatformPackager { - constructor(info, platform) { - this.info = info; - this.platform = platform; - this._resourceList = new (_lazyVal().Lazy)(() => (0, _promise().orIfFileNotExist)((0, _fsExtraP().readdir)(this.info.buildResourcesDir), [])); - this.platformSpecificBuildOptions = PlatformPackager.normalizePlatformSpecificBuildOptions(this.config[platform.buildConfigurationKey]); - this.appInfo = this.prepareAppInfo(info.appInfo); - } - - get packagerOptions() { - return this.info.options; - } - - get buildResourcesDir() { - return this.info.buildResourcesDir; - } - - get projectDir() { - return this.info.projectDir; - } - - get config() { - return this.info.config; - } - - get resourceList() { - return this._resourceList.value; - } - - get compression() { - const compression = this.platformSpecificBuildOptions.compression; // explicitly set to null - request to use default value instead of parent (in the config) - - if (compression === null) { - return "normal"; - } - - return compression || this.config.compression || "normal"; - } - - get debugLogger() { - return this.info.debugLogger; - } - - prepareAppInfo(appInfo) { - return new (_appInfo().AppInfo)(this.info, null, this.platformSpecificBuildOptions); - } - - static normalizePlatformSpecificBuildOptions(options) { - return options == null ? Object.create(null) : options; - } - - getCscPassword() { - const password = this.doGetCscPassword(); - - if ((0, _builderUtil().isEmptyOrSpaces)(password)) { - _builderUtil().log.info({ - reason: "CSC_KEY_PASSWORD is not defined" - }, "empty password will be used for code signing"); - - return ""; - } else { - return password.trim(); - } - } - - getCscLink(extraEnvName) { - // allow to specify as empty string - const envValue = chooseNotNull(extraEnvName == null ? null : process.env[extraEnvName], process.env.CSC_LINK); - return chooseNotNull(chooseNotNull(this.info.config.cscLink, this.platformSpecificBuildOptions.cscLink), envValue); - } - - doGetCscPassword() { - // allow to specify as empty string - return chooseNotNull(chooseNotNull(this.info.config.cscKeyPassword, this.platformSpecificBuildOptions.cscKeyPassword), process.env.CSC_KEY_PASSWORD); - } - - computeAppOutDir(outDir, arch) { - return this.packagerOptions.prepackaged || path.join(outDir, `${this.platform.buildConfigurationKey}${(0, _builderUtil().getArchSuffix)(arch)}${this.platform === _index().Platform.MAC ? "" : "-unpacked"}`); - } - - dispatchArtifactCreated(file, target, arch, safeArtifactName) { - return this.info.callArtifactBuildCompleted({ - file, - safeArtifactName, - target, - arch, - packager: this - }); - } - - pack(outDir, arch, targets, taskManager) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appOutDir = _this.computeAppOutDir(outDir, arch); - - yield _this.doPack(outDir, appOutDir, _this.platform.nodeName, arch, _this.platformSpecificBuildOptions, targets); - - _this.packageInDistributableFormat(appOutDir, arch, targets, taskManager); - })(); - } - - packageInDistributableFormat(appOutDir, arch, targets, taskManager) { - var _this2 = this; - - if (targets.find(it => !it.isAsyncSupported) == null) { - PlatformPackager.buildAsyncTargets(targets, taskManager, appOutDir, arch); - return; - } - - taskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - // BluebirdPromise.map doesn't invoke target.build immediately, but for RemoteTarget it is very critical to call build() before finishBuild() - const subTaskManager = new (_builderUtil().AsyncTaskManager)(_this2.info.cancellationToken); - PlatformPackager.buildAsyncTargets(targets, subTaskManager, appOutDir, arch); - yield subTaskManager.awaitTasks(); - - for (const target of targets) { - if (!target.isAsyncSupported) { - yield target.build(appOutDir, arch); - } - } - })); - } - - static buildAsyncTargets(targets, taskManager, appOutDir, arch) { - for (const target of targets) { - if (target.isAsyncSupported) { - taskManager.addTask(target.build(appOutDir, arch)); - } - } - } - - getExtraFileMatchers(isResources, appOutDir, options) { - const base = isResources ? this.getResourcesDir(appOutDir) : this.platform === _index().Platform.MAC ? path.join(appOutDir, `${this.appInfo.productFilename}.app`, "Contents") : appOutDir; - return (0, _fileMatcher().getFileMatchers)(this.config, isResources ? "extraResources" : "extraFiles", base, options); - } - - get electronDistExecutableName() { - return this.config.muonVersion == null ? "electron" : "brave"; - } - - get electronDistMacOsExecutableName() { - return this.config.muonVersion == null ? "Electron" : "Brave"; - } - - createGetFileMatchersOptions(outDir, arch, customBuildOptions) { - return { - macroExpander: it => this.expandMacro(it, arch == null ? null : _builderUtil().Arch[arch], { - "/*": "{,/**/*}" - }), - customBuildOptions, - globalOutDir: outDir, - defaultSrc: this.projectDir - }; - } - - doPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (_this3.packagerOptions.prepackaged != null) { - return; - } - - const framework = _this3.info.framework; - - _builderUtil().log.info({ - platform: platformName, - arch: _builderUtil().Arch[arch], - [`${framework.name}`]: framework.version, - appOutDir: _builderUtil().log.filePath(appOutDir) - }, `packaging`); - - yield framework.prepareApplicationStageDirectory({ - packager: _this3, - appOutDir, - platformName, - arch: _builderUtil().Arch[arch], - version: framework.version - }); - const excludePatterns = []; - - const computeParsedPatterns = patterns => { - if (patterns != null) { - for (const pattern of patterns) { - pattern.computeParsedPatterns(excludePatterns, _this3.info.projectDir); - } - } - }; - - const getFileMatchersOptions = _this3.createGetFileMatchersOptions(outDir, arch, platformSpecificBuildOptions); - - const macroExpander = getFileMatchersOptions.macroExpander; - - const extraResourceMatchers = _this3.getExtraFileMatchers(true, appOutDir, getFileMatchersOptions); - - computeParsedPatterns(extraResourceMatchers); - - const extraFileMatchers = _this3.getExtraFileMatchers(false, appOutDir, getFileMatchersOptions); - - computeParsedPatterns(extraFileMatchers); - const packContext = { - appOutDir, - outDir, - arch, - targets, - packager: _this3, - electronPlatformName: platformName - }; - const asarOptions = yield _this3.computeAsarOptions(platformSpecificBuildOptions); - const resourcesPath = _this3.platform === _index().Platform.MAC ? path.join(appOutDir, framework.distMacOsAppName, "Contents", "Resources") : (0, _Framework().isElectronBased)(framework) ? path.join(appOutDir, "resources") : appOutDir; - const taskManager = new (_builderUtil().AsyncTaskManager)(_this3.info.cancellationToken); - - _this3.copyAppFiles(taskManager, asarOptions, resourcesPath, path.join(resourcesPath, "app"), packContext, platformSpecificBuildOptions, excludePatterns, macroExpander); - - yield taskManager.awaitTasks(); - - if (_this3.info.cancellationToken.cancelled) { - return; - } - - if (framework.beforeCopyExtraFiles != null) { - yield framework.beforeCopyExtraFiles({ - packager: _this3, - appOutDir, - asarIntegrity: asarOptions == null ? null : yield (0, _integrity().computeData)(resourcesPath, asarOptions.externalAllowed ? { - externalAllowed: true - } : null), - platformName - }); - } - - if (_this3.info.cancellationToken.cancelled) { - return; - } - - const transformerForExtraFiles = _this3.createTransformerForExtraFiles(packContext); - - yield (0, _fileMatcher().copyFiles)(extraResourceMatchers, transformerForExtraFiles); - yield (0, _fileMatcher().copyFiles)(extraFileMatchers, transformerForExtraFiles); - - if (_this3.info.cancellationToken.cancelled) { - return; - } - - yield _this3.info.afterPack(packContext); - - if (framework.afterPack != null) { - yield framework.afterPack(packContext); - } - - const isAsar = asarOptions != null; - yield _this3.sanityCheckPackage(appOutDir, isAsar, framework); - yield _this3.signApp(packContext, isAsar); - const afterSign = resolveFunction(_this3.config.afterSign, "afterSign"); - - if (afterSign != null) { - yield Promise.resolve(afterSign(packContext)); - } - })(); - } - - createTransformerForExtraFiles(packContext) { - return null; - } - - copyAppFiles(taskManager, asarOptions, resourcePath, defaultDestination, packContext, platformSpecificBuildOptions, excludePatterns, macroExpander) { - var _this4 = this; - - const appDir = this.info.appDir; - const config = this.config; - const isElectronCompile = asarOptions != null && (0, _fileTransformer().isElectronCompileUsed)(this.info); - const mainMatchers = (0, _fileMatcher().getMainFileMatchers)(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this, packContext.outDir, isElectronCompile); - - if (excludePatterns.length > 0) { - for (const matcher of mainMatchers) { - matcher.excludePatterns = excludePatterns; - } - } - - const framework = this.info.framework; - const transformer = (0, _fileTransformer().createTransformer)(appDir, config, isElectronCompile ? Object.assign({ - originalMain: this.info.metadata.main, - main: _appFileCopier().ELECTRON_COMPILE_SHIM_FILENAME - }, config.extraMetadata) : config.extraMetadata, framework.createTransformer == null ? null : framework.createTransformer()); - - const _computeFileSets = matchers => { - return (0, _appFileCopier().computeFileSets)(matchers, this.info.isPrepackedAppAsar ? null : transformer, this, isElectronCompile).then( - /*#__PURE__*/ - function () { - var _ref2 = (0, _bluebirdLst().coroutine)(function* (result) { - if (!_this4.info.isPrepackedAppAsar && !_this4.info.areNodeModulesHandledExternally) { - const moduleFileMatcher = (0, _fileMatcher().getNodeModuleFileMatcher)(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, _this4.info); - result = result.concat((yield (0, _appFileCopier().computeNodeModuleFileSets)(_this4, moduleFileMatcher))); - } - - return result.filter(it => it.files.length > 0); - }); - - return function (_x) { - return _ref2.apply(this, arguments); - }; - }()); - }; - - if (this.info.isPrepackedAppAsar) { - taskManager.addTask(_bluebirdLst().default.each(_computeFileSets([new (_fileMatcher().FileMatcher)(appDir, resourcePath, macroExpander)]), it => (0, _appFileCopier().copyAppFiles)(it, this.info, transformer))); - } else if (asarOptions == null) { - // for ASAR all asar unpacked files will be extra transformed (e.g. sign of EXE and DLL) later, - // for prepackaged asar extra transformation not supported yet, - // so, extra transform if asar is disabled - const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext); - - const combinedTransformer = file => { - if (transformerForExtraFiles != null) { - const result = transformerForExtraFiles(file); - - if (result != null) { - return result; - } - } - - return transformer(file); - }; - - taskManager.addTask(_bluebirdLst().default.each(_computeFileSets(mainMatchers), it => (0, _appFileCopier().copyAppFiles)(it, this.info, combinedTransformer))); - } else { - const unpackPattern = (0, _fileMatcher().getFileMatchers)(config, "asarUnpack", defaultDestination, { - macroExpander, - customBuildOptions: platformSpecificBuildOptions, - globalOutDir: packContext.outDir, - defaultSrc: appDir - }); - const fileMatcher = unpackPattern == null ? null : unpackPattern[0]; - taskManager.addTask(_computeFileSets(mainMatchers).then( - /*#__PURE__*/ - function () { - var _ref3 = (0, _bluebirdLst().coroutine)(function* (fileSets) { - for (const fileSet of fileSets) { - yield (0, _appFileCopier().transformFiles)(transformer, fileSet); - } - - yield new (_asarUtil().AsarPackager)(appDir, resourcePath, asarOptions, fileMatcher == null ? null : fileMatcher.createFilter()).pack(fileSets, _this4); - }); - - return function (_x2) { - return _ref3.apply(this, arguments); - }; - }())); - } - } - - signApp(packContext, isAsar) { - return Promise.resolve(); - } - - getIconPath() { - return (0, _bluebirdLst().coroutine)(function* () { - return null; - })(); - } - - computeAsarOptions(customBuildOptions) { - var _this5 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (!(0, _Framework().isElectronBased)(_this5.info.framework)) { - return null; - } - - function errorMessage(name) { - return `${name} is deprecated is deprecated and not supported — please use asarUnpack`; - } - - const buildMetadata = _this5.config; - - if (buildMetadata["asar-unpack"] != null) { - throw new Error(errorMessage("asar-unpack")); - } - - if (buildMetadata["asar-unpack-dir"] != null) { - throw new Error(errorMessage("asar-unpack-dir")); - } - - const platformSpecific = customBuildOptions.asar; - const result = platformSpecific == null ? _this5.config.asar : platformSpecific; - - if (result === false) { - const appAsarStat = yield (0, _fs().statOrNull)(path.join(_this5.info.appDir, "app.asar")); //noinspection ES6MissingAwait - - if (appAsarStat == null || !appAsarStat.isFile()) { - _builderUtil().log.warn({ - solution: "enable asar and use asarUnpack to unpack files that must be externally available" - }, "asar using is disabled — it is strongly not recommended"); - } - - return null; - } - - if (result == null || result === true) { - return {}; - } - - for (const name of ["unpackDir", "unpack"]) { - if (result[name] != null) { - throw new Error(errorMessage(`asar.${name}`)); - } - } - - return (0, _builderUtil().deepAssign)({}, result); - })(); - } - - getElectronSrcDir(dist) { - return path.resolve(this.projectDir, dist); - } - - getElectronDestinationDir(appOutDir) { - return appOutDir; - } - - getResourcesDir(appOutDir) { - if (this.platform === _index().Platform.MAC) { - return this.getMacOsResourcesDir(appOutDir); - } else if ((0, _Framework().isElectronBased)(this.info.framework)) { - return path.join(appOutDir, "resources"); - } else { - return appOutDir; - } - } - - getMacOsResourcesDir(appOutDir) { - return path.join(appOutDir, `${this.appInfo.productFilename}.app`, "Contents", "Resources"); - } - - checkFileInPackage(resourcesDir, file, messagePrefix, isAsar) { - var _this6 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const relativeFile = path.relative(_this6.info.appDir, path.resolve(_this6.info.appDir, file)); - - if (isAsar) { - yield (0, _asarFileChecker().checkFileInArchive)(path.join(resourcesDir, "app.asar"), relativeFile, messagePrefix); - return; - } - - const pathParsed = path.parse(file); // Even when packaging to asar is disabled, it does not imply that the main file can not be inside an .asar archive. - // This may occur when the packaging is done manually before processing with electron-builder. - - if (pathParsed.dir.includes(".asar")) { - // The path needs to be split to the part with an asar archive which acts like a directory and the part with - // the path to main file itself. (e.g. path/arch.asar/dir/index.js -> path/arch.asar, dir/index.js) - // noinspection TypeScriptValidateJSTypes - const pathSplit = pathParsed.dir.split(path.sep); - let partWithAsarIndex = 0; - pathSplit.some((pathPart, index) => { - partWithAsarIndex = index; - return pathPart.endsWith(".asar"); - }); - const asarPath = path.join.apply(path, pathSplit.slice(0, partWithAsarIndex + 1)); - let mainPath = pathSplit.length > partWithAsarIndex + 1 ? path.join.apply(pathSplit.slice(partWithAsarIndex + 1)) : ""; - mainPath += path.join(mainPath, pathParsed.base); - yield (0, _asarFileChecker().checkFileInArchive)(path.join(resourcesDir, "app", asarPath), mainPath, messagePrefix); - } else { - const fullPath = path.join(resourcesDir, "app", relativeFile); - const outStat = yield (0, _fs().statOrNull)(fullPath); - - if (outStat == null) { - throw new Error(`${messagePrefix} "${fullPath}" does not exist. Seems like a wrong configuration.`); - } else { - //noinspection ES6MissingAwait - if (!outStat.isFile()) { - throw new Error(`${messagePrefix} "${fullPath}" is not a file. Seems like a wrong configuration.`); - } - } - } - })(); - } - - sanityCheckPackage(appOutDir, isAsar, framework) { - var _this7 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const outStat = yield (0, _fs().statOrNull)(appOutDir); - - if (outStat == null) { - throw new Error(`Output directory "${appOutDir}" does not exist. Seems like a wrong configuration.`); - } else { - //noinspection ES6MissingAwait - if (!outStat.isDirectory()) { - throw new Error(`Output directory "${appOutDir}" is not a directory. Seems like a wrong configuration.`); - } - } - - const resourcesDir = _this7.getResourcesDir(appOutDir); - - const mainFile = (framework.getMainFile == null ? null : framework.getMainFile(_this7.platform)) || _this7.info.metadata.main || "index.js"; - yield _this7.checkFileInPackage(resourcesDir, mainFile, "Application entry file", isAsar); - yield _this7.checkFileInPackage(resourcesDir, "package.json", "Application", isAsar); - })(); - } // tslint:disable-next-line:no-invalid-template-strings - - - computeSafeArtifactName(suggestedName, ext, arch, skipArchIfX64 = true, safePattern = "${name}-${version}-${arch}.${ext}") { - // GitHub only allows the listed characters in file names. - if (suggestedName != null && isSafeGithubName(suggestedName)) { - return null; - } - - return this.computeArtifactName(safePattern, ext, skipArchIfX64 && arch === _builderUtil().Arch.x64 ? null : arch); - } - - expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64 = true) { - let pattern = targetSpecificOptions == null ? null : targetSpecificOptions.artifactName; - - if (pattern == null) { - pattern = this.platformSpecificBuildOptions.artifactName || this.config.artifactName; - } - - if (pattern == null) { - // tslint:disable-next-line:no-invalid-template-strings - pattern = defaultPattern || "${productName}-${version}-${arch}.${ext}"; - } else { - // https://github.com/electron-userland/electron-builder/issues/3510 - // always respect arch in user custom artifact pattern - skipArchIfX64 = false; - } - - return this.computeArtifactName(pattern, ext, skipArchIfX64 && arch === _builderUtil().Arch.x64 ? null : arch); - } - - expandArtifactBeautyNamePattern(targetSpecificOptions, ext, arch) { - // tslint:disable-next-line:no-invalid-template-strings - return this.expandArtifactNamePattern(targetSpecificOptions, ext, arch, "${productName} ${version} ${arch}.${ext}", true); - } - - computeArtifactName(pattern, ext, arch) { - let archName = arch == null ? null : _builderUtil().Arch[arch]; - - if (arch === _builderUtil().Arch.x64) { - if (ext === "AppImage" || ext === "rpm") { - archName = "x86_64"; - } else if (ext === "deb" || ext === "snap") { - archName = "amd64"; - } - } else if (arch === _builderUtil().Arch.ia32) { - if (ext === "deb" || ext === "AppImage" || ext === "snap") { - archName = "i386"; - } else if (ext === "pacman" || ext === "rpm") { - archName = "i686"; - } - } - - return this.expandMacro(pattern, this.platform === _index().Platform.MAC ? null : archName, { - ext - }); - } - - expandMacro(pattern, arch, extra = {}, isProductNameSanitized = true) { - return (0, _macroExpander().expandMacro)(pattern, arch, this.appInfo, Object.assign({ - os: this.platform.buildConfigurationKey - }, extra), isProductNameSanitized); - } - - generateName2(ext, classifier, deployment) { - const dotExt = ext == null ? "" : `.${ext}`; - const separator = ext === "deb" ? "_" : "-"; - return `${deployment ? this.appInfo.name : this.appInfo.productFilename}${separator}${this.appInfo.version}${classifier == null ? "" : `${separator}${classifier}`}${dotExt}`; - } - - getTempFile(suffix) { - return this.info.tempDirManager.getTempFile({ - suffix - }); - } - - get fileAssociations() { - return (0, _builderUtil().asArray)(this.config.fileAssociations).concat((0, _builderUtil().asArray)(this.platformSpecificBuildOptions.fileAssociations)); - } - - getResource(custom, ...names) { - var _this8 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const resourcesDir = _this8.info.buildResourcesDir; - - if (custom === undefined) { - const resourceList = yield _this8.resourceList; - - for (const name of names) { - if (resourceList.includes(name)) { - return path.join(resourcesDir, name); - } - } - } else if (custom != null && !(0, _builderUtil().isEmptyOrSpaces)(custom)) { - const resourceList = yield _this8.resourceList; - - if (resourceList.includes(custom)) { - return path.join(resourcesDir, custom); - } - - let p = path.resolve(resourcesDir, custom); - - if ((yield (0, _fs().statOrNull)(p)) == null) { - p = path.resolve(_this8.projectDir, custom); - - if ((yield (0, _fs().statOrNull)(p)) == null) { - throw new (_builderUtil().InvalidConfigurationError)(`cannot find specified resource "${custom}", nor relative to "${resourcesDir}", neither relative to project dir ("${_this8.projectDir}")`); - } - } - - return p; - } - - return null; - })(); - } - - get forceCodeSigning() { - const forceCodeSigningPlatform = this.platformSpecificBuildOptions.forceCodeSigning; - return (forceCodeSigningPlatform == null ? this.config.forceCodeSigning : forceCodeSigningPlatform) || false; - } - - getOrConvertIcon(format) { - var _this9 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const result = yield _this9.resolveIcon((0, _builderUtil().asArray)(_this9.platformSpecificBuildOptions.icon || _this9.config.icon), [], format); - - if (result.length === 0) { - const framework = _this9.info.framework; - - if (framework.getDefaultIcon != null) { - return framework.getDefaultIcon(_this9.platform); - } - - _builderUtil().log.warn({ - reason: "application icon is not set" - }, `default ${capitalizeFirstLetter(framework.name)} icon is used`); - - return _this9.getDefaultFrameworkIcon(); - } else { - return result[0].file; - } - })(); - } - - getDefaultFrameworkIcon() { - const framework = this.info.framework; - return framework.getDefaultIcon == null ? null : framework.getDefaultIcon(this.platform); - } // convert if need, validate size (it is a reason why tool is called even if file has target extension (already specified as foo.icns for example)) - - - resolveIcon(sources, fallbackSources, outputFormat) { - var _this10 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const args = ["icon", "--format", outputFormat, "--root", _this10.buildResourcesDir, "--root", _this10.projectDir, "--out", path.resolve(_this10.projectDir, _this10.config.directories.output, `.icon-${outputFormat}`)]; - - for (const source of sources) { - args.push("--input", source); - } - - for (const source of fallbackSources) { - args.push("--fallback-input", source); - } - - const result = yield (0, _appBuilder().executeAppBuilderAsJson)(args); - const errorMessage = result.error; - - if (errorMessage != null) { - throw new (_builderUtil().InvalidConfigurationError)(errorMessage, result.errorCode); - } - - if (result.isFallback) { - _builderUtil().log.warn({ - reason: "application icon is not set" - }, `default ${capitalizeFirstLetter(_this10.info.framework.name)} icon is used`); - } - - return result.icons || []; - })(); - } - -} - -exports.PlatformPackager = PlatformPackager; - -function isSafeGithubName(name) { - return /^[0-9A-Za-z._-]+$/.test(name); -} // remove leading dot - - -function normalizeExt(ext) { - return ext.startsWith(".") ? ext.substring(1) : ext; -} - -function resolveFunction(executor, name) { - if (executor == null || typeof executor !== "string") { - return executor; - } - - let p = executor; - - if (p.startsWith(".")) { - p = path.resolve(p); - } - - try { - p = require.resolve(p); - } catch (e) { - (0, _builderUtil().debug)(e); - p = path.resolve(p); - } - - const m = require(p); - - const namedExport = m[name]; - - if (namedExport == null) { - return m.default || m; - } else { - return namedExport; - } -} - -function chooseNotNull(v1, v2) { - return v1 == null ? v2 : v1; -} - -function capitalizeFirstLetter(text) { - return text.charAt(0).toUpperCase() + text.slice(1); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=platformPackager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/platformPackager.js.map b/node_modules/app-builder-lib/out/platformPackager.js.map deleted file mode 100644 index 57cbe40..0000000 --- a/node_modules/app-builder-lib/out/platformPackager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/platformPackager.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,MAAgB,gBAAhB,CAAgC;AA2BpC,EAAA,WAAA,CAA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K,SAAU,eAAV,CAA6B,QAA7B,EAAmD,IAAnD,EAA+D;AACnE,MAAI,QAAQ,IAAI,IAAZ,IAAoB,OAAO,QAAP,KAAoB,QAA5C,EAAsD;AACpD,WAAO,QAAP;AACD;;AAED,MAAI,CAAC,GAAG,QAAR;;AACA,MAAI,CAAC,CAAC,UAAF,CAAa,GAAb,CAAJ,EAAuB;AACrB,IAAA,CAAC,GAAG,IAAI,CAAC,OAAL,CAAa,CAAb,CAAJ;AACD;;AAED,MAAI;AACF,IAAA,CAAC,GAAG,OAAO,CAAC,OAAR,CAAgB,CAAhB,CAAJ;AACD,GAFD,CAGA,OAAO,CAAP,EAAU;AACR,8BAAM,CAAN;AACA,IAAA,CAAC,GAAG,IAAI,CAAC,OAAL,CAAa,CAAb,CAAJ;AACD;;AAED,QAAM,CAAC,GAAG,OAAO,CAAC,CAAD,CAAjB;;AACA,QAAM,WAAW,GAAG,CAAC,CAAC,IAAD,CAArB;;AACA,MAAI,WAAW,IAAI,IAAnB,EAAyB;AACvB,WAAO,CAAC,CAAC,OAAF,IAAa,CAApB;AACD,GAFD,MAGK;AACH,WAAO,WAAP;AACD;AACF;;AAEK,SAAU,aAAV,CAAwB,EAAxB,EAAuD,EAAvD,EAAoF;AACxF,SAAO,EAAE,IAAI,IAAN,GAAa,EAAb,GAAkB,EAAzB;AACD;;AAED,SAAS,qBAAT,CAA+B,IAA/B,EAA2C;AACzC,SAAO,IAAI,CAAC,MAAL,CAAY,CAAZ,EAAe,WAAf,KAA+B,IAAI,CAAC,KAAL,CAAW,CAAX,CAAtC;AACD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, debug, DebugLogger, deepAssign, getArchSuffix, InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { FileTransformer, statOrNull } from \"builder-util/out/fs\"\nimport { orIfFileNotExist } from \"builder-util/out/promise\"\nimport { readdir } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { checkFileInArchive } from \"./asar/asarFileChecker\"\nimport { AsarPackager } from \"./asar/asarUtil\"\nimport { computeData } from \"./asar/integrity\"\nimport { copyFiles, FileMatcher, getFileMatchers, GetFileMatchersOptions, getMainFileMatchers, getNodeModuleFileMatcher } from \"./fileMatcher\"\nimport { createTransformer, isElectronCompileUsed } from \"./fileTransformer\"\nimport { Framework, isElectronBased } from \"./Framework\"\nimport { AfterPackContext, AsarOptions, CompressionLevel, Configuration, ElectronPlatformName, FileAssociation, Packager, PackagerOptions, Platform, PlatformSpecificBuildOptions, Target, TargetSpecificOptions } from \"./index\"\nimport { executeAppBuilderAsJson } from \"./util/appBuilder\"\nimport { computeFileSets, computeNodeModuleFileSets, copyAppFiles, ELECTRON_COMPILE_SHIM_FILENAME, transformFiles } from \"./util/appFileCopier\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\n\nexport abstract class PlatformPackager {\n get packagerOptions(): PackagerOptions {\n return this.info.options\n }\n\n get buildResourcesDir(): string {\n return this.info.buildResourcesDir\n }\n\n get projectDir(): string {\n return this.info.projectDir\n }\n\n get config(): Configuration {\n return this.info.config\n }\n\n readonly platformSpecificBuildOptions: DC\n\n get resourceList(): Promise> {\n return this._resourceList.value\n }\n\n private readonly _resourceList = new Lazy>(() => orIfFileNotExist(readdir(this.info.buildResourcesDir), []))\n\n readonly appInfo: AppInfo\n\n protected constructor(readonly info: Packager, readonly platform: Platform) {\n this.platformSpecificBuildOptions = PlatformPackager.normalizePlatformSpecificBuildOptions((this.config as any)[platform.buildConfigurationKey])\n this.appInfo = this.prepareAppInfo(info.appInfo)\n }\n\n get compression(): CompressionLevel {\n const compression = this.platformSpecificBuildOptions.compression\n // explicitly set to null - request to use default value instead of parent (in the config)\n if (compression === null) {\n return \"normal\"\n }\n return compression || this.config.compression || \"normal\"\n }\n\n get debugLogger(): DebugLogger {\n return this.info.debugLogger\n }\n\n abstract get defaultTarget(): Array\n\n protected prepareAppInfo(appInfo: AppInfo) {\n return new AppInfo(this.info, null, this.platformSpecificBuildOptions)\n }\n\n private static normalizePlatformSpecificBuildOptions(options: any | null | undefined): any {\n return options == null ? Object.create(null) : options\n }\n\n abstract createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void\n\n protected getCscPassword(): string {\n const password = this.doGetCscPassword()\n if (isEmptyOrSpaces(password)) {\n log.info({reason: \"CSC_KEY_PASSWORD is not defined\"}, \"empty password will be used for code signing\")\n return \"\"\n }\n else {\n return password!.trim()\n }\n }\n\n protected getCscLink(extraEnvName?: string | null): string | null | undefined {\n // allow to specify as empty string\n const envValue = chooseNotNull(extraEnvName == null ? null : process.env[extraEnvName], process.env.CSC_LINK)\n return chooseNotNull(chooseNotNull(this.info.config.cscLink, this.platformSpecificBuildOptions.cscLink), envValue)\n }\n\n protected doGetCscPassword(): string | null | undefined {\n // allow to specify as empty string\n return chooseNotNull(chooseNotNull(this.info.config.cscKeyPassword, this.platformSpecificBuildOptions.cscKeyPassword), process.env.CSC_KEY_PASSWORD)\n }\n\n protected computeAppOutDir(outDir: string, arch: Arch): string {\n return this.packagerOptions.prepackaged || path.join(outDir, `${this.platform.buildConfigurationKey}${getArchSuffix(arch)}${this.platform === Platform.MAC ? \"\" : \"-unpacked\"}`)\n }\n\n dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): Promise {\n return this.info.callArtifactBuildCompleted({\n file, safeArtifactName, target, arch,\n packager: this,\n })\n }\n\n async pack(outDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): Promise {\n const appOutDir = this.computeAppOutDir(outDir, arch)\n await this.doPack(outDir, appOutDir, this.platform.nodeName as ElectronPlatformName, arch, this.platformSpecificBuildOptions, targets)\n this.packageInDistributableFormat(appOutDir, arch, targets, taskManager)\n }\n\n protected packageInDistributableFormat(appOutDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): void {\n if (targets.find(it => !it.isAsyncSupported) == null) {\n PlatformPackager.buildAsyncTargets(targets, taskManager, appOutDir, arch)\n return\n }\n\n taskManager.add(async () => {\n // BluebirdPromise.map doesn't invoke target.build immediately, but for RemoteTarget it is very critical to call build() before finishBuild()\n const subTaskManager = new AsyncTaskManager(this.info.cancellationToken)\n PlatformPackager.buildAsyncTargets(targets, subTaskManager, appOutDir, arch)\n await subTaskManager.awaitTasks()\n\n for (const target of targets) {\n if (!target.isAsyncSupported) {\n await target.build(appOutDir, arch)\n }\n }\n })\n }\n\n private static buildAsyncTargets(targets: Array, taskManager: AsyncTaskManager, appOutDir: string, arch: Arch) {\n for (const target of targets) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.build(appOutDir, arch))\n }\n }\n }\n\n private getExtraFileMatchers(isResources: boolean, appOutDir: string, options: GetFileMatchersOptions): Array | null {\n const base = isResources ? this.getResourcesDir(appOutDir) : (this.platform === Platform.MAC ? path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\") : appOutDir)\n return getFileMatchers(this.config, isResources ? \"extraResources\" : \"extraFiles\", base, options)\n }\n\n get electronDistExecutableName() {\n return this.config.muonVersion == null ? \"electron\" : \"brave\"\n }\n\n get electronDistMacOsExecutableName() {\n return this.config.muonVersion == null ? \"Electron\" : \"Brave\"\n }\n\n createGetFileMatchersOptions(outDir: string, arch: Arch, customBuildOptions: PlatformSpecificBuildOptions): GetFileMatchersOptions {\n return {\n macroExpander: it => this.expandMacro(it, arch == null ? null : Arch[arch], {\"/*\": \"{,/**/*}\"}),\n customBuildOptions,\n globalOutDir: outDir,\n defaultSrc: this.projectDir,\n }\n }\n\n protected async doPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array) {\n if (this.packagerOptions.prepackaged != null) {\n return\n }\n\n const framework = this.info.framework\n log.info({\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n }, `packaging`)\n\n await framework.prepareApplicationStageDirectory({\n packager: this,\n appOutDir,\n platformName,\n arch: Arch[arch],\n version: framework.version,\n })\n\n const excludePatterns: Array = []\n\n const computeParsedPatterns = (patterns: Array | null) => {\n if (patterns != null) {\n for (const pattern of patterns) {\n pattern.computeParsedPatterns(excludePatterns, this.info.projectDir)\n }\n }\n }\n\n const getFileMatchersOptions = this.createGetFileMatchersOptions(outDir, arch, platformSpecificBuildOptions)\n const macroExpander = getFileMatchersOptions.macroExpander\n const extraResourceMatchers = this.getExtraFileMatchers(true, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraResourceMatchers)\n const extraFileMatchers = this.getExtraFileMatchers(false, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraFileMatchers)\n\n const packContext: AfterPackContext = {\n appOutDir, outDir, arch, targets,\n packager: this,\n electronPlatformName: platformName,\n }\n\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const resourcesPath = this.platform === Platform.MAC ? path.join(appOutDir, framework.distMacOsAppName, \"Contents\", \"Resources\") : (isElectronBased(framework) ? path.join(appOutDir, \"resources\") : appOutDir)\n const taskManager = new AsyncTaskManager(this.info.cancellationToken)\n this.copyAppFiles(taskManager, asarOptions, resourcesPath, path.join(resourcesPath, \"app\"), packContext, platformSpecificBuildOptions, excludePatterns, macroExpander)\n await taskManager.awaitTasks()\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n if (framework.beforeCopyExtraFiles != null) {\n await framework.beforeCopyExtraFiles({\n packager: this,\n appOutDir,\n asarIntegrity: asarOptions == null ? null : await computeData(resourcesPath, asarOptions.externalAllowed ? {externalAllowed: true} : null),\n platformName,\n })\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n await copyFiles(extraResourceMatchers, transformerForExtraFiles)\n await copyFiles(extraFileMatchers, transformerForExtraFiles)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.info.afterPack(packContext)\n\n if (framework.afterPack != null) {\n await framework.afterPack(packContext)\n }\n\n const isAsar = asarOptions != null\n await this.sanityCheckPackage(appOutDir, isAsar, framework)\n await this.signApp(packContext, isAsar)\n\n const afterSign = resolveFunction(this.config.afterSign, \"afterSign\")\n if (afterSign != null) {\n await Promise.resolve(afterSign(packContext))\n }\n }\n\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n return null\n }\n\n private copyAppFiles(taskManager: AsyncTaskManager, asarOptions: AsarOptions | null, resourcePath: string, defaultDestination: string, packContext: AfterPackContext, platformSpecificBuildOptions: DC, excludePatterns: Array, macroExpander: ((it: string) => string)) {\n const appDir = this.info.appDir\n const config = this.config\n const isElectronCompile = asarOptions != null && isElectronCompileUsed(this.info)\n\n const mainMatchers = getMainFileMatchers(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this, packContext.outDir, isElectronCompile)\n if (excludePatterns.length > 0) {\n for (const matcher of mainMatchers) {\n matcher.excludePatterns = excludePatterns\n }\n }\n\n const framework = this.info.framework\n const transformer = createTransformer(appDir, config, isElectronCompile ? {\n originalMain: this.info.metadata.main,\n main: ELECTRON_COMPILE_SHIM_FILENAME,\n ...config.extraMetadata\n } : config.extraMetadata, framework.createTransformer == null ? null : framework.createTransformer())\n\n const _computeFileSets = (matchers: Array) => {\n return computeFileSets(matchers, this.info.isPrepackedAppAsar ? null : transformer, this, isElectronCompile)\n .then(async result => {\n if (!this.info.isPrepackedAppAsar && !this.info.areNodeModulesHandledExternally) {\n const moduleFileMatcher = getNodeModuleFileMatcher(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this.info)\n result = result.concat(await computeNodeModuleFileSets(this, moduleFileMatcher))\n }\n return result.filter(it => it.files.length > 0)\n })\n }\n\n if (this.info.isPrepackedAppAsar) {\n taskManager.addTask(BluebirdPromise.each(_computeFileSets([new FileMatcher(appDir, resourcePath, macroExpander)]), it => copyAppFiles(it, this.info, transformer)))\n }\n else if (asarOptions == null) {\n // for ASAR all asar unpacked files will be extra transformed (e.g. sign of EXE and DLL) later,\n // for prepackaged asar extra transformation not supported yet,\n // so, extra transform if asar is disabled\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n const combinedTransformer: FileTransformer = file => {\n if (transformerForExtraFiles != null) {\n const result = transformerForExtraFiles(file)\n if (result != null) {\n return result\n }\n }\n return transformer(file)\n }\n\n taskManager.addTask(BluebirdPromise.each(_computeFileSets(mainMatchers), it => copyAppFiles(it, this.info, combinedTransformer)))\n }\n else {\n const unpackPattern = getFileMatchers(config, \"asarUnpack\", defaultDestination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: packContext.outDir,\n defaultSrc: appDir,\n })\n const fileMatcher = unpackPattern == null ? null : unpackPattern[0]\n taskManager.addTask(_computeFileSets(mainMatchers)\n .then(async fileSets => {\n for (const fileSet of fileSets) {\n await transformFiles(transformer, fileSet)\n }\n\n await new AsarPackager(appDir, resourcePath, asarOptions, fileMatcher == null ? null : fileMatcher.createFilter())\n .pack(fileSets, this)\n }))\n }\n }\n\n protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise {\n return Promise.resolve()\n }\n\n async getIconPath(): Promise {\n return null\n }\n\n private async computeAsarOptions(customBuildOptions: DC): Promise {\n if (!isElectronBased(this.info.framework)) {\n return null\n }\n\n function errorMessage(name: string) {\n return `${name} is deprecated is deprecated and not supported — please use asarUnpack`\n }\n\n const buildMetadata = this.config as any\n if (buildMetadata[\"asar-unpack\"] != null) {\n throw new Error(errorMessage(\"asar-unpack\"))\n }\n if (buildMetadata[\"asar-unpack-dir\"] != null) {\n throw new Error(errorMessage(\"asar-unpack-dir\"))\n }\n\n const platformSpecific = customBuildOptions.asar\n const result = platformSpecific == null ? this.config.asar : platformSpecific\n if (result === false) {\n const appAsarStat = await statOrNull(path.join(this.info.appDir, \"app.asar\"))\n //noinspection ES6MissingAwait\n if (appAsarStat == null || !appAsarStat.isFile()) {\n log.warn({\n solution: \"enable asar and use asarUnpack to unpack files that must be externally available\",\n }, \"asar using is disabled — it is strongly not recommended\")\n }\n return null\n }\n\n if (result == null || result === true) {\n return {}\n }\n\n for (const name of [\"unpackDir\", \"unpack\"]) {\n if ((result as any)[name] != null) {\n throw new Error(errorMessage(`asar.${name}`))\n }\n }\n return deepAssign({}, result)\n }\n\n public getElectronSrcDir(dist: string): string {\n return path.resolve(this.projectDir, dist)\n }\n\n public getElectronDestinationDir(appOutDir: string): string {\n return appOutDir\n }\n\n getResourcesDir(appOutDir: string): string {\n if (this.platform === Platform.MAC) {\n return this.getMacOsResourcesDir(appOutDir)\n }\n else if (isElectronBased(this.info.framework)) {\n return path.join(appOutDir, \"resources\")\n }\n else {\n return appOutDir\n }\n }\n\n public getMacOsResourcesDir(appOutDir: string): string {\n return path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\", \"Resources\")\n }\n\n private async checkFileInPackage(resourcesDir: string, file: string, messagePrefix: string, isAsar: boolean) {\n const relativeFile = path.relative(this.info.appDir, path.resolve(this.info.appDir, file))\n if (isAsar) {\n await checkFileInArchive(path.join(resourcesDir, \"app.asar\"), relativeFile, messagePrefix)\n return\n }\n\n const pathParsed = path.parse(file)\n // Even when packaging to asar is disabled, it does not imply that the main file can not be inside an .asar archive.\n // This may occur when the packaging is done manually before processing with electron-builder.\n if (pathParsed.dir.includes(\".asar\")) {\n // The path needs to be split to the part with an asar archive which acts like a directory and the part with\n // the path to main file itself. (e.g. path/arch.asar/dir/index.js -> path/arch.asar, dir/index.js)\n // noinspection TypeScriptValidateJSTypes\n const pathSplit: Array = pathParsed.dir.split(path.sep)\n let partWithAsarIndex = 0\n pathSplit.some((pathPart: string, index: number) => {\n partWithAsarIndex = index\n return pathPart.endsWith(\".asar\")\n })\n const asarPath = path.join.apply(path, pathSplit.slice(0, partWithAsarIndex + 1))\n let mainPath = pathSplit.length > (partWithAsarIndex + 1) ? path.join.apply(pathSplit.slice(partWithAsarIndex + 1)) : \"\"\n mainPath += path.join(mainPath, pathParsed.base)\n await checkFileInArchive(path.join(resourcesDir, \"app\", asarPath), mainPath, messagePrefix)\n }\n else {\n const fullPath = path.join(resourcesDir, \"app\", relativeFile)\n const outStat = await statOrNull(fullPath)\n if (outStat == null) {\n throw new Error(`${messagePrefix} \"${fullPath}\" does not exist. Seems like a wrong configuration.`)\n }\n else {\n //noinspection ES6MissingAwait\n if (!outStat.isFile()) {\n throw new Error(`${messagePrefix} \"${fullPath}\" is not a file. Seems like a wrong configuration.`)\n }\n }\n }\n }\n\n private async sanityCheckPackage(appOutDir: string, isAsar: boolean, framework: Framework): Promise {\n const outStat = await statOrNull(appOutDir)\n if (outStat == null) {\n throw new Error(`Output directory \"${appOutDir}\" does not exist. Seems like a wrong configuration.`)\n }\n else {\n //noinspection ES6MissingAwait\n if (!outStat.isDirectory()) {\n throw new Error(`Output directory \"${appOutDir}\" is not a directory. Seems like a wrong configuration.`)\n }\n }\n\n const resourcesDir = this.getResourcesDir(appOutDir)\n const mainFile = (framework.getMainFile == null ? null : framework.getMainFile(this.platform)) || this.info.metadata.main || \"index.js\"\n await this.checkFileInPackage(resourcesDir, mainFile, \"Application entry file\", isAsar)\n await this.checkFileInPackage(resourcesDir, \"package.json\", \"Application\", isAsar)\n }\n\n // tslint:disable-next-line:no-invalid-template-strings\n computeSafeArtifactName(suggestedName: string | null, ext: string, arch?: Arch | null, skipArchIfX64 = true, safePattern: string = \"${name}-${version}-${arch}.${ext}\"): string | null {\n // GitHub only allows the listed characters in file names.\n if (suggestedName != null && isSafeGithubName(suggestedName)) {\n return null\n }\n\n return this.computeArtifactName(safePattern, ext, skipArchIfX64 && arch === Arch.x64 ? null : arch)\n }\n\n expandArtifactNamePattern(targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null, defaultPattern?: string, skipArchIfX64 = true): string {\n let pattern = targetSpecificOptions == null ? null : targetSpecificOptions.artifactName\n if (pattern == null) {\n pattern = this.platformSpecificBuildOptions.artifactName || this.config.artifactName\n }\n\n if (pattern == null) {\n // tslint:disable-next-line:no-invalid-template-strings\n pattern = defaultPattern || \"${productName}-${version}-${arch}.${ext}\"\n }\n else {\n // https://github.com/electron-userland/electron-builder/issues/3510\n // always respect arch in user custom artifact pattern\n skipArchIfX64 = false\n }\n return this.computeArtifactName(pattern, ext, skipArchIfX64 && arch === Arch.x64 ? null : arch)\n }\n\n expandArtifactBeautyNamePattern(targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null): string {\n // tslint:disable-next-line:no-invalid-template-strings\n return this.expandArtifactNamePattern(targetSpecificOptions, ext, arch, \"${productName} ${version} ${arch}.${ext}\", true)\n }\n\n private computeArtifactName(pattern: any, ext: string, arch: Arch | null | undefined) {\n let archName: string | null = arch == null ? null : Arch[arch]\n if (arch === Arch.x64) {\n if (ext === \"AppImage\" || ext === \"rpm\") {\n archName = \"x86_64\"\n }\n else if (ext === \"deb\" || ext === \"snap\") {\n archName = \"amd64\"\n }\n }\n else if (arch === Arch.ia32) {\n if (ext === \"deb\" || ext === \"AppImage\" || ext === \"snap\") {\n archName = \"i386\"\n }\n else if (ext === \"pacman\" || ext === \"rpm\") {\n archName = \"i686\"\n }\n }\n\n return this.expandMacro(pattern, this.platform === Platform.MAC ? null : archName, {\n ext\n })\n }\n\n expandMacro(pattern: string, arch?: string | null, extra: any = {}, isProductNameSanitized = true): string {\n return doExpandMacro(pattern, arch, this.appInfo, {os: this.platform.buildConfigurationKey, ...extra}, isProductNameSanitized)\n }\n\n generateName2(ext: string | null, classifier: string | null | undefined, deployment: boolean): string {\n const dotExt = ext == null ? \"\" : `.${ext}`\n const separator = ext === \"deb\" ? \"_\" : \"-\"\n return `${deployment ? this.appInfo.name : this.appInfo.productFilename}${separator}${this.appInfo.version}${classifier == null ? \"\" : `${separator}${classifier}`}${dotExt}`\n }\n\n getTempFile(suffix: string): Promise {\n return this.info.tempDirManager.getTempFile({suffix})\n }\n\n get fileAssociations(): Array {\n return asArray(this.config.fileAssociations).concat(asArray(this.platformSpecificBuildOptions.fileAssociations))\n }\n\n async getResource(custom: string | null | undefined, ...names: Array): Promise {\n const resourcesDir = this.info.buildResourcesDir\n if (custom === undefined) {\n const resourceList = await this.resourceList\n for (const name of names) {\n if (resourceList.includes(name)) {\n return path.join(resourcesDir, name)\n }\n }\n }\n else if (custom != null && !isEmptyOrSpaces(custom)) {\n const resourceList = await this.resourceList\n if (resourceList.includes(custom)) {\n return path.join(resourcesDir, custom)\n }\n\n let p = path.resolve(resourcesDir, custom)\n if (await statOrNull(p) == null) {\n p = path.resolve(this.projectDir, custom)\n if (await statOrNull(p) == null) {\n throw new InvalidConfigurationError(`cannot find specified resource \"${custom}\", nor relative to \"${resourcesDir}\", neither relative to project dir (\"${this.projectDir}\")`)\n }\n }\n return p\n }\n return null\n }\n\n get forceCodeSigning(): boolean {\n const forceCodeSigningPlatform = this.platformSpecificBuildOptions.forceCodeSigning\n return (forceCodeSigningPlatform == null ? this.config.forceCodeSigning : forceCodeSigningPlatform) || false\n }\n\n protected async getOrConvertIcon(format: IconFormat): Promise {\n const result = await this.resolveIcon(asArray(this.platformSpecificBuildOptions.icon || this.config.icon), [], format)\n if (result.length === 0) {\n const framework = this.info.framework\n if (framework.getDefaultIcon != null) {\n return framework.getDefaultIcon(this.platform)\n }\n\n log.warn({reason: \"application icon is not set\"}, `default ${capitalizeFirstLetter(framework.name)} icon is used`)\n return this.getDefaultFrameworkIcon()\n }\n else {\n return result[0].file\n }\n }\n\n getDefaultFrameworkIcon(): string | null {\n const framework = this.info.framework\n return framework.getDefaultIcon == null ? null : framework.getDefaultIcon(this.platform)\n }\n\n // convert if need, validate size (it is a reason why tool is called even if file has target extension (already specified as foo.icns for example))\n async resolveIcon(sources: Array, fallbackSources: Array, outputFormat: IconFormat): Promise> {\n const args = [\n \"icon\",\n \"--format\", outputFormat,\n \"--root\", this.buildResourcesDir,\n \"--root\", this.projectDir,\n \"--out\", path.resolve(this.projectDir, this.config.directories!!.output!!, `.icon-${outputFormat}`),\n ]\n for (const source of sources) {\n args.push(\"--input\", source)\n }\n for (const source of fallbackSources) {\n args.push(\"--fallback-input\", source)\n }\n\n const result: IconConvertResult = await executeAppBuilderAsJson(args)\n const errorMessage = result.error\n if (errorMessage != null) {\n throw new InvalidConfigurationError(errorMessage, result.errorCode)\n }\n\n if (result.isFallback) {\n log.warn({reason: \"application icon is not set\"}, `default ${capitalizeFirstLetter(this.info.framework.name)} icon is used`)\n }\n\n return result.icons || []\n }\n}\n\nexport interface IconInfo {\n file: string\n size: number\n}\n\ninterface IconConvertResult {\n icons?: Array\n\n error?: string\n errorCode?: string\n isFallback?: boolean\n}\n\nexport type IconFormat = \"icns\" | \"ico\" | \"set\"\n\nexport function isSafeGithubName(name: string) {\n return /^[0-9A-Za-z._-]+$/.test(name)\n}\n\n// remove leading dot\nexport function normalizeExt(ext: string) {\n return ext.startsWith(\".\") ? ext.substring(1) : ext\n}\n\nexport function resolveFunction(executor: T | string, name: string): T {\n if (executor == null || typeof executor !== \"string\") {\n return executor\n }\n\n let p = executor as string\n if (p.startsWith(\".\")) {\n p = path.resolve(p)\n }\n\n try {\n p = require.resolve(p)\n }\n catch (e) {\n debug(e)\n p = path.resolve(p)\n }\n\n const m = require(p)\n const namedExport = m[name]\n if (namedExport == null) {\n return m.default || m\n }\n else {\n return namedExport\n }\n}\n\nexport function chooseNotNull(v1: string | null | undefined, v2: string | null | undefined): string | null | undefined {\n return v1 == null ? v2 : v1\n}\n\nfunction capitalizeFirstLetter(text: string) {\n return text.charAt(0).toUpperCase() + text.slice(1)\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/presets/rectCra.d.ts b/node_modules/app-builder-lib/out/presets/rectCra.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/presets/rectCra.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/presets/rectCra.js b/node_modules/app-builder-lib/out/presets/rectCra.js deleted file mode 100644 index 4a82212..0000000 --- a/node_modules/app-builder-lib/out/presets/rectCra.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.reactCra = reactCra; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/** @internal */ -function reactCra(_x) { - return _reactCra.apply(this, arguments); -} function _reactCra() { - _reactCra = (0, _bluebirdLst().coroutine)(function* (projectDir) { - if ((yield (0, _fs().statOrNull)(path.join(projectDir, "public", "electron.js"))) == null) { - // noinspection SpellCheckingInspection - _builderUtil().log.warn("public/electron.js not found. Please see https://medium.com/@kitze/%EF%B8%8F-from-react-to-an-electron-app-ready-for-production-a0468ecb1da3"); - } - - return { - directories: { - buildResources: "assets" - }, - files: ["build/**/*"], - extraMetadata: { - main: "build/electron.js" - } - }; - }); - return _reactCra.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=rectCra.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/presets/rectCra.js.map b/node_modules/app-builder-lib/out/presets/rectCra.js.map deleted file mode 100644 index a977fb2..0000000 --- a/node_modules/app-builder-lib/out/presets/rectCra.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/presets/rectCra.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAGA;SACsB,Q;;;;;;4CAAf,WAAwB,UAAxB,EAA0C;AAC/C,QAAI,OAAO,sBAAW,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,QAAtB,EAAgC,aAAhC,CAAX,CAAP,KAAsE,IAA1E,EAAgF;AAC9E;AACA,yBAAI,IAAJ,CAAS,8IAAT;AACD;;AAED,WAAO;AACL,MAAA,WAAW,EAAE;AACX,QAAA,cAAc,EAAE;AADL,OADR;AAIL,MAAA,KAAK,EAAE,CAAC,YAAD,CAJF;AAKL,MAAA,aAAa,EAAE;AACb,QAAA,IAAI,EAAE;AADO;AALV,KAAP;AAQE,G","sourcesContent":["import { log } from \"builder-util\"\nimport { statOrNull } from \"builder-util/out/fs\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\n\n/** @internal */\nexport async function reactCra(projectDir: string): Promise {\n if ((await statOrNull(path.join(projectDir, \"public\", \"electron.js\"))) == null) {\n // noinspection SpellCheckingInspection\n log.warn(\"public/electron.js not found. Please see https://medium.com/@kitze/%EF%B8%8F-from-react-to-an-electron-app-ready-for-production-a0468ecb1da3\")\n }\n\n return {\n directories: {\n buildResources: \"assets\"\n },\n files: [\"build/**/*\"],\n extraMetadata: {\n main: \"build/electron.js\"\n }\n }}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/publish/PublishManager.d.ts b/node_modules/app-builder-lib/out/publish/PublishManager.d.ts deleted file mode 100644 index 33f1f65..0000000 --- a/node_modules/app-builder-lib/out/publish/PublishManager.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Arch } from "builder-util"; -import { CancellationToken, PublishConfiguration, PublishProvider } from "builder-util-runtime"; -import { PublishContext, Publisher, PublishOptions } from "electron-publish"; -import { MultiProgress } from "electron-publish/out/multiProgress"; -import { PlatformSpecificBuildOptions } from "../index"; -import { Packager } from "../packager"; -import { PlatformPackager } from "../platformPackager"; -export declare class PublishManager implements PublishContext { - private readonly packager; - private readonly publishOptions; - readonly cancellationToken: CancellationToken; - private readonly nameToPublisher; - private readonly taskManager; - readonly isPublish: boolean; - readonly progress: MultiProgress | null; - private readonly updateFileWriteTask; - constructor(packager: Packager, publishOptions: PublishOptions, cancellationToken?: CancellationToken); - private getAppInfo; - getGlobalPublishConfigurations(): Promise | null>; - private artifactCreatedWithoutExplicitPublishConfig; - private getOrCreatePublisher; - cancelTasks(): void; - awaitTasks(): Promise; -} -export declare function getAppUpdatePublishConfiguration(packager: PlatformPackager, arch: Arch, errorIfCannot: boolean): Promise<{ - updaterCacheDirName: string; - provider: PublishProvider; - publisherName?: string[] | null | undefined; - publishAutoUpdate?: boolean | undefined; -} | null>; -export declare function getPublishConfigsForUpdateInfo(packager: PlatformPackager, publishConfigs: Array | null, arch: Arch | null): Promise | null>; -export declare function createPublisher(context: PublishContext, version: string, publishConfig: PublishConfiguration, options: PublishOptions, packager: Packager): Publisher | null; -export declare function computeDownloadUrl(publishConfiguration: PublishConfiguration, fileName: string | null, packager: PlatformPackager): string; -export declare function getPublishConfigs(platformPackager: PlatformPackager, targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined, arch: Arch | null, errorIfCannot: boolean): Promise | null>; diff --git a/node_modules/app-builder-lib/out/publish/PublishManager.js b/node_modules/app-builder-lib/out/publish/PublishManager.js deleted file mode 100644 index d423efa..0000000 --- a/node_modules/app-builder-lib/out/publish/PublishManager.js +++ /dev/null @@ -1,793 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getAppUpdatePublishConfiguration = getAppUpdatePublishConfiguration; -exports.getPublishConfigsForUpdateInfo = getPublishConfigsForUpdateInfo; -exports.createPublisher = createPublisher; -exports.computeDownloadUrl = computeDownloadUrl; -exports.getPublishConfigs = getPublishConfigs; -exports.PublishManager = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -var _debug2 = _interopRequireDefault(require("debug")); - -function _electronPublish() { - const data = require("electron-publish"); - - _electronPublish = function () { - return data; - }; - - return data; -} - -function _BintrayPublisher() { - const data = require("electron-publish/out/BintrayPublisher"); - - _BintrayPublisher = function () { - return data; - }; - - return data; -} - -function _gitHubPublisher() { - const data = require("electron-publish/out/gitHubPublisher"); - - _gitHubPublisher = function () { - return data; - }; - - return data; -} - -function _multiProgress() { - const data = require("electron-publish/out/multiProgress"); - - _multiProgress = function () { - return data; - }; - - return data; -} - -function _s3Publisher() { - const data = _interopRequireDefault(require("electron-publish/out/s3/s3Publisher")); - - _s3Publisher = function () { - return data; - }; - - return data; -} - -function _spacesPublisher() { - const data = _interopRequireDefault(require("electron-publish/out/s3/spacesPublisher")); - - _spacesPublisher = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _isCi() { - const data = _interopRequireDefault(require("is-ci")); - - _isCi = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function url() { - const data = _interopRequireWildcard(require("url")); - - url = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("../index"); - - _index = function () { - return data; - }; - - return data; -} - -function _macroExpander() { - const data = require("../util/macroExpander"); - - _macroExpander = function () { - return data; - }; - - return data; -} - -function _updateInfoBuilder() { - const data = require("./updateInfoBuilder"); - - _updateInfoBuilder = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const publishForPrWarning = "There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)" + "\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you."; -const debug = (0, _debug2.default)("electron-builder:publish"); - -function checkOptions(publishPolicy) { - if (publishPolicy != null && publishPolicy !== "onTag" && publishPolicy !== "onTagOrDraft" && publishPolicy !== "always" && publishPolicy !== "never") { - if (typeof publishPolicy === "string") { - throw new (_builderUtil().InvalidConfigurationError)(`Expected one of "onTag", "onTagOrDraft", "always", "never", but got ${JSON.stringify(publishPolicy)}.\nPlease note that publish configuration should be specified under "config"`); - } - } -} - -class PublishManager { - constructor(packager, publishOptions, cancellationToken = packager.cancellationToken) { - var _this = this; - - this.packager = packager; - this.publishOptions = publishOptions; - this.cancellationToken = cancellationToken; - this.nameToPublisher = new Map(); - this.isPublish = false; - this.progress = process.stdout.isTTY ? new (_multiProgress().MultiProgress)() : null; - this.updateFileWriteTask = []; - checkOptions(publishOptions.publish); - this.taskManager = new (_builderUtil().AsyncTaskManager)(cancellationToken); - const forcePublishForPr = process.env.PUBLISH_FOR_PULL_REQUEST === "true"; - - if (!(0, _builderUtil().isPullRequest)() || forcePublishForPr) { - if (publishOptions.publish === undefined) { - if (process.env.npm_lifecycle_event === "release") { - publishOptions.publish = "always"; - } else { - const tag = (0, _electronPublish().getCiTag)(); - - if (tag != null) { - _builderUtil().log.info({ - reason: "tag is defined", - tag - }, "artifacts will be published"); - - publishOptions.publish = "onTag"; - } else if (_isCi().default) { - _builderUtil().log.info({ - reason: "CI detected" - }, "artifacts will be published if draft release exists"); - - publishOptions.publish = "onTagOrDraft"; - } - } - } - - const publishPolicy = publishOptions.publish; - this.isPublish = publishPolicy != null && publishOptions.publish !== "never" && (publishPolicy !== "onTag" || (0, _electronPublish().getCiTag)() != null); - - if (this.isPublish && forcePublishForPr) { - _builderUtil().log.warn(publishForPrWarning); - } - } else if (publishOptions.publish !== "never") { - _builderUtil().log.info({ - reason: "current build is a part of pull request", - solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\n${publishForPrWarning}` - }, "publishing will be skipped"); - } - - packager.addAfterPackHandler( - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (event) { - const packager = event.packager; - - if (event.electronPlatformName === "darwin") { - if (!event.targets.some(it => it.name === "dmg" || it.name === "zip")) { - return; - } - } else if (packager.platform === _index().Platform.WINDOWS) { - if (!event.targets.some(it => isSuitableWindowsTarget(it))) { - return; - } - } else { - // AppImage writes data to AppImage stage dir, not to linux-unpacked - return; - } - - const publishConfig = yield getAppUpdatePublishConfiguration(packager, event.arch, _this.isPublish); - - if (publishConfig != null) { - yield (0, _fsExtraP().writeFile)(path.join(packager.getResourcesDir(event.appOutDir), "app-update.yml"), (0, _builderUtil().serializeToYaml)(publishConfig)); - } - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); - packager.artifactCreated(event => { - const publishConfiguration = event.publishConfig; - - if (publishConfiguration == null) { - this.taskManager.addTask(this.artifactCreatedWithoutExplicitPublishConfig(event)); - } else if (this.isPublish) { - if (debug.enabled) { - debug(`artifactCreated (isPublish: ${this.isPublish}): ${(0, _builderUtil().safeStringifyJson)(event, new Set(["packager"]))},\n publishConfig: ${(0, _builderUtil().safeStringifyJson)(publishConfiguration)}`); - } - - this.scheduleUpload(publishConfiguration, event, this.getAppInfo(event.packager)); - } - }); - } - - getAppInfo(platformPackager) { - return platformPackager == null ? this.packager.appInfo : platformPackager.appInfo; - } - - getGlobalPublishConfigurations() { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const publishers = _this2.packager.config.publish; - return yield resolvePublishConfigurations(publishers, null, _this2.packager, null, true); - })(); - } - /** @internal */ - - - scheduleUpload(publishConfig, event, appInfo) { - if (publishConfig.provider === "generic") { - return; - } - - const publisher = this.getOrCreatePublisher(publishConfig, appInfo); - - if (publisher == null) { - _builderUtil().log.debug({ - file: event.file, - reason: "publisher is null", - publishConfig: (0, _builderUtil().safeStringifyJson)(publishConfig) - }, "not published"); - - return; - } - - const providerName = publisher.providerName; - - if (this.publishOptions.publish === "onTagOrDraft" && (0, _electronPublish().getCiTag)() == null && !(providerName === "GitHub" || providerName === "Bintray")) { - _builderUtil().log.info({ - file: event.file, - reason: "current build is not for a git tag", - publishPolicy: "onTagOrDraft" - }, `not published to ${providerName}`); - - return; - } - - this.taskManager.addTask(publisher.upload(event)); - } - - artifactCreatedWithoutExplicitPublishConfig(event) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const platformPackager = event.packager; - const target = event.target; - const publishConfigs = yield getPublishConfigs(platformPackager, target == null ? null : target.options, event.arch, _this3.isPublish); - - if (debug.enabled) { - debug(`artifactCreated (isPublish: ${_this3.isPublish}): ${(0, _builderUtil().safeStringifyJson)(event, new Set(["packager"]))},\n publishConfigs: ${(0, _builderUtil().safeStringifyJson)(publishConfigs)}`); - } - - const eventFile = event.file; - - if (publishConfigs == null) { - if (_this3.isPublish) { - _builderUtil().log.debug({ - file: eventFile, - reason: "no publish configs" - }, "not published"); - } - - return; - } - - if (_this3.isPublish) { - for (const publishConfig of publishConfigs) { - if (_this3.cancellationToken.cancelled) { - _builderUtil().log.debug({ - file: event.file, - reason: "cancelled" - }, "not published"); - - break; - } - - _this3.scheduleUpload(publishConfig, event, _this3.getAppInfo(platformPackager)); - } - } - - if (event.isWriteUpdateInfo && target != null && eventFile != null && !_this3.cancellationToken.cancelled && (platformPackager.platform !== _index().Platform.WINDOWS || isSuitableWindowsTarget(target))) { - _this3.taskManager.addTask((0, _updateInfoBuilder().createUpdateInfoTasks)(event, publishConfigs).then(it => _this3.updateFileWriteTask.push(...it))); - } - })(); - } - - getOrCreatePublisher(publishConfig, appInfo) { - // to not include token into cache key - const providerCacheKey = (0, _builderUtil().safeStringifyJson)(publishConfig); - let publisher = this.nameToPublisher.get(providerCacheKey); - - if (publisher == null) { - publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager); - this.nameToPublisher.set(providerCacheKey, publisher); - - _builderUtil().log.info({ - publisher: publisher.toString() - }, "publishing"); - } - - return publisher; - } // noinspection JSUnusedGlobalSymbols - - - cancelTasks() { - this.taskManager.cancelTasks(); - this.nameToPublisher.clear(); - } - - awaitTasks() { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - yield _this4.taskManager.awaitTasks(); - const updateInfoFileTasks = _this4.updateFileWriteTask; - - if (_this4.cancellationToken.cancelled || updateInfoFileTasks.length === 0) { - return; - } - - yield (0, _updateInfoBuilder().writeUpdateInfoFiles)(updateInfoFileTasks, _this4.packager); - yield _this4.taskManager.awaitTasks(); - })(); - } - -} - -exports.PublishManager = PublishManager; - -function getAppUpdatePublishConfiguration(_x2, _x3, _x4) { - return _getAppUpdatePublishConfiguration.apply(this, arguments); -} - -function _getAppUpdatePublishConfiguration() { - _getAppUpdatePublishConfiguration = (0, _bluebirdLst().coroutine)(function* (packager, arch, errorIfCannot) { - const publishConfigs = yield getPublishConfigsForUpdateInfo(packager, (yield getPublishConfigs(packager, null, arch, errorIfCannot)), arch); - - if (publishConfigs == null || publishConfigs.length === 0) { - return null; - } - - const publishConfig = Object.assign({}, publishConfigs[0], { - updaterCacheDirName: packager.appInfo.updaterCacheDirName - }); - - if (packager.platform === _index().Platform.WINDOWS && publishConfig.publisherName == null) { - const winPackager = packager; - const publisherName = winPackager.isForceCodeSigningVerification ? yield winPackager.computedPublisherName.value : undefined; - - if (publisherName != null) { - publishConfig.publisherName = publisherName; - } - } - - return publishConfig; - }); - return _getAppUpdatePublishConfiguration.apply(this, arguments); -} - -function getPublishConfigsForUpdateInfo(_x5, _x6, _x7) { - return _getPublishConfigsForUpdateInfo.apply(this, arguments); -} - -function _getPublishConfigsForUpdateInfo() { - _getPublishConfigsForUpdateInfo = (0, _bluebirdLst().coroutine)(function* (packager, publishConfigs, arch) { - if (publishConfigs === null) { - return null; - } - - if (publishConfigs.length === 0) { - _builderUtil().log.debug(null, "getPublishConfigsForUpdateInfo: no publishConfigs, detect using repository info"); // https://github.com/electron-userland/electron-builder/issues/925#issuecomment-261732378 - // default publish config is github, file should be generated regardless of publish state (user can test installer locally or manage the release process manually) - - - const repositoryInfo = yield packager.info.repositoryInfo; - debug(`getPublishConfigsForUpdateInfo: ${(0, _builderUtil().safeStringifyJson)(repositoryInfo)}`); - - if (repositoryInfo != null && repositoryInfo.type === "github") { - const resolvedPublishConfig = yield getResolvedPublishConfig(packager, packager.info, { - provider: repositoryInfo.type - }, arch, false); - - if (resolvedPublishConfig != null) { - debug(`getPublishConfigsForUpdateInfo: resolve to publish config ${(0, _builderUtil().safeStringifyJson)(resolvedPublishConfig)}`); - return [resolvedPublishConfig]; - } - } - } - - return publishConfigs; - }); - return _getPublishConfigsForUpdateInfo.apply(this, arguments); -} - -function createPublisher(context, version, publishConfig, options, packager) { - if (debug.enabled) { - debug(`Create publisher: ${(0, _builderUtil().safeStringifyJson)(publishConfig)}`); - } - - const provider = publishConfig.provider; - - switch (provider) { - case "github": - return new (_gitHubPublisher().GitHubPublisher)(context, publishConfig, version, options); - - case "bintray": - return new (_BintrayPublisher().BintrayPublisher)(context, publishConfig, version, options); - - case "generic": - return null; - - default: - const clazz = requireProviderClass(provider, packager); - return clazz == null ? null : new clazz(context, publishConfig); - } -} - -function requireProviderClass(provider, packager) { - switch (provider) { - case "github": - return _gitHubPublisher().GitHubPublisher; - - case "bintray": - return _BintrayPublisher().BintrayPublisher; - - case "generic": - return null; - - case "s3": - return _s3Publisher().default; - - case "spaces": - return _spacesPublisher().default; - - default: - const name = `electron-publisher-${provider}`; - let module = null; - - try { - module = require(path.join(packager.buildResourcesDir, name + ".js")); - } catch (ignored) { - console.log(ignored); - } - - if (module == null) { - module = require(name); - } - - return module.default || module; - } -} - -function computeDownloadUrl(publishConfiguration, fileName, packager) { - if (publishConfiguration.provider === "generic") { - const baseUrlString = publishConfiguration.url; - - if (fileName == null) { - return baseUrlString; - } - - const baseUrl = url().parse(baseUrlString); - return url().format(Object.assign({}, baseUrl, { - pathname: path.posix.resolve(baseUrl.pathname || "/", encodeURI(fileName)) - })); - } - - let baseUrl; - - if (publishConfiguration.provider === "github") { - const gh = publishConfiguration; - baseUrl = `${(0, _builderUtilRuntime().githubUrl)(gh)}/${gh.owner}/${gh.repo}/releases/download/${gh.vPrefixedTagName === false ? "" : "v"}${packager.appInfo.version}`; - } else { - baseUrl = (0, _builderUtilRuntime().getS3LikeProviderBaseUrl)(publishConfiguration); - } - - if (fileName == null) { - return baseUrl; - } - - return `${baseUrl}/${encodeURI(fileName)}`; -} - -function getPublishConfigs(_x8, _x9, _x10, _x11) { - return _getPublishConfigs.apply(this, arguments); -} - -function _getPublishConfigs() { - _getPublishConfigs = (0, _bluebirdLst().coroutine)(function* (platformPackager, targetSpecificOptions, arch, errorIfCannot) { - let publishers; // check build.nsis (target) - - if (targetSpecificOptions != null) { - publishers = targetSpecificOptions.publish; // if explicitly set to null - do not publish - - if (publishers === null) { - return null; - } - } // check build.win (platform) - - - if (publishers == null) { - publishers = platformPackager.platformSpecificBuildOptions.publish; - - if (publishers === null) { - return null; - } - } - - if (publishers == null) { - publishers = platformPackager.config.publish; - - if (publishers === null) { - return null; - } - } - - return yield resolvePublishConfigurations(publishers, platformPackager, platformPackager.info, arch, errorIfCannot); - }); - return _getPublishConfigs.apply(this, arguments); -} - -function resolvePublishConfigurations(_x12, _x13, _x14, _x15, _x16) { - return _resolvePublishConfigurations.apply(this, arguments); -} - -function _resolvePublishConfigurations() { - _resolvePublishConfigurations = (0, _bluebirdLst().coroutine)(function* (publishers, platformPackager, packager, arch, errorIfCannot) { - if (publishers == null) { - let serviceName = null; - - if (!(0, _builderUtil().isEmptyOrSpaces)(process.env.GH_TOKEN) || !(0, _builderUtil().isEmptyOrSpaces)(process.env.GITHUB_TOKEN)) { - serviceName = "github"; - } else if (!(0, _builderUtil().isEmptyOrSpaces)(process.env.BT_TOKEN)) { - serviceName = "bintray"; - } - - if (serviceName != null) { - _builderUtil().log.debug(null, `Detect ${serviceName} as publish provider`); - - return [yield getResolvedPublishConfig(platformPackager, packager, { - provider: serviceName - }, arch, errorIfCannot)]; - } - } - - if (publishers == null) { - return []; - } - - debug(`Explicit publish provider: ${(0, _builderUtil().safeStringifyJson)(publishers)}`); - return yield _bluebirdLst().default.map((0, _builderUtil().asArray)(publishers), it => getResolvedPublishConfig(platformPackager, packager, typeof it === "string" ? { - provider: it - } : it, arch, errorIfCannot)); - }); - return _resolvePublishConfigurations.apply(this, arguments); -} - -function isSuitableWindowsTarget(target) { - if (target.name === "appx" && target.options != null && target.options.electronUpdaterAware) { - return true; - } - - return target.name === "nsis" || target.name.startsWith("nsis-"); -} - -function expandPublishConfig(options, platformPackager, packager, arch) { - for (const name of Object.keys(options)) { - const value = options[name]; - - if (typeof value === "string") { - const archValue = arch == null ? null : _builderUtil().Arch[arch]; - const expanded = platformPackager == null ? (0, _macroExpander().expandMacro)(value, archValue, packager.appInfo) : platformPackager.expandMacro(value, archValue); - - if (expanded !== value) { - options[name] = expanded; - } - } - } -} - -function isDetectUpdateChannel(platformSpecificConfiguration, configuration) { - const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel; - return value == null ? configuration.detectUpdateChannel !== false : value; -} - -function getResolvedPublishConfig(_x17, _x18, _x19, _x20, _x21) { - return _getResolvedPublishConfig.apply(this, arguments); -} function _getResolvedPublishConfig() { - _getResolvedPublishConfig = (0, _bluebirdLst().coroutine)(function* (platformPackager, packager, options, arch, errorIfCannot) { - options = Object.assign({}, options); - expandPublishConfig(options, platformPackager, packager, arch); - let channelFromAppVersion = null; - - if (options.channel == null && isDetectUpdateChannel(platformPackager == null ? null : platformPackager.platformSpecificBuildOptions, packager.config)) { - channelFromAppVersion = packager.appInfo.channel; - } - - const provider = options.provider; - - if (provider === "generic") { - const o = options; - - if (o.url == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Please specify "url" for "generic" update server`); - } - - if (channelFromAppVersion != null) { - o.channel = channelFromAppVersion; - } - - return options; - } - - const providerClass = requireProviderClass(options.provider, packager); - - if (providerClass != null && providerClass.checkAndResolveOptions != null) { - yield providerClass.checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot); - return options; - } - - const isGithub = provider === "github"; - - if (!isGithub && provider !== "bintray") { - return options; - } - - let owner = isGithub ? options.owner : options.owner; - let project = isGithub ? options.repo : options.package; - - if (isGithub && owner == null && project != null) { - const index = project.indexOf("/"); - - if (index > 0) { - const repo = project; - project = repo.substring(0, index); - owner = repo.substring(index + 1); - } - } - - function getInfo() { - return _getInfo.apply(this, arguments); - } - - function _getInfo() { - _getInfo = (0, _bluebirdLst().coroutine)(function* () { - const info = yield packager.repositoryInfo; - - if (info != null) { - return info; - } - - const message = `Cannot detect repository by .git/config. Please specify "repository" in the package.json (https://docs.npmjs.com/files/package.json#repository).\nPlease see https://electron.build/configuration/publish`; - - if (errorIfCannot) { - throw new Error(message); - } else { - _builderUtil().log.warn(message); - - return null; - } - }); - return _getInfo.apply(this, arguments); - } - - if (!owner || !project) { - _builderUtil().log.debug({ - reason: "owner or project is not specified explicitly", - provider, - owner, - project - }, "calling getInfo"); - - const info = yield getInfo(); - - if (info == null) { - return null; - } - - if (!owner) { - owner = info.user; - } - - if (!project) { - project = info.project; - } - } - - if (isGithub) { - if (options.token != null && !options.private) { - _builderUtil().log.warn('"token" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).'); - } //tslint:disable-next-line:no-object-literal-type-assertion - - - return Object.assign({ - owner, - repo: project - }, options); - } else { - //tslint:disable-next-line:no-object-literal-type-assertion - return Object.assign({ - owner, - package: project - }, options); - } - }); - return _getResolvedPublishConfig.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=PublishManager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/publish/PublishManager.js.map b/node_modules/app-builder-lib/out/publish/PublishManager.js.map deleted file mode 100644 index faa3bc0..0000000 --- a/node_modules/app-builder-lib/out/publish/PublishManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/publish/PublishManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEA,MAAM,mBAAmB,GAAG,yKAC1B,6LADF;AAGA,MAAM,KAAK,GAAG,qBAAO,0BAAP,CAAd;;AAEA,SAAS,YAAT,CAAsB,aAAtB,EAAwC;AACtC,MAAI,aAAa,IAAI,IAAjB,IAAyB,aAAa,KAAK,OAA3C,IAAsD,aAAa,KAAK,cAAxE,IAA0F,aAAa,KAAK,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ND,MAOK;AACH;AACA,aAAO,MAAA,CAAA,MAAA,CAAA;AAAC,QAAA,KAAD;AAAQ,QAAA,OAAO,EAAE;AAAjB,OAAA,EAA6B,OAA7B,CAAP;AACD;AACF,G","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml } from \"builder-util\"\nimport { BintrayOptions, CancellationToken, GenericServerOptions, getS3LikeProviderBaseUrl, GithubOptions, githubUrl, PublishConfiguration, PublishProvider } from \"builder-util-runtime\"\nimport _debug from \"debug\"\nimport { getCiTag, PublishContext, Publisher, PublishOptions, UploadTask } from \"electron-publish\"\nimport { BintrayPublisher } from \"electron-publish/out/BintrayPublisher\"\nimport { GitHubPublisher } from \"electron-publish/out/gitHubPublisher\"\nimport { MultiProgress } from \"electron-publish/out/multiProgress\"\nimport S3Publisher from \"electron-publish/out/s3/s3Publisher\"\nimport SpacesPublisher from \"electron-publish/out/s3/spacesPublisher\"\nimport { writeFile } from \"fs-extra-p\"\nimport isCi from \"is-ci\"\nimport * as path from \"path\"\nimport { WriteStream as TtyWriteStream } from \"tty\"\nimport * as url from \"url\"\nimport { AppInfo, ArtifactCreated, Configuration, Platform, PlatformSpecificBuildOptions, Target } from \"../index\"\nimport { Packager } from \"../packager\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { expandMacro } from \"../util/macroExpander\"\nimport { WinPackager } from \"../winPackager\"\nimport { createUpdateInfoTasks, UpdateInfoFileTask, writeUpdateInfoFiles } from \"./updateInfoBuilder\"\n\nconst publishForPrWarning = \"There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)\" +\n \"\\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.\"\n\nconst debug = _debug(\"electron-builder:publish\")\n\nfunction checkOptions(publishPolicy: any) {\n if (publishPolicy != null && publishPolicy !== \"onTag\" && publishPolicy !== \"onTagOrDraft\" && publishPolicy !== \"always\" && publishPolicy !== \"never\") {\n if (typeof publishPolicy === \"string\") {\n throw new InvalidConfigurationError(`Expected one of \"onTag\", \"onTagOrDraft\", \"always\", \"never\", but got ${JSON.stringify(publishPolicy)}.\\nPlease note that publish configuration should be specified under \"config\"`)\n }\n }\n}\n\nexport class PublishManager implements PublishContext {\n private readonly nameToPublisher = new Map()\n\n private readonly taskManager: AsyncTaskManager\n\n readonly isPublish: boolean = false\n\n readonly progress = (process.stdout as TtyWriteStream).isTTY ? new MultiProgress() : null\n\n private readonly updateFileWriteTask: Array = []\n\n constructor(private readonly packager: Packager, private readonly publishOptions: PublishOptions, readonly cancellationToken: CancellationToken = packager.cancellationToken) {\n checkOptions(publishOptions.publish)\n\n this.taskManager = new AsyncTaskManager(cancellationToken)\n\n const forcePublishForPr = process.env.PUBLISH_FOR_PULL_REQUEST === \"true\"\n if (!isPullRequest() || forcePublishForPr) {\n if (publishOptions.publish === undefined) {\n if (process.env.npm_lifecycle_event === \"release\") {\n publishOptions.publish = \"always\"\n }\n else {\n const tag = getCiTag()\n if (tag != null) {\n log.info({reason: \"tag is defined\", tag}, \"artifacts will be published\")\n publishOptions.publish = \"onTag\"\n }\n else if (isCi) {\n log.info({reason: \"CI detected\"}, \"artifacts will be published if draft release exists\")\n publishOptions.publish = \"onTagOrDraft\"\n }\n }\n }\n\n const publishPolicy = publishOptions.publish\n this.isPublish = publishPolicy != null && publishOptions.publish !== \"never\" && (publishPolicy !== \"onTag\" || getCiTag() != null)\n if (this.isPublish && forcePublishForPr) {\n log.warn(publishForPrWarning)\n }\n }\n else if (publishOptions.publish !== \"never\") {\n log.info({\n reason: \"current build is a part of pull request\",\n solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\\n${publishForPrWarning}`,\n }, \"publishing will be skipped\")\n }\n\n packager.addAfterPackHandler(async event => {\n const packager = event.packager\n if (event.electronPlatformName === \"darwin\") {\n if (!event.targets.some(it => it.name === \"dmg\" || it.name === \"zip\")) {\n return\n }\n }\n else if (packager.platform === Platform.WINDOWS) {\n if (!event.targets.some(it => isSuitableWindowsTarget(it))) {\n return\n }\n }\n else {\n // AppImage writes data to AppImage stage dir, not to linux-unpacked\n return\n }\n\n const publishConfig = await getAppUpdatePublishConfiguration(packager, event.arch, this.isPublish)\n if (publishConfig != null) {\n await writeFile(path.join(packager.getResourcesDir(event.appOutDir), \"app-update.yml\"), serializeToYaml(publishConfig))\n }\n })\n\n packager.artifactCreated(event => {\n const publishConfiguration = event.publishConfig\n if (publishConfiguration == null) {\n this.taskManager.addTask(this.artifactCreatedWithoutExplicitPublishConfig(event))\n }\n else if (this.isPublish) {\n if (debug.enabled) {\n debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set([\"packager\"]))},\\n publishConfig: ${safeStringifyJson(publishConfiguration)}`)\n }\n this.scheduleUpload(publishConfiguration, event, this.getAppInfo(event.packager))\n }\n })\n }\n\n private getAppInfo(platformPackager: PlatformPackager | null) {\n return platformPackager == null ? this.packager.appInfo : platformPackager.appInfo\n }\n\n async getGlobalPublishConfigurations(): Promise | null> {\n const publishers = this.packager.config.publish\n return await resolvePublishConfigurations(publishers, null, this.packager, null, true)\n }\n\n /** @internal */\n scheduleUpload(publishConfig: PublishConfiguration, event: UploadTask, appInfo: AppInfo): void {\n if (publishConfig.provider === \"generic\") {\n return\n }\n\n const publisher = this.getOrCreatePublisher(publishConfig, appInfo)\n if (publisher == null) {\n log.debug({\n file: event.file,\n reason: \"publisher is null\",\n publishConfig: safeStringifyJson(publishConfig),\n }, \"not published\")\n return\n }\n\n const providerName = publisher.providerName\n if (this.publishOptions.publish === \"onTagOrDraft\" && getCiTag() == null && !(providerName === \"GitHub\" || providerName === \"Bintray\")) {\n log.info({file: event.file, reason: \"current build is not for a git tag\", publishPolicy: \"onTagOrDraft\"}, `not published to ${providerName}`)\n return\n }\n\n this.taskManager.addTask(publisher.upload(event))\n }\n\n private async artifactCreatedWithoutExplicitPublishConfig(event: ArtifactCreated) {\n const platformPackager = event.packager\n const target = event.target\n const publishConfigs = await getPublishConfigs(platformPackager, target == null ? null : target.options, event.arch, this.isPublish)\n\n if (debug.enabled) {\n debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set([\"packager\"]))},\\n publishConfigs: ${safeStringifyJson(publishConfigs)}`)\n }\n\n const eventFile = event.file\n if (publishConfigs == null) {\n if (this.isPublish) {\n log.debug({file: eventFile, reason: \"no publish configs\"}, \"not published\")\n }\n return\n }\n\n if (this.isPublish) {\n for (const publishConfig of publishConfigs) {\n if (this.cancellationToken.cancelled) {\n log.debug({file: event.file, reason: \"cancelled\"}, \"not published\")\n break\n }\n\n this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager))\n }\n }\n\n if (event.isWriteUpdateInfo && target != null && eventFile != null &&\n !this.cancellationToken.cancelled &&\n (platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target))) {\n this.taskManager.addTask(createUpdateInfoTasks(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)))\n }\n }\n\n private getOrCreatePublisher(publishConfig: PublishConfiguration, appInfo: AppInfo): Publisher | null {\n // to not include token into cache key\n const providerCacheKey = safeStringifyJson(publishConfig)\n let publisher = this.nameToPublisher.get(providerCacheKey)\n if (publisher == null) {\n publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager)\n this.nameToPublisher.set(providerCacheKey, publisher)\n log.info({publisher: publisher!!.toString()}, \"publishing\")\n }\n return publisher\n }\n\n // noinspection JSUnusedGlobalSymbols\n cancelTasks() {\n this.taskManager.cancelTasks()\n this.nameToPublisher.clear()\n }\n\n async awaitTasks(): Promise {\n await this.taskManager.awaitTasks()\n\n const updateInfoFileTasks = this.updateFileWriteTask\n if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) {\n return\n }\n\n await writeUpdateInfoFiles(updateInfoFileTasks, this.packager)\n await this.taskManager.awaitTasks()\n }\n}\n\nexport async function getAppUpdatePublishConfiguration(packager: PlatformPackager, arch: Arch, errorIfCannot: boolean) {\n const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, errorIfCannot), arch)\n if (publishConfigs == null || publishConfigs.length === 0) {\n return null\n }\n\n const publishConfig = {\n ...publishConfigs[0],\n updaterCacheDirName: packager.appInfo.updaterCacheDirName,\n }\n\n if (packager.platform === Platform.WINDOWS && publishConfig.publisherName == null) {\n const winPackager = packager as WinPackager\n const publisherName = winPackager.isForceCodeSigningVerification ? await winPackager.computedPublisherName.value : undefined\n if (publisherName != null) {\n publishConfig.publisherName = publisherName\n }\n }\n return publishConfig\n}\n\nexport async function getPublishConfigsForUpdateInfo(packager: PlatformPackager, publishConfigs: Array | null, arch: Arch | null): Promise | null> {\n if (publishConfigs === null) {\n return null\n }\n\n if (publishConfigs.length === 0) {\n log.debug(null, \"getPublishConfigsForUpdateInfo: no publishConfigs, detect using repository info\")\n // https://github.com/electron-userland/electron-builder/issues/925#issuecomment-261732378\n // default publish config is github, file should be generated regardless of publish state (user can test installer locally or manage the release process manually)\n const repositoryInfo = await packager.info.repositoryInfo\n debug(`getPublishConfigsForUpdateInfo: ${safeStringifyJson(repositoryInfo)}`)\n if (repositoryInfo != null && repositoryInfo.type === \"github\") {\n const resolvedPublishConfig = await getResolvedPublishConfig(packager, packager.info, {provider: repositoryInfo.type}, arch, false)\n if (resolvedPublishConfig != null) {\n debug(`getPublishConfigsForUpdateInfo: resolve to publish config ${safeStringifyJson(resolvedPublishConfig)}`)\n return [resolvedPublishConfig]\n }\n }\n }\n return publishConfigs\n}\n\nexport function createPublisher(context: PublishContext, version: string, publishConfig: PublishConfiguration, options: PublishOptions, packager: Packager): Publisher | null {\n if (debug.enabled) {\n debug(`Create publisher: ${safeStringifyJson(publishConfig)}`)\n }\n\n const provider = publishConfig.provider\n switch (provider) {\n case \"github\":\n return new GitHubPublisher(context, publishConfig as GithubOptions, version, options)\n\n case \"bintray\":\n return new BintrayPublisher(context, publishConfig as BintrayOptions, version, options)\n\n case \"generic\":\n return null\n\n default:\n const clazz = requireProviderClass(provider, packager)\n return clazz == null ? null : new clazz(context, publishConfig)\n }\n}\n\nfunction requireProviderClass(provider: string, packager: Packager): any | null {\n switch (provider) {\n case \"github\":\n return GitHubPublisher\n\n case \"bintray\":\n return BintrayPublisher\n\n case \"generic\":\n return null\n\n case \"s3\":\n return S3Publisher\n\n case \"spaces\":\n return SpacesPublisher\n\n default:\n const name = `electron-publisher-${provider}`\n let module: any = null\n try {\n module = require(path.join(packager.buildResourcesDir, name + \".js\"))\n }\n catch (ignored) {\n console.log(ignored)\n }\n\n if (module == null) {\n module = require(name)\n }\n return module.default || module\n }\n}\n\nexport function computeDownloadUrl(publishConfiguration: PublishConfiguration, fileName: string | null, packager: PlatformPackager) {\n if (publishConfiguration.provider === \"generic\") {\n const baseUrlString = (publishConfiguration as GenericServerOptions).url\n if (fileName == null) {\n return baseUrlString\n }\n\n const baseUrl = url.parse(baseUrlString)\n return url.format({...baseUrl as url.UrlObject, pathname: path.posix.resolve(baseUrl.pathname || \"/\", encodeURI(fileName))})\n }\n\n let baseUrl\n if (publishConfiguration.provider === \"github\") {\n const gh = publishConfiguration as GithubOptions\n baseUrl = `${githubUrl(gh)}/${gh.owner}/${gh.repo}/releases/download/${gh.vPrefixedTagName === false ? \"\" : \"v\"}${packager.appInfo.version}`\n }\n else {\n baseUrl = getS3LikeProviderBaseUrl(publishConfiguration)\n }\n\n if (fileName == null) {\n return baseUrl\n }\n return `${baseUrl}/${encodeURI(fileName)}`\n}\n\nexport async function getPublishConfigs(platformPackager: PlatformPackager, targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined, arch: Arch | null, errorIfCannot: boolean): Promise | null> {\n let publishers\n\n // check build.nsis (target)\n if (targetSpecificOptions != null) {\n publishers = targetSpecificOptions.publish\n // if explicitly set to null - do not publish\n if (publishers === null) {\n return null\n }\n }\n\n // check build.win (platform)\n if (publishers == null) {\n publishers = platformPackager.platformSpecificBuildOptions.publish\n if (publishers === null) {\n return null\n }\n }\n\n if (publishers == null) {\n publishers = platformPackager.config.publish\n if (publishers === null) {\n return null\n }\n }\n return await resolvePublishConfigurations(publishers, platformPackager, platformPackager.info, arch, errorIfCannot)\n}\n\nasync function resolvePublishConfigurations(publishers: any, platformPackager: PlatformPackager | null, packager: Packager, arch: Arch | null, errorIfCannot: boolean): Promise | null> {\n if (publishers == null) {\n let serviceName: PublishProvider | null = null\n if (!isEmptyOrSpaces(process.env.GH_TOKEN) || !isEmptyOrSpaces(process.env.GITHUB_TOKEN)) {\n serviceName = \"github\"\n }\n else if (!isEmptyOrSpaces(process.env.BT_TOKEN)) {\n serviceName = \"bintray\"\n }\n\n if (serviceName != null) {\n log.debug(null, `Detect ${serviceName} as publish provider`)\n return [(await getResolvedPublishConfig(platformPackager, packager, {provider: serviceName}, arch, errorIfCannot))!]\n }\n }\n\n if (publishers == null) {\n return []\n }\n\n debug(`Explicit publish provider: ${safeStringifyJson(publishers)}`)\n return await (BluebirdPromise.map(asArray(publishers), it => getResolvedPublishConfig(platformPackager, packager, typeof it === \"string\" ? {provider: it} : it, arch, errorIfCannot)) as Promise>)\n}\n\nfunction isSuitableWindowsTarget(target: Target) {\n if (target.name === \"appx\" && target.options != null && (target.options as any).electronUpdaterAware) {\n return true\n }\n return target.name === \"nsis\" || target.name.startsWith(\"nsis-\")\n}\n\nfunction expandPublishConfig(options: any, platformPackager: PlatformPackager | null, packager: Packager, arch: Arch | null): void {\n for (const name of Object.keys(options)) {\n const value = options[name]\n if (typeof value === \"string\") {\n const archValue = arch == null ? null : Arch[arch]\n const expanded = platformPackager == null ? expandMacro(value, archValue, packager.appInfo) : platformPackager.expandMacro(value, archValue)\n if (expanded !== value) {\n options[name] = expanded\n }\n }\n }\n}\n\nfunction isDetectUpdateChannel(platformSpecificConfiguration: PlatformSpecificBuildOptions | null, configuration: Configuration) {\n const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel\n return value == null ? configuration.detectUpdateChannel !== false : value\n}\n\nasync function getResolvedPublishConfig(platformPackager: PlatformPackager | null, packager: Packager, options: PublishConfiguration, arch: Arch | null, errorIfCannot: boolean): Promise {\n options = {...options}\n expandPublishConfig(options, platformPackager, packager, arch)\n\n let channelFromAppVersion: string | null = null\n if ((options as GenericServerOptions).channel == null && isDetectUpdateChannel(platformPackager == null ? null : platformPackager.platformSpecificBuildOptions, packager.config)) {\n channelFromAppVersion = packager.appInfo.channel\n }\n\n const provider = options.provider\n if (provider === \"generic\") {\n const o = options as GenericServerOptions\n if (o.url == null) {\n throw new InvalidConfigurationError(`Please specify \"url\" for \"generic\" update server`)\n }\n\n if (channelFromAppVersion != null) {\n (o as any).channel = channelFromAppVersion\n }\n return options\n }\n\n const providerClass = requireProviderClass(options.provider, packager)\n if (providerClass != null && providerClass.checkAndResolveOptions != null) {\n await providerClass.checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot)\n return options\n }\n\n const isGithub = provider === \"github\"\n if (!isGithub && provider !== \"bintray\") {\n return options\n }\n\n let owner = isGithub ? (options as GithubOptions).owner : (options as BintrayOptions).owner\n let project = isGithub ? (options as GithubOptions).repo : (options as BintrayOptions).package\n\n if (isGithub && owner == null && project != null) {\n const index = project.indexOf(\"/\")\n if (index > 0) {\n const repo = project\n project = repo.substring(0, index)\n owner = repo.substring(index + 1)\n }\n }\n\n async function getInfo() {\n const info = await packager.repositoryInfo\n if (info != null) {\n return info\n }\n\n const message = `Cannot detect repository by .git/config. Please specify \"repository\" in the package.json (https://docs.npmjs.com/files/package.json#repository).\\nPlease see https://electron.build/configuration/publish`\n if (errorIfCannot) {\n throw new Error(message)\n }\n else {\n log.warn(message)\n return null\n }\n }\n\n if (!owner || !project) {\n log.debug({reason: \"owner or project is not specified explicitly\", provider, owner, project}, \"calling getInfo\")\n const info = await getInfo()\n if (info == null) {\n return null\n }\n\n if (!owner) {\n owner = info.user\n }\n if (!project) {\n project = info.project\n }\n }\n\n if (isGithub) {\n if ((options as GithubOptions).token != null && !(options as GithubOptions).private) {\n log.warn('\"token\" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).')\n }\n //tslint:disable-next-line:no-object-literal-type-assertion\n return {owner, repo: project, ...options} as GithubOptions\n }\n else {\n //tslint:disable-next-line:no-object-literal-type-assertion\n return {owner, package: project, ...options} as BintrayOptions\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.d.ts b/node_modules/app-builder-lib/out/publish/updateInfoBuilder.d.ts deleted file mode 100644 index aec4f34..0000000 --- a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PublishConfiguration, UpdateInfo } from "builder-util-runtime"; -import { Packager } from "../packager"; -import { PlatformPackager } from "../platformPackager"; -export interface UpdateInfoFileTask { - readonly file: string; - readonly info: UpdateInfo; - readonly publishConfiguration: PublishConfiguration; - readonly packager: PlatformPackager; -} -export declare function writeUpdateInfoFiles(updateInfoFileTasks: Array, packager: Packager): Promise; diff --git a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js b/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js deleted file mode 100644 index c14e1e6..0000000 --- a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js +++ /dev/null @@ -1,382 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createUpdateInfoTasks = createUpdateInfoTasks; -exports.writeUpdateInfoFiles = writeUpdateInfoFiles; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function semver() { - const data = _interopRequireWildcard(require("semver")); - - semver = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _hash() { - const data = require("../util/hash"); - - _hash = function () { - return data; - }; - - return data; -} - -function _PublishManager() { - const data = require("./PublishManager"); - - _PublishManager = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getReleaseInfo(_x) { - return _getReleaseInfo.apply(this, arguments); -} - -function _getReleaseInfo() { - _getReleaseInfo = (0, _bluebirdLst().coroutine)(function* (packager) { - const releaseInfo = Object.assign({}, packager.platformSpecificBuildOptions.releaseInfo || packager.config.releaseInfo); - - if (releaseInfo.releaseNotes == null) { - const releaseNotesFile = yield packager.getResource(releaseInfo.releaseNotesFile, `release-notes-${packager.platform.buildConfigurationKey}.md`, `release-notes-${packager.platform.name}.md`, `release-notes-${packager.platform.nodeName}.md`, "release-notes.md"); - const releaseNotes = releaseNotesFile == null ? null : yield (0, _fsExtraP().readFile)(releaseNotesFile, "utf-8"); // to avoid undefined in the file, check for null - - if (releaseNotes != null) { - releaseInfo.releaseNotes = releaseNotes; - } - } - - delete releaseInfo.releaseNotesFile; - return releaseInfo; - }); - return _getReleaseInfo.apply(this, arguments); -} - -function isGenerateUpdatesFilesForAllChannels(packager) { - const value = packager.platformSpecificBuildOptions.generateUpdatesFilesForAllChannels; - return value == null ? packager.config.generateUpdatesFilesForAllChannels : value; -} -/** - if this is an "alpha" version, we need to generate only the "alpha" .yml file - if this is a "beta" version, we need to generate both the "alpha" and "beta" .yml file - if this is a "stable" version, we need to generate all the "alpha", "beta" and "stable" .yml file - */ - - -function computeChannelNames(packager, publishConfig) { - const currentChannel = publishConfig.channel || "latest"; // for GitHub should be pre-release way be used - - if (currentChannel === "alpha" || publishConfig.provider === "github" || !isGenerateUpdatesFilesForAllChannels(packager)) { - return [currentChannel]; - } - - switch (currentChannel) { - case "beta": - return [currentChannel, "alpha"]; - - case "latest": - return [currentChannel, "alpha", "beta"]; - - default: - return [currentChannel]; - } -} - -function getUpdateInfoFileName(channel, packager, arch) { - const osSuffix = packager.platform === _core().Platform.WINDOWS ? "" : `-${packager.platform.buildConfigurationKey}`; - return `${channel}${osSuffix}${getArchPrefixForUpdateFile(arch, packager)}.yml`; -} - -function getArchPrefixForUpdateFile(arch, packager) { - if (arch == null || arch === _builderUtil().Arch.x64 || packager.platform !== _core().Platform.LINUX) { - return ""; - } - - return arch === _builderUtil().Arch.armv7l ? "-arm" : `-${_builderUtil().Arch[arch]}`; -} - -function computeIsisElectronUpdater1xCompatibility(updaterCompatibility, publishConfiguration, packager) { - if (updaterCompatibility != null) { - return semver().satisfies("1.0.0", updaterCompatibility); - } // spaces is a new publish provider, no need to keep backward compatibility - - - if (publishConfiguration.provider === "spaces") { - return false; - } - - const updaterVersion = packager.metadata.dependencies == null ? null : packager.metadata.dependencies["electron-updater"]; - return updaterVersion == null || semver().lt(updaterVersion, "4.0.0"); -} -/** @internal */ - - -function createUpdateInfoTasks(_x2, _x3) { - return _createUpdateInfoTasks.apply(this, arguments); -} - -function _createUpdateInfoTasks() { - _createUpdateInfoTasks = (0, _bluebirdLst().coroutine)(function* (event, _publishConfigs) { - const packager = event.packager; - const publishConfigs = yield (0, _PublishManager().getPublishConfigsForUpdateInfo)(packager, _publishConfigs, event.arch); - - if (publishConfigs == null || publishConfigs.length === 0) { - return []; - } - - const outDir = event.target.outDir; - const version = packager.appInfo.version; - const sha2 = new (_lazyVal().Lazy)(() => (0, _hash().hashFile)(event.file, "sha256", "hex")); - - const isMac = packager.platform === _core().Platform.MAC; - - const createdFiles = new Set(); - const sharedInfo = yield createUpdateInfo(version, event, (yield getReleaseInfo(packager))); - const tasks = []; - const electronUpdaterCompatibility = packager.platformSpecificBuildOptions.electronUpdaterCompatibility || packager.config.electronUpdaterCompatibility || ">=2.15"; - - for (const publishConfiguration of publishConfigs) { - const isBintray = publishConfiguration.provider === "bintray"; - let dir = outDir; // Bintray uses different variant of channel file info, better to generate it to a separate dir by always - - if (isBintray || publishConfigs.length > 1 && publishConfiguration !== publishConfigs[0]) { - dir = path.join(outDir, publishConfiguration.provider); - } - - let isElectronUpdater1xCompatibility = computeIsisElectronUpdater1xCompatibility(electronUpdaterCompatibility, publishConfiguration, packager.info); - let info = sharedInfo; // noinspection JSDeprecatedSymbols - - if (isElectronUpdater1xCompatibility && packager.platform === _core().Platform.WINDOWS) { - info = Object.assign({}, info); // noinspection JSDeprecatedSymbols - - info.sha2 = yield sha2.value; - } - - if (event.safeArtifactName != null && publishConfiguration.provider === "github") { - const newFiles = info.files.slice(); - newFiles[0].url = event.safeArtifactName; - info = Object.assign({}, info, { - files: newFiles, - path: event.safeArtifactName - }); - } - - for (const channel of computeChannelNames(packager, publishConfiguration)) { - if (isMac && isElectronUpdater1xCompatibility && event.file.endsWith(".zip")) { - // write only for first channel (generateUpdatesFilesForAllChannels is a new functionality, no need to generate old mac update info file) - isElectronUpdater1xCompatibility = false; - yield writeOldMacInfo(publishConfiguration, outDir, dir, channel, createdFiles, version, packager); - } - - const updateInfoFile = path.join(dir, (isBintray ? `${version}_` : "") + getUpdateInfoFileName(channel, packager, event.arch)); - - if (createdFiles.has(updateInfoFile)) { - continue; - } - - createdFiles.add(updateInfoFile); // artifact should be uploaded only to designated publish provider - - tasks.push({ - file: updateInfoFile, - info, - publishConfiguration, - packager - }); - } - } - - return tasks; - }); - return _createUpdateInfoTasks.apply(this, arguments); -} - -function createUpdateInfo(_x4, _x5, _x6) { - return _createUpdateInfo.apply(this, arguments); -} - -function _createUpdateInfo() { - _createUpdateInfo = (0, _bluebirdLst().coroutine)(function* (version, event, releaseInfo) { - const customUpdateInfo = event.updateInfo; - const url = path.basename(event.file); - const sha512 = (customUpdateInfo == null ? null : customUpdateInfo.sha512) || (yield (0, _hash().hashFile)(event.file)); - const files = [{ - url, - sha512 - }]; - const result = Object.assign({ - version, - files, - path: url - /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */ - , - sha512 - /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */ - - }, releaseInfo); - - if (customUpdateInfo != null) { - // file info or nsis web installer packages info - Object.assign("sha512" in customUpdateInfo ? files[0] : result, customUpdateInfo); - } - - return result; - }); - return _createUpdateInfo.apply(this, arguments); -} - -function writeUpdateInfoFiles(_x7, _x8) { - return _writeUpdateInfoFiles.apply(this, arguments); -} // backward compatibility - write json file - - -function _writeUpdateInfoFiles() { - _writeUpdateInfoFiles = (0, _bluebirdLst().coroutine)(function* (updateInfoFileTasks, packager) { - // zip must be first and zip info must be used for old path/sha512 properties in the update info - updateInfoFileTasks.sort((a, b) => (a.info.files[0].url.endsWith(".zip") ? 0 : 100) - (b.info.files[0].url.endsWith(".zip") ? 0 : 100)); - const updateChannelFileToInfo = new Map(); - - for (const task of updateInfoFileTasks) { - // https://github.com/electron-userland/electron-builder/pull/2994 - const key = `${task.file}@${(0, _builderUtil().safeStringifyJson)(task.publishConfiguration, new Set(["releaseType"]))}`; - const existingTask = updateChannelFileToInfo.get(key); - - if (existingTask == null) { - updateChannelFileToInfo.set(key, task); - continue; - } - - existingTask.info.files.push(...task.info.files); - } - - const releaseDate = new Date().toISOString(); - yield _bluebirdLst().default.map(updateChannelFileToInfo.values(), - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (task) { - const publishConfig = task.publishConfiguration; - - if (publishConfig.publishAutoUpdate === false) { - _builderUtil().log.debug({ - provider: publishConfig.provider, - reason: "publishAutoUpdate is set to false" - }, "auto update metadata file not published"); - - return; - } - - if (task.info.releaseDate == null) { - task.info.releaseDate = releaseDate; - } - - const fileContent = Buffer.from((0, _builderUtil().serializeToYaml)(task.info, false, true)); - yield (0, _fsExtraP().outputFile)(task.file, fileContent); - packager.dispatchArtifactCreated({ - file: task.file, - fileContent, - arch: null, - packager: task.packager, - target: null, - publishConfig - }); - }); - - return function (_x16) { - return _ref.apply(this, arguments); - }; - }(), { - concurrency: 4 - }); - }); - return _writeUpdateInfoFiles.apply(this, arguments); -} - -function writeOldMacInfo(_x9, _x10, _x11, _x12, _x13, _x14, _x15) { - return _writeOldMacInfo.apply(this, arguments); -} function _writeOldMacInfo() { - _writeOldMacInfo = (0, _bluebirdLst().coroutine)(function* (publishConfig, outDir, dir, channel, createdFiles, version, packager) { - const isGitHub = publishConfig.provider === "github"; - const updateInfoFile = isGitHub && outDir === dir ? path.join(dir, "github", `${channel}-mac.json`) : path.join(dir, `${channel}-mac.json`); - - if (!createdFiles.has(updateInfoFile)) { - createdFiles.add(updateInfoFile); - yield (0, _fsExtraP().outputJson)(updateInfoFile, { - version, - releaseDate: new Date().toISOString(), - url: (0, _PublishManager().computeDownloadUrl)(publishConfig, packager.generateName2("zip", "mac", isGitHub), packager) - }, { - spaces: 2 - }); - packager.info.dispatchArtifactCreated({ - file: updateInfoFile, - arch: null, - packager, - target: null, - publishConfig - }); - } - }); - return _writeOldMacInfo.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=updateInfoBuilder.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js.map b/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js.map deleted file mode 100644 index 6568bca..0000000 --- a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/publish/updateInfoBuilder.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAA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,GAAI,QAAQ,IAAI,MAAM,KAAK,GAAxB,GAA+B,IAAI,CAAC,IAAL,CAAU,GAAV,EAAe,QAAf,EAAyB,GAAG,OAAO,WAAnC,CAA/B,GAAiF,IAAI,CAAC,IAAL,CAAU,GAAV,EAAe,GAAG,OAAO,WAAzB,CAAxG;;AACA,QAAI,CAAC,YAAY,CAAC,GAAb,CAAiB,cAAjB,CAAL,EAAuC;AACrC,MAAA,YAAY,CAAC,GAAb,CAAiB,cAAjB;AACA,YAAM,4BAAW,cAAX,EAA2B;AAC/B,QAAA,OAD+B;AAE/B,QAAA,WAAW,EAAE,IAAI,IAAJ,GAAW,WAAX,EAFkB;AAG/B,QAAA,GAAG,EAAE,0CAAmB,aAAnB,EAAkC,QAAQ,CAAC,aAAT,CAAuB,KAAvB,EAA8B,KAA9B,EAAqC,QAArC,CAAlC,EAAkF,QAAlF;AAH0B,OAA3B,EAIH;AAAC,QAAA,MAAM,EAAE;AAAT,OAJG,CAAN;AAMA,MAAA,QAAQ,CAAC,IAAT,CAAc,uBAAd,CAAsC;AACpC,QAAA,IAAI,EAAE,cAD8B;AAEpC,QAAA,IAAI,EAAE,IAF8B;AAGpC,QAAA,QAHoC;AAIpC,QAAA,MAAM,EAAE,IAJ4B;AAKpC,QAAA;AALoC,OAAtC;AAOD;AACF,G","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, log, safeStringifyJson, serializeToYaml } from \"builder-util\"\nimport { GenericServerOptions, PublishConfiguration, UpdateInfo, WindowsUpdateInfo } from \"builder-util-runtime\"\nimport { outputFile, outputJson, readFile } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { ReleaseInfo } from \"..\"\nimport { Platform } from \"../core\"\nimport { Packager } from \"../packager\"\nimport { ArtifactCreated } from \"../packagerApi\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { hashFile } from \"../util/hash\"\nimport { computeDownloadUrl, getPublishConfigsForUpdateInfo } from \"./PublishManager\"\n\nasync function getReleaseInfo(packager: PlatformPackager) {\n const releaseInfo: ReleaseInfo = {...(packager.platformSpecificBuildOptions.releaseInfo || packager.config.releaseInfo)}\n if (releaseInfo.releaseNotes == null) {\n const releaseNotesFile = await packager.getResource(releaseInfo.releaseNotesFile, `release-notes-${packager.platform.buildConfigurationKey}.md`, `release-notes-${packager.platform.name}.md`, `release-notes-${packager.platform.nodeName}.md`, \"release-notes.md\")\n const releaseNotes = releaseNotesFile == null ? null : await readFile(releaseNotesFile, \"utf-8\")\n // to avoid undefined in the file, check for null\n if (releaseNotes != null) {\n releaseInfo.releaseNotes = releaseNotes\n }\n }\n delete releaseInfo.releaseNotesFile\n return releaseInfo\n}\n\nfunction isGenerateUpdatesFilesForAllChannels(packager: PlatformPackager) {\n const value = packager.platformSpecificBuildOptions.generateUpdatesFilesForAllChannels\n return value == null ? packager.config.generateUpdatesFilesForAllChannels : value\n}\n\n/**\n if this is an \"alpha\" version, we need to generate only the \"alpha\" .yml file\n if this is a \"beta\" version, we need to generate both the \"alpha\" and \"beta\" .yml file\n if this is a \"stable\" version, we need to generate all the \"alpha\", \"beta\" and \"stable\" .yml file\n */\nfunction computeChannelNames(packager: PlatformPackager, publishConfig: PublishConfiguration): Array {\n const currentChannel: string = (publishConfig as GenericServerOptions).channel || \"latest\"\n // for GitHub should be pre-release way be used\n if (currentChannel === \"alpha\" || publishConfig.provider === \"github\" || !isGenerateUpdatesFilesForAllChannels(packager)) {\n return [currentChannel]\n }\n\n switch (currentChannel) {\n case \"beta\":\n return [currentChannel, \"alpha\"]\n\n case \"latest\":\n return [currentChannel, \"alpha\", \"beta\"]\n\n default:\n return [currentChannel]\n }\n}\n\nfunction getUpdateInfoFileName(channel: string, packager: PlatformPackager, arch: Arch | null): string {\n const osSuffix = packager.platform === Platform.WINDOWS ? \"\" : `-${packager.platform.buildConfigurationKey}`\n return `${channel}${osSuffix}${getArchPrefixForUpdateFile(arch, packager)}.yml`\n}\n\nfunction getArchPrefixForUpdateFile(arch: Arch | null, packager: PlatformPackager) {\n if (arch == null || arch === Arch.x64 || packager.platform !== Platform.LINUX) {\n return \"\"\n }\n return arch === Arch.armv7l ? \"-arm\" : `-${Arch[arch]}`\n}\n\nexport interface UpdateInfoFileTask {\n readonly file: string\n readonly info: UpdateInfo\n readonly publishConfiguration: PublishConfiguration\n\n readonly packager: PlatformPackager\n}\n\nfunction computeIsisElectronUpdater1xCompatibility(updaterCompatibility: string | null, publishConfiguration: PublishConfiguration, packager: Packager) {\n if (updaterCompatibility != null) {\n return semver.satisfies(\"1.0.0\", updaterCompatibility)\n }\n\n // spaces is a new publish provider, no need to keep backward compatibility\n if (publishConfiguration.provider === \"spaces\") {\n return false\n }\n\n const updaterVersion = packager.metadata.dependencies == null ? null : packager.metadata.dependencies[\"electron-updater\"]\n return updaterVersion == null || semver.lt(updaterVersion, \"4.0.0\")\n}\n\n/** @internal */\nexport async function createUpdateInfoTasks(event: ArtifactCreated, _publishConfigs: Array): Promise> {\n const packager = event.packager\n const publishConfigs = await getPublishConfigsForUpdateInfo(packager, _publishConfigs, event.arch)\n if (publishConfigs == null || publishConfigs.length === 0) {\n return []\n }\n\n const outDir = event.target!.outDir\n const version = packager.appInfo.version\n const sha2 = new Lazy(() => hashFile(event.file!, \"sha256\", \"hex\"))\n const isMac = packager.platform === Platform.MAC\n const createdFiles = new Set()\n const sharedInfo = await createUpdateInfo(version, event, await getReleaseInfo(packager))\n const tasks: Array = []\n const electronUpdaterCompatibility = packager.platformSpecificBuildOptions.electronUpdaterCompatibility || packager.config.electronUpdaterCompatibility || \">=2.15\"\n for (const publishConfiguration of publishConfigs) {\n const isBintray = publishConfiguration.provider === \"bintray\"\n let dir = outDir\n // Bintray uses different variant of channel file info, better to generate it to a separate dir by always\n if (isBintray || (publishConfigs.length > 1 && publishConfiguration !== publishConfigs[0])) {\n dir = path.join(outDir, publishConfiguration.provider)\n }\n\n let isElectronUpdater1xCompatibility = computeIsisElectronUpdater1xCompatibility(electronUpdaterCompatibility, publishConfiguration, packager.info)\n\n let info = sharedInfo\n // noinspection JSDeprecatedSymbols\n if (isElectronUpdater1xCompatibility && packager.platform === Platform.WINDOWS) {\n info = {\n ...info,\n };\n // noinspection JSDeprecatedSymbols\n (info as WindowsUpdateInfo).sha2 = await sha2.value\n }\n\n if (event.safeArtifactName != null && publishConfiguration.provider === \"github\") {\n const newFiles = info.files.slice()\n newFiles[0].url = event.safeArtifactName\n info = {\n ...info,\n files: newFiles,\n path: event.safeArtifactName,\n }\n }\n\n for (const channel of computeChannelNames(packager, publishConfiguration)) {\n if (isMac && isElectronUpdater1xCompatibility && event.file.endsWith(\".zip\")) {\n // write only for first channel (generateUpdatesFilesForAllChannels is a new functionality, no need to generate old mac update info file)\n isElectronUpdater1xCompatibility = false\n await writeOldMacInfo(publishConfiguration, outDir, dir, channel, createdFiles, version, packager)\n }\n\n const updateInfoFile = path.join(dir, (isBintray ? `${version}_` : \"\") + getUpdateInfoFileName(channel, packager, event.arch))\n if (createdFiles.has(updateInfoFile)) {\n continue\n }\n\n createdFiles.add(updateInfoFile)\n\n // artifact should be uploaded only to designated publish provider\n tasks.push({\n file: updateInfoFile,\n info,\n publishConfiguration,\n packager,\n })\n }\n }\n return tasks\n}\n\nasync function createUpdateInfo(version: string, event: ArtifactCreated, releaseInfo: ReleaseInfo): Promise {\n const customUpdateInfo = event.updateInfo\n const url = path.basename(event.file!)\n const sha512 = (customUpdateInfo == null ? null : customUpdateInfo.sha512) || await hashFile(event.file!)\n const files = [{url, sha512}]\n const result: UpdateInfo = {\n version,\n files,\n path: url /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */,\n sha512 /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */,\n ...releaseInfo as UpdateInfo,\n }\n\n if (customUpdateInfo != null) {\n // file info or nsis web installer packages info\n Object.assign(\"sha512\" in customUpdateInfo ? files[0] : result, customUpdateInfo)\n }\n return result\n}\n\nexport async function writeUpdateInfoFiles(updateInfoFileTasks: Array, packager: Packager) {\n // zip must be first and zip info must be used for old path/sha512 properties in the update info\n updateInfoFileTasks.sort((a, b) => (a.info.files[0].url.endsWith(\".zip\") ? 0 : 100) - (b.info.files[0].url.endsWith(\".zip\") ? 0 : 100))\n\n const updateChannelFileToInfo = new Map()\n for (const task of updateInfoFileTasks) {\n // https://github.com/electron-userland/electron-builder/pull/2994\n const key = `${task.file}@${safeStringifyJson(task.publishConfiguration, new Set([\"releaseType\"]))}`\n const existingTask = updateChannelFileToInfo.get(key)\n if (existingTask == null) {\n updateChannelFileToInfo.set(key, task)\n continue\n }\n\n existingTask.info.files.push(...task.info.files)\n }\n\n const releaseDate = new Date().toISOString()\n await BluebirdPromise.map(updateChannelFileToInfo.values(), async task => {\n const publishConfig = task.publishConfiguration\n if (publishConfig.publishAutoUpdate === false) {\n log.debug({\n provider: publishConfig.provider,\n reason: \"publishAutoUpdate is set to false\"\n }, \"auto update metadata file not published\")\n return\n }\n\n if (task.info.releaseDate == null) {\n task.info.releaseDate = releaseDate\n }\n\n const fileContent = Buffer.from(serializeToYaml(task.info, false, true))\n await outputFile(task.file, fileContent)\n packager.dispatchArtifactCreated({\n file: task.file,\n fileContent,\n arch: null,\n packager: task.packager,\n target: null,\n publishConfig,\n })\n }, {concurrency: 4})\n}\n\n// backward compatibility - write json file\nasync function writeOldMacInfo(publishConfig: PublishConfiguration, outDir: string, dir: string, channel: string, createdFiles: Set, version: string, packager: PlatformPackager) {\n const isGitHub = publishConfig.provider === \"github\"\n const updateInfoFile = (isGitHub && outDir === dir) ? path.join(dir, \"github\", `${channel}-mac.json`) : path.join(dir, `${channel}-mac.json`)\n if (!createdFiles.has(updateInfoFile)) {\n createdFiles.add(updateInfoFile)\n await outputJson(updateInfoFile, {\n version,\n releaseDate: new Date().toISOString(),\n url: computeDownloadUrl(publishConfig, packager.generateName2(\"zip\", \"mac\", isGitHub), packager),\n }, {spaces: 2})\n\n packager.info.dispatchArtifactCreated({\n file: updateInfoFile,\n arch: null,\n packager,\n target: null,\n publishConfig,\n })\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.d.ts b/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.d.ts deleted file mode 100644 index a8d70e8..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Lazy } from "lazy-val"; -import { Packager } from "../packager"; -export declare class ProjectInfoManager { - readonly packager: Packager; - readonly infoFile: Lazy; - constructor(packager: Packager); - private saveConfigurationAndMetadata; -} diff --git a/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.js b/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.js deleted file mode 100644 index 538be69..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ProjectInfoManager = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class ProjectInfoManager { - constructor(packager) { - this.packager = packager; - this.infoFile = new (_lazyVal().Lazy)(() => this.saveConfigurationAndMetadata()); - } - - saveConfigurationAndMetadata() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - const tempDir = yield packager.tempDirManager.createTempDir({ - prefix: "remote-build-metadata" - }); // we cannot use getTempFile because file name must be constant - - const info = { - metadata: packager.metadata, - configuration: packager.config, - repositoryInfo: yield packager.repositoryInfo, - buildResourceDirName: path.basename(packager.buildResourcesDir) - }; - - if (packager.metadata !== packager.devMetadata && packager.devMetadata != null) { - info.devMetadata = packager.devMetadata; - } - - const file = path.join(tempDir, "info.json"); - yield (0, _fsExtraP().outputJson)(file, info); - return file; - })(); - } - -} exports.ProjectInfoManager = ProjectInfoManager; -// __ts-babel@6.0.4 -//# sourceMappingURL=ProjectInfoManager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.js.map b/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.js.map deleted file mode 100644 index 4bd128e..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/ProjectInfoManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/remoteBuilder/ProjectInfoManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAGM,MAAO,kBAAP,CAAyB;AAG7B,EAAA,WAAA,CAAqB,QAArB,EAAuC;AAAlB,SAAA,QAAA,GAAA,QAAA;AAFZ,SAAA,QAAA,GAAW,KAAI,eAAJ,EAAS,MAAM,KAAK,4BAAL,EAAf,CAAX;AAGR;;AAEa,EAAA,4BAAN,GAAkC;AAAA;;AAAA;AACxC,YAAM,QAAQ,GAAG,KAAI,CAAC,QAAtB;AACA,YAAM,OAAO,SAAS,QAAQ,CAAC,cAAT,CAAwB,aAAxB,CAAsC;AAAC,QAAA,MAAM,EAAE;AAAT,OAAtC,CAAtB,CAFwC,CAGxC;;AACA,YAAM,IAAI,GAAQ;AAChB,QAAA,QAAQ,EAAE,QAAQ,CAAC,QADH;AAEhB,QAAA,aAAa,EAAE,QAAQ,CAAC,MAFR;AAGhB,QAAA,cAAc,QAAQ,QAAQ,CAAC,cAHf;AAIhB,QAAA,oBAAoB,EAAE,IAAI,CAAC,QAAL,CAAc,QAAQ,CAAC,iBAAvB;AAJN,OAAlB;;AAMA,UAAI,QAAQ,CAAC,QAAT,KAAsB,QAAQ,CAAC,WAA/B,IAA8C,QAAQ,CAAC,WAAT,IAAwB,IAA1E,EAAgF;AAC9E,QAAA,IAAI,CAAC,WAAL,GAAmB,QAAQ,CAAC,WAA5B;AACD;;AACD,YAAM,IAAI,GAAG,IAAI,CAAC,IAAL,CAAU,OAAV,EAAmB,WAAnB,CAAb;AACA,YAAM,4BAAW,IAAX,EAAiB,IAAjB,CAAN;AACA,aAAO,IAAP;AAfwC;AAgBzC;;AAtB4B,C","sourcesContent":["import { outputJson } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Packager } from \"../packager\"\n\nexport class ProjectInfoManager {\n readonly infoFile = new Lazy(() => this.saveConfigurationAndMetadata())\n\n constructor(readonly packager: Packager) {\n }\n\n private async saveConfigurationAndMetadata() {\n const packager = this.packager\n const tempDir = await packager.tempDirManager.createTempDir({prefix: \"remote-build-metadata\"})\n // we cannot use getTempFile because file name must be constant\n const info: any = {\n metadata: packager.metadata,\n configuration: packager.config,\n repositoryInfo: await packager.repositoryInfo,\n buildResourceDirName: path.basename(packager.buildResourcesDir)\n }\n if (packager.metadata !== packager.devMetadata && packager.devMetadata != null) {\n info.devMetadata = packager.devMetadata\n }\n const file = path.join(tempDir, \"info.json\")\n await outputJson(file, info)\n return file\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.d.ts b/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.d.ts deleted file mode 100644 index 7835572..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Arch } from "builder-util"; -import { UploadTask } from "electron-publish/out/publisher"; -import { Target } from "../core"; -import { PlatformPackager } from "../platformPackager"; -export declare class RemoteBuilder { - readonly packager: PlatformPackager; - private readonly toBuild; - private buildStarted; - constructor(packager: PlatformPackager); - scheduleBuild(target: Target, arch: Arch, unpackedDirectory: string): void; - build(): Promise; - private _build; - private artifactInfoToArtifactCreatedEvent; -} -interface ArtifactInfo extends UploadTask { - target: string | null; - readonly isWriteUpdateInfo?: boolean; - readonly updateInfo?: any; -} -export interface RemoteBuilderResponse { - files: Array | null; - error: string | null; -} -export {}; diff --git a/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.js b/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.js deleted file mode 100644 index 160b922..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.js +++ /dev/null @@ -1,179 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.RemoteBuilder = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _appBuilder() { - const data = require("../util/appBuilder"); - - _appBuilder = function () { - return data; - }; - - return data; -} - -function _ProjectInfoManager() { - const data = require("./ProjectInfoManager"); - - _ProjectInfoManager = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class RemoteBuilder { - constructor(packager) { - this.packager = packager; - this.toBuild = new Map(); - this.buildStarted = false; - } - - scheduleBuild(target, arch, unpackedDirectory) { - if (!(0, _builderUtil().isEnvTrue)(process.env._REMOTE_BUILD) && this.packager.config.remoteBuild === false) { - throw new Error("Target is not supported on your OS and using of Electron Build Service is disabled (\"remoteBuild\" option)"); - } - - let list = this.toBuild.get(arch); - - if (list == null) { - list = []; - this.toBuild.set(arch, list); - } - - list.push({ - name: target.name, - arch: _builderUtil().Arch[arch], - unpackedDirectory, - outDir: target.outDir - }); - } - - build() { - if (this.buildStarted) { - return Promise.resolve(); - } - - this.buildStarted = true; - return _bluebirdLst().default.mapSeries(Array.from(this.toBuild.keys()), arch => { - return this._build(this.toBuild.get(arch), this.packager); - }); - } // noinspection JSMethodCanBeStatic - - - _build(targets, packager) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (_builderUtil().log.isDebugEnabled) { - _builderUtil().log.debug({ - remoteTargets: JSON.stringify(targets, null, 2) - }, "remote building"); - } - - const projectInfoManager = new (_ProjectInfoManager().ProjectInfoManager)(packager.info); // let result: RemoteBuilderResponse | null = null - - const req = Buffer.from(JSON.stringify({ - targets: targets.map(it => { - return { - name: it.name, - arch: it.arch, - unpackedDirName: path.basename(it.unpackedDirectory) - }; - }), - platform: packager.platform.buildConfigurationKey - })).toString("base64"); - const outDir = targets[0].outDir; - const args = ["remote-build", "--request", req, "--output", outDir]; - args.push("--file", targets[0].unpackedDirectory); - args.push("--file", (yield projectInfoManager.infoFile.value)); - const buildResourcesDir = packager.buildResourcesDir; - - if (buildResourcesDir === packager.projectDir) { - throw new (_builderUtil().InvalidConfigurationError)(`Build resources dir equals to project dir and so, not sent to remote build agent. It will lead to incorrect results.\nPlease set "directories.buildResources" to separate dir or leave default ("build" directory in the project root)`); - } - - args.push("--build-resource-dir", buildResourcesDir); - const result = yield (0, _appBuilder().executeAppBuilderAsJson)(args); - - if (result.error != null) { - throw new (_builderUtil().InvalidConfigurationError)(`Remote builder error (if you think that it is not your application misconfiguration issue, please file issue to https://github.com/electron-userland/electron-builder/issues):\n\n${result.error}`, "REMOTE_BUILDER_ERROR"); - } else if (result.files != null) { - for (const artifact of result.files) { - const localFile = path.join(outDir, artifact.file); - - const artifactCreatedEvent = _this.artifactInfoToArtifactCreatedEvent(artifact, localFile, outDir); // PublishManager uses outDir and options, real (the same as for local build) values must be used - - - yield _this.packager.info.callArtifactBuildCompleted(artifactCreatedEvent); - } - } - })(); - } - - artifactInfoToArtifactCreatedEvent(artifact, localFile, outDir) { - const target = artifact.target; // noinspection SpellCheckingInspection - - return Object.assign({}, artifact, { - file: localFile, - target: target == null ? null : new FakeTarget(target, outDir, this.packager.config[target]), - packager: this.packager - }); - } - -} - -exports.RemoteBuilder = RemoteBuilder; - -class FakeTarget extends _core().Target { - constructor(name, outDir, options) { - super(name); - this.outDir = outDir; - this.options = options; - } - - build(appOutDir, arch) {// no build - - return (0, _bluebirdLst().coroutine)(function* () {})(); - } - -} -// __ts-babel@6.0.4 -//# sourceMappingURL=RemoteBuilder.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.js.map b/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.js.map deleted file mode 100644 index 2f06b2c..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/RemoteBuilder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/remoteBuilder/RemoteBuilder.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AASM,MAAO,aAAP,CAAoB;AAIxB,EAAA,W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AAA,OAAA,GAAA,OAAA;AAE3D;;AAEK,EAAA,KAAN,CAAY,SAAZ,EAA+B,IAA/B,EAAyC,CACvC;;AADuC;AAExC;;AAP4B,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, isEnvTrue, log, InvalidConfigurationError } from \"builder-util\"\nimport * as path from \"path\"\nimport { UploadTask } from \"electron-publish/out/publisher\"\nimport { Target, TargetSpecificOptions } from \"../core\"\nimport { ArtifactCreated } from \"../packagerApi\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { ProjectInfoManager } from \"./ProjectInfoManager\"\n\ninterface TargetInfo {\n name: string\n arch: string\n unpackedDirectory: string\n outDir: string\n}\n\nexport class RemoteBuilder {\n private readonly toBuild = new Map>()\n private buildStarted = false\n\n constructor(readonly packager: PlatformPackager) {\n }\n\n scheduleBuild(target: Target, arch: Arch, unpackedDirectory: string) {\n if (!isEnvTrue(process.env._REMOTE_BUILD) && this.packager.config.remoteBuild === false) {\n throw new Error(\"Target is not supported on your OS and using of Electron Build Service is disabled (\\\"remoteBuild\\\" option)\")\n }\n\n let list = this.toBuild.get(arch)\n if (list == null) {\n list = []\n this.toBuild.set(arch, list)\n }\n\n list.push({\n name: target.name,\n arch: Arch[arch],\n unpackedDirectory,\n outDir: target.outDir,\n })\n }\n\n build(): Promise {\n if (this.buildStarted) {\n return Promise.resolve()\n }\n\n this.buildStarted = true\n\n return BluebirdPromise.mapSeries(Array.from(this.toBuild.keys()), (arch: Arch) => {\n return this._build(this.toBuild.get(arch)!!, this.packager)\n })\n }\n\n // noinspection JSMethodCanBeStatic\n private async _build(targets: Array, packager: PlatformPackager): Promise {\n if (log.isDebugEnabled) {\n log.debug({remoteTargets: JSON.stringify(targets, null, 2)}, \"remote building\")\n }\n\n const projectInfoManager = new ProjectInfoManager(packager.info)\n\n // let result: RemoteBuilderResponse | null = null\n const req = Buffer.from(JSON.stringify({\n targets: targets.map(it => {\n return {\n name: it.name,\n arch: it.arch,\n unpackedDirName: path.basename(it.unpackedDirectory),\n }\n }),\n platform: packager.platform.buildConfigurationKey,\n })).toString(\"base64\")\n const outDir = targets[0].outDir\n const args = [\"remote-build\", \"--request\", req, \"--output\", outDir]\n\n args.push(\"--file\", targets[0].unpackedDirectory)\n args.push(\"--file\", await projectInfoManager.infoFile.value)\n\n const buildResourcesDir = packager.buildResourcesDir\n if (buildResourcesDir === packager.projectDir) {\n throw new InvalidConfigurationError(`Build resources dir equals to project dir and so, not sent to remote build agent. It will lead to incorrect results.\\nPlease set \"directories.buildResources\" to separate dir or leave default (\"build\" directory in the project root)`)\n }\n\n args.push(\"--build-resource-dir\", buildResourcesDir)\n\n const result: any = await executeAppBuilderAsJson(args)\n if (result.error != null) {\n throw new InvalidConfigurationError(`Remote builder error (if you think that it is not your application misconfiguration issue, please file issue to https://github.com/electron-userland/electron-builder/issues):\\n\\n${result.error}`, \"REMOTE_BUILDER_ERROR\")\n }\n else if (result.files != null) {\n for (const artifact of result.files) {\n const localFile = path.join(outDir, artifact.file)\n const artifactCreatedEvent = this.artifactInfoToArtifactCreatedEvent(artifact, localFile, outDir)\n // PublishManager uses outDir and options, real (the same as for local build) values must be used\n await this.packager.info.callArtifactBuildCompleted(artifactCreatedEvent)\n }\n }\n }\n\n private artifactInfoToArtifactCreatedEvent(artifact: ArtifactInfo, localFile: string, outDir: string): ArtifactCreated {\n const target = artifact.target\n // noinspection SpellCheckingInspection\n return {\n ...artifact,\n file: localFile,\n target: target == null ? null : new FakeTarget(target, outDir, (this.packager.config as any)[target]),\n packager: this.packager,\n }\n }\n}\n\nclass FakeTarget extends Target {\n constructor(name: string, readonly outDir: string, readonly options: TargetSpecificOptions | null | undefined) {\n super(name)\n }\n\n async build(appOutDir: string, arch: Arch) {\n // no build\n }\n}\n\ninterface ArtifactInfo extends UploadTask {\n target: string | null\n\n readonly isWriteUpdateInfo?: boolean\n readonly updateInfo?: any\n}\n\nexport interface RemoteBuilderResponse {\n files: Array | null\n error: string | null\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.d.ts b/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.js b/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.js deleted file mode 100644 index 8470b72..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _() { - const data = require(".."); - - _ = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -if (process.env.BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG == null) { - process.env.BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG = "true"; -} - -function doBuild(_x) { - return _doBuild.apply(this, arguments); -} - -function _doBuild() { - _doBuild = (0, _bluebirdLst().coroutine)(function* (data) { - if (process.env.APP_BUILDER_TMP_DIR == null) { - throw new Error("Env APP_BUILDER_TMP_DIR must be set for builder process"); - } - - const projectDir = process.env.PROJECT_DIR; - - if (projectDir == null) { - throw new Error("Env PROJECT_DIR must be set for builder process"); - } - - const targets = data.targets; - - if (data.platform == null) { - throw new Error("platform not specified"); - } - - if (targets == null) { - throw new Error("targets path not specified"); - } - - if (!Array.isArray(targets)) { - throw new Error("targets must be array of target name"); - } - - const infoFile = projectDir + path.sep + "info.json"; - const info = yield (0, _fsExtraP().readJson)(infoFile); - const projectOutDir = process.env.PROJECT_OUT_DIR; - - if (projectDir == null) { - throw new Error("Env PROJECT_OUT_DIR must be set for builder process"); - } // yes, for now we expect the only target - - - const prepackaged = projectDir + path.sep + targets[0].unpackedDirName; // do not use build function because we don't need to publish artifacts - - const options = { - prepackaged, - projectDir, - [data.platform]: targets.map(it => it.name + ":" + it.arch), - publish: "never" - }; - const packager = new (_().Packager)(options); - const artifacts = []; - const relativePathOffset = projectOutDir.length + 1; - packager.artifactCreated(event => { - if (event.file == null) { - return; - } - - artifacts.push({ - file: event.file.substring(relativePathOffset), - target: event.target == null ? null : event.target.name, - arch: event.arch, - safeArtifactName: event.safeArtifactName, - isWriteUpdateInfo: event.isWriteUpdateInfo === true, - updateInfo: event.updateInfo - }); - }); - - packager.stageDirPathCustomizer = (target, packager, arch) => { - // snap creates a lot of files and so, we cannot use tmpfs to avoid out of memory error - const parentDir = target.name === "snap" && !target.isUseTemplateApp ? projectOutDir : projectDir; - return parentDir + path.sep + `__${target.name}-${_().Arch[arch]}`; - }; // _build method expects final effective configuration - packager.options.config is ignored - - - yield packager._build(Object.assign({}, info.configuration, { - publish: null, - beforeBuild: null, - afterPack: null, - afterSign: null, - afterAllArtifactBuild: null, - onNodeModuleFile: null, - directories: { - output: projectOutDir, - buildResources: projectDir + path.sep + info.buildResourceDirName - } - }), info.metadata, info.devMetadata, info.repositoryInfo); // writeJson must be not used because it adds unwanted \n as last file symbol - - yield (0, _fsExtraP().writeFile)(path.join(process.env.APP_BUILDER_TMP_DIR, "__build-result.json"), JSON.stringify(artifacts)); - }); - return _doBuild.apply(this, arguments); -} - -doBuild(JSON.parse(process.argv[2])).catch(error => { - process.exitCode = 0; - return (0, _fsExtraP().writeFile)(path.join(process.env.APP_BUILDER_TMP_DIR, "__build-result.json"), (error.stack || error).toString()); -}); -// __ts-babel@6.0.4 -//# sourceMappingURL=builder-cli.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.js.map b/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.js.map deleted file mode 100644 index 490e1c8..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/builder-cli.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/remoteBuilder/builder-cli.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGA,IAAI,OAAO,CAAC,GAAR,CAAY,kCAAZ,IAAkD,IAAtD,EAA4D;AAC1D,EAAA,OAAO,CAAC,GAAR,CAAY,kCAAZ,GAAiD,MAAjD;AACD;;SAEc,O;;;;;2CAAf,WAAuB,IAAvB,EAAsC;AACpC,QAAI,OAAO,CAAC,GAAR,CAAY,mBAAZ,IAAmC,IAAvC,EAA6C;AAC3C,YAAM,IAAI,KAAJ,CAAU,yDAAV,CAAN;AACD;;AAED,UAAM,UAAU,GAAG,OAAO,CAAC,GAAR,CAAY,WAA/B;;AACA,QAAI,UAAU,IAAI,IAAlB,EAAwB;AACtB,YAAM,IAAI,KAAJ,CAAU,iDAAV,CAAN;AACD;;AAED,UAAM,OAAO,GAAG,IAAI,CAAC,OAArB;;AACA,QAAI,IAAI,CAAC,QAAL,IAAiB,IAArB,EAA2B;AACzB,YAAM,IAAI,KAAJ,CAAU,wBAAV,CAAN;AACD;;AACD,QAAI,OAAO,IAAI,IAAf,EAAqB;AACnB,YAAM,IAAI,KAAJ,CAAU,4BAAV,CAAN;AACD;;AACD,QAAI,CAAC,KAAK,CAAC,OAAN,CAAc,OAAd,CAAL,EAA6B;AAC3B,YAAM,IAAI,KAAJ,CAAU,sCAAV,CAAN;AAC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K,IAAG;AACb,EAAA,OAAO,CAAC,QAAR,GAAmB,CAAnB;AACA,SAAO,2BAAU,IAAI,CAAC,IAAL,CAAU,OAAO,CAAC,GAAR,CAAY,mBAAtB,EAA6C,qBAA7C,CAAV,EAA+E,CAAC,KAAK,CAAC,KAAN,IAAe,KAAhB,EAAuB,QAAvB,EAA/E,CAAP;AACD,CAJH,E","sourcesContent":["import { readJson, writeFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { UploadTask, Arch, Packager, PackagerOptions, PublishOptions } from \"..\"\nimport SnapTarget from \"../targets/snap\"\n\nif (process.env.BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG == null) {\n process.env.BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG = \"true\"\n}\n\nasync function doBuild(data: BuildTask): Promise {\n if (process.env.APP_BUILDER_TMP_DIR == null) {\n throw new Error(\"Env APP_BUILDER_TMP_DIR must be set for builder process\")\n }\n\n const projectDir = process.env.PROJECT_DIR\n if (projectDir == null) {\n throw new Error(\"Env PROJECT_DIR must be set for builder process\")\n }\n\n const targets = data.targets\n if (data.platform == null) {\n throw new Error(\"platform not specified\")\n }\n if (targets == null) {\n throw new Error(\"targets path not specified\")\n }\n if (!Array.isArray(targets)) {\n throw new Error(\"targets must be array of target name\")\n }\n\n const infoFile = projectDir + path.sep + \"info.json\"\n const info = await readJson(infoFile)\n\n const projectOutDir = process.env.PROJECT_OUT_DIR\n if (projectDir == null) {\n throw new Error(\"Env PROJECT_OUT_DIR must be set for builder process\")\n }\n\n // yes, for now we expect the only target\n const prepackaged = projectDir + path.sep + targets[0].unpackedDirName\n // do not use build function because we don't need to publish artifacts\n const options: PackagerOptions & PublishOptions = {\n prepackaged,\n projectDir,\n [data.platform]: targets.map(it => it.name + \":\" + it.arch),\n publish: \"never\",\n }\n const packager = new Packager(options)\n\n const artifacts: Array = []\n const relativePathOffset = projectOutDir!!.length + 1\n packager.artifactCreated(event => {\n if (event.file == null) {\n return\n }\n\n artifacts.push({\n file: event.file.substring(relativePathOffset),\n target: event.target == null ? null : event.target.name,\n arch: event.arch,\n safeArtifactName: event.safeArtifactName,\n isWriteUpdateInfo: event.isWriteUpdateInfo === true,\n updateInfo: event.updateInfo,\n })\n })\n\n packager.stageDirPathCustomizer = (target, packager, arch) => {\n // snap creates a lot of files and so, we cannot use tmpfs to avoid out of memory error\n const parentDir = target.name === \"snap\" && !(target as SnapTarget).isUseTemplateApp ? projectOutDir : projectDir\n return parentDir + path.sep + `__${target.name}-${Arch[arch]}`\n }\n\n // _build method expects final effective configuration - packager.options.config is ignored\n await packager._build({\n ...info.configuration,\n publish: null,\n beforeBuild: null,\n afterPack: null,\n afterSign: null,\n afterAllArtifactBuild: null,\n onNodeModuleFile: null,\n directories: {\n output: projectOutDir,\n buildResources: projectDir + path.sep + info.buildResourceDirName\n },\n }, info.metadata, info.devMetadata, info.repositoryInfo)\n\n // writeJson must be not used because it adds unwanted \\n as last file symbol\n await writeFile(path.join(process.env.APP_BUILDER_TMP_DIR!!, \"__build-result.json\"), JSON.stringify(artifacts))\n}\n\ndoBuild(JSON.parse(process.argv[2]))\n .catch(error => {\n process.exitCode = 0\n return writeFile(path.join(process.env.APP_BUILDER_TMP_DIR!!, \"__build-result.json\"), (error.stack || error).toString())\n })\n\ninterface TargetInfo {\n name: string\n arch: string\n unpackedDirName: string\n}\n\ninterface ArtifactInfo extends UploadTask {\n target: string | null\n\n readonly isWriteUpdateInfo?: boolean\n readonly updateInfo?: any\n}\n\ninterface BuildTask {\n platform: string\n targets: Array\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.d.ts b/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.d.ts deleted file mode 100644 index c13b0c6..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -export declare const ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT: Buffer; -export declare const ELECTRON_BUILD_SERVICE_CA_CERT: Buffer; diff --git a/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.js b/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.js deleted file mode 100644 index 09970a4..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ELECTRON_BUILD_SERVICE_CA_CERT = exports.ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT = void 0; -// noinspection SpellCheckingInspection -const ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT = Buffer.from(`-----BEGIN CERTIFICATE----- -MIIBiDCCAS+gAwIBAgIRAPHSzTRLcN2nElhQdaRP47IwCgYIKoZIzj0EAwIwJDEi -MCAGA1UEAxMZZWxlY3Ryb24uYnVpbGQubG9jYWwgcm9vdDAeFw0xNzExMTMxNzI4 -NDFaFw0yNzExMTExNzI4NDFaMCQxIjAgBgNVBAMTGWVsZWN0cm9uLmJ1aWxkLmxv -Y2FsIHJvb3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQVyduuCT2acuk2QH06 -yal/b6O7eTTpOHk3Ucjc+ZZta2vC2+c1IKcSAwimKbTbK+nRxWWJl9ZYx9RTwbRf -QjD6o0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E -FgQUlm08vBe4CUNAOTQN5Z1RNTfJjjYwCgYIKoZIzj0EAwIDRwAwRAIgMXlT6YM8 -4pQtnhUjijVMz+NlcYafS1CEbNBMaWhP87YCIGXUmu7ON9hRLanXzBNBlrtTQG+i -l/NT6REwZA64/lNy ------END CERTIFICATE----- -`); // noinspection SpellCheckingInspection - -exports.ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT = ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT; -const ELECTRON_BUILD_SERVICE_CA_CERT = Buffer.from(`-----BEGIN CERTIFICATE----- -MIIBfTCCASOgAwIBAgIRAIdieK1+3C4abgOvQ7pVVqAwCgYIKoZIzj0EAwIwHjEc -MBoGA1UEAxMTZWxlY3Ryb24uYnVpbGQgcm9vdDAeFw0xNzExMTMxNzI4NDFaFw0x -ODExMTMxNzI4NDFaMB4xHDAaBgNVBAMTE2VsZWN0cm9uLmJ1aWxkIHJvb3QwWTAT -BgcqhkjOPQIBBggqhkjOPQMBBwNCAAR+4b6twzizN/z27yvwrCV5kinGUrfo+W7n -L/l28ErscNe1BDSyh/IYrnMWb1rDMSLGhvkgI9Cfex1whNPHR101o0IwQDAOBgNV -HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU6Dq8kK7tQlrt -zkIYrYiTZGpHEp0wCgYIKoZIzj0EAwIDSAAwRQIgKSfjAQbYlY/S1wMLUi84r8QN -hhMnUwsOmlDan0xPalICIQDLIAXAIyArVtH38a4aizvhH8YeXrxzpJh3U8RolBZF -SA== ------END CERTIFICATE----- -`); exports.ELECTRON_BUILD_SERVICE_CA_CERT = ELECTRON_BUILD_SERVICE_CA_CERT; -// __ts-babel@6.0.4 -//# sourceMappingURL=remote-builder-certs.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.js.map b/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.js.map deleted file mode 100644 index b44bfa4..0000000 --- a/node_modules/app-builder-lib/out/remoteBuilder/remote-builder-certs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/remoteBuilder/remote-builder-certs.ts"],"names":[],"mappings":";;;;;;AAAA;AACO,MAAM,oCAAoC,GAAG,MAAM,CAAC,IAAP,CAAY;;;;;;;;;;;CAAZ,CAA7C,C,CAaP;;;AACO,MAAM,8BAA8B,GAAG,MAAM,CAAC,IAAP,CAAY;;;;;;;;;;;CAAZ,CAAvC,C","sourcesContent":["// noinspection SpellCheckingInspection\nexport const ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT = Buffer.from(`-----BEGIN CERTIFICATE-----\nMIIBiDCCAS+gAwIBAgIRAPHSzTRLcN2nElhQdaRP47IwCgYIKoZIzj0EAwIwJDEi\nMCAGA1UEAxMZZWxlY3Ryb24uYnVpbGQubG9jYWwgcm9vdDAeFw0xNzExMTMxNzI4\nNDFaFw0yNzExMTExNzI4NDFaMCQxIjAgBgNVBAMTGWVsZWN0cm9uLmJ1aWxkLmxv\nY2FsIHJvb3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQVyduuCT2acuk2QH06\nyal/b6O7eTTpOHk3Ucjc+ZZta2vC2+c1IKcSAwimKbTbK+nRxWWJl9ZYx9RTwbRf\nQjD6o0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E\nFgQUlm08vBe4CUNAOTQN5Z1RNTfJjjYwCgYIKoZIzj0EAwIDRwAwRAIgMXlT6YM8\n4pQtnhUjijVMz+NlcYafS1CEbNBMaWhP87YCIGXUmu7ON9hRLanXzBNBlrtTQG+i\nl/NT6REwZA64/lNy\n-----END CERTIFICATE-----\n`)\n\n// noinspection SpellCheckingInspection\nexport const ELECTRON_BUILD_SERVICE_CA_CERT = Buffer.from(`-----BEGIN CERTIFICATE-----\nMIIBfTCCASOgAwIBAgIRAIdieK1+3C4abgOvQ7pVVqAwCgYIKoZIzj0EAwIwHjEc\nMBoGA1UEAxMTZWxlY3Ryb24uYnVpbGQgcm9vdDAeFw0xNzExMTMxNzI4NDFaFw0x\nODExMTMxNzI4NDFaMB4xHDAaBgNVBAMTE2VsZWN0cm9uLmJ1aWxkIHJvb3QwWTAT\nBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR+4b6twzizN/z27yvwrCV5kinGUrfo+W7n\nL/l28ErscNe1BDSyh/IYrnMWb1rDMSLGhvkgI9Cfex1whNPHR101o0IwQDAOBgNV\nHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU6Dq8kK7tQlrt\nzkIYrYiTZGpHEp0wCgYIKoZIzj0EAwIDSAAwRQIgKSfjAQbYlY/S1wMLUi84r8QN\nhhMnUwsOmlDan0xPalICIQDLIAXAIyArVtH38a4aizvhH8YeXrxzpJh3U8RolBZF\nSA==\n-----END CERTIFICATE-----\n`)"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/AppImageTarget.d.ts b/node_modules/app-builder-lib/out/targets/AppImageTarget.d.ts deleted file mode 100644 index 02ac5b4..0000000 --- a/node_modules/app-builder-lib/out/targets/AppImageTarget.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Arch } from "builder-util"; -import { AppImageOptions } from ".."; -import { Target } from "../core"; -import { LinuxPackager } from "../linuxPackager"; -import { LinuxTargetHelper } from "./LinuxTargetHelper"; -export default class AppImageTarget extends Target { - private readonly packager; - private readonly helper; - readonly outDir: string; - readonly options: AppImageOptions; - private readonly desktopEntry; - constructor(ignored: string, packager: LinuxPackager, helper: LinuxTargetHelper, outDir: string); - build(appOutDir: string, arch: Arch): Promise; -} diff --git a/node_modules/app-builder-lib/out/targets/AppImageTarget.js b/node_modules/app-builder-lib/out/targets/AppImageTarget.js deleted file mode 100644 index ffe73b4..0000000 --- a/node_modules/app-builder-lib/out/targets/AppImageTarget.js +++ /dev/null @@ -1,178 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _PublishManager() { - const data = require("../publish/PublishManager"); - - _PublishManager = function () { - return data; - }; - - return data; -} - -function _appBuilder() { - const data = require("../util/appBuilder"); - - _appBuilder = function () { - return data; - }; - - return data; -} - -function _license() { - const data = require("../util/license"); - - _license = function () { - return data; - }; - - return data; -} - -function _targetUtil() { - const data = require("./targetUtil"); - - _targetUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -// https://unix.stackexchange.com/questions/375191/append-to-sub-directory-inside-squashfs-file -class AppImageTarget extends _core().Target { - constructor(ignored, packager, helper, outDir) { - super("appImage"); - this.packager = packager; - this.helper = helper; - this.outDir = outDir; - this.options = Object.assign({}, this.packager.platformSpecificBuildOptions, this.packager.config[this.name]); // we add X-AppImage-BuildId to ensure that new desktop file will be installed - - this.desktopEntry = new (_lazyVal().Lazy)(() => helper.computeDesktopEntry(this.options, "AppRun", { - "X-AppImage-Version": `${packager.appInfo.buildVersion}` - })); - } - - build(appOutDir, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - const options = _this.options; // https://github.com/electron-userland/electron-builder/issues/775 - // https://github.com/electron-userland/electron-builder/issues/1726 - // tslint:disable-next-line:no-invalid-template-strings - - const artifactName = packager.expandArtifactBeautyNamePattern(options, "AppImage", arch); - const artifactPath = path.join(_this.outDir, artifactName); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: "AppImage", - file: artifactPath, - arch - }); - const c = yield Promise.all([_this.desktopEntry.value, _this.helper.icons, (0, _PublishManager().getAppUpdatePublishConfiguration)(packager, arch, false - /* in any case validation will be done on publish */ - ), (0, _license().getNotLocalizedLicenseFile)(options.license, _this.packager, ["txt", "html"]), (0, _targetUtil().createStageDir)(_this, packager, arch)]); - const license = c[3]; - const stageDir = c[4]; - const publishConfig = c[2]; - - if (publishConfig != null) { - yield (0, _fsExtraP().outputFile)(path.join(packager.getResourcesDir(stageDir.dir), "app-update.yml"), (0, _builderUtil().serializeToYaml)(publishConfig)); - } - - if (_this.packager.packagerOptions.effectiveOptionComputed != null && (yield _this.packager.packagerOptions.effectiveOptionComputed({ - desktop: yield _this.desktopEntry.value - }))) { - return; - } - - const args = ["appimage", "--stage", stageDir.dir, "--arch", _builderUtil().Arch[arch], "--output", artifactPath, "--app", appOutDir, "--configuration", JSON.stringify(Object.assign({ - productName: _this.packager.appInfo.productName, - desktopEntry: c[0], - executableName: _this.packager.executableName, - icons: c[1], - fileAssociations: _this.packager.fileAssociations - }, options))]; - (0, _appBuilder().objectToArgs)(args, { - license - }); - - if (packager.compression === "maximum") { - args.push("--compression", "xz"); - } - - yield packager.info.callArtifactBuildCompleted({ - file: artifactPath, - safeArtifactName: packager.computeSafeArtifactName(artifactName, "AppImage", arch, false), - target: _this, - arch, - packager, - isWriteUpdateInfo: true, - updateInfo: yield (0, _appBuilder().executeAppBuilderAsJson)(args) - }); - })(); - } - -} exports.default = AppImageTarget; -// __ts-babel@6.0.4 -//# sourceMappingURL=AppImageTarget.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/AppImageTarget.js.map b/node_modules/app-builder-lib/out/targets/AppImageTarget.js.map deleted file mode 100644 index 802287a..0000000 --- a/node_modules/app-builder-lib/out/targets/AppImageTarget.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/AppImageTarget.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAC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AI,CAAC,SAAL,CAAc,MAAA,CAAA,MAAA,CAAA;AAChC,QAAA,WAAW,EAAE,KAAI,CAAC,QAAL,CAAc,OAAd,CAAsB,WADH;AAEhC,QAAA,YAAY,EAAE,CAAC,CAAC,CAAD,CAFiB;AAGhC,QAAA,cAAc,EAAE,KAAI,CAAC,QAAL,CAAc,cAHE;AAIhC,QAAA,KAAK,EAAE,CAAC,CAAC,CAAD,CAJwB;AAKhC,QAAA,gBAAgB,EAAE,KAAI,CAAC,QAAL,CAAc;AALA,OAAA,EAM7B,OAN6B,CAAd,CANT,CAAb;AAeA,sCAAa,IAAb,EAAmB;AACjB,QAAA;AADiB,OAAnB;;AAGA,UAAI,QAAQ,CAAC,WAAT,KAAyB,SAA7B,EAAwC;AACtC,QAAA,IAAI,CAAC,IAAL,CAAU,eAAV,EAA2B,IAA3B;AACD;;AAED,YAAM,QAAQ,CAAC,IAAT,CAAc,0BAAd,CAAyC;AAC7C,QAAA,IAAI,EAAE,YADuC;AAE7C,QAAA,gBAAgB,EAAE,QAAQ,CAAC,uBAAT,CAAiC,YAAjC,EAA+C,UAA/C,EAA2D,IAA3D,EAAiE,KAAjE,CAF2B;AAG7C,QAAA,MAAM,EAAE,KAHqC;AAI7C,QAAA,IAJ6C;AAK7C,QAAA,QAL6C;AAM7C,QAAA,iBAAiB,EAAE,IAN0B;AAO7C,QAAA,UAAU,QAAQ,2CAAwB,IAAxB;AAP2B,OAAzC,CAAN;AAvDuC;AAgExC;;AA7E+C,C","sourcesContent":["import { Arch, serializeToYaml } from \"builder-util\"\nimport { outputFile } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppImageOptions } from \"..\"\nimport { Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { getAppUpdatePublishConfiguration } from \"../publish/PublishManager\"\nimport { executeAppBuilderAsJson, objectToArgs } from \"../util/appBuilder\"\nimport { getNotLocalizedLicenseFile } from \"../util/license\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDir } from \"./targetUtil\"\n\n// https://unix.stackexchange.com/questions/375191/append-to-sub-directory-inside-squashfs-file\nexport default class AppImageTarget extends Target {\n readonly options: AppImageOptions = {...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name]}\n private readonly desktopEntry: Lazy\n\n constructor(ignored: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(\"appImage\")\n\n // we add X-AppImage-BuildId to ensure that new desktop file will be installed\n this.desktopEntry = new Lazy(() => helper.computeDesktopEntry(this.options, \"AppRun\", {\n \"X-AppImage-Version\": `${packager.appInfo.buildVersion}`,\n }))\n }\n\n async build(appOutDir: string, arch: Arch): Promise {\n const packager = this.packager\n const options = this.options\n // https://github.com/electron-userland/electron-builder/issues/775\n // https://github.com/electron-userland/electron-builder/issues/1726\n // tslint:disable-next-line:no-invalid-template-strings\n const artifactName = packager.expandArtifactBeautyNamePattern(options, \"AppImage\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"AppImage\",\n file: artifactPath,\n arch,\n })\n\n const c = await Promise.all([\n this.desktopEntry.value,\n this.helper.icons,\n getAppUpdatePublishConfiguration(packager, arch, false /* in any case validation will be done on publish */),\n getNotLocalizedLicenseFile(options.license, this.packager, [\"txt\", \"html\"]),\n createStageDir(this, packager, arch),\n ])\n const license = c[3]\n const stageDir = c[4]\n\n const publishConfig = c[2]\n if (publishConfig != null) {\n await outputFile(path.join(packager.getResourcesDir(stageDir.dir), \"app-update.yml\"), serializeToYaml(publishConfig))\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null && await this.packager.packagerOptions.effectiveOptionComputed({desktop: await this.desktopEntry.value})) {\n return\n }\n\n const args = [\n \"appimage\",\n \"--stage\", stageDir.dir,\n \"--arch\", Arch[arch],\n \"--output\", artifactPath,\n \"--app\", appOutDir,\n \"--configuration\", (JSON.stringify({\n productName: this.packager.appInfo.productName,\n desktopEntry: c[0],\n executableName: this.packager.executableName,\n icons: c[1],\n fileAssociations: this.packager.fileAssociations,\n ...options,\n })),\n ]\n objectToArgs(args, {\n license,\n })\n if (packager.compression === \"maximum\") {\n args.push(\"--compression\", \"xz\")\n }\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"AppImage\", arch, false),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: true,\n updateInfo: await executeAppBuilderAsJson(args),\n })\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/AppxTarget.d.ts b/node_modules/app-builder-lib/out/targets/AppxTarget.d.ts deleted file mode 100644 index ad6edc3..0000000 --- a/node_modules/app-builder-lib/out/targets/AppxTarget.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Arch } from "builder-util"; -import { AppXOptions } from "../"; -import { Target } from "../core"; -import { WinPackager } from "../winPackager"; -export default class AppXTarget extends Target { - private readonly packager; - readonly outDir: string; - readonly options: AppXOptions; - constructor(packager: WinPackager, outDir: string); - build(appOutDir: string, arch: Arch): Promise; - private static computeUserAssets; - private computePublisherName; - private writeManifest; - private getExtensions; -} diff --git a/node_modules/app-builder-lib/out/targets/AppxTarget.js b/node_modules/app-builder-lib/out/targets/AppxTarget.js deleted file mode 100644 index def3d9c..0000000 --- a/node_modules/app-builder-lib/out/targets/AppxTarget.js +++ /dev/null @@ -1,436 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _windowsCodeSign() { - const data = require("../codeSign/windowsCodeSign"); - - _windowsCodeSign = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _pathManager() { - const data = require("../util/pathManager"); - - _pathManager = function () { - return data; - }; - - return data; -} - -function _targetUtil() { - const data = require("./targetUtil"); - - _targetUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const APPX_ASSETS_DIR_NAME = "appx"; -const vendorAssetsForDefaultAssets = { - "StoreLogo.png": "SampleAppx.50x50.png", - "Square150x150Logo.png": "SampleAppx.150x150.png", - "Square44x44Logo.png": "SampleAppx.44x44.png", - "Wide310x150Logo.png": "SampleAppx.310x150.png" -}; -const DEFAULT_RESOURCE_LANG = "en-US"; - -class AppXTarget extends _core().Target { - constructor(packager, outDir) { - super("appx"); - this.packager = packager; - this.outDir = outDir; - this.options = (0, _builderUtil().deepAssign)({}, this.packager.platformSpecificBuildOptions, this.packager.config.appx); - - if (process.platform !== "darwin" && (process.platform !== "win32" || (0, _windowsCodeSign().isOldWin6)())) { - throw new Error("AppX is supported only on Windows 10 or Windows Server 2012 R2 (version number 6.3+)"); - } - } // https://docs.microsoft.com/en-us/windows/uwp/packaging/create-app-package-with-makeappx-tool#mapping-files - - - build(appOutDir, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - const artifactName = packager.expandArtifactBeautyNamePattern(_this.options, "appx", arch); - const artifactPath = path.join(_this.outDir, artifactName); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: "AppX", - file: artifactPath, - arch - }); - const vendorPath = yield (0, _windowsCodeSign().getSignVendorPath)(); - const vm = yield packager.vm.value; - const stageDir = yield (0, _targetUtil().createStageDir)(_this, packager, arch); - const mappingFile = stageDir.getTempFile("mapping.txt"); - const makeAppXArgs = ["pack", "/o" - /* overwrite the output file if it exists */ - , "/f", vm.toVmFile(mappingFile), "/p", vm.toVmFile(artifactPath)]; - - if (packager.compression === "store") { - makeAppXArgs.push("/nc"); - } - - const mappingList = []; - mappingList.push((yield _bluebirdLst().default.map((0, _fs().walk)(appOutDir), file => { - let appxPath = file.substring(appOutDir.length + 1); - - if (path.sep !== "\\") { - appxPath = appxPath.replace(/\//g, "\\"); - } - - return `"${vm.toVmFile(file)}" "app\\${appxPath}"`; - }))); - const userAssetDir = yield _this.packager.getResource(undefined, APPX_ASSETS_DIR_NAME); - const assetInfo = yield AppXTarget.computeUserAssets(vm, vendorPath, userAssetDir); - const userAssets = assetInfo.userAssets; - const manifestFile = stageDir.getTempFile("AppxManifest.xml"); - yield _this.writeManifest(manifestFile, arch, (yield _this.computePublisherName()), userAssets); - mappingList.push(assetInfo.mappings); - mappingList.push([`"${vm.toVmFile(manifestFile)}" "AppxManifest.xml"`]); - - if (isScaledAssetsProvided(userAssets)) { - const outFile = vm.toVmFile(stageDir.getTempFile("resources.pri")); - const makePriPath = vm.toVmFile(path.join(vendorPath, "windows-10", _builderUtil().Arch[arch], "makepri.exe")); - const assetRoot = stageDir.getTempFile("appx/assets"); - yield (0, _fsExtraP().emptyDir)(assetRoot); - yield _bluebirdLst().default.map(assetInfo.allAssets, it => (0, _fs().copyOrLinkFile)(it, path.join(assetRoot, path.basename(it)))); - yield vm.exec(makePriPath, ["new", "/Overwrite", "/Manifest", vm.toVmFile(manifestFile), "/ProjectRoot", vm.toVmFile(path.dirname(assetRoot)), "/ConfigXml", vm.toVmFile(path.join((0, _pathManager().getTemplatePath)("appx"), "priconfig.xml")), "/OutputFile", outFile]); // in addition to resources.pri, resources.scale-140.pri and other such files will be generated - - for (const resourceFile of (yield (0, _fsExtraP().readdir)(stageDir.dir)).filter(it => it.startsWith("resources.")).sort()) { - mappingList.push([`"${vm.toVmFile(stageDir.getTempFile(resourceFile))}" "${resourceFile}"`]); - } - - makeAppXArgs.push("/l"); - } - - let mapping = "[Files]"; - - for (const list of mappingList) { - mapping += "\r\n" + list.join("\r\n"); - } - - yield (0, _fsExtraP().writeFile)(mappingFile, mapping); - packager.debugLogger.add("appx.mapping", mapping); - - if (_this.options.makeappxArgs != null) { - makeAppXArgs.push(..._this.options.makeappxArgs); - } - - yield vm.exec(vm.toVmFile(path.join(vendorPath, "windows-10", _builderUtil().Arch[arch], "makeappx.exe")), makeAppXArgs); - yield packager.sign(artifactPath); - yield stageDir.cleanup(); - yield packager.info.callArtifactBuildCompleted({ - file: artifactPath, - packager, - arch, - safeArtifactName: packager.computeSafeArtifactName(artifactName, "appx"), - target: _this, - isWriteUpdateInfo: _this.options.electronUpdaterAware - }); - })(); - } - - static computeUserAssets(vm, vendorPath, userAssetDir) { - return (0, _bluebirdLst().coroutine)(function* () { - const mappings = []; - let userAssets; - const allAssets = []; - - if (userAssetDir == null) { - userAssets = []; - } else { - userAssets = (yield (0, _fsExtraP().readdir)(userAssetDir)).filter(it => !it.startsWith(".") && !it.endsWith(".db") && it.includes(".")); - - for (const name of userAssets) { - mappings.push(`"${vm.toVmFile(userAssetDir)}${vm.pathSep}${name}" "assets\\${name}"`); - allAssets.push(path.join(userAssetDir, name)); - } - } - - for (const defaultAsset of Object.keys(vendorAssetsForDefaultAssets)) { - if (userAssets.length === 0 || !isDefaultAssetIncluded(userAssets, defaultAsset)) { - const file = path.join(vendorPath, "appxAssets", vendorAssetsForDefaultAssets[defaultAsset]); - mappings.push(`"${vm.toVmFile(file)}" "assets\\${defaultAsset}"`); - allAssets.push(file); - } - } // we do not use process.arch to build path to tools, because even if you are on x64, ia32 appx tool must be used if you build appx for ia32 - - - return { - userAssets, - mappings, - allAssets - }; - })(); - } // https://github.com/electron-userland/electron-builder/issues/2108#issuecomment-333200711 - - - computePublisherName() { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if ((yield _this2.packager.cscInfo.value) == null) { - _builderUtil().log.info({ - reason: "Windows Store only build" - }, "AppX is not signed"); - - return _this2.options.publisher || "CN=ms"; - } - - const certInfo = yield _this2.packager.lazyCertInfo.value; - const publisher = certInfo == null ? null : certInfo.bloodyMicrosoftSubjectDn; - - if (publisher == null) { - throw new Error("Internal error: cannot compute subject using certificate info"); - } - - return publisher; - })(); - } - - writeManifest(outFile, arch, publisher, userAssets) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appInfo = _this3.packager.appInfo; - const options = _this3.options; - const executable = `app\\${appInfo.productFilename}.exe`; - const displayName = options.displayName || appInfo.productName; - const manifest = (yield (0, _fsExtraP().readFile)(path.join((0, _pathManager().getTemplatePath)("appx"), "appxmanifest.xml"), "utf8")).replace(/\${([a-zA-Z0-9]+)}/g, (match, p1) => { - switch (p1) { - case "publisher": - return publisher; - - case "publisherDisplayName": - const name = options.publisherDisplayName || appInfo.companyName; - - if (name == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Please specify "author" in the application package.json — it is required because "appx.publisherDisplayName" is not set.`); - } - - return name; - - case "version": - return appInfo.getVersionInWeirdWindowsForm(false); - - case "applicationId": - const result = options.applicationId || options.identityName || appInfo.name; - - if (!isNaN(parseInt(result[0], 10))) { - let message = `AppX Application.Id can’t start with numbers: "${result}"`; - - if (options.applicationId == null) { - message += `\nPlease set appx.applicationId (or correct appx.identityName or name)`; - } - - throw new (_builderUtil().InvalidConfigurationError)(message); - } - - return result; - - case "identityName": - return options.identityName || appInfo.name; - - case "executable": - return executable; - - case "displayName": - return displayName; - - case "description": - return appInfo.description || appInfo.productName; - - case "backgroundColor": - return options.backgroundColor || "#464646"; - - case "logo": - return "assets\\StoreLogo.png"; - - case "square150x150Logo": - return "assets\\Square150x150Logo.png"; - - case "square44x44Logo": - return "assets\\Square44x44Logo.png"; - - case "lockScreen": - return lockScreenTag(userAssets); - - case "defaultTile": - return defaultTileTag(userAssets); - - case "splashScreen": - return splashScreenTag(userAssets); - - case "arch": - return arch === _builderUtil().Arch.ia32 ? "x86" : "x64"; - - case "resourceLanguages": - return resourceLanguageTag((0, _builderUtil().asArray)(options.languages)); - - case "extensions": - return _this3.getExtensions(executable, displayName); - - default: - throw new Error(`Macro ${p1} is not defined`); - } - }); - yield (0, _fsExtraP().writeFile)(outFile, manifest); - })(); - } - - getExtensions(executable, displayName) { - const uriSchemes = (0, _builderUtil().asArray)(this.packager.config.protocols).concat((0, _builderUtil().asArray)(this.packager.platformSpecificBuildOptions.protocols)); - let isAddAutoLaunchExtension = this.options.addAutoLaunchExtension; - - if (isAddAutoLaunchExtension === undefined) { - const deps = this.packager.info.metadata.dependencies; - isAddAutoLaunchExtension = deps != null && deps["electron-winstore-auto-launch"] != null; - } - - if (!isAddAutoLaunchExtension && uriSchemes.length === 0) { - return ""; - } - - let extensions = ""; - - if (isAddAutoLaunchExtension) { - extensions += ` - - - `; - } - - for (const protocol of uriSchemes) { - for (const scheme of (0, _builderUtil().asArray)(protocol.schemes)) { - extensions += ` - - - ${protocol.name} - - `; - } - } - - extensions += ""; - return extensions; - } - -} // get the resource - language tag, see https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest - - -exports.default = AppXTarget; - -function resourceLanguageTag(userLanguages) { - if (userLanguages == null || userLanguages.length === 0) { - userLanguages = [DEFAULT_RESOURCE_LANG]; - } - - return userLanguages.map(it => ``).join("\n"); -} - -function lockScreenTag(userAssets) { - if (isDefaultAssetIncluded(userAssets, "BadgeLogo.png")) { - return ''; - } else { - return ""; - } -} - -function defaultTileTag(userAssets) { - const defaultTiles = [""); - return defaultTiles.join(" "); -} - -function splashScreenTag(userAssets) { - if (isDefaultAssetIncluded(userAssets, "SplashScreen.png")) { - return ''; - } else { - return ""; - } -} - -function isDefaultAssetIncluded(userAssets, defaultAsset) { - const defaultAssetName = defaultAsset.substring(0, defaultAsset.indexOf(".")); - return userAssets.some(it => it.includes(defaultAssetName)); -} - -function isScaledAssetsProvided(userAssets) { - return userAssets.some(it => it.includes(".scale-") || it.includes(".targetsize-")); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=AppxTarget.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/AppxTarget.js.map b/node_modules/app-builder-lib/out/targets/AppxTarget.js.map deleted file mode 100644 index 2d3bbd1..0000000 --- a/node_modules/app-builder-lib/out/targets/AppxTarget.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/AppxTarget.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM,oBAAoB,GAAG,MAA7B;AAEA,MAAM,4BAA4B,GAA+B;AAC/D,mBAAiB,sBAD8C;AAE/D,2BAAyB,wBAFsC;AAG/D,yBAAuB,sBAHwC;AAI/D,yBAAuB;AAJwC,CAAjE;AAOA,MAAM,qBAAqB,GAAG,OAA9B;;AAEc,MAAO,UAAP,SAA0B,cAA1B,CAAgC;AAG5C,EAAA,WAAA,CAA6B,QAA7B,EAA6D,MAA7D,EAA2E;AACzE,UAAM,MAAN;AAD2B,SAAA,QAAA,GAAA,QAAA;AAAgC,SAAA,MAAA,GAAA,MAAA;AAFpD,SAAA,OAAA,GAAuB,+B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Y,SAAZ,KAA0B,EAAE,CAAC,QAAH,CAAY,cAAZ,CAAhD,CAAP;AACD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, deepAssign, InvalidConfigurationError, log } from \"builder-util\"\nimport { copyOrLinkFile, walk } from \"builder-util/out/fs\"\nimport { emptyDir, readdir, readFile, writeFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { AppXOptions } from \"../\"\nimport { getSignVendorPath, isOldWin6 } from \"../codeSign/windowsCodeSign\"\nimport { Target } from \"../core\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { VmManager } from \"../vm/vm\"\nimport { WinPackager } from \"../winPackager\"\nimport { createStageDir } from \"./targetUtil\"\n\nconst APPX_ASSETS_DIR_NAME = \"appx\"\n\nconst vendorAssetsForDefaultAssets: { [key: string]: string; } = {\n \"StoreLogo.png\": \"SampleAppx.50x50.png\",\n \"Square150x150Logo.png\": \"SampleAppx.150x150.png\",\n \"Square44x44Logo.png\": \"SampleAppx.44x44.png\",\n \"Wide310x150Logo.png\": \"SampleAppx.310x150.png\",\n}\n\nconst DEFAULT_RESOURCE_LANG = \"en-US\"\n\nexport default class AppXTarget extends Target {\n readonly options: AppXOptions = deepAssign({}, this.packager.platformSpecificBuildOptions, this.packager.config.appx)\n\n constructor(private readonly packager: WinPackager, readonly outDir: string) {\n super(\"appx\")\n\n if (process.platform !== \"darwin\" && (process.platform !== \"win32\" || isOldWin6())) {\n throw new Error(\"AppX is supported only on Windows 10 or Windows Server 2012 R2 (version number 6.3+)\")\n }\n }\n\n // https://docs.microsoft.com/en-us/windows/uwp/packaging/create-app-package-with-makeappx-tool#mapping-files\n async build(appOutDir: string, arch: Arch): Promise {\n const packager = this.packager\n const artifactName = packager.expandArtifactBeautyNamePattern(this.options, \"appx\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"AppX\",\n file: artifactPath,\n arch,\n })\n\n const vendorPath = await getSignVendorPath()\n const vm = await packager.vm.value\n\n const stageDir = await createStageDir(this, packager, arch)\n\n const mappingFile = stageDir.getTempFile(\"mapping.txt\")\n const makeAppXArgs = [\"pack\", \"/o\" /* overwrite the output file if it exists */,\n \"/f\", vm.toVmFile(mappingFile),\n \"/p\", vm.toVmFile(artifactPath),\n ]\n if (packager.compression === \"store\") {\n makeAppXArgs.push(\"/nc\")\n }\n\n const mappingList: Array> = []\n mappingList.push(await BluebirdPromise.map(walk(appOutDir), file => {\n let appxPath = file.substring(appOutDir.length + 1)\n if (path.sep !== \"\\\\\") {\n appxPath = appxPath.replace(/\\//g, \"\\\\\")\n }\n return `\"${vm.toVmFile(file)}\" \"app\\\\${appxPath}\"`\n }))\n\n const userAssetDir = await this.packager.getResource(undefined, APPX_ASSETS_DIR_NAME)\n const assetInfo = await AppXTarget.computeUserAssets(vm, vendorPath, userAssetDir)\n const userAssets = assetInfo.userAssets\n\n const manifestFile = stageDir.getTempFile(\"AppxManifest.xml\")\n await this.writeManifest(manifestFile, arch, await this.computePublisherName(), userAssets)\n mappingList.push(assetInfo.mappings)\n mappingList.push([`\"${vm.toVmFile(manifestFile)}\" \"AppxManifest.xml\"`])\n\n if (isScaledAssetsProvided(userAssets)) {\n const outFile = vm.toVmFile(stageDir.getTempFile(\"resources.pri\"))\n const makePriPath = vm.toVmFile(path.join(vendorPath, \"windows-10\", Arch[arch], \"makepri.exe\"))\n\n const assetRoot = stageDir.getTempFile(\"appx/assets\")\n await emptyDir(assetRoot)\n await BluebirdPromise.map(assetInfo.allAssets, it => copyOrLinkFile(it, path.join(assetRoot, path.basename(it))))\n\n await vm.exec(makePriPath, [\"new\",\n \"/Overwrite\",\n \"/Manifest\", vm.toVmFile(manifestFile),\n \"/ProjectRoot\", vm.toVmFile(path.dirname(assetRoot)),\n \"/ConfigXml\", vm.toVmFile(path.join(getTemplatePath(\"appx\"), \"priconfig.xml\")),\n \"/OutputFile\", outFile,\n ])\n\n // in addition to resources.pri, resources.scale-140.pri and other such files will be generated\n for (const resourceFile of (await readdir(stageDir.dir)).filter(it => it.startsWith(\"resources.\")).sort()) {\n mappingList.push([`\"${vm.toVmFile(stageDir.getTempFile(resourceFile))}\" \"${resourceFile}\"`])\n }\n makeAppXArgs.push(\"/l\")\n }\n\n let mapping = \"[Files]\"\n for (const list of mappingList) {\n mapping += \"\\r\\n\" + list.join(\"\\r\\n\")\n }\n await writeFile(mappingFile, mapping)\n packager.debugLogger.add(\"appx.mapping\", mapping)\n\n if (this.options.makeappxArgs != null) {\n makeAppXArgs.push(...this.options.makeappxArgs)\n }\n await vm.exec(vm.toVmFile(path.join(vendorPath, \"windows-10\", Arch[arch], \"makeappx.exe\")), makeAppXArgs)\n await packager.sign(artifactPath)\n\n await stageDir.cleanup()\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n packager,\n arch,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"appx\"),\n target: this,\n isWriteUpdateInfo: this.options.electronUpdaterAware,\n })\n }\n\n private static async computeUserAssets(vm: VmManager, vendorPath: string, userAssetDir: string | null) {\n const mappings: Array = []\n let userAssets: Array\n const allAssets: Array = []\n if (userAssetDir == null) {\n userAssets = []\n }\n else {\n userAssets = (await readdir(userAssetDir)).filter(it => !it.startsWith(\".\") && !it.endsWith(\".db\") && it.includes(\".\"))\n for (const name of userAssets) {\n mappings.push(`\"${vm.toVmFile(userAssetDir)}${vm.pathSep}${name}\" \"assets\\\\${name}\"`)\n allAssets.push(path.join(userAssetDir, name))\n }\n }\n\n for (const defaultAsset of Object.keys(vendorAssetsForDefaultAssets)) {\n if (userAssets.length === 0 || !isDefaultAssetIncluded(userAssets, defaultAsset)) {\n const file = path.join(vendorPath, \"appxAssets\", vendorAssetsForDefaultAssets[defaultAsset])\n mappings.push(`\"${vm.toVmFile(file)}\" \"assets\\\\${defaultAsset}\"`)\n allAssets.push(file)\n }\n }\n\n // we do not use process.arch to build path to tools, because even if you are on x64, ia32 appx tool must be used if you build appx for ia32\n return {userAssets, mappings, allAssets}\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2108#issuecomment-333200711\n private async computePublisherName() {\n if (await this.packager.cscInfo.value == null) {\n log.info({reason: \"Windows Store only build\"}, \"AppX is not signed\")\n return this.options.publisher || \"CN=ms\"\n }\n\n const certInfo = await this.packager.lazyCertInfo.value\n const publisher = certInfo == null ? null : certInfo.bloodyMicrosoftSubjectDn\n if (publisher == null) {\n throw new Error(\"Internal error: cannot compute subject using certificate info\")\n }\n return publisher\n }\n\n private async writeManifest(outFile: string, arch: Arch, publisher: string, userAssets: Array) {\n const appInfo = this.packager.appInfo\n const options = this.options\n const executable = `app\\\\${appInfo.productFilename}.exe`\n const displayName = options.displayName || appInfo.productName\n const manifest = (await readFile(path.join(getTemplatePath(\"appx\"), \"appxmanifest.xml\"), \"utf8\"))\n .replace(/\\${([a-zA-Z0-9]+)}/g, (match, p1): string => {\n switch (p1) {\n case \"publisher\":\n return publisher\n\n case \"publisherDisplayName\":\n const name = options.publisherDisplayName || appInfo.companyName\n if (name == null) {\n throw new InvalidConfigurationError(`Please specify \"author\" in the application package.json — it is required because \"appx.publisherDisplayName\" is not set.`)\n }\n return name\n\n case \"version\":\n return appInfo.getVersionInWeirdWindowsForm(false)\n\n case \"applicationId\":\n const result = options.applicationId || options.identityName || appInfo.name\n if (!isNaN(parseInt(result[0], 10))) {\n let message = `AppX Application.Id can’t start with numbers: \"${result}\"`\n if (options.applicationId == null) {\n message += `\\nPlease set appx.applicationId (or correct appx.identityName or name)`\n }\n throw new InvalidConfigurationError(message)\n }\n return result\n\n case \"identityName\":\n return options.identityName || appInfo.name\n\n case \"executable\":\n return executable\n\n case \"displayName\":\n return displayName\n\n case \"description\":\n return appInfo.description || appInfo.productName\n\n case \"backgroundColor\":\n return options.backgroundColor || \"#464646\"\n\n case \"logo\":\n return \"assets\\\\StoreLogo.png\"\n\n case \"square150x150Logo\":\n return \"assets\\\\Square150x150Logo.png\"\n\n case \"square44x44Logo\":\n return \"assets\\\\Square44x44Logo.png\"\n\n case \"lockScreen\":\n return lockScreenTag(userAssets)\n\n case \"defaultTile\":\n return defaultTileTag(userAssets)\n\n case \"splashScreen\":\n return splashScreenTag(userAssets)\n\n case \"arch\":\n return arch === Arch.ia32 ? \"x86\" : \"x64\"\n\n case \"resourceLanguages\":\n return resourceLanguageTag(asArray(options.languages))\n\n case \"extensions\":\n return this.getExtensions(executable, displayName)\n\n default:\n throw new Error(`Macro ${p1} is not defined`)\n }\n })\n await writeFile(outFile, manifest)\n }\n\n private getExtensions(executable: string, displayName: string): string {\n const uriSchemes = asArray(this.packager.config.protocols)\n .concat(asArray(this.packager.platformSpecificBuildOptions.protocols))\n\n let isAddAutoLaunchExtension = this.options.addAutoLaunchExtension\n if (isAddAutoLaunchExtension === undefined) {\n const deps = this.packager.info.metadata.dependencies\n isAddAutoLaunchExtension = deps != null && deps[\"electron-winstore-auto-launch\"] != null\n }\n\n if (!isAddAutoLaunchExtension && uriSchemes.length === 0) {\n return \"\"\n }\n\n let extensions = \"\"\n\n if (isAddAutoLaunchExtension) {\n extensions += `\n \n \n `\n }\n\n for (const protocol of uriSchemes) {\n for (const scheme of asArray(protocol.schemes)) {\n extensions += `\n \n \n ${protocol.name}\n \n `\n }\n }\n\n extensions += \"\"\n return extensions\n }\n}\n\n// get the resource - language tag, see https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest\nfunction resourceLanguageTag(userLanguages: Array | null | undefined): string {\n if (userLanguages == null || userLanguages.length === 0) {\n userLanguages = [DEFAULT_RESOURCE_LANG]\n }\n return userLanguages.map(it => ``).join(\"\\n\")\n}\n\nfunction lockScreenTag(userAssets: Array): string {\n if (isDefaultAssetIncluded(userAssets, \"BadgeLogo.png\")) {\n return ''\n }\n else {\n return \"\"\n }\n}\n\nfunction defaultTileTag(userAssets: Array): string {\n const defaultTiles: Array = [\"\")\n return defaultTiles.join(\" \")\n}\n\nfunction splashScreenTag(userAssets: Array): string {\n if (isDefaultAssetIncluded(userAssets, \"SplashScreen.png\")) {\n return ''\n }\n else {\n return \"\"\n }\n}\n\nfunction isDefaultAssetIncluded(userAssets: Array, defaultAsset: string) {\n const defaultAssetName = defaultAsset.substring(0, defaultAsset.indexOf(\".\"))\n return userAssets.some(it => it.includes(defaultAssetName))\n}\n\nfunction isScaledAssetsProvided(userAssets: Array) {\n return userAssets.some(it => it.includes(\".scale-\") || it.includes(\".targetsize-\"))\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/ArchiveTarget.d.ts b/node_modules/app-builder-lib/out/targets/ArchiveTarget.d.ts deleted file mode 100644 index c871894..0000000 --- a/node_modules/app-builder-lib/out/targets/ArchiveTarget.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Arch } from "builder-util"; -import { Target, TargetSpecificOptions } from "../core"; -import { PlatformPackager } from "../platformPackager"; -export declare class ArchiveTarget extends Target { - readonly outDir: string; - private readonly packager; - private readonly isWriteUpdateInfo; - readonly options: TargetSpecificOptions; - constructor(name: string, outDir: string, packager: PlatformPackager, isWriteUpdateInfo?: boolean); - build(appOutDir: string, arch: Arch): Promise; -} diff --git a/node_modules/app-builder-lib/out/targets/ArchiveTarget.js b/node_modules/app-builder-lib/out/targets/ArchiveTarget.js deleted file mode 100644 index 248901f..0000000 --- a/node_modules/app-builder-lib/out/targets/ArchiveTarget.js +++ /dev/null @@ -1,153 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ArchiveTarget = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _fileMatcher() { - const data = require("../fileMatcher"); - - _fileMatcher = function () { - return data; - }; - - return data; -} - -function _archive() { - const data = require("./archive"); - - _archive = function () { - return data; - }; - - return data; -} - -function _differentialUpdateInfoBuilder() { - const data = require("./differentialUpdateInfoBuilder"); - - _differentialUpdateInfoBuilder = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class ArchiveTarget extends _core().Target { - constructor(name, outDir, packager, isWriteUpdateInfo = false) { - super(name); - this.outDir = outDir; - this.packager = packager; - this.isWriteUpdateInfo = isWriteUpdateInfo; - this.options = this.packager.config[this.name]; - } - - build(appOutDir, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - - const isMac = packager.platform === _core().Platform.MAC; - - const format = _this.name; - let defaultPattern; - - if (packager.platform === _core().Platform.LINUX) { - // tslint:disable-next-line:no-invalid-template-strings - defaultPattern = "${name}-${version}" + (arch === _builderUtil().Arch.x64 ? "" : "-${arch}") + ".${ext}"; - } else { - // tslint:disable-next-line:no-invalid-template-strings - defaultPattern = "${productName}-${version}" + (arch === _builderUtil().Arch.x64 ? "" : "-${arch}") + "-${os}.${ext}"; - } - - const artifactName = packager.expandArtifactNamePattern(_this.options, format, arch, defaultPattern, false); - const artifactPath = path.join(_this.outDir, artifactName); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: `${isMac ? "macOS " : ""}${format}`, - file: artifactPath, - arch - }); - let updateInfo = null; - - if (format.startsWith("tar.")) { - yield (0, _archive().tar)(packager.compression, format, artifactPath, appOutDir, isMac, packager.info.tempDirManager); - } else { - let withoutDir = !isMac; - let dirToArchive = appOutDir; - - if (isMac) { - dirToArchive = path.dirname(appOutDir); - const fileMatchers = (0, _fileMatcher().getFileMatchers)(packager.config, "extraDistFiles", dirToArchive, packager.createGetFileMatchersOptions(_this.outDir, arch, packager.platformSpecificBuildOptions)); - - if (fileMatchers == null) { - dirToArchive = appOutDir; - } else { - yield (0, _fileMatcher().copyFiles)(fileMatchers, null, true); - withoutDir = true; - } - } - - const archiveOptions = { - compression: packager.compression, - withoutDir - }; - yield (0, _archive().archive)(format, artifactPath, dirToArchive, archiveOptions); - - if (_this.isWriteUpdateInfo && format === "zip") { - updateInfo = yield (0, _differentialUpdateInfoBuilder().appendBlockmap)(artifactPath); - } - } - - yield packager.info.callArtifactBuildCompleted({ - updateInfo, - file: artifactPath, - // tslint:disable-next-line:no-invalid-template-strings - safeArtifactName: packager.computeSafeArtifactName(artifactName, format, arch, false, defaultPattern.replace("${productName}", "${name}")), - target: _this, - arch, - packager, - isWriteUpdateInfo: _this.isWriteUpdateInfo - }); - })(); - } - -} exports.ArchiveTarget = ArchiveTarget; -// __ts-babel@6.0.4 -//# sourceMappingURL=ArchiveTarget.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/ArchiveTarget.js.map b/node_modules/app-builder-lib/out/targets/ArchiveTarget.js.map deleted file mode 100644 index 4e41a13..0000000 --- a/node_modules/app-builder-lib/out/targets/ArchiveTarget.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/ArchiveTarget.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,MAAO,aAAP,SAA6B,cAA7B,CAAmC;AAGvC,EAAA,WAAA,CAAY,IAAZ,EAAmC,MAAnC,EAAoE,QAApE,EAAsH,iBAAA,GAAoB,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AAf,CAAuB,gBAAvB,EAAyC,SAAzC,CAApE,CAJ2B;AAK7C,QAAA,MAAM,EAAE,KALqC;AAM7C,QAAA,IAN6C;AAO7C,QAAA,QAP6C;AAQ7C,QAAA,iBAAiB,EAAE,KAAI,CAAC;AARqB,OAAzC,CAAN;AArDuC;AA+DxC;;AAtEsC,C","sourcesContent":["import { Arch } from \"builder-util\"\nimport * as path from \"path\"\nimport { Platform, Target, TargetSpecificOptions } from \"../core\"\nimport { copyFiles, getFileMatchers } from \"../fileMatcher\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { archive, tar } from \"./archive\"\nimport { appendBlockmap } from \"./differentialUpdateInfoBuilder\"\n\nexport class ArchiveTarget extends Target {\n readonly options: TargetSpecificOptions = (this.packager.config as any)[this.name]\n\n constructor(name: string, readonly outDir: string, private readonly packager: PlatformPackager, private readonly isWriteUpdateInfo = false) {\n super(name)\n }\n\n async build(appOutDir: string, arch: Arch): Promise {\n const packager = this.packager\n const isMac = packager.platform === Platform.MAC\n const format = this.name\n\n let defaultPattern: string\n if (packager.platform === Platform.LINUX) {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${name}-${version}\" + (arch === Arch.x64 ? \"\" : \"-${arch}\") + \".${ext}\"\n }\n else {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${productName}-${version}\" + (arch === Arch.x64 ? \"\" : \"-${arch}\") + \"-${os}.${ext}\"\n }\n\n const artifactName = packager.expandArtifactNamePattern(this.options, format, arch, defaultPattern, false)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: `${isMac ? \"macOS \" : \"\"}${format}`,\n file: artifactPath,\n arch,\n })\n let updateInfo: any = null\n if (format.startsWith(\"tar.\")) {\n await tar(packager.compression, format, artifactPath, appOutDir, isMac, packager.info.tempDirManager)\n }\n else {\n let withoutDir = !isMac\n let dirToArchive = appOutDir\n if (isMac) {\n dirToArchive = path.dirname(appOutDir)\n const fileMatchers = getFileMatchers(packager.config, \"extraDistFiles\", dirToArchive, packager.createGetFileMatchersOptions(this.outDir, arch, packager.platformSpecificBuildOptions))\n if (fileMatchers == null) {\n dirToArchive = appOutDir\n }\n else {\n await copyFiles(fileMatchers, null, true)\n withoutDir = true\n }\n }\n\n const archiveOptions = {\n compression: packager.compression,\n withoutDir,\n }\n await archive(format, artifactPath, dirToArchive, archiveOptions)\n\n if (this.isWriteUpdateInfo && format === \"zip\") {\n updateInfo = await appendBlockmap(artifactPath)\n }\n }\n\n await packager.info.callArtifactBuildCompleted({\n updateInfo,\n file: artifactPath,\n // tslint:disable-next-line:no-invalid-template-strings\n safeArtifactName: packager.computeSafeArtifactName(artifactName, format, arch, false, defaultPattern.replace(\"${productName}\", \"${name}\")),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: this.isWriteUpdateInfo,\n })\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.d.ts b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.d.ts deleted file mode 100644 index 66ac144..0000000 --- a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LinuxTargetSpecificOptions } from ".."; -import { LinuxPackager } from "../linuxPackager"; -import { IconInfo } from "../platformPackager"; -export declare const installPrefix = "/opt"; -export declare class LinuxTargetHelper { - private packager; - private readonly iconPromise; - maxIconPath: string | null; - constructor(packager: LinuxPackager); - readonly icons: Promise>; - private computeDesktopIcons; - getDescription(options: LinuxTargetSpecificOptions): string; - writeDesktopEntry(targetSpecificOptions: LinuxTargetSpecificOptions, exec?: string, destination?: string | null, extra?: { - [key: string]: string; - }): Promise; - computeDesktopEntry(targetSpecificOptions: LinuxTargetSpecificOptions, exec?: string, extra?: { - [key: string]: string; - }): Promise; -} diff --git a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js deleted file mode 100644 index a26a9b8..0000000 --- a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js +++ /dev/null @@ -1,199 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.LinuxTargetHelper = exports.installPrefix = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -const installPrefix = "/opt"; -exports.installPrefix = installPrefix; - -class LinuxTargetHelper { - constructor(packager) { - this.packager = packager; - this.iconPromise = new (_lazyVal().Lazy)(() => this.computeDesktopIcons()); - this.maxIconPath = null; - } - - get icons() { - return this.iconPromise.value; - } // must be name without spaces and other special characters, but not product name used - - - computeDesktopIcons() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - const iconDir = packager.platformSpecificBuildOptions.icon; - const sources = iconDir == null ? [] : [iconDir]; - const commonConfiguration = packager.config; - const icnsPath = (commonConfiguration.mac || {}).icon || commonConfiguration.icon; - - if (icnsPath != null) { - sources.push(icnsPath); - } // need to put here and not as default because need to resolve image size - - - const result = yield packager.resolveIcon(sources, (0, _builderUtil().asArray)(packager.getDefaultFrameworkIcon()), "set"); - _this.maxIconPath = result[result.length - 1].file; - return result; - })(); - } - - getDescription(options) { - return options.description || this.packager.appInfo.description; - } - - writeDesktopEntry(targetSpecificOptions, exec, destination, extra) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const data = yield _this2.computeDesktopEntry(targetSpecificOptions, exec, extra); - const file = destination || (yield _this2.packager.getTempFile(`${_this2.packager.appInfo.productFilename}.desktop`)); - yield (0, _fsExtraP().outputFile)(file, data); - return file; - })(); - } - - computeDesktopEntry(targetSpecificOptions, exec, extra) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (exec != null && exec.length === 0) { - throw new Error("Specified exec is empty"); - } // https://github.com/electron-userland/electron-builder/issues/3418 - - - if (targetSpecificOptions.desktop != null && targetSpecificOptions.desktop.Exec != null) { - throw new Error("Please specify executable name as linux.executableName instead of linux.desktop.Exec"); - } - - const packager = _this3.packager; - const appInfo = packager.appInfo; - const productFilename = appInfo.productFilename; - const desktopMeta = Object.assign({ - Name: appInfo.productName, - Comment: _this3.getDescription(targetSpecificOptions), - Exec: exec == null ? `"${installPrefix}/${productFilename}/${packager.executableName}" %U` : exec, - Terminal: "false", - Type: "Application", - Icon: packager.executableName, - // https://askubuntu.com/questions/367396/what-represent-the-startupwmclass-field-of-a-desktop-file - // must be set to package.json name (because it is Electron set WM_CLASS) - // to get WM_CLASS of running window: xprop WM_CLASS - // StartupWMClass doesn't work for unicode - // https://github.com/electron/electron/blob/2-0-x/atom/browser/native_window_views.cc#L226 - StartupWMClass: appInfo.productName - }, extra, targetSpecificOptions.desktop); - const mimeTypes = (0, _builderUtil().asArray)(targetSpecificOptions.mimeTypes); - - for (const fileAssociation of packager.fileAssociations) { - if (fileAssociation.mimeType != null) { - mimeTypes.push(fileAssociation.mimeType); - } - } - - for (const protocol of (0, _builderUtil().asArray)(packager.config.protocols).concat((0, _builderUtil().asArray)(packager.platformSpecificBuildOptions.protocols))) { - for (const scheme of (0, _builderUtil().asArray)(protocol.schemes)) { - mimeTypes.push(`x-scheme-handler/${scheme}`); - } - } - - if (mimeTypes.length !== 0) { - desktopMeta.MimeType = mimeTypes.join(";") + ";"; - } - - let category = targetSpecificOptions.category; - - if ((0, _builderUtil().isEmptyOrSpaces)(category)) { - const macCategory = (packager.config.mac || {}).category; - - if (macCategory != null) { - category = macToLinuxCategory[macCategory]; - } - - if (category == null) { - // https://github.com/develar/onshape-desktop-shell/issues/48 - if (macCategory != null) { - _builderUtil().log.warn({ - macCategory - }, "cannot map macOS category to Linux. If possible mapping is known for you, please file issue to add it."); - } - - _builderUtil().log.warn({ - reason: "linux.category is not set and cannot map from macOS", - docs: "https://electron.build/configuration/configuration#LinuxBuildOptions-category" - }, "application Linux category is set to default \"Utility\""); - - category = "Utility"; - } - } - - desktopMeta.Categories = `${category}${category.endsWith(";") ? "" : ";"}`; - let data = `[Desktop Entry]`; - - for (const name of Object.keys(desktopMeta)) { - data += `\n${name}=${desktopMeta[name]}`; - } - - data += "\n"; - return data; - })(); - } - -} - -exports.LinuxTargetHelper = LinuxTargetHelper; -const macToLinuxCategory = { - "public.app-category.graphics-design": "Graphics", - "public.app-category.developer-tools": "Development", - "public.app-category.education": "Education", - "public.app-category.games": "Game", - "public.app-category.video": "Video;AudioVideo", - "public.app-category.utilities": "Utility", - "public.app-category.social-networking": "Network;Chat", - "public.app-category.finance": "Office;Finance" -}; -// __ts-babel@6.0.4 -//# sourceMappingURL=LinuxTargetHelper.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js.map b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js.map deleted file mode 100644 index cb39498..0000000 --- a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/LinuxTargetHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAKO,MAAM,aAAa,GAAG,MAAtB;;;AAED,MAAO,iBAAP,CAAwB;AAK5B,EAAA,WAAA,CAAoB,QAApB,EAA2C;AAAvB,SAAA,QAAA,GAAA,QAAA;AAJH,SAAA,WAAA,GAAc,KAAI,eAAJ,EAAS,MAAM,KAAK,mBAAL,EAAf,CAAd;AAEjB,SAAA,WAAA,GAA6B,IAA7B;AAGC;;AAED,MAAI,KAAJ,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B,GAAlB,IAAyB,EAAzB,GAA8B,GAAG,EAAxE;AAEA,UAAI,IAAI,GAAG,iBAAX;;AACA,WAAK,MAAM,IAAX,IAAmB,MAAM,CAAC,IAAP,CAAY,WAAZ,CAAnB,EAA6C;AAC3C,QAAA,IAAI,IAAI,KAAK,IAAI,IAAI,WAAW,CAAC,IAAD,CAAM,EAAtC;AACD;;AACD,MAAA,IAAI,IAAI,IAAR;AACA,aAAO,IAAP;AA1E4H;AA2E7H;;AApH2B;;;AAuH9B,MAAM,kBAAkB,GAAQ;AAC9B,yCAAuC,UADT;AAE9B,yCAAuC,aAFT;AAG9B,mCAAiC,WAHH;AAI9B,+BAA6B,MAJC;AAK9B,+BAA6B,kBALC;AAM9B,mCAAiC,SANH;AAO9B,2CAAyC,cAPX;AAQ9B,iCAA+B;AARD,CAAhC,C","sourcesContent":["import { asArray, isEmptyOrSpaces, log } from \"builder-util\"\nimport { outputFile } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport { LinuxTargetSpecificOptions } from \"..\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { IconInfo } from \"../platformPackager\"\n\nexport const installPrefix = \"/opt\"\n\nexport class LinuxTargetHelper {\n private readonly iconPromise = new Lazy(() => this.computeDesktopIcons())\n\n maxIconPath: string | null = null\n\n constructor(private packager: LinuxPackager) {\n }\n\n get icons(): Promise> {\n return this.iconPromise.value\n }\n\n // must be name without spaces and other special characters, but not product name used\n private async computeDesktopIcons(): Promise> {\n const packager = this.packager\n const iconDir = packager.platformSpecificBuildOptions.icon\n const sources = iconDir == null ? [] : [iconDir]\n\n const commonConfiguration = packager.config\n const icnsPath = (commonConfiguration.mac || {}).icon || commonConfiguration.icon\n if (icnsPath != null) {\n sources.push(icnsPath)\n }\n\n // need to put here and not as default because need to resolve image size\n const result = await packager.resolveIcon(sources, asArray(packager.getDefaultFrameworkIcon()), \"set\")\n this.maxIconPath = result[result.length - 1].file\n return result\n }\n\n getDescription(options: LinuxTargetSpecificOptions) {\n return options.description || this.packager.appInfo.description\n }\n\n async writeDesktopEntry(targetSpecificOptions: LinuxTargetSpecificOptions, exec?: string, destination?: string | null, extra?: { [key: string]: string; }): Promise {\n const data = await this.computeDesktopEntry(targetSpecificOptions, exec, extra)\n const file = destination || await this.packager.getTempFile(`${this.packager.appInfo.productFilename}.desktop`)\n await outputFile(file, data)\n return file\n }\n\n async computeDesktopEntry(targetSpecificOptions: LinuxTargetSpecificOptions, exec?: string, extra?: { [key: string]: string; }): Promise {\n if (exec != null && exec.length === 0) {\n throw new Error(\"Specified exec is empty\")\n }\n // https://github.com/electron-userland/electron-builder/issues/3418\n if (targetSpecificOptions.desktop != null && targetSpecificOptions.desktop.Exec != null) {\n throw new Error(\"Please specify executable name as linux.executableName instead of linux.desktop.Exec\")\n }\n\n const packager = this.packager\n const appInfo = packager.appInfo\n\n const productFilename = appInfo.productFilename\n\n const desktopMeta: any = {\n Name: appInfo.productName,\n Comment: this.getDescription(targetSpecificOptions),\n Exec: exec == null ? `\"${installPrefix}/${productFilename}/${packager.executableName}\" %U` : exec,\n Terminal: \"false\",\n Type: \"Application\",\n Icon: packager.executableName,\n // https://askubuntu.com/questions/367396/what-represent-the-startupwmclass-field-of-a-desktop-file\n // must be set to package.json name (because it is Electron set WM_CLASS)\n // to get WM_CLASS of running window: xprop WM_CLASS\n // StartupWMClass doesn't work for unicode\n // https://github.com/electron/electron/blob/2-0-x/atom/browser/native_window_views.cc#L226\n StartupWMClass: appInfo.productName,\n ...extra,\n ...targetSpecificOptions.desktop,\n }\n\n const mimeTypes: Array = asArray(targetSpecificOptions.mimeTypes)\n for (const fileAssociation of packager.fileAssociations) {\n if (fileAssociation.mimeType != null) {\n mimeTypes.push(fileAssociation.mimeType)\n }\n }\n\n for (const protocol of asArray(packager.config.protocols).concat(asArray(packager.platformSpecificBuildOptions.protocols))) {\n for (const scheme of asArray(protocol.schemes)) {\n mimeTypes.push(`x-scheme-handler/${scheme}`)\n }\n }\n\n if (mimeTypes.length !== 0) {\n desktopMeta.MimeType = mimeTypes.join(\";\") + \";\"\n }\n\n let category = targetSpecificOptions.category\n if (isEmptyOrSpaces(category)) {\n const macCategory = (packager.config.mac || {}).category\n if (macCategory != null) {\n category = macToLinuxCategory[macCategory]\n }\n\n if (category == null) {\n // https://github.com/develar/onshape-desktop-shell/issues/48\n if (macCategory != null) {\n log.warn({macCategory}, \"cannot map macOS category to Linux. If possible mapping is known for you, please file issue to add it.\")\n }\n log.warn({\n reason: \"linux.category is not set and cannot map from macOS\",\n docs: \"https://electron.build/configuration/configuration#LinuxBuildOptions-category\",\n }, \"application Linux category is set to default \\\"Utility\\\"\")\n category = \"Utility\"\n }\n }\n desktopMeta.Categories = `${category}${category.endsWith(\";\") ? \"\" : \";\"}`\n\n let data = `[Desktop Entry]`\n for (const name of Object.keys(desktopMeta)) {\n data += `\\n${name}=${desktopMeta[name]}`\n }\n data += \"\\n\"\n return data\n }\n}\n\nconst macToLinuxCategory: any = {\n \"public.app-category.graphics-design\": \"Graphics\",\n \"public.app-category.developer-tools\": \"Development\",\n \"public.app-category.education\": \"Education\",\n \"public.app-category.games\": \"Game\",\n \"public.app-category.video\": \"Video;AudioVideo\",\n \"public.app-category.utilities\": \"Utility\",\n \"public.app-category.social-networking\": \"Network;Chat\",\n \"public.app-category.finance\": \"Office;Finance\",\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/MsiTarget.d.ts b/node_modules/app-builder-lib/out/targets/MsiTarget.d.ts deleted file mode 100644 index 2e414fb..0000000 --- a/node_modules/app-builder-lib/out/targets/MsiTarget.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Arch } from "builder-util"; -import { MsiOptions } from "../"; -import { Target } from "../core"; -import { WinPackager } from "../winPackager"; -export default class MsiTarget extends Target { - private readonly packager; - readonly outDir: string; - private readonly vm; - readonly options: MsiOptions; - constructor(packager: WinPackager, outDir: string); - build(appOutDir: string, arch: Arch): Promise; - private light; - private getCommonWixArgs; - private writeManifest; - private computeFileDeclaration; -} diff --git a/node_modules/app-builder-lib/out/targets/MsiTarget.js b/node_modules/app-builder-lib/out/targets/MsiTarget.js deleted file mode 100644 index c876d45..0000000 --- a/node_modules/app-builder-lib/out/targets/MsiTarget.js +++ /dev/null @@ -1,411 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _binDownload() { - const data = require("../binDownload"); - - _binDownload = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -function ejs() { - const data = _interopRequireWildcard(require("ejs")); - - ejs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _CommonWindowsInstallerConfiguration() { - const data = require("../options/CommonWindowsInstallerConfiguration"); - - _CommonWindowsInstallerConfiguration = function () { - return data; - }; - - return data; -} - -function _pathManager() { - const data = require("../util/pathManager"); - - _pathManager = function () { - return data; - }; - - return data; -} - -function _vm() { - const data = require("../vm/vm"); - - _vm = function () { - return data; - }; - - return data; -} - -function _WineVm() { - const data = require("../vm/WineVm"); - - _WineVm = function () { - return data; - }; - - return data; -} - -function _targetUtil() { - const data = require("./targetUtil"); - - _targetUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID = _builderUtilRuntime().UUID.parse("d752fe43-5d44-44d5-9fc9-6dd1bf19d5cc"); - -const ROOT_DIR_ID = "APPLICATIONFOLDER"; -const ASSISTED_UI_FILE_NAME = "WixUI_Assisted.wxs"; -const projectTemplate = new (_lazyVal().Lazy)( -/*#__PURE__*/ -(0, _bluebirdLst().coroutine)(function* () { - const template = (yield (0, _fsExtraP().readFile)(path.join((0, _pathManager().getTemplatePath)("msi"), "template.xml"), "utf8")).replace(/{{/g, "<%").replace(/}}/g, "%>").replace(/\${([^}]+)}/g, "<%=$1%>"); - return ejs().compile(template); -})); // WiX doesn't support Mono, so, dontnet462 is required to be installed for wine (preinstalled in our bundled wine) - -class MsiTarget extends _core().Target { - constructor(packager, outDir) { - super("msi"); - this.packager = packager; - this.outDir = outDir; - this.vm = process.platform === "win32" ? new (_vm().VmManager)() : new (_WineVm().WineVmManager)(); - this.options = (0, _builderUtil().deepAssign)(this.packager.platformSpecificBuildOptions, this.packager.config.msi); - } - - build(appOutDir, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - const artifactName = packager.expandArtifactBeautyNamePattern(_this.options, "msi", arch); - const artifactPath = path.join(_this.outDir, artifactName); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: "MSI", - file: artifactPath, - arch - }); - const stageDir = yield (0, _targetUtil().createStageDir)(_this, packager, arch); - const vm = _this.vm; - const commonOptions = (0, _CommonWindowsInstallerConfiguration().getEffectiveOptions)(_this.options, _this.packager); - - if (commonOptions.isAssisted) { - // F*** *** *** *** *** *** *** *** *** *** *** *** *** WiX *** *** *** *** *** *** *** *** *** - // cannot understand how to set MSIINSTALLPERUSER on radio box change. In any case installed per user. - _builderUtil().log.warn(`MSI DOESN'T SUPPORT assisted installer. Please use NSIS instead.`); - } - - const projectFile = stageDir.getTempFile("project.wxs"); - const objectFiles = ["project.wixobj"]; - const uiFile = commonOptions.isAssisted ? stageDir.getTempFile(ASSISTED_UI_FILE_NAME) : null; - yield (0, _fsExtraP().writeFile)(projectFile, (yield _this.writeManifest(appOutDir, arch, commonOptions))); - - if (uiFile !== null) { - yield (0, _fsExtraP().writeFile)(uiFile, (yield (0, _fsExtraP().readFile)(path.join((0, _pathManager().getTemplatePath)("msi"), ASSISTED_UI_FILE_NAME), "utf8"))); - objectFiles.push(ASSISTED_UI_FILE_NAME.replace(".wxs", ".wixobj")); - } // noinspection SpellCheckingInspection - - - const vendorPath = yield (0, _binDownload().getBinFromGithub)("wix", "4.0.0.5512.2", "/X5poahdCc3199Vt6AP7gluTlT1nxi9cbbHhZhCMEu+ngyP1LiBMn+oZX7QAZVaKeBMc2SjVp7fJqNLqsUnPNQ=="); // noinspection SpellCheckingInspection - - const candleArgs = ["-arch", arch === _builderUtil().Arch.ia32 ? "x86" : arch === _builderUtil().Arch.armv7l ? "arm" : "x64", `-dappDir=${vm.toVmFile(appOutDir)}`].concat(_this.getCommonWixArgs()); - candleArgs.push("project.wxs"); - - if (uiFile !== null) { - candleArgs.push(ASSISTED_UI_FILE_NAME); - } - - yield vm.exec(vm.toVmFile(path.join(vendorPath, "candle.exe")), candleArgs, { - cwd: stageDir.dir - }); - yield _this.light(objectFiles, vm, artifactPath, appOutDir, vendorPath, stageDir.dir); - yield stageDir.cleanup(); - yield packager.sign(artifactPath); - yield packager.info.callArtifactBuildCompleted({ - file: artifactPath, - packager, - arch, - safeArtifactName: packager.computeSafeArtifactName(artifactName, "msi"), - target: _this, - isWriteUpdateInfo: false - }); - })(); - } - - light(objectFiles, vm, artifactPath, appOutDir, vendorPath, tempDir) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - // noinspection SpellCheckingInspection - const lightArgs = ["-out", vm.toVmFile(artifactPath), "-v", // https://github.com/wixtoolset/issues/issues/5169 - "-spdb", // https://sourceforge.net/p/wix/bugs/2405/ - // error LGHT1076 : ICE61: This product should remove only older versions of itself. The Maximum version is not less than the current product. (1.1.0.42 1.1.0.42) - "-sw1076", `-dappDir=${vm.toVmFile(appOutDir)}`].concat(_this2.getCommonWixArgs()); // http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Build-3-5-2229-0-give-me-the-following-error-error-LGHT0216-An-unexpected-Win32-exception-with-errorn-td5707443.html - - if (process.platform !== "win32") { - // noinspection SpellCheckingInspection - lightArgs.push("-sval"); - } - - if (_this2.options.oneClick === false) { - lightArgs.push("-ext", "WixUIExtension"); - } // objectFiles - only filenames, we set current directory to our temp stage dir - - - lightArgs.push(...objectFiles); - yield vm.exec(vm.toVmFile(path.join(vendorPath, "light.exe")), lightArgs, { - cwd: tempDir - }); - })(); - } - - getCommonWixArgs() { - const args = ["-pedantic"]; - - if (this.options.warningsAsErrors !== false) { - args.push("-wx"); - } - - return args; - } - - writeManifest(appOutDir, arch, commonOptions) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appInfo = _this3.packager.appInfo; - const { - files, - dirs - } = yield _this3.computeFileDeclaration(appOutDir); - const companyName = appInfo.companyName; - - if (!companyName) { - _builderUtil().log.warn(`Manufacturer is not set for MSI — please set "author" in the package.json`); - } - - const compression = _this3.packager.compression; - const options = _this3.options; - const iconPath = yield _this3.packager.getIconPath(); - return (yield projectTemplate.value)(Object.assign({}, commonOptions, { - isCreateDesktopShortcut: commonOptions.isCreateDesktopShortcut !== _CommonWindowsInstallerConfiguration().DesktopShortcutCreationPolicy.NEVER, - isRunAfterFinish: options.runAfterFinish !== false, - iconPath: iconPath == null ? null : _this3.vm.toVmFile(iconPath), - compressionLevel: compression === "store" ? "none" : "high", - version: appInfo.getVersionInWeirdWindowsForm(), - productName: appInfo.productName, - upgradeCode: (options.upgradeCode || _builderUtilRuntime().UUID.v5(appInfo.id, ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID)).toUpperCase(), - manufacturer: companyName || appInfo.productName, - appDescription: appInfo.description, - // https://stackoverflow.com/questions/1929038/compilation-error-ice80-the-64bitcomponent-uses-32bitdirectory - programFilesId: arch === _builderUtil().Arch.x64 ? "ProgramFiles64Folder" : "ProgramFilesFolder", - // wix in the name because special wix format can be used in the name - installationDirectoryWixName: (0, _targetUtil().getWindowsInstallationDirName)(appInfo, commonOptions.isPerMachine === true), - dirs, - files - })); - })(); - } - - computeFileDeclaration(appOutDir) { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appInfo = _this4.packager.appInfo; - let isRootDirAddedToRemoveTable = false; - const dirNames = new Set(); - const dirs = []; - const fileSpace = " ".repeat(6); - const commonOptions = (0, _CommonWindowsInstallerConfiguration().getEffectiveOptions)(_this4.options, _this4.packager); - const files = yield _bluebirdLst().default.map((0, _fs().walk)(appOutDir), file => { - const packagePath = file.substring(appOutDir.length + 1); - const lastSlash = packagePath.lastIndexOf(path.sep); - const fileName = lastSlash > 0 ? packagePath.substring(lastSlash + 1) : packagePath; - let directoryId = null; - let dirName = ""; // Wix Directory.FileSource doesn't work - https://stackoverflow.com/questions/21519388/wix-filesource-confusion - - if (lastSlash > 0) { - // This Name attribute may also define multiple directories using the inline directory syntax. - // For example, "ProgramFilesFolder:\My Company\My Product\bin" would create a reference to a Directory element with Id="ProgramFilesFolder" then create directories named "My Company" then "My Product" then "bin" nested beneath each other. - // This syntax is a shortcut to defining each directory in an individual Directory element. - dirName = packagePath.substring(0, lastSlash); // https://github.com/electron-userland/electron-builder/issues/3027 - - directoryId = "d" + (0, _crypto().createHash)("md5").update(dirName).digest("base64").replace(/\//g, "_").replace(/\+/g, ".").replace(/=+$/, ""); - - if (!dirNames.has(dirName)) { - dirNames.add(dirName); - dirs.push(``); - } - } else if (!isRootDirAddedToRemoveTable) { - isRootDirAddedToRemoveTable = true; - } // since RegistryValue can be part of Component, *** *** *** *** *** *** *** *** *** wix cannot auto generate guid - // https://stackoverflow.com/questions/1405100/change-my-component-guid-in-wix - - - let result = ``; - result += `\n${fileSpace} \n`; - const shortcutName = commonOptions.shortcutName; - - if (isCreateDesktopShortcut) { - result += `${fileSpace} \n`; - } - - const hasMenuCategory = commonOptions.menuCategory != null; - const startMenuShortcutDirectoryId = hasMenuCategory ? "AppProgramMenuDir" : "ProgramMenuFolder"; - - if (commonOptions.isCreateStartMenuShortcut) { - if (hasMenuCategory) { - dirs.push(``); - } - - result += `${fileSpace} \n`; - result += `${fileSpace} \n`; - result += `${fileSpace} \n`; - } - - result += `${fileSpace}`; - - if (hasMenuCategory) { - result += `\n`; - } - } else { - result += `/>`; - } - - return `${result}\n${fileSpace}`; - }); - return { - dirs: listToString(dirs, 2), - files: listToString(files, 3) - }; - })(); - } - -} - -exports.default = MsiTarget; - -function listToString(list, indentLevel) { - const space = " ".repeat(indentLevel * 2); - return list.join(`\n${space}`); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=MsiTarget.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/MsiTarget.js.map b/node_modules/app-builder-lib/out/targets/MsiTarget.js.map deleted file mode 100644 index 647f429..0000000 --- a/node_modules/app-builder-lib/out/targets/MsiTarget.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/MsiTarget.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AA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bluebird-lst\"\nimport { Arch, log, deepAssign } from \"builder-util\"\nimport { UUID } from \"builder-util-runtime\"\nimport { getBinFromGithub } from \"../binDownload\"\nimport { walk } from \"builder-util/out/fs\"\nimport { createHash } from \"crypto\"\nimport * as ejs from \"ejs\"\nimport { readFile, writeFile } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { MsiOptions } from \"../\"\nimport { Target } from \"../core\"\nimport { DesktopShortcutCreationPolicy, FinalCommonWindowsInstallerOptions, getEffectiveOptions } from \"../options/CommonWindowsInstallerConfiguration\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { VmManager } from \"../vm/vm\"\nimport { WineVmManager } from \"../vm/WineVm\"\nimport { WinPackager } from \"../winPackager\"\nimport { createStageDir, getWindowsInstallationDirName } from \"./targetUtil\"\n\nconst ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID = UUID.parse(\"d752fe43-5d44-44d5-9fc9-6dd1bf19d5cc\")\nconst ROOT_DIR_ID = \"APPLICATIONFOLDER\"\n\nconst ASSISTED_UI_FILE_NAME = \"WixUI_Assisted.wxs\"\n\nconst projectTemplate = new Lazy<(data: any) => string>(async () => {\n const template = (await readFile(path.join(getTemplatePath(\"msi\"), \"template.xml\"), \"utf8\"))\n .replace(/{{/g, \"<%\")\n .replace(/}}/g, \"%>\")\n .replace(/\\${([^}]+)}/g, \"<%=$1%>\")\n return ejs.compile(template)\n})\n\n// WiX doesn't support Mono, so, dontnet462 is required to be installed for wine (preinstalled in our bundled wine)\nexport default class MsiTarget extends Target {\n private readonly vm = process.platform === \"win32\" ? new VmManager() : new WineVmManager()\n\n readonly options: MsiOptions = deepAssign(this.packager.platformSpecificBuildOptions, this.packager.config.msi)\n\n constructor(private readonly packager: WinPackager, readonly outDir: string) {\n super(\"msi\")\n }\n\n async build(appOutDir: string, arch: Arch) {\n const packager = this.packager\n const artifactName = packager.expandArtifactBeautyNamePattern(this.options, \"msi\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"MSI\",\n file: artifactPath,\n arch,\n })\n\n const stageDir = await createStageDir(this, packager, arch)\n const vm = this.vm\n\n const commonOptions = getEffectiveOptions(this.options, this.packager)\n\n if (commonOptions.isAssisted) {\n // F*** *** *** *** *** *** *** *** *** *** *** *** *** WiX *** *** *** *** *** *** *** *** ***\n // cannot understand how to set MSIINSTALLPERUSER on radio box change. In any case installed per user.\n log.warn(`MSI DOESN'T SUPPORT assisted installer. Please use NSIS instead.`)\n }\n\n const projectFile = stageDir.getTempFile(\"project.wxs\")\n const objectFiles = [\"project.wixobj\"]\n const uiFile = commonOptions.isAssisted ? stageDir.getTempFile(ASSISTED_UI_FILE_NAME) : null\n await writeFile(projectFile, await this.writeManifest(appOutDir, arch, commonOptions))\n if (uiFile !== null) {\n await writeFile(uiFile, await readFile(path.join(getTemplatePath(\"msi\"), ASSISTED_UI_FILE_NAME), \"utf8\"))\n objectFiles.push(ASSISTED_UI_FILE_NAME.replace(\".wxs\", \".wixobj\"))\n }\n\n // noinspection SpellCheckingInspection\n const vendorPath = await getBinFromGithub(\"wix\", \"4.0.0.5512.2\", \"/X5poahdCc3199Vt6AP7gluTlT1nxi9cbbHhZhCMEu+ngyP1LiBMn+oZX7QAZVaKeBMc2SjVp7fJqNLqsUnPNQ==\")\n\n // noinspection SpellCheckingInspection\n const candleArgs = [\n \"-arch\", arch === Arch.ia32 ? \"x86\" : (arch === Arch.armv7l ? \"arm\" : \"x64\"),\n `-dappDir=${vm.toVmFile(appOutDir)}`,\n ].concat(this.getCommonWixArgs())\n candleArgs.push(\"project.wxs\")\n if (uiFile !== null) {\n candleArgs.push(ASSISTED_UI_FILE_NAME)\n }\n await vm.exec(vm.toVmFile(path.join(vendorPath, \"candle.exe\")), candleArgs, {\n cwd: stageDir.dir,\n })\n\n await this.light(objectFiles, vm, artifactPath, appOutDir, vendorPath, stageDir.dir)\n\n await stageDir.cleanup()\n\n await packager.sign(artifactPath)\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n packager,\n arch,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"msi\"),\n target: this,\n isWriteUpdateInfo: false,\n })\n }\n\n private async light(objectFiles: Array, vm: VmManager, artifactPath: string, appOutDir: string, vendorPath: string, tempDir: string) {\n // noinspection SpellCheckingInspection\n const lightArgs = [\n \"-out\", vm.toVmFile(artifactPath),\n \"-v\",\n // https://github.com/wixtoolset/issues/issues/5169\n \"-spdb\",\n // https://sourceforge.net/p/wix/bugs/2405/\n // error LGHT1076 : ICE61: This product should remove only older versions of itself. The Maximum version is not less than the current product. (1.1.0.42 1.1.0.42)\n \"-sw1076\",\n `-dappDir=${vm.toVmFile(appOutDir)}`,\n // \"-dcl:high\",\n ].concat(this.getCommonWixArgs())\n\n // http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Build-3-5-2229-0-give-me-the-following-error-error-LGHT0216-An-unexpected-Win32-exception-with-errorn-td5707443.html\n if (process.platform !== \"win32\") {\n // noinspection SpellCheckingInspection\n lightArgs.push(\"-sval\")\n }\n\n if (this.options.oneClick === false) {\n lightArgs.push(\"-ext\", \"WixUIExtension\")\n }\n\n // objectFiles - only filenames, we set current directory to our temp stage dir\n lightArgs.push(...objectFiles)\n await vm.exec(vm.toVmFile(path.join(vendorPath, \"light.exe\")), lightArgs, {\n cwd: tempDir,\n })\n }\n\n private getCommonWixArgs() {\n const args: Array = [\"-pedantic\"]\n if (this.options.warningsAsErrors !== false) {\n args.push(\"-wx\")\n }\n return args\n }\n\n private async writeManifest(appOutDir: string, arch: Arch, commonOptions: FinalCommonWindowsInstallerOptions) {\n const appInfo = this.packager.appInfo\n const {files, dirs} = await this.computeFileDeclaration(appOutDir)\n\n const companyName = appInfo.companyName\n if (!companyName) {\n log.warn(`Manufacturer is not set for MSI — please set \"author\" in the package.json`)\n }\n\n const compression = this.packager.compression\n const options = this.options\n const iconPath = await this.packager.getIconPath()\n return (await projectTemplate.value)({\n ...commonOptions,\n isCreateDesktopShortcut: commonOptions.isCreateDesktopShortcut !== DesktopShortcutCreationPolicy.NEVER,\n isRunAfterFinish: options.runAfterFinish !== false,\n iconPath: iconPath == null ? null : this.vm.toVmFile(iconPath),\n compressionLevel: compression === \"store\" ? \"none\" : \"high\",\n version: appInfo.getVersionInWeirdWindowsForm(),\n productName: appInfo.productName,\n upgradeCode: (options.upgradeCode || UUID.v5(appInfo.id, ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID)).toUpperCase(),\n manufacturer: companyName || appInfo.productName,\n appDescription: appInfo.description,\n // https://stackoverflow.com/questions/1929038/compilation-error-ice80-the-64bitcomponent-uses-32bitdirectory\n programFilesId: arch === Arch.x64 ? \"ProgramFiles64Folder\" : \"ProgramFilesFolder\",\n // wix in the name because special wix format can be used in the name\n installationDirectoryWixName: getWindowsInstallationDirName(appInfo, commonOptions.isPerMachine === true),\n dirs,\n files,\n })\n }\n\n private async computeFileDeclaration(appOutDir: string) {\n const appInfo = this.packager.appInfo\n let isRootDirAddedToRemoveTable = false\n const dirNames = new Set()\n const dirs: Array = []\n const fileSpace = \" \".repeat(6)\n const commonOptions = getEffectiveOptions(this.options, this.packager)\n const files = await BluebirdPromise.map(walk(appOutDir), file => {\n const packagePath = file.substring(appOutDir.length + 1)\n\n const lastSlash = packagePath.lastIndexOf(path.sep)\n const fileName = lastSlash > 0 ? packagePath.substring(lastSlash + 1) : packagePath\n let directoryId: string | null = null\n let dirName = \"\"\n // Wix Directory.FileSource doesn't work - https://stackoverflow.com/questions/21519388/wix-filesource-confusion\n if (lastSlash > 0) {\n // This Name attribute may also define multiple directories using the inline directory syntax.\n // For example, \"ProgramFilesFolder:\\My Company\\My Product\\bin\" would create a reference to a Directory element with Id=\"ProgramFilesFolder\" then create directories named \"My Company\" then \"My Product\" then \"bin\" nested beneath each other.\n // This syntax is a shortcut to defining each directory in an individual Directory element.\n dirName = packagePath.substring(0, lastSlash)\n // https://github.com/electron-userland/electron-builder/issues/3027\n directoryId = \"d\" + createHash(\"md5\").update(dirName).digest(\"base64\").replace(/\\//g, \"_\").replace(/\\+/g, \".\").replace(/=+$/, \"\")\n if (!dirNames.has(dirName)) {\n dirNames.add(dirName)\n dirs.push(``)\n }\n }\n else if (!isRootDirAddedToRemoveTable) {\n isRootDirAddedToRemoveTable = true\n }\n\n // since RegistryValue can be part of Component, *** *** *** *** *** *** *** *** *** wix cannot auto generate guid\n // https://stackoverflow.com/questions/1405100/change-my-component-guid-in-wix\n let result = ``\n result += `\\n${fileSpace} \\n`\n const shortcutName = commonOptions.shortcutName\n if (isCreateDesktopShortcut) {\n result += `${fileSpace} \\n`\n }\n\n const hasMenuCategory = commonOptions.menuCategory != null\n const startMenuShortcutDirectoryId = hasMenuCategory ? \"AppProgramMenuDir\" : \"ProgramMenuFolder\"\n if (commonOptions.isCreateStartMenuShortcut) {\n if (hasMenuCategory) {\n dirs.push(``)\n }\n result += `${fileSpace} \\n`\n result += `${fileSpace} \\n`\n result += `${fileSpace} \\n`\n }\n result += `${fileSpace}`\n\n if (hasMenuCategory) {\n result += `\\n`\n }\n }\n else {\n result += `/>`\n }\n\n return `${result}\\n${fileSpace}`\n })\n\n return {dirs: listToString(dirs, 2), files: listToString(files, 3)}\n }\n}\n\nfunction listToString(list: Array, indentLevel: number) {\n const space = \" \".repeat(indentLevel * 2)\n return list.join(`\\n${space}`)\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/archive.d.ts b/node_modules/app-builder-lib/out/targets/archive.d.ts deleted file mode 100644 index 9703df1..0000000 --- a/node_modules/app-builder-lib/out/targets/archive.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { CompressionLevel } from "../core"; -export interface ArchiveOptions { - compression?: CompressionLevel | null; - /** - * @default false - */ - withoutDir?: boolean; - /** - * @default true - */ - solid?: boolean; - /** - * @default true - */ - isArchiveHeaderCompressed?: boolean; - dictSize?: number; - excluded?: Array | null; - method?: "Copy" | "LZMA" | "Deflate" | "DEFAULT"; - isRegularFile?: boolean; -} -export declare function compute7zCompressArgs(format: string, options?: ArchiveOptions): string[]; diff --git a/node_modules/app-builder-lib/out/targets/archive.js b/node_modules/app-builder-lib/out/targets/archive.js deleted file mode 100644 index d7124b0..0000000 --- a/node_modules/app-builder-lib/out/targets/archive.js +++ /dev/null @@ -1,241 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.tar = tar; -exports.compute7zCompressArgs = compute7zCompressArgs; -exports.archive = archive; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _zipBin() { - const data = require("7zip-bin"); - - _zipBin = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _tools() { - const data = require("./tools"); - - _tools = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/** @internal */ -function tar(_x, _x2, _x3, _x4, _x5, _x6) { - return _tar.apply(this, arguments); -} - -function _tar() { - _tar = (0, _bluebirdLst().coroutine)(function* (compression, format, outFile, dirToArchive, isMacApp, tempDirManager) { - const tarFile = yield tempDirManager.getTempFile({ - suffix: ".tar" - }); - const tarArgs = debug7zArgs("a"); - tarArgs.push(tarFile); - tarArgs.push(path.basename(dirToArchive)); - yield Promise.all([(0, _builderUtil().exec)(_zipBin().path7za, tarArgs, { - cwd: path.dirname(dirToArchive) - }), // remove file before - 7z doesn't overwrite file, but update - (0, _fs().unlinkIfExists)(outFile)]); - - if (!isMacApp) { - yield (0, _builderUtil().exec)(_zipBin().path7za, ["rn", tarFile, path.basename(dirToArchive), path.basename(outFile, `.${format}`)]); - } - - if (format === "tar.lz") { - // noinspection SpellCheckingInspection - let lzipPath = "lzip"; - - if (process.platform === "darwin") { - lzipPath = path.join((yield (0, _tools().getLinuxToolsPath)()), "bin", lzipPath); - } - - yield (0, _builderUtil().exec)(lzipPath, [compression === "store" ? "-1" : "-9", "--keep" - /* keep (don't delete) input files */ - , tarFile]); // bloody lzip creates file in the same dir where input file with postfix `.lz`, option --output doesn't work - - yield (0, _fsExtraP().move)(`${tarFile}.lz`, outFile); - return; - } - - const args = compute7zCompressArgs(format === "tar.xz" ? "xz" : format === "tar.bz2" ? "bzip2" : "gzip", { - isRegularFile: true, - method: "DEFAULT", - compression - }); - args.push(outFile, tarFile); - yield (0, _builderUtil().exec)(_zipBin().path7za, args, { - cwd: path.dirname(dirToArchive) - }, _builderUtil().debug7z.enabled); - }); - return _tar.apply(this, arguments); -} - -function compute7zCompressArgs(format, options = {}) { - let storeOnly = options.compression === "store"; - const args = debug7zArgs("a"); - let isLevelSet = false; - - if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) { - storeOnly = false; - args.push(`-mx=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL}`); - isLevelSet = true; - } - - const isZip = format === "zip"; - - if (!storeOnly) { - if (isZip && options.compression === "maximum") { - // http://superuser.com/a/742034 - args.push("-mfb=258", "-mpass=15"); - } - - if (!isLevelSet) { - // https://github.com/electron-userland/electron-builder/pull/3032 - args.push("-mx=" + (!isZip || options.compression === "maximum" ? "9" : "7")); - } - } - - if (options.dictSize != null) { - args.push(`-md=${options.dictSize}m`); - } // https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#7Z - // https://stackoverflow.com/questions/27136783/7zip-produces-different-output-from-identical-input - // tc and ta are off by default, but to be sure, we explicitly set it to off - // disable "Stores NTFS timestamps for files: Modification time, Creation time, Last access time." to produce the same archive for the same data - - - if (!options.isRegularFile) { - args.push("-mtc=off"); - } - - if (format === "7z" || format.endsWith(".7z")) { - if (options.solid === false) { - args.push("-ms=off"); - } - - if (options.isArchiveHeaderCompressed === false) { - args.push("-mhc=off"); - } // args valid only for 7z - // -mtm=off disable "Stores last Modified timestamps for files." - - - args.push("-mtm=off", "-mta=off"); - } - - if (options.method != null) { - if (options.method !== "DEFAULT") { - args.push(`-mm=${options.method}`); - } - } else if (isZip || storeOnly) { - args.push(`-mm=${storeOnly ? "Copy" : "Deflate"}`); - } - - if (isZip) { - // -mcu switch: 7-Zip uses UTF-8, if there are non-ASCII symbols. - // because default mode: 7-Zip uses UTF-8, if the local code page doesn't contain required symbols. - // but archive should be the same regardless where produced - args.push("-mcu"); - } - - return args; -} // 7z is very fast, so, use ultra compression - -/** @internal */ - - -function archive(_x7, _x8, _x9) { - return _archive.apply(this, arguments); -} - -function _archive() { - _archive = (0, _bluebirdLst().coroutine)(function* (format, outFile, dirToArchive, options = {}) { - const args = compute7zCompressArgs(format, options); // remove file before - 7z doesn't overwrite file, but update - - yield (0, _fs().unlinkIfExists)(outFile); - args.push(outFile, options.withoutDir ? "." : path.basename(dirToArchive)); - - if (options.excluded != null) { - for (const mask of options.excluded) { - args.push(`-xr!${mask}`); - } - } - - try { - yield (0, _builderUtil().exec)(_zipBin().path7za, args, { - cwd: options.withoutDir ? dirToArchive : path.dirname(dirToArchive) - }, _builderUtil().debug7z.enabled); - } catch (e) { - if (e.code === "ENOENT" && !(yield (0, _fs().exists)(dirToArchive))) { - throw new Error(`Cannot create archive: "${dirToArchive}" doesn't exist`); - } else { - throw e; - } - } - - return outFile; - }); - return _archive.apply(this, arguments); -} - -function debug7zArgs(command) { - const args = [command, "-bd"]; - - if (_builderUtil().debug7z.enabled) { - args.push("-bb"); - } - - return args; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=archive.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/archive.js.map b/node_modules/app-builder-lib/out/targets/archive.js.map deleted file mode 100644 index e9e225e..0000000 --- a/node_modules/app-builder-lib/out/targets/archive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/archive.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;SACsB,G;;;;;uCAAf,WAAmB,WAAnB,EAA8D,MAA9D,EAA8E,OAA9E,EAA+F,YAA/F,EAAqH,QAArH,EAAwI,cAAxI,EAA8J;AACnK,UAAM,OAAO,SAAS,cAAc,CAAC,WAAf,CAA2B;AAAC,MAAA,MAAM,EAAE;AAAT,KAA3B,CAAtB;AACA,UAAM,OAAO,GAAG,WAAW,CAAC,GAAD,CAA3B;AACA,IAAA,OAAO,CAAC,IAAR,CAAa,OAAb;AACA,IAAA,OAAO,CAAC,IAAR,CAAa,IAAI,CAAC,QAAL,CAAc,YAAd,CAAb;AAEA,UAAM,OAAO,CAAC,GAAR,CAAY,CAChB,yBAAK,iBAAL,EAAc,OAAd,EAAuB;AAAC,MAAA,GAAG,EAAE,IAAI,CAAC,OAAL,CAAa,YAAb;AAAN,KAAvB,CADgB,EAEhB;AACA,8BAAe,OAAf,CAHgB,CAAZ,CAAN;;AAMA,QAAI,CAAC,QAAL,EAAe;AACb,YAAM,yBAAK,iBAAL,EAAc,CAAC,IAAD,EAAO,OAAP,EAAgB,IAAI,CAAC,QAAL,CAAc,YAAd,CAAhB,EAA6C,IAAI,CAAC,QAAL,CAAc,OAAd,EAAuB,IA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,OAAP;AACD,G;;;;AAED,SAAS,WAAT,CAAqB,OAArB,EAAuC;AACrC,QAAM,IAAI,GAAG,CAAC,OAAD,EAAU,KAAV,CAAb;;AACA,MAAI,uBAAQ,OAAZ,EAAqB;AACnB,IAAA,IAAI,CAAC,IAAL,CAAU,KAAV;AACD;;AACD,SAAO,IAAP;AACD,C","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport { debug7z, exec } from \"builder-util\"\nimport { exists, unlinkIfExists } from \"builder-util/out/fs\"\nimport { move } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { TmpDir } from \"temp-file\"\nimport { CompressionLevel } from \"../core\"\nimport { getLinuxToolsPath } from \"./tools\"\n\n/** @internal */\nexport async function tar(compression: CompressionLevel | any | any, format: string, outFile: string, dirToArchive: string, isMacApp: boolean, tempDirManager: TmpDir): Promise {\n const tarFile = await tempDirManager.getTempFile({suffix: \".tar\"})\n const tarArgs = debug7zArgs(\"a\")\n tarArgs.push(tarFile)\n tarArgs.push(path.basename(dirToArchive))\n\n await Promise.all([\n exec(path7za, tarArgs, {cwd: path.dirname(dirToArchive)}),\n // remove file before - 7z doesn't overwrite file, but update\n unlinkIfExists(outFile),\n ])\n\n if (!isMacApp) {\n await exec(path7za, [\"rn\", tarFile, path.basename(dirToArchive), path.basename(outFile, `.${format}`)])\n }\n\n if (format === \"tar.lz\") {\n // noinspection SpellCheckingInspection\n let lzipPath = \"lzip\"\n if (process.platform === \"darwin\") {\n lzipPath = path.join(await getLinuxToolsPath(), \"bin\", lzipPath)\n }\n await exec(lzipPath, [compression === \"store\" ? \"-1\" : \"-9\", \"--keep\" /* keep (don't delete) input files */, tarFile])\n // bloody lzip creates file in the same dir where input file with postfix `.lz`, option --output doesn't work\n await move(`${tarFile}.lz`, outFile)\n return\n }\n\n const args = compute7zCompressArgs(format === \"tar.xz\" ? \"xz\" : (format === \"tar.bz2\" ? \"bzip2\" : \"gzip\"), {\n isRegularFile: true,\n method: \"DEFAULT\",\n compression,\n })\n args.push(outFile, tarFile)\n await exec(path7za, args, {\n cwd: path.dirname(dirToArchive),\n }, debug7z.enabled)\n}\n\nexport interface ArchiveOptions {\n compression?: CompressionLevel | null\n\n /**\n * @default false\n */\n withoutDir?: boolean\n\n /**\n * @default true\n */\n solid?: boolean\n\n /**\n * @default true\n */\n isArchiveHeaderCompressed?: boolean\n\n dictSize?: number\n excluded?: Array | null\n\n // DEFAULT allows to disable custom logic and do not pass method switch at all\n method?: \"Copy\" | \"LZMA\" | \"Deflate\" | \"DEFAULT\"\n\n isRegularFile?: boolean\n}\n\nexport function compute7zCompressArgs(format: string, options: ArchiveOptions = {}) {\n let storeOnly = options.compression === \"store\"\n const args = debug7zArgs(\"a\")\n\n let isLevelSet = false\n if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {\n storeOnly = false\n args.push(`-mx=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL}`)\n isLevelSet = true\n }\n\n const isZip = format === \"zip\"\n if (!storeOnly) {\n if (isZip && options.compression === \"maximum\") {\n // http://superuser.com/a/742034\n args.push(\"-mfb=258\", \"-mpass=15\")\n }\n\n if (!isLevelSet) {\n // https://github.com/electron-userland/electron-builder/pull/3032\n args.push(\"-mx=\" + ((!isZip || options.compression === \"maximum\") ? \"9\" : \"7\"))\n }\n }\n\n if (options.dictSize != null) {\n args.push(`-md=${options.dictSize}m`)\n }\n\n // https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#7Z\n // https://stackoverflow.com/questions/27136783/7zip-produces-different-output-from-identical-input\n // tc and ta are off by default, but to be sure, we explicitly set it to off\n // disable \"Stores NTFS timestamps for files: Modification time, Creation time, Last access time.\" to produce the same archive for the same data\n if (!options.isRegularFile) {\n args.push(\"-mtc=off\")\n }\n\n if (format === \"7z\" || format.endsWith(\".7z\")) {\n if (options.solid === false) {\n args.push(\"-ms=off\")\n }\n\n if (options.isArchiveHeaderCompressed === false) {\n args.push(\"-mhc=off\")\n }\n\n // args valid only for 7z\n // -mtm=off disable \"Stores last Modified timestamps for files.\"\n args.push(\"-mtm=off\", \"-mta=off\")\n }\n\n if (options.method != null) {\n if (options.method !== \"DEFAULT\") {\n args.push(`-mm=${options.method}`)\n }\n }\n else if (isZip || storeOnly) {\n args.push(`-mm=${storeOnly ? \"Copy\" : \"Deflate\"}`)\n }\n\n if (isZip) {\n // -mcu switch: 7-Zip uses UTF-8, if there are non-ASCII symbols.\n // because default mode: 7-Zip uses UTF-8, if the local code page doesn't contain required symbols.\n // but archive should be the same regardless where produced\n args.push(\"-mcu\")\n }\n return args\n}\n\n// 7z is very fast, so, use ultra compression\n/** @internal */\nexport async function archive(format: string, outFile: string, dirToArchive: string, options: ArchiveOptions = {}): Promise {\n const args = compute7zCompressArgs(format, options)\n // remove file before - 7z doesn't overwrite file, but update\n await unlinkIfExists(outFile)\n\n args.push(outFile, options.withoutDir ? \".\" : path.basename(dirToArchive))\n if (options.excluded != null) {\n for (const mask of options.excluded) {\n args.push(`-xr!${mask}`)\n }\n }\n\n try {\n await exec(path7za, args, {\n cwd: options.withoutDir ? dirToArchive : path.dirname(dirToArchive),\n }, debug7z.enabled)\n }\n catch (e) {\n if (e.code === \"ENOENT\" && !(await exists(dirToArchive))) {\n throw new Error(`Cannot create archive: \"${dirToArchive}\" doesn't exist`)\n }\n else {\n throw e\n }\n }\n\n return outFile\n}\n\nfunction debug7zArgs(command: \"a\" | \"x\"): Array {\n const args = [command, \"-bd\"]\n if (debug7z.enabled) {\n args.push(\"-bb\")\n }\n return args\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.d.ts b/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.d.ts deleted file mode 100644 index 0c0d1ab..0000000 --- a/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { BlockMapDataHolder, PackageFileInfo } from "builder-util-runtime"; -import { Target } from "../core"; -import { PlatformPackager } from "../platformPackager"; -import { ArchiveOptions } from "./archive"; -export declare const BLOCK_MAP_FILE_SUFFIX = ".blockmap"; -export declare function createNsisWebDifferentialUpdateInfo(artifactPath: string, packageFiles: { - [arch: string]: PackageFileInfo; -}): { - packages: { - [arch: string]: PackageFileInfo; - }; -} | null; -export declare function configureDifferentialAwareArchiveOptions(archiveOptions: ArchiveOptions): ArchiveOptions; -export declare function appendBlockmap(file: string): Promise; -export declare function createBlockmap(file: string, target: Target, packager: PlatformPackager, safeArtifactName: string | null): Promise; diff --git a/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.js b/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.js deleted file mode 100644 index 75ebb46..0000000 --- a/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.js +++ /dev/null @@ -1,139 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createNsisWebDifferentialUpdateInfo = createNsisWebDifferentialUpdateInfo; -exports.configureDifferentialAwareArchiveOptions = configureDifferentialAwareArchiveOptions; -exports.appendBlockmap = appendBlockmap; -exports.createBlockmap = createBlockmap; -exports.BLOCK_MAP_FILE_SUFFIX = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _appBuilder() { - const data = require("../util/appBuilder"); - - _appBuilder = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const BLOCK_MAP_FILE_SUFFIX = ".blockmap"; -exports.BLOCK_MAP_FILE_SUFFIX = BLOCK_MAP_FILE_SUFFIX; - -function createNsisWebDifferentialUpdateInfo(artifactPath, packageFiles) { - if (packageFiles == null) { - return null; - } - - const keys = Object.keys(packageFiles); - - if (keys.length <= 0) { - return null; - } - - const packages = {}; - - for (const arch of keys) { - const packageFileInfo = packageFiles[arch]; - const file = path.basename(packageFileInfo.path); - packages[arch] = Object.assign({}, packageFileInfo, { - path: file, - // https://github.com/electron-userland/electron-builder/issues/2583 - file - }); - } - - return { - packages - }; -} - -function configureDifferentialAwareArchiveOptions(archiveOptions) { - /* - * dict size 64 MB: Full: 33,744.88 KB, To download: 17,630.3 KB (52%) - * dict size 16 MB: Full: 33,936.84 KB, To download: 16,175.9 KB (48%) - * dict size 8 MB: Full: 34,187.59 KB, To download: 8,229.9 KB (24%) - * dict size 4 MB: Full: 34,628.73 KB, To download: 3,782.97 KB (11%) - as we can see, if file changed in one place, all block is invalidated (and update size approximately equals to dict size) - 1 MB is used: - 1MB: - 2018/01/11 11:54:41:0045 File has 59 changed blocks - 2018/01/11 11:54:41:0050 Full: 71,588.59 KB, To download: 1,243.39 KB (2%) - 4MB: - 2018/01/11 11:31:43:0440 Full: 70,303.55 KB, To download: 4,843.27 KB (7%) - 2018/01/11 11:31:43:0435 File has 234 changed blocks - */ - archiveOptions.dictSize = 1; // solid compression leads to a lot of changed blocks - - archiveOptions.solid = false; // do not allow to change compression level to avoid different packages - - archiveOptions.compression = "normal"; - return archiveOptions; -} - -function appendBlockmap(_x) { - return _appendBlockmap.apply(this, arguments); -} - -function _appendBlockmap() { - _appendBlockmap = (0, _bluebirdLst().coroutine)(function* (file) { - _builderUtil().log.info({ - file: _builderUtil().log.filePath(file) - }, "building embedded block map"); - - return yield (0, _appBuilder().executeAppBuilderAsJson)(["blockmap", "--input", file, "--compression", "deflate"]); - }); - return _appendBlockmap.apply(this, arguments); -} - -function createBlockmap(_x2, _x3, _x4, _x5) { - return _createBlockmap.apply(this, arguments); -} function _createBlockmap() { - _createBlockmap = (0, _bluebirdLst().coroutine)(function* (file, target, packager, safeArtifactName) { - const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`; - - _builderUtil().log.info({ - blockMapFile: _builderUtil().log.filePath(blockMapFile) - }, "building block map"); - - const updateInfo = yield (0, _appBuilder().executeAppBuilderAsJson)(["blockmap", "--input", file, "--output", blockMapFile]); - yield packager.info.callArtifactBuildCompleted({ - file: blockMapFile, - safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`, - target, - arch: null, - packager, - updateInfo - }); - return updateInfo; - }); - return _createBlockmap.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=differentialUpdateInfoBuilder.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.js.map b/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.js.map deleted file mode 100644 index 41123aa..0000000 --- a/node_modules/app-builder-lib/out/targets/differentialUpdateInfoBuilder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/differentialUpdateInfoBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGO,MAAM,qBAAqB,GAAG,WAA9B;;;AAED,SAAU,mCAAV,CAA8C,YAA9C,EAAoE,YAApE,EAAqH;AACzH,MAAI,YAAY,IAAI,IAApB,EAA0B;AACxB,WAAO,IAAP;AACD;;AAED,QAAM,IAAI,GAAG,MAAM,CAAC,IAAP,CAAY,YAAZ,CAAb;;AACA,MAAI,IAAI,CAAC,MAAL,IAAe,CAAnB,EAAsB;AACpB,WAAO,IAAP;AACD;;AAED,QAAM,QAAQ,GAAwC,EAAtD;;AACA,OAAK,MAAM,IAAX,IAAmB,IAAnB,EAAyB;AACvB,UA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Ad,CAAyC;AAC7C,MAAA,IAAI,EAAE,YADuC;AAE7C,MAAA,gBAAgB,EAAE,gBAAgB,IAAI,IAApB,GAA2B,IAA3B,GAAkC,GAAG,gBAAgB,GAAG,qBAAqB,EAFlD;AAG7C,MAAA,MAH6C;AAI7C,MAAA,IAAI,EAAE,IAJuC;AAK7C,MAAA,QAL6C;AAM7C,MAAA;AAN6C,KAAzC,CAAN;AAQA,WAAO,UAAP;AACD,G","sourcesContent":["import { log } from \"builder-util\"\nimport { BlockMapDataHolder, PackageFileInfo } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { ArchiveOptions } from \"./archive\"\n\nexport const BLOCK_MAP_FILE_SUFFIX = \".blockmap\"\n\nexport function createNsisWebDifferentialUpdateInfo(artifactPath: string, packageFiles: { [arch: string]: PackageFileInfo }) {\n if (packageFiles == null) {\n return null\n }\n\n const keys = Object.keys(packageFiles)\n if (keys.length <= 0) {\n return null\n }\n\n const packages: { [arch: string]: PackageFileInfo } = {}\n for (const arch of keys) {\n const packageFileInfo = packageFiles[arch]\n const file = path.basename(packageFileInfo.path)\n packages[arch] = {\n ...packageFileInfo,\n path: file,\n // https://github.com/electron-userland/electron-builder/issues/2583\n file,\n } as any\n }\n return {packages}\n}\n\nexport function configureDifferentialAwareArchiveOptions(archiveOptions: ArchiveOptions): ArchiveOptions {\n /*\n * dict size 64 MB: Full: 33,744.88 KB, To download: 17,630.3 KB (52%)\n * dict size 16 MB: Full: 33,936.84 KB, To download: 16,175.9 KB (48%)\n * dict size 8 MB: Full: 34,187.59 KB, To download: 8,229.9 KB (24%)\n * dict size 4 MB: Full: 34,628.73 KB, To download: 3,782.97 KB (11%)\n\n as we can see, if file changed in one place, all block is invalidated (and update size approximately equals to dict size)\n\n 1 MB is used:\n\n 1MB:\n\n 2018/01/11 11:54:41:0045 File has 59 changed blocks\n 2018/01/11 11:54:41:0050 Full: 71,588.59 KB, To download: 1,243.39 KB (2%)\n\n 4MB:\n\n 2018/01/11 11:31:43:0440 Full: 70,303.55 KB, To download: 4,843.27 KB (7%)\n 2018/01/11 11:31:43:0435 File has 234 changed blocks\n\n */\n archiveOptions.dictSize = 1\n // solid compression leads to a lot of changed blocks\n archiveOptions.solid = false\n // do not allow to change compression level to avoid different packages\n archiveOptions.compression = \"normal\"\n return archiveOptions\n}\n\nexport async function appendBlockmap(file: string): Promise {\n log.info({file: log.filePath(file)}, \"building embedded block map\")\n return await executeAppBuilderAsJson([\"blockmap\", \"--input\", file, \"--compression\", \"deflate\"])\n}\n\nexport async function createBlockmap(file: string, target: Target, packager: PlatformPackager, safeArtifactName: string | null): Promise {\n const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`\n log.info({blockMapFile: log.filePath(blockMapFile)}, \"building block map\")\n const updateInfo = await executeAppBuilderAsJson([\"blockmap\", \"--input\", file, \"--output\", blockMapFile])\n await packager.info.callArtifactBuildCompleted({\n file: blockMapFile,\n safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,\n target,\n arch: null,\n packager,\n updateInfo,\n })\n return updateInfo\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/fpm.d.ts b/node_modules/app-builder-lib/out/targets/fpm.d.ts deleted file mode 100644 index e2ba55a..0000000 --- a/node_modules/app-builder-lib/out/targets/fpm.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Arch } from "builder-util"; -import { LinuxTargetSpecificOptions } from ".."; -import { Target } from "../core"; -import { LinuxPackager } from "../linuxPackager"; -import { LinuxTargetHelper } from "./LinuxTargetHelper"; -export default class FpmTarget extends Target { - private readonly packager; - private readonly helper; - readonly outDir: string; - readonly options: LinuxTargetSpecificOptions; - private readonly scriptFiles; - constructor(name: string, packager: LinuxPackager, helper: LinuxTargetHelper, outDir: string); - private createScripts; - checkOptions(): Promise; - private computeFpmMetaInfoOptions; - build(appOutDir: string, arch: Arch): Promise; -} diff --git a/node_modules/app-builder-lib/out/targets/fpm.js b/node_modules/app-builder-lib/out/targets/fpm.js deleted file mode 100644 index 9e1b088..0000000 --- a/node_modules/app-builder-lib/out/targets/fpm.js +++ /dev/null @@ -1,399 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _zipBin() { - const data = require("7zip-bin"); - - _zipBin = function () { - return data; - }; - - return data; -} - -function _appBuilderBin() { - const data = require("app-builder-bin"); - - _appBuilderBin = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _appInfo() { - const data = require("../appInfo"); - - _appInfo = function () { - return data; - }; - - return data; -} - -function _appBuilder() { - const data = require("../util/appBuilder"); - - _appBuilder = function () { - return data; - }; - - return data; -} - -function _bundledTool() { - const data = require("../util/bundledTool"); - - _bundledTool = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function errorMessages() { - const data = _interopRequireWildcard(require("../errorMessages")); - - errorMessages = function () { - return data; - }; - - return data; -} - -function _macosVersion() { - const data = require("../util/macosVersion"); - - _macosVersion = function () { - return data; - }; - - return data; -} - -function _pathManager() { - const data = require("../util/pathManager"); - - _pathManager = function () { - return data; - }; - - return data; -} - -function _LinuxTargetHelper() { - const data = require("./LinuxTargetHelper"); - - _LinuxTargetHelper = function () { - return data; - }; - - return data; -} - -function _tools() { - const data = require("./tools"); - - _tools = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class FpmTarget extends _core().Target { - constructor(name, packager, helper, outDir) { - super(name, false); - this.packager = packager; - this.helper = helper; - this.outDir = outDir; - this.options = Object.assign({}, this.packager.platformSpecificBuildOptions, this.packager.config[this.name]); - this.scriptFiles = this.createScripts(); - } - - createScripts() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const defaultTemplatesDir = (0, _pathManager().getTemplatePath)("linux"); - const packager = _this.packager; - const templateOptions = Object.assign({ - // old API compatibility - executable: packager.executableName, - productFilename: packager.appInfo.productFilename - }, packager.platformSpecificBuildOptions); - - function getResource(value, defaultFile) { - if (value == null) { - return path.join(defaultTemplatesDir, defaultFile); - } - - return path.resolve(packager.projectDir, value); - } - - return yield Promise.all([writeConfigFile(packager.info.tempDirManager, getResource(_this.options.afterInstall, "after-install.tpl"), templateOptions), writeConfigFile(packager.info.tempDirManager, getResource(_this.options.afterRemove, "after-remove.tpl"), templateOptions)]); - })(); - } - - checkOptions() { - return this.computeFpmMetaInfoOptions(); - } - - computeFpmMetaInfoOptions() { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this2.packager; - const projectUrl = yield packager.appInfo.computePackageUrl(); - const errors = []; - - if (projectUrl == null) { - errors.push("Please specify project homepage, see https://electron.build/configuration/configuration#Metadata-homepage"); - } - - const options = _this2.options; - let author = options.maintainer; - - if (author == null) { - const a = packager.info.metadata.author; - - if (a == null || a.email == null) { - errors.push(errorMessages().authorEmailIsMissed); - } else { - author = `${a.name} <${a.email}>`; - } - } - - if (errors.length > 0) { - throw new Error(errors.join("\n\n")); - } - - return { - maintainer: author, - url: projectUrl, - vendor: options.vendor || author - }; - })(); - } - - build(appOutDir, arch) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const fpmMetaInfoOptions = yield _this3.computeFpmMetaInfoOptions(); - const target = _this3.name; // tslint:disable:no-invalid-template-strings - - let nameFormat = "${name}-${version}-${arch}.${ext}"; - let isUseArchIfX64 = false; - - if (target === "deb") { - nameFormat = "${name}_${version}_${arch}.${ext}"; - isUseArchIfX64 = true; - } else if (target === "rpm") { - nameFormat = "${name}-${version}.${arch}.${ext}"; - isUseArchIfX64 = true; - } - - const packager = _this3.packager; - const artifactPath = path.join(_this3.outDir, packager.expandArtifactNamePattern(_this3.options, target, arch, nameFormat, !isUseArchIfX64)); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: target, - file: artifactPath, - arch - }); - yield (0, _fs().unlinkIfExists)(artifactPath); - - if (packager.packagerOptions.prepackaged != null) { - yield (0, _fsExtraP().ensureDir)(_this3.outDir); - } - - const scripts = yield _this3.scriptFiles; - const appInfo = packager.appInfo; - const options = _this3.options; - const synopsis = options.synopsis; - const args = ["-s", "dir", "-t", target, "--architecture", target === "pacman" && arch === _builderUtil().Arch.ia32 ? "i686" : (0, _builderUtil().toLinuxArchString)(arch), "--name", appInfo.linuxPackageName, "--force", "--after-install", scripts[0], "--after-remove", scripts[1], "--description", (0, _appInfo().smarten)(target === "rpm" ? _this3.helper.getDescription(options) : `${synopsis || ""}\n ${_this3.helper.getDescription(options)}`), "--version", appInfo.version, "--package", artifactPath]; - (0, _appBuilder().objectToArgs)(args, fpmMetaInfoOptions); - - if (_builderUtil().debug.enabled) { - args.push("--log", "debug", "--debug"); - } - - const packageCategory = options.packageCategory; - - if (packageCategory != null) { - args.push("--category", packageCategory); - } - - const compression = options.compression; - - if (target === "deb") { - args.push("--deb-compression", compression || "xz"); - (0, _builderUtil().use)(options.priority, it => args.push("--deb-priority", it)); - } else if (target === "rpm") { - args.push("--rpm-compression", (compression === "xz" ? "xzmt" : compression) || "xzmt"); - args.push("--rpm-os", "linux"); - - if (synopsis != null) { - args.push("--rpm-summary", (0, _appInfo().smarten)(synopsis)); - } - } // noinspection JSDeprecatedSymbols - - - let depends = options.depends || packager.platformSpecificBuildOptions.depends; - - if (depends == null) { - if (target === "deb") { - depends = ["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3", "libxss1"]; - } else if (target === "pacman") { - // noinspection SpellCheckingInspection - depends = ["c-ares", "ffmpeg", "gtk3", "http-parser", "libevent", "libvpx", "libxslt", "libxss", "minizip", "nss", "re2", "snappy", "libnotify", "libappindicator-gtk2", "libappindicator-gtk3", "libappindicator-sharp"]; - } else if (target === "rpm") { - // noinspection SpellCheckingInspection - depends = ["libnotify", "libappindicator", "libXScrnSaver"]; - } else { - depends = []; - } - } else if (!Array.isArray(depends)) { - // noinspection SuspiciousTypeOfGuard - if (typeof depends === "string") { - depends = [depends]; - } else { - throw new Error(`depends must be Array or String, but specified as: ${depends}`); - } - } - - for (const dep of depends) { - args.push("--depends", dep); - } - - (0, _builderUtil().use)(packager.info.metadata.license, it => args.push("--license", it)); - (0, _builderUtil().use)(appInfo.buildNumber, it => args.push("--iteration", it)); - (0, _builderUtil().use)(options.fpm, it => args.push(...it)); - args.push(`${appOutDir}/=${_LinuxTargetHelper().installPrefix}/${appInfo.productFilename}`); - - for (const icon of yield _this3.helper.icons) { - const extWithDot = path.extname(icon.file); - const sizeName = extWithDot === ".svg" ? "scalable" : `${icon.size}x${icon.size}`; - args.push(`${icon.file}=/usr/share/icons/hicolor/${sizeName}/apps/${packager.executableName}${extWithDot}`); - } - - const desktopFilePath = yield _this3.helper.writeDesktopEntry(_this3.options); - args.push(`${desktopFilePath}=/usr/share/applications/${packager.executableName}.desktop`); - - if (packager.packagerOptions.effectiveOptionComputed != null && (yield packager.packagerOptions.effectiveOptionComputed([args, desktopFilePath]))) { - return; - } - - const env = Object.assign({}, process.env, { - FPM_COMPRESS_PROGRAM: _appBuilderBin().appBuilderPath, - SZA_PATH: _zipBin().path7za, - SZA_COMPRESSION_LEVEL: packager.compression === "store" ? "0" : "9", - SZA_ARCHIVE_TYPE: "xz" - }); // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary) - // so, for now, brew install rpm is still required. - - if (target !== "rpm" && (yield (0, _macosVersion().isMacOsSierra)())) { - const linuxToolsPath = yield (0, _tools().getLinuxToolsPath)(); - Object.assign(env, { - PATH: (0, _bundledTool().computeEnv)(process.env.PATH, [path.join(linuxToolsPath, "bin")]), - DYLD_LIBRARY_PATH: (0, _bundledTool().computeEnv)(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, "lib")]) - }); - } - - yield (0, _builderUtil().exec)((yield _tools().fpmPath.value), args, { - env - }); - yield packager.dispatchArtifactCreated(artifactPath, _this3, arch); - })(); - } - -} - -exports.default = FpmTarget; - -function writeConfigFile(_x, _x2, _x3) { - return _writeConfigFile.apply(this, arguments); -} function _writeConfigFile() { - _writeConfigFile = (0, _bluebirdLst().coroutine)(function* (tmpDir, templatePath, options) { - //noinspection JSUnusedLocalSymbols - function replacer(match, p1) { - if (p1 in options) { - return options[p1]; - } else { - throw new Error(`Macro ${p1} is not defined`); - } - } - - const config = (yield (0, _fsExtraP().readFile)(templatePath, "utf8")).replace(/\${([a-zA-Z]+)}/g, replacer).replace(/<%=([a-zA-Z]+)%>/g, (match, p1) => { - _builderUtil().log.warn("<%= varName %> is deprecated, please use ${varName} instead"); - - return replacer(match, p1.trim()); - }); - const outputPath = yield tmpDir.getTempFile({ - suffix: path.basename(templatePath, ".tpl") - }); - yield (0, _fsExtraP().outputFile)(outputPath, config); - return outputPath; - }); - return _writeConfigFile.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=fpm.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/fpm.js.map b/node_modules/app-builder-lib/out/targets/fpm.js.map deleted file mode 100644 index fc92d61..0000000 --- a/node_modules/app-builder-lib/out/targets/fp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debug, exec, log, TmpDir, toLinuxArchString, use } from \"builder-util\"\nimport { smarten } from \"../appInfo\"\nimport { objectToArgs } from \"../util/appBuilder\"\nimport { computeEnv } from \"../util/bundledTool\"\nimport { unlinkIfExists } from \"builder-util/out/fs\"\nimport { ensureDir, outputFile, readFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { DebOptions, LinuxTargetSpecificOptions } from \"..\"\nimport { Target } from \"../core\"\nimport * as errorMessages from \"../errorMessages\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { isMacOsSierra } from \"../util/macosVersion\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { installPrefix, LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { fpmPath, getLinuxToolsPath } from \"./tools\"\n\ninterface FpmOptions {\n maintainer: string | undefined\n vendor: string\n url: string\n}\n\nexport default class FpmTarget extends Target {\n readonly options: LinuxTargetSpecificOptions = {...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name]}\n\n private readonly scriptFiles: Promise>\n\n constructor(name: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(name, false)\n\n this.scriptFiles = this.createScripts()\n }\n\n private async createScripts(): Promise> {\n const defaultTemplatesDir = getTemplatePath(\"linux\")\n\n const packager = this.packager\n const templateOptions = {\n // old API compatibility\n executable: packager.executableName,\n productFilename: packager.appInfo.productFilename, ...packager.platformSpecificBuildOptions}\n\n function getResource(value: string | null | undefined, defaultFile: string) {\n if (value == null) {\n return path.join(defaultTemplatesDir, defaultFile)\n }\n return path.resolve(packager.projectDir, value)\n }\n\n return await Promise.all([\n writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterInstall, \"after-install.tpl\"), templateOptions),\n writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterRemove, \"after-remove.tpl\"), templateOptions)\n ])\n }\n\n checkOptions(): Promise {\n return this.computeFpmMetaInfoOptions()\n }\n\n private async computeFpmMetaInfoOptions(): Promise {\n const packager = this.packager\n const projectUrl = await packager.appInfo.computePackageUrl()\n const errors: Array = []\n if (projectUrl == null) {\n errors.push(\"Please specify project homepage, see https://electron.build/configuration/configuration#Metadata-homepage\")\n }\n\n const options = this.options\n let author = options.maintainer\n if (author == null) {\n const a = packager.info.metadata.author\n if (a == null || a.email == null) {\n errors.push(errorMessages.authorEmailIsMissed)\n }\n else {\n author = `${a.name} <${a.email}>`\n }\n }\n\n if (errors.length > 0) {\n throw new Error(errors.join(\"\\n\\n\"))\n }\n\n return {\n maintainer: author!!,\n url: projectUrl!!,\n vendor: options.vendor || author!!,\n }\n }\n\n async build(appOutDir: string, arch: Arch): Promise {\n const fpmMetaInfoOptions = await this.computeFpmMetaInfoOptions()\n\n const target = this.name\n\n // tslint:disable:no-invalid-template-strings\n let nameFormat = \"${name}-${version}-${arch}.${ext}\"\n let isUseArchIfX64 = false\n if (target === \"deb\") {\n nameFormat = \"${name}_${version}_${arch}.${ext}\"\n isUseArchIfX64 = true\n }\n else if (target === \"rpm\") {\n nameFormat = \"${name}-${version}.${arch}.${ext}\"\n isUseArchIfX64 = true\n }\n\n const packager = this.packager\n const artifactPath = path.join(this.outDir, packager.expandArtifactNamePattern(this.options, target, arch, nameFormat, !isUseArchIfX64))\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: target,\n file: artifactPath,\n arch,\n })\n\n await unlinkIfExists(artifactPath)\n if (packager.packagerOptions.prepackaged != null) {\n await ensureDir(this.outDir)\n }\n\n const scripts = await this.scriptFiles\n const appInfo = packager.appInfo\n const options = this.options\n const synopsis = options.synopsis\n const args = [\n \"-s\", \"dir\",\n \"-t\", target,\n \"--architecture\", (target === \"pacman\" && arch === Arch.ia32) ? \"i686\" : toLinuxArchString(arch),\n \"--name\", appInfo.linuxPackageName,\n \"--force\",\n \"--after-install\", scripts[0],\n \"--after-remove\", scripts[1],\n \"--description\", smarten(target === \"rpm\" ? this.helper.getDescription(options)! : `${synopsis || \"\"}\\n ${this.helper.getDescription(options)}`),\n \"--version\", appInfo.version,\n \"--package\", artifactPath,\n ]\n\n objectToArgs(args, fpmMetaInfoOptions as any)\n\n if (debug.enabled) {\n args.push(\n \"--log\", \"debug\",\n \"--debug\")\n }\n\n const packageCategory = options.packageCategory\n if (packageCategory != null) {\n args.push(\"--category\", packageCategory)\n }\n\n const compression = options.compression\n if (target === \"deb\") {\n args.push(\"--deb-compression\", compression || \"xz\")\n use((options as DebOptions).priority, it => args.push(\"--deb-priority\", it!))\n }\n else if (target === \"rpm\") {\n args.push(\"--rpm-compression\", (compression === \"xz\" ? \"xzmt\" : compression) || \"xzmt\")\n args.push(\"--rpm-os\", \"linux\")\n\n if (synopsis != null) {\n args.push(\"--rpm-summary\", smarten(synopsis))\n }\n }\n\n // noinspection JSDeprecatedSymbols\n let depends = options.depends || packager.platformSpecificBuildOptions.depends\n if (depends == null) {\n if (target === \"deb\") {\n depends = [\"gconf2\", \"gconf-service\", \"libnotify4\", \"libappindicator1\", \"libxtst6\", \"libnss3\", \"libxss1\"]\n }\n else if (target === \"pacman\") {\n // noinspection SpellCheckingInspection\n depends = [\"c-ares\", \"ffmpeg\", \"gtk3\", \"http-parser\", \"libevent\", \"libvpx\", \"libxslt\", \"libxss\", \"minizip\", \"nss\", \"re2\", \"snappy\", \"libnotify\", \"libappindicator-gtk2\", \"libappindicator-gtk3\", \"libappindicator-sharp\"]\n }\n else if (target === \"rpm\") {\n // noinspection SpellCheckingInspection\n depends = [\"libnotify\", \"libappindicator\", \"libXScrnSaver\"]\n }\n else {\n depends = []\n }\n }\n else if (!Array.isArray(depends)) {\n // noinspection SuspiciousTypeOfGuard\n if (typeof depends === \"string\") {\n depends = [depends as string]\n }\n else {\n throw new Error(`depends must be Array or String, but specified as: ${depends}`)\n }\n }\n\n for (const dep of depends) {\n args.push(\"--depends\", dep)\n }\n\n use(packager.info.metadata.license, it => args.push(\"--license\", it!))\n use(appInfo.buildNumber, it => args.push(\"--iteration\", it!))\n\n use(options.fpm, it => args.push(...it as any))\n\n args.push(`${appOutDir}/=${installPrefix}/${appInfo.productFilename}`)\n for (const icon of (await this.helper.icons)) {\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n args.push(`${icon.file}=/usr/share/icons/hicolor/${sizeName}/apps/${packager.executableName}${extWithDot}`)\n }\n\n const desktopFilePath = await this.helper.writeDesktopEntry(this.options)\n args.push(`${desktopFilePath}=/usr/share/applications/${packager.executableName}.desktop`)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && await packager.packagerOptions.effectiveOptionComputed([args, desktopFilePath])) {\n return\n }\n\n const env = {\n ...process.env,\n FPM_COMPRESS_PROGRAM: appBuilderPath,\n SZA_PATH: path7za,\n SZA_COMPRESSION_LEVEL: packager.compression === \"store\" ? \"0\" : \"9\",\n SZA_ARCHIVE_TYPE: \"xz\",\n }\n\n // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary)\n // so, for now, brew install rpm is still required.\n if (target !== \"rpm\" && await isMacOsSierra()) {\n const linuxToolsPath = await getLinuxToolsPath()\n Object.assign(env, {\n PATH: computeEnv(process.env.PATH, [path.join(linuxToolsPath, \"bin\")]),\n DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, \"lib\")]),\n })\n }\n await exec(await fpmPath.value, args, {env})\n\n await packager.dispatchArtifactCreated(artifactPath, this, arch)\n }\n}\n\nasync function writeConfigFile(tmpDir: TmpDir, templatePath: string, options: any): Promise {\n //noinspection JSUnusedLocalSymbols\n function replacer(match: string, p1: string) {\n if (p1 in options) {\n return options[p1]\n }\n else {\n throw new Error(`Macro ${p1} is not defined`)\n }\n }\n const config = (await readFile(templatePath, \"utf8\"))\n .replace(/\\${([a-zA-Z]+)}/g, replacer)\n .replace(/<%=([a-zA-Z]+)%>/g, (match, p1) => {\n log.warn(\"<%= varName %> is deprecated, please use ${varName} instead\")\n return replacer(match, p1.trim())\n })\n\n const outputPath = await tmpDir.getTempFile({suffix: path.basename(templatePath, \".tpl\")})\n await outputFile(outputPath, config)\n return outputPath\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.d.ts b/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.d.ts deleted file mode 100644 index c48d6bf..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Arch } from "builder-util"; -import { PackageFileInfo } from "builder-util-runtime"; -import { Target } from "../../core"; -import { WinPackager } from "../../winPackager"; -import { NsisOptions } from "./nsisOptions"; -import { AppPackageHelper } from "./nsisUtil"; -export declare class NsisTarget extends Target { - readonly packager: WinPackager; - readonly outDir: string; - protected readonly packageHelper: AppPackageHelper; - readonly options: NsisOptions; - /** @private */ - readonly archs: Map; - constructor(packager: WinPackager, outDir: string, targetName: string, packageHelper: AppPackageHelper); - build(appOutDir: string, arch: Arch): Promise; - readonly isBuildDifferentialAware: boolean; - private getPreCompressedFileExtensions; - /** @private */ - buildAppPackage(appOutDir: string, arch: Arch): Promise; - finishBuild(): Promise; - protected readonly installerFilenamePattern: string; - private readonly isPortable; - private buildInstaller; - protected generateGitHubInstallerName(): string; - private readonly isUnicodeEnabled; - readonly isWebInstaller: boolean; - private computeScriptAndSignUninstaller; - private computeVersionKey; - protected configureDefines(oneClick: boolean, defines: any): Promise; - private configureDefinesForAllTypeOfInstaller; - private executeMakensis; - private computeCommonInstallerScriptHeader; - private computeFinalScript; -} diff --git a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js b/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js deleted file mode 100644 index a498888..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js +++ /dev/null @@ -1,929 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NsisTarget = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _zipBin() { - const data = require("7zip-bin"); - - _zipBin = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _binDownload() { - const data = require("../../binDownload"); - - _binDownload = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _hash() { - const data = require("../../util/hash"); - - _hash = function () { - return data; - }; - - return data; -} - -var _debug2 = _interopRequireDefault(require("debug")); - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _core() { - const data = require("../../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _CommonWindowsInstallerConfiguration() { - const data = require("../../options/CommonWindowsInstallerConfiguration"); - - _CommonWindowsInstallerConfiguration = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("../../platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _timer() { - const data = require("../../util/timer"); - - _timer = function () { - return data; - }; - - return data; -} - -function _wine() { - const data = require("../../wine"); - - _wine = function () { - return data; - }; - - return data; -} - -function _archive() { - const data = require("../archive"); - - _archive = function () { - return data; - }; - - return data; -} - -function _differentialUpdateInfoBuilder() { - const data = require("../differentialUpdateInfoBuilder"); - - _differentialUpdateInfoBuilder = function () { - return data; - }; - - return data; -} - -function _targetUtil() { - const data = require("../targetUtil"); - - _targetUtil = function () { - return data; - }; - - return data; -} - -function _nsisLang() { - const data = require("./nsisLang"); - - _nsisLang = function () { - return data; - }; - - return data; -} - -function _nsisLicense() { - const data = require("./nsisLicense"); - - _nsisLicense = function () { - return data; - }; - - return data; -} - -function _nsisScriptGenerator() { - const data = require("./nsisScriptGenerator"); - - _nsisScriptGenerator = function () { - return data; - }; - - return data; -} - -function _nsisUtil() { - const data = require("./nsisUtil"); - - _nsisUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const debug = (0, _debug2.default)("electron-builder:nsis"); // noinspection SpellCheckingInspection - -const ELECTRON_BUILDER_NS_UUID = _builderUtilRuntime().UUID.parse("50e065bc-3134-11e6-9bab-38c9862bdaf3"); // noinspection SpellCheckingInspection - - -const nsisResourcePathPromise = new (_lazyVal().Lazy)(() => (0, _binDownload().getBinFromGithub)("nsis-resources", "3.3.0", "4okc98BD0v9xDcSjhPVhAkBMqos+FvD/5/H72fTTIwoHTuWd2WdD7r+1j72hxd+ZXxq1y3FRW0x6Z3jR0VfpMw==")); -const USE_NSIS_BUILT_IN_COMPRESSOR = false; - -class NsisTarget extends _core().Target { - constructor(packager, outDir, targetName, packageHelper) { - super(targetName); - this.packager = packager; - this.outDir = outDir; - this.packageHelper = packageHelper; - /** @private */ - - this.archs = new Map(); - this.packageHelper.refCount++; - this.options = targetName === "portable" ? Object.create(null) : Object.assign({}, this.packager.config.nsis, { - preCompressedFileExtensions: [".avi", ".mov", ".m4v", ".mp4", ".m4p", ".qt", ".mkv", ".webm", ".vmdk"] - }); - - if (targetName !== "nsis") { - Object.assign(this.options, this.packager.config[targetName === "nsis-web" ? "nsisWeb" : targetName]); - } - - const deps = packager.info.metadata.dependencies; - - if (deps != null && deps["electron-squirrel-startup"] != null) { - _builderUtil().log.warn('"electron-squirrel-startup" dependency is not required for NSIS'); - } - } - - build(appOutDir, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - _this.archs.set(arch, appOutDir); - })(); - } - - get isBuildDifferentialAware() { - return !this.isPortable && this.options.differentialPackage !== false; - } - - getPreCompressedFileExtensions() { - const result = this.isWebInstaller ? null : this.options.preCompressedFileExtensions; - return result == null ? null : (0, _builderUtil().asArray)(result).map(it => it.startsWith(".") ? it : `.${it}`); - } - /** @private */ - - - buildAppPackage(appOutDir, arch) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const options = _this2.options; - const packager = _this2.packager; - const isBuildDifferentialAware = _this2.isBuildDifferentialAware; - const format = !isBuildDifferentialAware && options.useZip ? "zip" : "7z"; - const archiveFile = path.join(_this2.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${_builderUtil().Arch[arch]}.nsis.${format}`); - - const preCompressedFileExtensions = _this2.getPreCompressedFileExtensions(); - - const archiveOptions = { - withoutDir: true, - compression: packager.compression, - excluded: preCompressedFileExtensions == null ? null : preCompressedFileExtensions.map(it => `*${it}`) - }; - const timer = (0, _timer().time)(`nsis package, ${_builderUtil().Arch[arch]}`); - yield (0, _archive().archive)(format, archiveFile, appOutDir, isBuildDifferentialAware ? (0, _differentialUpdateInfoBuilder().configureDifferentialAwareArchiveOptions)(archiveOptions) : archiveOptions); - timer.end(); - - if (isBuildDifferentialAware && _this2.isWebInstaller) { - const data = yield (0, _differentialUpdateInfoBuilder().appendBlockmap)(archiveFile); - return Object.assign({}, data, { - path: archiveFile - }); - } else { - return yield createPackageFileInfo(archiveFile); - } - })(); - } - - finishBuild() { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - try { - yield _this3.buildInstaller(); - } finally { - yield _this3.packageHelper.finishBuild(); - } - })(); - } - - get installerFilenamePattern() { - // tslint:disable:no-invalid-template-strings - return "${productName} " + (this.isPortable ? "" : "Setup ") + "${version}.${ext}"; - } - - get isPortable() { - return this.name === "portable"; - } - - buildInstaller() { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this4.packager; - const appInfo = packager.appInfo; - const options = _this4.options; - const installerFilename = packager.expandArtifactNamePattern(options, "exe", null, _this4.installerFilenamePattern); - const oneClick = options.oneClick !== false; - const installerPath = path.join(_this4.outDir, installerFilename); - const logFields = { - target: _this4.name, - file: _builderUtil().log.filePath(installerPath), - archs: Array.from(_this4.archs.keys()).map(it => _builderUtil().Arch[it]).join(", ") - }; - const isPerMachine = options.perMachine === true; - - if (!_this4.isPortable) { - logFields.oneClick = oneClick; - logFields.perMachine = isPerMachine; - } - - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: _this4.name, - file: installerPath, - arch: null - }, logFields); - - const guid = options.guid || _builderUtilRuntime().UUID.v5(appInfo.id, ELECTRON_BUILDER_NS_UUID); - - const uninstallAppKey = guid.replace(/\\/g, " - "); - const defines = { - APP_ID: appInfo.id, - APP_GUID: guid, - // Windows bug - entry in Software\Microsoft\Windows\CurrentVersion\Uninstall cannot have \ symbols (dir) - UNINSTALL_APP_KEY: uninstallAppKey, - PRODUCT_NAME: appInfo.productName, - PRODUCT_FILENAME: appInfo.productFilename, - APP_FILENAME: (0, _targetUtil().getWindowsInstallationDirName)(appInfo, !oneClick || isPerMachine), - APP_DESCRIPTION: appInfo.description, - VERSION: appInfo.version, - PROJECT_DIR: packager.projectDir, - BUILD_RESOURCES_DIR: packager.info.buildResourcesDir - }; - - if (uninstallAppKey !== guid) { - defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${guid}`; - } - - const commands = { - OutFile: `"${installerPath}"`, - VIProductVersion: appInfo.getVersionInWeirdWindowsForm(), - VIAddVersionKey: _this4.computeVersionKey(), - Unicode: _this4.isUnicodeEnabled - }; - const isPortable = _this4.isPortable; - const iconPath = (isPortable ? null : yield packager.getResource(options.installerIcon, "installerIcon.ico")) || (yield packager.getIconPath()); - - if (iconPath != null) { - if (isPortable) { - commands.Icon = `"${iconPath}"`; - } else { - defines.MUI_ICON = iconPath; - defines.MUI_UNICON = iconPath; - } - } - - const packageFiles = {}; - let estimatedSize = 0; - - if (_this4.isPortable && options.useZip) { - for (const [arch, dir] of _this4.archs.entries()) { - defines[arch === _builderUtil().Arch.x64 ? "APP_DIR_64" : "APP_DIR_32"] = dir; - } - } else if (USE_NSIS_BUILT_IN_COMPRESSOR && _this4.archs.size === 1) { - defines.APP_BUILD_DIR = _this4.archs.get(_this4.archs.keys().next().value); - } else { - yield _bluebirdLst().default.map(_this4.archs.keys(), - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (arch) { - const fileInfo = yield _this4.packageHelper.packArch(arch, _this4); - const file = fileInfo.path; - const defineKey = arch === _builderUtil().Arch.x64 ? "APP_64" : "APP_32"; - defines[defineKey] = file; - defines[`${defineKey}_NAME`] = path.basename(file); // nsis expect a hexadecimal string - - defines[`${defineKey}_HASH`] = Buffer.from(fileInfo.sha512, "base64").toString("hex").toUpperCase(); - - if (_this4.isWebInstaller) { - yield packager.dispatchArtifactCreated(file, _this4, arch); - packageFiles[_builderUtil().Arch[arch]] = fileInfo; - } - - const archiveInfo = (yield (0, _builderUtil().exec)(_zipBin().path7za, ["l", file])).trim(); // after adding blockmap data will be "Warnings: 1" in the end of output - - const match = archiveInfo.match(/(\d+)\s+\d+\s+\d+\s+files/); - - if (match == null) { - _builderUtil().log.warn({ - output: archiveInfo - }, "cannot compute size of app package"); - } else { - estimatedSize += parseInt(match[1], 10); - } - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); - } - - _this4.configureDefinesForAllTypeOfInstaller(defines); - - if (isPortable) { - defines.REQUEST_EXECUTION_LEVEL = options.requestExecutionLevel || "user"; - } else { - yield _this4.configureDefines(oneClick, defines); - } - - if (estimatedSize !== 0) { - // in kb - defines.ESTIMATED_SIZE = Math.round(estimatedSize / 1024); - } - - if (packager.compression === "store") { - commands.SetCompress = "off"; - } else { - // difference - 33.540 vs 33.601, only 61 KB (but zip is faster to decompress) - // do not use /SOLID - "With solid compression, files are uncompressed to temporary file before they are copied to their final destination", - // it is not good for portable installer (where built-in NSIS compression is used). http://forums.winamp.com/showpost.php?p=2982902&postcount=6 - commands.SetCompressor = "zlib"; - - if (!_this4.isWebInstaller) { - defines.COMPRESS = "auto"; - } - } - - debug(defines); - debug(commands); - - if (packager.packagerOptions.effectiveOptionComputed != null && (yield packager.packagerOptions.effectiveOptionComputed([defines, commands]))) { - return; - } - - const sharedHeader = yield _this4.computeCommonInstallerScriptHeader(); - const script = isPortable ? yield (0, _fsExtraP().readFile)(path.join(_nsisUtil().nsisTemplatesDir, "portable.nsi"), "utf8") : yield _this4.computeScriptAndSignUninstaller(defines, commands, installerPath, sharedHeader); - yield _this4.executeMakensis(defines, commands, sharedHeader + (yield _this4.computeFinalScript(script, true))); - yield Promise.all([packager.sign(installerPath), defines.UNINSTALLER_OUT_FILE == null ? Promise.resolve() : (0, _fsExtraP().unlink)(defines.UNINSTALLER_OUT_FILE)]); - const safeArtifactName = (0, _platformPackager().isSafeGithubName)(installerFilename) ? installerFilename : _this4.generateGitHubInstallerName(); - let updateInfo; - - if (_this4.isWebInstaller) { - updateInfo = (0, _differentialUpdateInfoBuilder().createNsisWebDifferentialUpdateInfo)(installerPath, packageFiles); - } else if (_this4.isBuildDifferentialAware) { - updateInfo = yield (0, _differentialUpdateInfoBuilder().createBlockmap)(installerPath, _this4, packager, safeArtifactName); - } - - if (updateInfo != null && isPerMachine && oneClick) { - updateInfo.isAdminRightsRequired = true; - } - - yield packager.info.callArtifactBuildCompleted({ - file: installerPath, - updateInfo, - target: _this4, - packager, - arch: _this4.archs.size === 1 ? _this4.archs.keys().next().value : null, - safeArtifactName, - isWriteUpdateInfo: !_this4.isPortable - }); - })(); - } - - generateGitHubInstallerName() { - const appInfo = this.packager.appInfo; - const classifier = appInfo.name.toLowerCase() === appInfo.name ? "setup-" : "Setup-"; - return `${appInfo.name}-${this.isPortable ? "" : classifier}${appInfo.version}.exe`; - } - - get isUnicodeEnabled() { - return this.options.unicode !== false; - } - - get isWebInstaller() { - return false; - } - - computeScriptAndSignUninstaller(defines, commands, installerPath, sharedHeader) { - var _this5 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this5.packager; - const customScriptPath = yield packager.getResource(_this5.options.script, "installer.nsi"); - const script = yield (0, _fsExtraP().readFile)(customScriptPath || path.join(_nsisUtil().nsisTemplatesDir, "installer.nsi"), "utf8"); - - if (customScriptPath != null) { - _builderUtil().log.info({ - reason: "custom NSIS script is used" - }, "uninstaller is not signed by electron-builder"); - - return script; - } // https://github.com/electron-userland/electron-builder/issues/2103 - // it is more safe and reliable to write uninstaller to our out dir - - - const uninstallerPath = path.join(_this5.outDir, `.__uninstaller-${_this5.name}-${_this5.packager.appInfo.sanitizedName}.exe`); - const isWin = process.platform === "win32"; - defines.BUILD_UNINSTALLER = null; - defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join("Z:", uninstallerPath); - yield _this5.executeMakensis(defines, commands, sharedHeader + (yield _this5.computeFinalScript(script, false))); - yield (0, _wine().execWine)(installerPath); - yield packager.sign(uninstallerPath, " Signing NSIS uninstaller"); - delete defines.BUILD_UNINSTALLER; // platform-specific path, not wine - - defines.UNINSTALLER_OUT_FILE = uninstallerPath; - return script; - })(); - } - - computeVersionKey() { - // Error: invalid VIProductVersion format, should be X.X.X.X - // so, we must strip beta - const localeId = this.options.language || "1033"; - const appInfo = this.packager.appInfo; - const versionKey = [`/LANG=${localeId} ProductName "${appInfo.productName}"`, `/LANG=${localeId} ProductVersion "${appInfo.version}"`, `/LANG=${localeId} LegalCopyright "${appInfo.copyright}"`, `/LANG=${localeId} FileDescription "${appInfo.description}"`, `/LANG=${localeId} FileVersion "${appInfo.buildVersion}"`]; - (0, _builderUtil().use)(this.packager.platformSpecificBuildOptions.legalTrademarks, it => versionKey.push(`/LANG=${localeId} LegalTrademarks "${it}"`)); - (0, _builderUtil().use)(appInfo.companyName, it => versionKey.push(`/LANG=${localeId} CompanyName "${it}"`)); - return versionKey; - } - - configureDefines(oneClick, defines) { - const packager = this.packager; - const options = this.options; - const asyncTaskManager = new (_builderUtil().AsyncTaskManager)(packager.info.cancellationToken); - - if (oneClick) { - defines.ONE_CLICK = null; - - if (options.runAfterFinish !== false) { - defines.RUN_AFTER_FINISH = null; - } - - asyncTaskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const installerHeaderIcon = yield packager.getResource(options.installerHeaderIcon, "installerHeaderIcon.ico"); - - if (installerHeaderIcon != null) { - defines.HEADER_ICO = installerHeaderIcon; - } - })); - } else { - if (options.runAfterFinish === false) { - defines.HIDE_RUN_AFTER_FINISH = null; - } - - asyncTaskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const installerHeader = yield packager.getResource(options.installerHeader, "installerHeader.bmp"); - - if (installerHeader != null) { - defines.MUI_HEADERIMAGE = null; - defines.MUI_HEADERIMAGE_RIGHT = null; - defines.MUI_HEADERIMAGE_BITMAP = installerHeader; - } - })); - asyncTaskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const bitmap = (yield packager.getResource(options.installerSidebar, "installerSidebar.bmp")) || "${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp"; - defines.MUI_WELCOMEFINISHPAGE_BITMAP = bitmap; - defines.MUI_UNWELCOMEFINISHPAGE_BITMAP = (yield packager.getResource(options.uninstallerSidebar, "uninstallerSidebar.bmp")) || bitmap; - })); - - if (options.allowElevation !== false) { - defines.MULTIUSER_INSTALLMODE_ALLOW_ELEVATION = null; - } - } - - if (options.perMachine === true) { - defines.INSTALL_MODE_PER_ALL_USERS = null; - } - - if (!oneClick || options.perMachine === true) { - defines.INSTALL_MODE_PER_ALL_USERS_REQUIRED = null; - } - - if (options.allowToChangeInstallationDirectory) { - if (oneClick) { - throw new (_builderUtil().InvalidConfigurationError)("allowToChangeInstallationDirectory makes sense only for assisted installer (please set oneClick to false)"); - } - - defines.allowToChangeInstallationDirectory = null; - } - - const commonOptions = (0, _CommonWindowsInstallerConfiguration().getEffectiveOptions)(options, packager); - - if (commonOptions.menuCategory != null) { - defines.MENU_FILENAME = commonOptions.menuCategory; - } - - defines.SHORTCUT_NAME = commonOptions.shortcutName; - - if (options.deleteAppDataOnUninstall) { - defines.DELETE_APP_DATA_ON_UNINSTALL = null; - } - - asyncTaskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const uninstallerIcon = yield packager.getResource(options.uninstallerIcon, "uninstallerIcon.ico"); - - if (uninstallerIcon != null) { - // we don't need to copy MUI_UNICON (defaults to app icon), so, we have 2 defines - defines.UNINSTALLER_ICON = uninstallerIcon; - defines.MUI_UNICON = uninstallerIcon; - } - })); - defines.UNINSTALL_DISPLAY_NAME = packager.expandMacro(options.uninstallDisplayName || "${productName} ${version}", null, {}, false); - - if (commonOptions.isCreateDesktopShortcut === _CommonWindowsInstallerConfiguration().DesktopShortcutCreationPolicy.NEVER) { - defines.DO_NOT_CREATE_DESKTOP_SHORTCUT = null; - } - - if (commonOptions.isCreateDesktopShortcut === _CommonWindowsInstallerConfiguration().DesktopShortcutCreationPolicy.ALWAYS) { - defines.RECREATE_DESKTOP_SHORTCUT = null; - } - - if (!commonOptions.isCreateStartMenuShortcut) { - defines.DO_NOT_CREATE_START_MENU_SHORTCUT = null; - } - - if (options.displayLanguageSelector === true) { - defines.DISPLAY_LANG_SELECTOR = null; - } - - return asyncTaskManager.awaitTasks(); - } - - configureDefinesForAllTypeOfInstaller(defines) { - const appInfo = this.packager.appInfo; - const companyName = appInfo.companyName; - - if (companyName != null) { - defines.COMPANY_NAME = companyName; - } // electron uses product file name as app data, define it as well to remove on uninstall - - - if (defines.APP_FILENAME !== appInfo.productFilename) { - defines.APP_PRODUCT_FILENAME = appInfo.productFilename; - } - - if (this.isWebInstaller) { - defines.APP_PACKAGE_STORE_FILE = `${appInfo.updaterCacheDirName}\\${_builderUtilRuntime().CURRENT_APP_PACKAGE_FILE_NAME}`; - } else { - defines.APP_INSTALLER_STORE_FILE = `${appInfo.updaterCacheDirName}\\${_builderUtilRuntime().CURRENT_APP_INSTALLER_FILE_NAME}`; - } - - if (!this.isWebInstaller && defines.APP_BUILD_DIR == null) { - const options = this.options; - - if (options.useZip) { - defines.ZIP_COMPRESSION = null; - } - - defines.COMPRESSION_METHOD = options.useZip ? "zip" : "7z"; - } - } - - executeMakensis(defines, commands, script) { - var _this6 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const args = _this6.options.warningsAsErrors === false ? [] : ["-WX"]; - - for (const name of Object.keys(defines)) { - const value = defines[name]; - - if (value == null) { - args.push(`-D${name}`); - } else { - args.push(`-D${name}=${value}`); - } - } - - for (const name of Object.keys(commands)) { - const value = commands[name]; - - if (Array.isArray(value)) { - for (const c of value) { - args.push(`-X${name} ${c}`); - } - } else { - args.push(`-X${name} ${value}`); - } - } - - args.push("-"); - - if (_this6.packager.debugLogger.isEnabled) { - _this6.packager.debugLogger.add("nsis.script", script); - } - - const nsisPath = yield _nsisUtil().NSIS_PATH.value; - const command = path.join(nsisPath, process.platform === "darwin" ? "mac" : process.platform === "win32" ? "Bin" : "linux", process.platform === "win32" ? "makensis.exe" : "makensis"); - yield (0, _builderUtil().spawnAndWrite)(command, args, script, { - // we use NSIS_CONFIG_CONST_DATA_PATH=no to build makensis on Linux, but in any case it doesn't use stubs as MacOS/Windows version, so, we explicitly set NSISDIR - env: Object.assign({}, process.env, { - NSISDIR: nsisPath - }), - cwd: _nsisUtil().nsisTemplatesDir - }); - })(); - } - - computeCommonInstallerScriptHeader() { - var _this7 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this7.packager; - const options = _this7.options; - const scriptGenerator = new (_nsisScriptGenerator().NsisScriptGenerator)(); - const langConfigurator = new (_nsisLang().LangConfigurator)(options); - scriptGenerator.include(path.join(_nsisUtil().nsisTemplatesDir, "include", "StdUtils.nsh")); - const includeDir = path.join(_nsisUtil().nsisTemplatesDir, "include"); - scriptGenerator.addIncludeDir(includeDir); - scriptGenerator.flags(["updated", "force-run", "keep-shortcuts", "no-desktop-shortcut", "delete-app-data", "allusers", "currentuser"]); - (0, _nsisLang().createAddLangsMacro)(scriptGenerator, langConfigurator); - const taskManager = new (_builderUtil().AsyncTaskManager)(packager.info.cancellationToken); - const pluginArch = _this7.isUnicodeEnabled ? "x86-unicode" : "x86-ansi"; - taskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - scriptGenerator.addPluginDir(pluginArch, path.join((yield nsisResourcePathPromise.value), "plugins", pluginArch)); - })); - taskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const userPluginDir = path.join(packager.info.buildResourcesDir, pluginArch); - const stat = yield (0, _fs().statOrNull)(userPluginDir); - - if (stat != null && stat.isDirectory()) { - scriptGenerator.addPluginDir(pluginArch, userPluginDir); - } - })); - taskManager.addTask((0, _nsisLang().addCustomMessageFileInclude)("messages.yml", packager, scriptGenerator, langConfigurator)); - - if (!_this7.isPortable) { - if (options.oneClick === false) { - taskManager.addTask((0, _nsisLang().addCustomMessageFileInclude)("assistedMessages.yml", packager, scriptGenerator, langConfigurator)); - } - - taskManager.add( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const customInclude = yield packager.getResource(_this7.options.include, "installer.nsh"); - - if (customInclude != null) { - scriptGenerator.addIncludeDir(packager.info.buildResourcesDir); - scriptGenerator.include(customInclude); - } - })); - } - - yield taskManager.awaitTasks(); - return scriptGenerator.build(); - })(); - } - - computeFinalScript(originalScript, isInstaller) { - var _this8 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this8.packager; - const options = _this8.options; - const langConfigurator = new (_nsisLang().LangConfigurator)(options); - const scriptGenerator = new (_nsisScriptGenerator().NsisScriptGenerator)(); - const taskManager = new (_builderUtil().AsyncTaskManager)(packager.info.cancellationToken); - - if (isInstaller) { - // http://stackoverflow.com/questions/997456/nsis-license-file-based-on-language-selection - taskManager.add(() => (0, _nsisLicense().computeLicensePage)(packager, options, scriptGenerator, langConfigurator.langs)); - } - - yield taskManager.awaitTasks(); - - if (_this8.isPortable) { - return scriptGenerator.build() + originalScript; - } - - const preCompressedFileExtensions = _this8.getPreCompressedFileExtensions(); - - if (preCompressedFileExtensions != null && preCompressedFileExtensions.length !== 0) { - for (const [arch, dir] of _this8.archs.entries()) { - yield generateForPreCompressed(preCompressedFileExtensions, dir, arch, scriptGenerator); - } - } - - const fileAssociations = packager.fileAssociations; - - if (fileAssociations.length !== 0) { - scriptGenerator.include(path.join(path.join(_nsisUtil().nsisTemplatesDir, "include"), "FileAssociation.nsh")); - - if (isInstaller) { - const registerFileAssociationsScript = new (_nsisScriptGenerator().NsisScriptGenerator)(); - - for (const item of fileAssociations) { - const extensions = (0, _builderUtil().asArray)(item.ext).map(_platformPackager().normalizeExt); - - for (const ext of extensions) { - const customIcon = yield packager.getResource((0, _builderUtil().getPlatformIconFileName)(item.icon, false), `${extensions[0]}.ico`); - let installedIconPath = "$appExe,0"; - - if (customIcon != null) { - installedIconPath = `$INSTDIR\\resources\\${path.basename(customIcon)}`; - registerFileAssociationsScript.file(installedIconPath, customIcon); - } - - const icon = `"${installedIconPath}"`; - const commandText = `"Open with ${packager.appInfo.productName}"`; - const command = '"$appExe $\\"%1$\\""'; - registerFileAssociationsScript.insertMacro("APP_ASSOCIATE", `"${ext}" "${item.name || ext}" "${item.description || ""}" ${icon} ${commandText} ${command}`); - } - } - - scriptGenerator.macro("registerFileAssociations", registerFileAssociationsScript); - } else { - const unregisterFileAssociationsScript = new (_nsisScriptGenerator().NsisScriptGenerator)(); - - for (const item of fileAssociations) { - for (const ext of (0, _builderUtil().asArray)(item.ext)) { - unregisterFileAssociationsScript.insertMacro("APP_UNASSOCIATE", `"${(0, _platformPackager().normalizeExt)(ext)}" "${item.name || ext}"`); - } - } - - scriptGenerator.macro("unregisterFileAssociations", unregisterFileAssociationsScript); - } - } - - return scriptGenerator.build() + originalScript; - })(); - } - -} - -exports.NsisTarget = NsisTarget; - -function generateForPreCompressed(_x2, _x3, _x4, _x5) { - return _generateForPreCompressed.apply(this, arguments); -} - -function _generateForPreCompressed() { - _generateForPreCompressed = (0, _bluebirdLst().coroutine)(function* (preCompressedFileExtensions, dir, arch, scriptGenerator) { - const resourcesDir = path.join(dir, "resources"); - const dirInfo = yield (0, _fs().statOrNull)(resourcesDir); - - if (dirInfo == null || !dirInfo.isDirectory()) { - return; - } - - const nodeModules = `${path.sep}node_modules`; - const preCompressedAssets = yield (0, _fs().walk)(resourcesDir, (file, stat) => { - if (stat.isDirectory()) { - return !file.endsWith(nodeModules); - } else { - return preCompressedFileExtensions.some(it => file.endsWith(it)); - } - }); - - if (preCompressedAssets.length !== 0) { - const macro = new (_nsisScriptGenerator().NsisScriptGenerator)(); - - for (const file of preCompressedAssets) { - macro.file(`$INSTDIR\\${path.relative(dir, file).replace(/\//g, "\\")}`, file); - } - - scriptGenerator.macro(`customFiles_${_builderUtil().Arch[arch]}`, macro); - } - }); - return _generateForPreCompressed.apply(this, arguments); -} - -function createPackageFileInfo(_x6) { - return _createPackageFileInfo.apply(this, arguments); -} function _createPackageFileInfo() { - _createPackageFileInfo = (0, _bluebirdLst().coroutine)(function* (file) { - return { - path: file, - size: (yield (0, _fsExtraP().stat)(file)).size, - sha512: yield (0, _hash().hashFile)(file) - }; - }); - return _createPackageFileInfo.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=NsisTarget.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js.map b/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js.map deleted file mode 100644 index 5e7f064..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/targets/nsis/NsisTarget.ts"],"names":[],"mapp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AAD,EAAO,IAAP,KAAe;AAClE,UAAI,IAAI,CAAC,WAAL,EAAJ,EAAwB;AACtB,eAAO,CAAC,IAAI,CAAC,QAAL,CAAc,WAAd,CAAR;AACD,OAFD,MAGK;AACH,eAAO,2BAA2B,CAAC,IAA5B,CAAiC,EAAE,IAAI,IAAI,CAAC,QAAL,CAAc,EAAd,CAAvC,CAAP;AACD;AACF,KAPiC,CAAlC;;AASA,QAAI,mBAAmB,CAAC,MAApB,KAA+B,CAAnC,EAAsC;AACpC,YAAM,KAAK,GAAG,KAAI,0CAAJ,GAAd;;AACA,WAAK,MAAM,IAAX,IAAmB,mBAAnB,EAAwC;AACtC,QAAA,KAAK,CAAC,IAAN,CAAW,aAAa,IAAI,CAAC,QAAL,CAAc,GAAd,EAAmB,IAAnB,EAAyB,OAAzB,CAAiC,KAAjC,EAAwC,IAAxC,CAA6C,EAArE,EAAyE,IAAzE;AACD;;AACD,MAAA,eAAe,CAAC,KAAhB,CAAsB,eAAe,oBAAK,IAAL,CAAU,EAA/C,EAAmD,KAAnD;AACD;AACF,G;;;;SAEc,qB;;;;;;yDAAf,WAAqC,IAArC,EAAiD;AAC/C,WAAO;AACL,MAAA,IAAI,EAAE,IADD;AAEL,MAAA,IAAI,EAAE,OAAO,sBAAK,IAAL,CAAP,EAAmB,IAFpB;AAGL,MAAA,MAAM,QAAQ,sBAAS,IAAT;AAHT,KAAP;AAKD,G","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, getPlatformIconFileName, InvalidConfigurationError, log, spawnAndWrite, use, exec } from \"builder-util\"\nimport { PackageFileInfo, UUID, CURRENT_APP_PACKAGE_FILE_NAME, CURRENT_APP_INSTALLER_FILE_NAME } from \"builder-util-runtime\"\nimport { getBinFromGithub } from \"../../binDownload\"\nimport { statOrNull, walk } from \"builder-util/out/fs\"\nimport { hashFile } from \"../../util/hash\"\nimport _debug from \"debug\"\nimport { readFile, stat, unlink } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Target } from \"../../core\"\nimport { DesktopShortcutCreationPolicy, getEffectiveOptions } from \"../../options/CommonWindowsInstallerConfiguration\"\nimport { isSafeGithubName, normalizeExt } from \"../../platformPackager\"\nimport { time } from \"../../util/timer\"\nimport { execWine } from \"../../wine\"\nimport { WinPackager } from \"../../winPackager\"\nimport { archive, ArchiveOptions } from \"../archive\"\nimport { appendBlockmap, configureDifferentialAwareArchiveOptions, createBlockmap, createNsisWebDifferentialUpdateInfo } from \"../differentialUpdateInfoBuilder\"\nimport { getWindowsInstallationDirName } from \"../targetUtil\"\nimport { addCustomMessageFileInclude, createAddLangsMacro, LangConfigurator } from \"./nsisLang\"\nimport { computeLicensePage } from \"./nsisLicense\"\nimport { NsisOptions, PortableOptions } from \"./nsisOptions\"\nimport { NsisScriptGenerator } from \"./nsisScriptGenerator\"\nimport { AppPackageHelper, NSIS_PATH, nsisTemplatesDir } from \"./nsisUtil\"\n\nconst debug = _debug(\"electron-builder:nsis\")\n\n// noinspection SpellCheckingInspection\nconst ELECTRON_BUILDER_NS_UUID = UUID.parse(\"50e065bc-3134-11e6-9bab-38c9862bdaf3\")\n\n// noinspection SpellCheckingInspection\nconst nsisResourcePathPromise = new Lazy(() => getBinFromGithub(\"nsis-resources\", \"3.3.0\", \"4okc98BD0v9xDcSjhPVhAkBMqos+FvD/5/H72fTTIwoHTuWd2WdD7r+1j72hxd+ZXxq1y3FRW0x6Z3jR0VfpMw==\"))\n\nconst USE_NSIS_BUILT_IN_COMPRESSOR = false\n\nexport class NsisTarget extends Target {\n readonly options: NsisOptions\n\n /** @private */\n readonly archs: Map = new Map()\n\n constructor(readonly packager: WinPackager, readonly outDir: string, targetName: string, protected readonly packageHelper: AppPackageHelper) {\n super(targetName)\n\n this.packageHelper.refCount++\n\n this.options = targetName === \"portable\" ? Object.create(null) : {\n ...this.packager.config.nsis,\n preCompressedFileExtensions: [\".avi\", \".mov\", \".m4v\", \".mp4\", \".m4p\", \".qt\", \".mkv\", \".webm\", \".vmdk\"],\n }\n\n if (targetName !== \"nsis\") {\n Object.assign(this.options, (this.packager.config as any)[targetName === \"nsis-web\" ? \"nsisWeb\" : targetName])\n }\n\n const deps = packager.info.metadata.dependencies\n if (deps != null && deps[\"electron-squirrel-startup\"] != null) {\n log.warn('\"electron-squirrel-startup\" dependency is not required for NSIS')\n }\n }\n\n async build(appOutDir: string, arch: Arch) {\n this.archs.set(arch, appOutDir)\n }\n\n get isBuildDifferentialAware() {\n return !this.isPortable && this.options.differentialPackage !== false\n }\n\n private getPreCompressedFileExtensions(): Array | null {\n const result = this.isWebInstaller ? null : this.options.preCompressedFileExtensions\n return result == null ? null : asArray(result).map(it => it.startsWith(\".\") ? it : `.${it}`)\n }\n\n /** @private */\n async buildAppPackage(appOutDir: string, arch: Arch): Promise {\n const options = this.options\n const packager = this.packager\n\n const isBuildDifferentialAware = this.isBuildDifferentialAware\n const format = !isBuildDifferentialAware && options.useZip ? \"zip\" : \"7z\"\n const archiveFile = path.join(this.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${Arch[arch]}.nsis.${format}`)\n const preCompressedFileExtensions = this.getPreCompressedFileExtensions()\n const archiveOptions: ArchiveOptions = {\n withoutDir: true,\n compression: packager.compression,\n excluded: preCompressedFileExtensions == null ? null : preCompressedFileExtensions.map(it => `*${it}`)\n }\n\n const timer = time(`nsis package, ${Arch[arch]}`)\n await archive(format, archiveFile, appOutDir, isBuildDifferentialAware ? configureDifferentialAwareArchiveOptions(archiveOptions) : archiveOptions)\n timer.end()\n\n if (isBuildDifferentialAware && this.isWebInstaller) {\n const data = await appendBlockmap(archiveFile)\n return {\n ...data,\n path: archiveFile,\n }\n }\n else {\n return await createPackageFileInfo(archiveFile)\n }\n }\n\n async finishBuild(): Promise {\n try {\n await this.buildInstaller()\n }\n finally {\n await this.packageHelper.finishBuild()\n }\n }\n\n protected get installerFilenamePattern(): string {\n // tslint:disable:no-invalid-template-strings\n return \"${productName} \" + (this.isPortable ? \"\" : \"Setup \") + \"${version}.${ext}\"\n }\n\n private get isPortable() {\n return this.name === \"portable\"\n }\n\n private async buildInstaller(): Promise {\n const packager = this.packager\n const appInfo = packager.appInfo\n const options = this.options\n const installerFilename = packager.expandArtifactNamePattern(options, \"exe\", null, this.installerFilenamePattern)\n const oneClick = options.oneClick !== false\n const installerPath = path.join(this.outDir, installerFilename)\n\n const logFields: any = {\n target: this.name,\n file: log.filePath(installerPath),\n archs: Array.from(this.archs.keys()).map(it => Arch[it]).join(\", \"),\n }\n const isPerMachine = options.perMachine === true\n if (!this.isPortable) {\n logFields.oneClick = oneClick\n logFields.perMachine = isPerMachine\n }\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: this.name,\n file: installerPath,\n arch: null,\n }, logFields)\n\n const guid = options.guid || UUID.v5(appInfo.id, ELECTRON_BUILDER_NS_UUID)\n const uninstallAppKey = guid.replace(/\\\\/g, \" - \")\n const defines: any = {\n APP_ID: appInfo.id,\n APP_GUID: guid,\n // Windows bug - entry in Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall cannot have \\ symbols (dir)\n UNINSTALL_APP_KEY: uninstallAppKey,\n PRODUCT_NAME: appInfo.productName,\n PRODUCT_FILENAME: appInfo.productFilename,\n APP_FILENAME: getWindowsInstallationDirName(appInfo, !oneClick || isPerMachine),\n APP_DESCRIPTION: appInfo.description,\n VERSION: appInfo.version,\n\n PROJECT_DIR: packager.projectDir,\n BUILD_RESOURCES_DIR: packager.info.buildResourcesDir,\n }\n if (uninstallAppKey !== guid) {\n defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\${guid}`\n }\n\n const commands: any = {\n OutFile: `\"${installerPath}\"`,\n VIProductVersion: appInfo.getVersionInWeirdWindowsForm(),\n VIAddVersionKey: this.computeVersionKey(),\n Unicode: this.isUnicodeEnabled,\n }\n\n const isPortable = this.isPortable\n const iconPath = (isPortable ? null : await packager.getResource(options.installerIcon, \"installerIcon.ico\")) || await packager.getIconPath()\n if (iconPath != null) {\n if (isPortable) {\n commands.Icon = `\"${iconPath}\"`\n }\n else {\n defines.MUI_ICON = iconPath\n defines.MUI_UNICON = iconPath\n }\n }\n\n const packageFiles: { [arch: string]: PackageFileInfo } = {}\n let estimatedSize = 0\n if (this.isPortable && options.useZip) {\n for (const [arch, dir] of this.archs.entries()) {\n defines[arch === Arch.x64 ? \"APP_DIR_64\" : \"APP_DIR_32\"] = dir\n }\n }\n else if (USE_NSIS_BUILT_IN_COMPRESSOR && this.archs.size === 1) {\n defines.APP_BUILD_DIR = this.archs.get(this.archs.keys().next().value)\n }\n else {\n await BluebirdPromise.map(this.archs.keys(), async arch => {\n const fileInfo = await this.packageHelper.packArch(arch, this)\n const file = fileInfo.path\n const defineKey = arch === Arch.x64 ? \"APP_64\" : \"APP_32\"\n defines[defineKey] = file\n defines[`${defineKey}_NAME`] = path.basename(file)\n // nsis expect a hexadecimal string\n defines[`${defineKey}_HASH`] = Buffer.from(fileInfo.sha512, \"base64\").toString(\"hex\").toUpperCase()\n\n if (this.isWebInstaller) {\n await packager.dispatchArtifactCreated(file, this, arch)\n packageFiles[Arch[arch]] = fileInfo\n }\n\n const archiveInfo = (await exec(path7za, [\"l\", file])).trim()\n // after adding blockmap data will be \"Warnings: 1\" in the end of output\n const match = archiveInfo.match(/(\\d+)\\s+\\d+\\s+\\d+\\s+files/)\n if (match == null) {\n log.warn({output: archiveInfo}, \"cannot compute size of app package\")\n }\n else {\n estimatedSize += parseInt(match[1], 10)\n }\n })\n }\n\n this.configureDefinesForAllTypeOfInstaller(defines)\n if (isPortable) {\n defines.REQUEST_EXECUTION_LEVEL = (options as PortableOptions).requestExecutionLevel || \"user\"\n }\n else {\n await this.configureDefines(oneClick, defines)\n }\n\n if (estimatedSize !== 0) {\n // in kb\n defines.ESTIMATED_SIZE = Math.round(estimatedSize / 1024)\n }\n\n if (packager.compression === \"store\") {\n commands.SetCompress = \"off\"\n }\n else {\n // difference - 33.540 vs 33.601, only 61 KB (but zip is faster to decompress)\n // do not use /SOLID - \"With solid compression, files are uncompressed to temporary file before they are copied to their final destination\",\n // it is not good for portable installer (where built-in NSIS compression is used). http://forums.winamp.com/showpost.php?p=2982902&postcount=6\n commands.SetCompressor = \"zlib\"\n if (!this.isWebInstaller) {\n defines.COMPRESS = \"auto\"\n }\n }\n\n debug(defines)\n debug(commands)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && await packager.packagerOptions.effectiveOptionComputed([defines, commands])) {\n return\n }\n\n const sharedHeader = await this.computeCommonInstallerScriptHeader()\n const script = isPortable ? await readFile(path.join(nsisTemplatesDir, \"portable.nsi\"), \"utf8\") : await this.computeScriptAndSignUninstaller(defines, commands, installerPath, sharedHeader)\n await this.executeMakensis(defines, commands, sharedHeader + await this.computeFinalScript(script, true))\n await Promise.all([packager.sign(installerPath), defines.UNINSTALLER_OUT_FILE == null ? Promise.resolve() : unlink(defines.UNINSTALLER_OUT_FILE)])\n\n const safeArtifactName = isSafeGithubName(installerFilename) ? installerFilename : this.generateGitHubInstallerName()\n\n let updateInfo: any\n if (this.isWebInstaller) {\n updateInfo = createNsisWebDifferentialUpdateInfo(installerPath, packageFiles)\n }\n else if (this.isBuildDifferentialAware) {\n updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName)\n }\n\n if (updateInfo != null && isPerMachine && oneClick) {\n updateInfo.isAdminRightsRequired = true\n }\n\n await packager.info.callArtifactBuildCompleted({\n file: installerPath,\n updateInfo,\n target: this,\n packager,\n arch: this.archs.size === 1 ? this.archs.keys().next().value : null,\n safeArtifactName,\n isWriteUpdateInfo: !this.isPortable,\n })\n }\n\n protected generateGitHubInstallerName() {\n const appInfo = this.packager.appInfo\n const classifier = appInfo.name.toLowerCase() === appInfo.name ? \"setup-\" : \"Setup-\"\n return `${appInfo.name}-${this.isPortable ? \"\" : classifier}${appInfo.version}.exe`\n }\n\n private get isUnicodeEnabled() {\n return this.options.unicode !== false\n }\n\n get isWebInstaller(): boolean {\n return false\n }\n\n private async computeScriptAndSignUninstaller(defines: any, commands: any, installerPath: string, sharedHeader: string) {\n const packager = this.packager\n const customScriptPath = await packager.getResource(this.options.script, \"installer.nsi\")\n const script = await readFile(customScriptPath || path.join(nsisTemplatesDir, \"installer.nsi\"), \"utf8\")\n\n if (customScriptPath != null) {\n log.info({reason: \"custom NSIS script is used\"}, \"uninstaller is not signed by electron-builder\")\n return script\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2103\n // it is more safe and reliable to write uninstaller to our out dir\n const uninstallerPath = path.join(this.outDir, `.__uninstaller-${this.name}-${this.packager.appInfo.sanitizedName}.exe`)\n const isWin = process.platform === \"win32\"\n defines.BUILD_UNINSTALLER = null\n defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join(\"Z:\", uninstallerPath)\n await this.executeMakensis(defines, commands, sharedHeader + await this.computeFinalScript(script, false))\n await execWine(installerPath)\n await packager.sign(uninstallerPath, \" Signing NSIS uninstaller\")\n\n delete defines.BUILD_UNINSTALLER\n // platform-specific path, not wine\n defines.UNINSTALLER_OUT_FILE = uninstallerPath\n return script\n }\n\n private computeVersionKey() {\n // Error: invalid VIProductVersion format, should be X.X.X.X\n // so, we must strip beta\n const localeId = this.options.language || \"1033\"\n const appInfo = this.packager.appInfo\n const versionKey = [\n `/LANG=${localeId} ProductName \"${appInfo.productName}\"`,\n `/LANG=${localeId} ProductVersion \"${appInfo.version}\"`,\n `/LANG=${localeId} LegalCopyright \"${appInfo.copyright}\"`,\n `/LANG=${localeId} FileDescription \"${appInfo.description}\"`,\n `/LANG=${localeId} FileVersion \"${appInfo.buildVersion}\"`,\n ]\n use(this.packager.platformSpecificBuildOptions.legalTrademarks, it => versionKey.push(`/LANG=${localeId} LegalTrademarks \"${it}\"`))\n use(appInfo.companyName, it => versionKey.push(`/LANG=${localeId} CompanyName \"${it}\"`))\n return versionKey\n }\n\n protected configureDefines(oneClick: boolean, defines: any): Promise {\n const packager = this.packager\n const options = this.options\n\n const asyncTaskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n if (oneClick) {\n defines.ONE_CLICK = null\n\n if (options.runAfterFinish !== false) {\n defines.RUN_AFTER_FINISH = null\n }\n\n asyncTaskManager.add(async () => {\n const installerHeaderIcon = await packager.getResource(options.installerHeaderIcon, \"installerHeaderIcon.ico\")\n if (installerHeaderIcon != null) {\n defines.HEADER_ICO = installerHeaderIcon\n }\n })\n }\n else {\n if (options.runAfterFinish === false) {\n defines.HIDE_RUN_AFTER_FINISH = null\n }\n\n asyncTaskManager.add(async () => {\n const installerHeader = await packager.getResource(options.installerHeader, \"installerHeader.bmp\")\n if (installerHeader != null) {\n defines.MUI_HEADERIMAGE = null\n defines.MUI_HEADERIMAGE_RIGHT = null\n defines.MUI_HEADERIMAGE_BITMAP = installerHeader\n }\n })\n\n asyncTaskManager.add(async () => {\n const bitmap = (await packager.getResource(options.installerSidebar, \"installerSidebar.bmp\")) || \"${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp\"\n defines.MUI_WELCOMEFINISHPAGE_BITMAP = bitmap\n defines.MUI_UNWELCOMEFINISHPAGE_BITMAP = (await packager.getResource(options.uninstallerSidebar, \"uninstallerSidebar.bmp\")) || bitmap\n })\n\n if (options.allowElevation !== false) {\n defines.MULTIUSER_INSTALLMODE_ALLOW_ELEVATION = null\n }\n }\n\n if (options.perMachine === true) {\n defines.INSTALL_MODE_PER_ALL_USERS = null\n }\n\n if (!oneClick || options.perMachine === true) {\n defines.INSTALL_MODE_PER_ALL_USERS_REQUIRED = null\n }\n\n if (options.allowToChangeInstallationDirectory) {\n if (oneClick) {\n throw new InvalidConfigurationError(\"allowToChangeInstallationDirectory makes sense only for assisted installer (please set oneClick to false)\")\n }\n defines.allowToChangeInstallationDirectory = null\n }\n\n const commonOptions = getEffectiveOptions(options, packager)\n\n if (commonOptions.menuCategory != null) {\n defines.MENU_FILENAME = commonOptions.menuCategory\n }\n\n defines.SHORTCUT_NAME = commonOptions.shortcutName\n\n if (options.deleteAppDataOnUninstall) {\n defines.DELETE_APP_DATA_ON_UNINSTALL = null\n }\n\n asyncTaskManager.add(async () => {\n const uninstallerIcon = await packager.getResource(options.uninstallerIcon, \"uninstallerIcon.ico\")\n if (uninstallerIcon != null) {\n // we don't need to copy MUI_UNICON (defaults to app icon), so, we have 2 defines\n defines.UNINSTALLER_ICON = uninstallerIcon\n defines.MUI_UNICON = uninstallerIcon\n }\n })\n\n defines.UNINSTALL_DISPLAY_NAME = packager.expandMacro(options.uninstallDisplayName || \"${productName} ${version}\", null, {}, false)\n if (commonOptions.isCreateDesktopShortcut === DesktopShortcutCreationPolicy.NEVER) {\n defines.DO_NOT_CREATE_DESKTOP_SHORTCUT = null\n }\n if (commonOptions.isCreateDesktopShortcut === DesktopShortcutCreationPolicy.ALWAYS) {\n defines.RECREATE_DESKTOP_SHORTCUT = null\n }\n if (!commonOptions.isCreateStartMenuShortcut) {\n defines.DO_NOT_CREATE_START_MENU_SHORTCUT = null\n }\n\n if (options.displayLanguageSelector === true) {\n defines.DISPLAY_LANG_SELECTOR = null\n }\n\n return asyncTaskManager.awaitTasks()\n }\n\n private configureDefinesForAllTypeOfInstaller(defines: any) {\n const appInfo = this.packager.appInfo\n const companyName = appInfo.companyName\n if (companyName != null) {\n defines.COMPANY_NAME = companyName\n }\n\n // electron uses product file name as app data, define it as well to remove on uninstall\n if (defines.APP_FILENAME !== appInfo.productFilename) {\n defines.APP_PRODUCT_FILENAME = appInfo.productFilename\n }\n\n if (this.isWebInstaller) {\n defines.APP_PACKAGE_STORE_FILE = `${appInfo.updaterCacheDirName}\\\\${CURRENT_APP_PACKAGE_FILE_NAME}`\n }\n else {\n defines.APP_INSTALLER_STORE_FILE = `${appInfo.updaterCacheDirName}\\\\${CURRENT_APP_INSTALLER_FILE_NAME}`\n }\n\n if (!this.isWebInstaller && defines.APP_BUILD_DIR == null) {\n const options = this.options\n if (options.useZip) {\n defines.ZIP_COMPRESSION = null\n }\n\n defines.COMPRESSION_METHOD = options.useZip ? \"zip\" : \"7z\"\n }\n }\n\n private async executeMakensis(defines: any, commands: any, script: string) {\n const args: Array = (this.options.warningsAsErrors === false) ? [] : [\"-WX\"]\n for (const name of Object.keys(defines)) {\n const value = defines[name]\n if (value == null) {\n args.push(`-D${name}`)\n }\n else {\n args.push(`-D${name}=${value}`)\n }\n }\n\n for (const name of Object.keys(commands)) {\n const value = commands[name]\n if (Array.isArray(value)) {\n for (const c of value) {\n args.push(`-X${name} ${c}`)\n }\n }\n else {\n args.push(`-X${name} ${value}`)\n }\n }\n\n args.push(\"-\")\n\n if (this.packager.debugLogger.isEnabled) {\n this.packager.debugLogger.add(\"nsis.script\", script)\n }\n\n const nsisPath = await NSIS_PATH.value\n const command = path.join(nsisPath, process.platform === \"darwin\" ? \"mac\" : (process.platform === \"win32\" ? \"Bin\" : \"linux\"), process.platform === \"win32\" ? \"makensis.exe\" : \"makensis\")\n await spawnAndWrite(command, args, script, {\n // we use NSIS_CONFIG_CONST_DATA_PATH=no to build makensis on Linux, but in any case it doesn't use stubs as MacOS/Windows version, so, we explicitly set NSISDIR\n env: {...process.env, NSISDIR: nsisPath},\n cwd: nsisTemplatesDir,\n })\n }\n\n private async computeCommonInstallerScriptHeader() {\n const packager = this.packager\n const options = this.options\n const scriptGenerator = new NsisScriptGenerator()\n const langConfigurator = new LangConfigurator(options)\n\n scriptGenerator.include(path.join(nsisTemplatesDir, \"include\", \"StdUtils.nsh\"))\n\n const includeDir = path.join(nsisTemplatesDir, \"include\")\n scriptGenerator.addIncludeDir(includeDir)\n scriptGenerator.flags([\"updated\", \"force-run\", \"keep-shortcuts\", \"no-desktop-shortcut\", \"delete-app-data\", \"allusers\", \"currentuser\"])\n\n createAddLangsMacro(scriptGenerator, langConfigurator)\n\n const taskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n const pluginArch = this.isUnicodeEnabled ? \"x86-unicode\" : \"x86-ansi\"\n taskManager.add(async () => {\n scriptGenerator.addPluginDir(pluginArch, path.join(await nsisResourcePathPromise.value, \"plugins\", pluginArch))\n })\n\n taskManager.add(async () => {\n const userPluginDir = path.join(packager.info.buildResourcesDir, pluginArch)\n const stat = await statOrNull(userPluginDir)\n if (stat != null && stat.isDirectory()) {\n scriptGenerator.addPluginDir(pluginArch, userPluginDir)\n }\n })\n\n taskManager.addTask(addCustomMessageFileInclude(\"messages.yml\", packager, scriptGenerator, langConfigurator))\n\n if (!this.isPortable) {\n if (options.oneClick === false) {\n taskManager.addTask(addCustomMessageFileInclude(\"assistedMessages.yml\", packager, scriptGenerator, langConfigurator))\n }\n\n taskManager.add(async () => {\n const customInclude = await packager.getResource(this.options.include, \"installer.nsh\")\n if (customInclude != null) {\n scriptGenerator.addIncludeDir(packager.info.buildResourcesDir)\n scriptGenerator.include(customInclude)\n }\n })\n }\n\n await taskManager.awaitTasks()\n return scriptGenerator.build()\n }\n\n private async computeFinalScript(originalScript: string, isInstaller: boolean) {\n const packager = this.packager\n const options = this.options\n const langConfigurator = new LangConfigurator(options)\n\n const scriptGenerator = new NsisScriptGenerator()\n const taskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n if (isInstaller) {\n // http://stackoverflow.com/questions/997456/nsis-license-file-based-on-language-selection\n taskManager.add(() => computeLicensePage(packager, options, scriptGenerator, langConfigurator.langs))\n }\n\n await taskManager.awaitTasks()\n\n if (this.isPortable) {\n return scriptGenerator.build() + originalScript\n }\n\n const preCompressedFileExtensions = this.getPreCompressedFileExtensions()\n if (preCompressedFileExtensions != null && preCompressedFileExtensions.length !== 0) {\n for (const [arch, dir] of this.archs.entries()) {\n await generateForPreCompressed(preCompressedFileExtensions, dir, arch, scriptGenerator)\n }\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length !== 0) {\n\n scriptGenerator.include(path.join(path.join(nsisTemplatesDir, \"include\"), \"FileAssociation.nsh\"))\n if (isInstaller) {\n const registerFileAssociationsScript = new NsisScriptGenerator()\n for (const item of fileAssociations) {\n const extensions = asArray(item.ext).map(normalizeExt)\n for (const ext of extensions) {\n const customIcon = await packager.getResource(getPlatformIconFileName(item.icon, false), `${extensions[0]}.ico`)\n let installedIconPath = \"$appExe,0\"\n if (customIcon != null) {\n installedIconPath = `$INSTDIR\\\\resources\\\\${path.basename(customIcon)}`\n registerFileAssociationsScript.file(installedIconPath, customIcon)\n }\n\n const icon = `\"${installedIconPath}\"`\n const commandText = `\"Open with ${packager.appInfo.productName}\"`\n const command = '\"$appExe $\\\\\"%1$\\\\\"\"'\n registerFileAssociationsScript.insertMacro(\"APP_ASSOCIATE\", `\"${ext}\" \"${item.name || ext}\" \"${item.description || \"\"}\" ${icon} ${commandText} ${command}`)\n }\n }\n scriptGenerator.macro(\"registerFileAssociations\", registerFileAssociationsScript)\n }\n else {\n const unregisterFileAssociationsScript = new NsisScriptGenerator()\n for (const item of fileAssociations) {\n for (const ext of asArray(item.ext)) {\n unregisterFileAssociationsScript.insertMacro(\"APP_UNASSOCIATE\", `\"${normalizeExt(ext)}\" \"${item.name || ext}\"`)\n }\n }\n scriptGenerator.macro(\"unregisterFileAssociations\", unregisterFileAssociationsScript)\n }\n }\n\n return scriptGenerator.build() + originalScript\n }\n}\n\nasync function generateForPreCompressed(preCompressedFileExtensions: Array, dir: string, arch: Arch, scriptGenerator: NsisScriptGenerator) {\n const resourcesDir = path.join(dir, \"resources\")\n const dirInfo = await statOrNull(resourcesDir)\n if (dirInfo == null || !dirInfo.isDirectory()) {\n return\n }\n\n const nodeModules = `${path.sep}node_modules`\n const preCompressedAssets = await walk(resourcesDir, (file, stat) => {\n if (stat.isDirectory()) {\n return !file.endsWith(nodeModules)\n }\n else {\n return preCompressedFileExtensions.some(it => file.endsWith(it))\n }\n })\n\n if (preCompressedAssets.length !== 0) {\n const macro = new NsisScriptGenerator()\n for (const file of preCompressedAssets) {\n macro.file(`$INSTDIR\\\\${path.relative(dir, file).replace(/\\//g, \"\\\\\")}`, file)\n }\n scriptGenerator.macro(`customFiles_${Arch[arch]}`, macro)\n }\n}\n\nasync function createPackageFileInfo(file: string): Promise {\n return {\n path: file,\n size: (await stat(file)).size,\n sha512: await hashFile(file),\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.d.ts b/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.d.ts deleted file mode 100644 index e563177..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { WinPackager } from "../../winPackager"; -import { NsisTarget } from "./NsisTarget"; -import { AppPackageHelper } from "./nsisUtil"; -/** @private */ -export declare class WebInstallerTarget extends NsisTarget { - constructor(packager: WinPackager, outDir: string, targetName: string, packageHelper: AppPackageHelper); - readonly isWebInstaller: boolean; - protected configureDefines(oneClick: boolean, defines: any): Promise; - protected readonly installerFilenamePattern: string; - protected generateGitHubInstallerName(): string; -} diff --git a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js b/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js deleted file mode 100644 index d03b7cd..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.WebInstallerTarget = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _PublishManager() { - const data = require("../../publish/PublishManager"); - - _PublishManager = function () { - return data; - }; - - return data; -} - -function _NsisTarget() { - const data = require("./NsisTarget"); - - _NsisTarget = function () { - return data; - }; - - return data; -} - -/** @private */ -class WebInstallerTarget extends _NsisTarget().NsisTarget { - constructor(packager, outDir, targetName, packageHelper) { - super(packager, outDir, targetName, packageHelper); - } - - get isWebInstaller() { - return true; - } - - configureDefines(oneClick, defines) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - //noinspection ES6MissingAwait - yield _NsisTarget().NsisTarget.prototype.configureDefines.call(_this, oneClick, defines); - const packager = _this.packager; - const options = _this.options; - let appPackageUrl = options.appPackageUrl; - - if (appPackageUrl == null) { - const publishConfigs = yield (0, _PublishManager().getPublishConfigsForUpdateInfo)(packager, (yield (0, _PublishManager().getPublishConfigs)(packager, packager.info.config, null, false)), null); - - if (publishConfigs == null || publishConfigs.length === 0) { - throw new Error("Cannot compute app package download URL"); - } - - appPackageUrl = (0, _PublishManager().computeDownloadUrl)(publishConfigs[0], null, packager); - defines.APP_PACKAGE_URL_IS_INCOMLETE = null; - } - - defines.APP_PACKAGE_URL = appPackageUrl; - })(); - } - - get installerFilenamePattern() { - // tslint:disable:no-invalid-template-strings - return "${productName} Web Setup ${version}.${ext}"; - } - - generateGitHubInstallerName() { - const appInfo = this.packager.appInfo; - const classifier = appInfo.name.toLowerCase() === appInfo.name ? "web-setup" : "WebSetup"; - return `${appInfo.name}-${classifier}-${appInfo.version}.exe`; - } - -} exports.WebInstallerTarget = WebInstallerTarget; -// __ts-babel@6.0.4 -//# sourceMappingURL=WebInstallerTarget.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js.map b/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js.map deleted file mode 100644 index eac6a36..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/targets/nsis/WebInstallerTarget.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AACM,MAAO,kBAAP,SAAkC,wBAAlC,CAA4C;AAChD,EAAA,WAAA,CAAY,QAAZ,EAAmC,MAAnC,EAAmD,UAAnD,EAAuE,aAAvE,EAAsG;AACpG,UAAM,QAAN,EAAgB,MA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OAAO,MAAvD;AACD;;AAxC+C,C","sourcesContent":["import { computeDownloadUrl, getPublishConfigs, getPublishConfigsForUpdateInfo } from \"../../publish/PublishManager\"\nimport { WinPackager } from \"../../winPackager\"\nimport { NsisWebOptions } from \"./nsisOptions\"\nimport { NsisTarget } from \"./NsisTarget\"\nimport { AppPackageHelper } from \"./nsisUtil\"\n\n/** @private */\nexport class WebInstallerTarget extends NsisTarget {\n constructor(packager: WinPackager, outDir: string, targetName: string, packageHelper: AppPackageHelper) {\n super(packager, outDir, targetName, packageHelper)\n }\n\n get isWebInstaller(): boolean {\n return true\n }\n\n protected async configureDefines(oneClick: boolean, defines: any): Promise {\n //noinspection ES6MissingAwait\n await (NsisTarget.prototype as WebInstallerTarget).configureDefines.call(this, oneClick, defines)\n\n const packager = this.packager\n const options = this.options as NsisWebOptions\n\n let appPackageUrl = options.appPackageUrl\n if (appPackageUrl == null) {\n const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, packager.info.config, null, false), null)\n if (publishConfigs == null || publishConfigs.length === 0) {\n throw new Error(\"Cannot compute app package download URL\")\n }\n\n appPackageUrl = computeDownloadUrl(publishConfigs[0], null, packager)\n\n defines.APP_PACKAGE_URL_IS_INCOMLETE = null\n }\n\n defines.APP_PACKAGE_URL = appPackageUrl\n }\n\n protected get installerFilenamePattern(): string {\n // tslint:disable:no-invalid-template-strings\n return \"${productName} Web Setup ${version}.${ext}\"\n }\n\n protected generateGitHubInstallerName(): string {\n const appInfo = this.packager.appInfo\n const classifier = appInfo.name.toLowerCase() === appInfo.name ? \"web-setup\" : \"WebSetup\"\n return `${appInfo.name}-${classifier}-${appInfo.version}.exe`\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisLang.d.ts b/node_modules/app-builder-lib/out/targets/nsis/nsisLang.d.ts deleted file mode 100644 index 4e65310..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisLang.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PlatformPackager } from "../../platformPackager"; -import { NsisOptions } from "./nsisOptions"; -import { NsisScriptGenerator } from "./nsisScriptGenerator"; -export declare class LangConfigurator { - readonly isMultiLang: boolean; - readonly langs: Array; - constructor(options: NsisOptions); -} -export declare function createAddLangsMacro(scriptGenerator: NsisScriptGenerator, langConfigurator: LangConfigurator): void; -export declare function addCustomMessageFileInclude(input: string, packager: PlatformPackager, scriptGenerator: NsisScriptGenerator, langConfigurator: LangConfigurator): Promise; diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js b/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js deleted file mode 100644 index 52aa669..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createAddLangsMacro = createAddLangsMacro; -exports.addCustomMessageFileInclude = addCustomMessageFileInclude; -exports.LangConfigurator = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _langs() { - const data = require("../../util/langs"); - - _langs = function () { - return data; - }; - - return data; -} - -var _debug2 = _interopRequireDefault(require("debug")); - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _jsYaml() { - const data = require("js-yaml"); - - _jsYaml = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _nsisUtil() { - const data = require("./nsisUtil"); - - _nsisUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const debug = (0, _debug2.default)("electron-builder:nsis"); - -class LangConfigurator { - constructor(options) { - const rawList = options.installerLanguages; - - if (options.unicode === false || rawList === null || Array.isArray(rawList) && rawList.length === 0) { - this.isMultiLang = false; - } else { - this.isMultiLang = options.multiLanguageInstaller !== false; - } - - if (this.isMultiLang) { - this.langs = rawList == null ? _langs().bundledLanguages.slice() : (0, _builderUtil().asArray)(rawList).map(it => (0, _langs().toLangWithRegion)(it.replace("-", "_"))); - } else { - this.langs = ["en_US"]; - } - } - -} - -exports.LangConfigurator = LangConfigurator; - -function createAddLangsMacro(scriptGenerator, langConfigurator) { - const result = []; - - for (const langWithRegion of langConfigurator.langs) { - let name; - - if (langWithRegion === "zh_CN") { - name = "SimpChinese"; - } else if (langWithRegion === "zh_TW") { - name = "TradChinese"; - } else if (langWithRegion === "nb_NO") { - name = "Norwegian"; - } else if (langWithRegion === "pt_BR") { - name = "PortugueseBR"; - } else { - const lang = langWithRegion.substring(0, langWithRegion.indexOf("_")); - name = _langs().langIdToName[lang]; - - if (name == null) { - throw new Error(`Language name is unknown for ${lang}`); - } - - if (name === "Spanish") { - name = "SpanishInternational"; - } - } - - result.push(`!insertmacro MUI_LANGUAGE "${name}"`); - } - - scriptGenerator.macro("addLangs", result); -} - -function writeCustomLangFile(_x, _x2) { - return _writeCustomLangFile.apply(this, arguments); -} - -function _writeCustomLangFile() { - _writeCustomLangFile = (0, _bluebirdLst().coroutine)(function* (data, packager) { - const file = yield packager.getTempFile("messages.nsh"); - yield (0, _fsExtraP().outputFile)(file, data); - return file; - }); - return _writeCustomLangFile.apply(this, arguments); -} - -function addCustomMessageFileInclude(_x3, _x4, _x5, _x6) { - return _addCustomMessageFileInclude.apply(this, arguments); -} - -function _addCustomMessageFileInclude() { - _addCustomMessageFileInclude = (0, _bluebirdLst().coroutine)(function* (input, packager, scriptGenerator, langConfigurator) { - const data = (0, _jsYaml().safeLoad)((yield (0, _fsExtraP().readFile)(path.join(_nsisUtil().nsisTemplatesDir, input), "utf-8"))); - const instructions = computeCustomMessageTranslations(data, langConfigurator).join("\n"); - debug(instructions); - scriptGenerator.include((yield writeCustomLangFile(instructions, packager))); - }); - return _addCustomMessageFileInclude.apply(this, arguments); -} - -function computeCustomMessageTranslations(messages, langConfigurator) { - const result = []; - const includedLangs = new Set(langConfigurator.langs); - - for (const messageId of Object.keys(messages)) { - const langToTranslations = messages[messageId]; - const unspecifiedLangs = new Set(langConfigurator.langs); - - for (const lang of Object.keys(langToTranslations)) { - const langWithRegion = (0, _langs().toLangWithRegion)(lang); - - if (!includedLangs.has(langWithRegion)) { - continue; - } - - const value = langToTranslations[lang]; - - if (value == null) { - throw new Error(`${messageId} not specified for ${lang}`); - } - - result.push(`LangString ${messageId} ${_langs().lcid[langWithRegion]} "${value.replace(/\n/g, "$\\r$\\n")}"`); - unspecifiedLangs.delete(langWithRegion); - } - - if (langConfigurator.isMultiLang) { - const defaultTranslation = langToTranslations.en.replace(/\n/g, "$\\r$\\n"); - - for (const langWithRegion of unspecifiedLangs) { - result.push(`LangString ${messageId} ${_langs().lcid[langWithRegion]} "${defaultTranslation}"`); - } - } - } - - return result; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=nsisLang.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js.map b/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js.map deleted file mode 100644 index ec47fba..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/targets/nsis/nsisLang.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;A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from \"builder-util\"\nimport { bundledLanguages, langIdToName, lcid, toLangWithRegion } from \"../../util/langs\"\nimport _debug from \"debug\"\nimport { outputFile, readFile } from \"fs-extra-p\"\nimport { safeLoad } from \"js-yaml\"\nimport * as path from \"path\"\nimport { PlatformPackager } from \"../../platformPackager\"\nimport { NsisOptions } from \"./nsisOptions\"\nimport { NsisScriptGenerator } from \"./nsisScriptGenerator\"\nimport { nsisTemplatesDir } from \"./nsisUtil\"\n\nconst debug = _debug(\"electron-builder:nsis\")\n\nexport class LangConfigurator {\n readonly isMultiLang: boolean\n readonly langs: Array\n\n constructor(options: NsisOptions) {\n const rawList = options.installerLanguages\n\n if (options.unicode === false || rawList === null || (Array.isArray(rawList) && rawList.length === 0)) {\n this.isMultiLang = false\n }\n else {\n this.isMultiLang = options.multiLanguageInstaller !== false\n }\n\n if (this.isMultiLang) {\n this.langs = rawList == null ? bundledLanguages.slice() : asArray(rawList)\n .map(it => toLangWithRegion(it.replace(\"-\", \"_\")))\n }\n else {\n this.langs = [\"en_US\"]\n }\n }\n}\n\nexport function createAddLangsMacro(scriptGenerator: NsisScriptGenerator, langConfigurator: LangConfigurator) {\n const result: Array = []\n for (const langWithRegion of langConfigurator.langs) {\n let name: string\n if (langWithRegion === \"zh_CN\") {\n name = \"SimpChinese\"\n }\n else if (langWithRegion === \"zh_TW\") {\n name = \"TradChinese\"\n }\n else if (langWithRegion === \"nb_NO\") {\n name = \"Norwegian\"\n }\n else if (langWithRegion === \"pt_BR\") {\n name = \"PortugueseBR\"\n }\n else {\n const lang = langWithRegion.substring(0, langWithRegion.indexOf(\"_\"))\n name = (langIdToName as any)[lang]\n if (name == null) {\n throw new Error(`Language name is unknown for ${lang}`)\n }\n\n if (name === \"Spanish\") {\n name = \"SpanishInternational\"\n }\n }\n result.push(`!insertmacro MUI_LANGUAGE \"${name}\"`)\n }\n\n scriptGenerator.macro(\"addLangs\", result)\n}\n\nasync function writeCustomLangFile(data: string, packager: PlatformPackager) {\n const file = await packager.getTempFile(\"messages.nsh\")\n await outputFile(file, data)\n return file\n}\n\nexport async function addCustomMessageFileInclude(input: string, packager: PlatformPackager, scriptGenerator: NsisScriptGenerator, langConfigurator: LangConfigurator) {\n const data = safeLoad(await readFile(path.join(nsisTemplatesDir, input), \"utf-8\"))\n const instructions = computeCustomMessageTranslations(data, langConfigurator).join(\"\\n\")\n debug(instructions)\n scriptGenerator.include(await writeCustomLangFile(instructions, packager))\n}\n\nfunction computeCustomMessageTranslations(messages: any, langConfigurator: LangConfigurator): Array {\n const result: Array = []\n const includedLangs = new Set(langConfigurator.langs)\n for (const messageId of Object.keys(messages)) {\n const langToTranslations = messages[messageId]\n const unspecifiedLangs = new Set(langConfigurator.langs)\n for (const lang of Object.keys(langToTranslations)) {\n const langWithRegion = toLangWithRegion(lang)\n\n if (!includedLangs.has(langWithRegion)) {\n continue\n }\n\n const value = langToTranslations[lang]\n if (value == null) {\n throw new Error(`${messageId} not specified for ${lang}`)\n }\n\n result.push(`LangString ${messageId} ${lcid[langWithRegion]} \"${value.replace(/\\n/g, \"$\\\\r$\\\\n\")}\"`)\n unspecifiedLangs.delete(langWithRegion)\n }\n\n if (langConfigurator.isMultiLang) {\n const defaultTranslation = langToTranslations.en.replace(/\\n/g, \"$\\\\r$\\\\n\")\n for (const langWithRegion of unspecifiedLangs) {\n result.push(`LangString ${messageId} ${lcid[langWithRegion]} \"${defaultTranslation}\"`)\n }\n }\n }\n return result\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.d.ts b/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.d.ts deleted file mode 100644 index fedb716..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { WinPackager } from "../../winPackager"; -import { NsisOptions } from "./nsisOptions"; -import { NsisScriptGenerator } from "./nsisScriptGenerator"; -export declare function computeLicensePage(packager: WinPackager, options: NsisOptions, scriptGenerator: NsisScriptGenerator, languages: Array): Promise; diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js b/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js deleted file mode 100644 index 2b0c855..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.computeLicensePage = computeLicensePage; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _langs() { - const data = require("../../util/langs"); - - _langs = function () { - return data; - }; - - return data; -} - -function _license() { - const data = require("../../util/license"); - - _license = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _nsisUtil() { - const data = require("./nsisUtil"); - - _nsisUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function computeLicensePage(_x, _x2, _x3, _x4) { - return _computeLicensePage.apply(this, arguments); -} function _computeLicensePage() { - _computeLicensePage = (0, _bluebirdLst().coroutine)(function* (packager, options, scriptGenerator, languages) { - const license = yield (0, _license().getNotLocalizedLicenseFile)(options.license, packager); - - if (license != null) { - let licensePage; - - if (license.endsWith(".html")) { - licensePage = ["!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow", "Function LicenseShow", " FindWindow $R0 `#32770` `` $HWNDPARENT", " GetDlgItem $R0 $R0 1000", "EmbedHTML::Load /replace $R0 file://$PLUGINSDIR\\license.html", "FunctionEnd", `!insertmacro MUI_PAGE_LICENSE "${path.join(_nsisUtil().nsisTemplatesDir, "empty-license.txt")}"`]; - } else { - licensePage = [`!insertmacro MUI_PAGE_LICENSE "${license}"`]; - } - - scriptGenerator.macro("licensePage", licensePage); - - if (license.endsWith(".html")) { - scriptGenerator.macro("addLicenseFiles", [`File /oname=$PLUGINSDIR\\license.html "${license}"`]); - } - - return; - } - - const licenseFiles = yield (0, _license().getLicenseFiles)(packager); - - if (licenseFiles.length === 0) { - return; - } - - const licensePage = []; - const unspecifiedLangs = new Set(languages); - let defaultFile = null; - - for (const item of licenseFiles) { - unspecifiedLangs.delete(item.langWithRegion); - - if (defaultFile == null) { - defaultFile = item.file; - } - - licensePage.push(`LicenseLangString MUILicense ${_langs().lcid[item.langWithRegion] || item.lang} "${item.file}"`); - } - - for (const l of unspecifiedLangs) { - licensePage.push(`LicenseLangString MUILicense ${_langs().lcid[l]} "${defaultFile}"`); - } - - licensePage.push('!insertmacro MUI_PAGE_LICENSE "$(MUILicense)"'); - scriptGenerator.macro("licensePage", licensePage); - }); - return _computeLicensePage.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=nsisLicense.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js.map b/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js.map deleted file mode 100644 index 993ef22..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/targets/nsis/nsisLicense.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;SAEsB,kB;;;;;;sDAAf,WAAkC,QAAlC,EAAyD,OAAzD,EAA+E,eAA/E,EAAqH,SAArH,EAA6I;AAClJ,UAAM,OAAO,SAAS,2CAA2B,OAAO,CAAC,OAAnC,EAA4C,QAA5C,CAAtB;;A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C,IAAZ,CAAiB,gCAAgC,cAAK,CAAL,CAAO,KAAK,WAAW,GAAxE;AACD;;AAED,IAAA,WAAW,CAAC,IAAZ,CAAiB,+CAAjB;AACA,IAAA,eAAe,CAAC,KAAhB,CAAsB,aAAtB,EAAqC,WAArC;AACD,G","sourcesContent":["import { lcid } from \"../../util/langs\"\nimport { getLicenseFiles, getNotLocalizedLicenseFile } from \"../../util/license\"\nimport * as path from \"path\"\nimport { WinPackager } from \"../../winPackager\"\nimport { NsisOptions } from \"./nsisOptions\"\nimport { NsisScriptGenerator } from \"./nsisScriptGenerator\"\nimport { nsisTemplatesDir } from \"./nsisUtil\"\n\nexport async function computeLicensePage(packager: WinPackager, options: NsisOptions, scriptGenerator: NsisScriptGenerator, languages: Array): Promise {\n const license = await getNotLocalizedLicenseFile(options.license, packager)\n if (license != null) {\n let licensePage: Array\n if (license.endsWith(\".html\")) {\n licensePage = [\n \"!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow\",\n \"Function LicenseShow\",\n \" FindWindow $R0 `#32770` `` $HWNDPARENT\",\n \" GetDlgItem $R0 $R0 1000\",\n \"EmbedHTML::Load /replace $R0 file://$PLUGINSDIR\\\\license.html\",\n \"FunctionEnd\",\n\n `!insertmacro MUI_PAGE_LICENSE \"${path.join(nsisTemplatesDir, \"empty-license.txt\")}\"`,\n ]\n }\n else {\n licensePage = [`!insertmacro MUI_PAGE_LICENSE \"${license}\"`]\n }\n\n scriptGenerator.macro(\"licensePage\", licensePage)\n if (license.endsWith(\".html\")) {\n scriptGenerator.macro(\"addLicenseFiles\", [`File /oname=$PLUGINSDIR\\\\license.html \"${license}\"`])\n }\n return\n }\n\n const licenseFiles = await getLicenseFiles(packager)\n if (licenseFiles.length === 0) {\n return\n }\n\n const licensePage: Array = []\n const unspecifiedLangs = new Set(languages)\n\n let defaultFile: string | null = null\n for (const item of licenseFiles) {\n unspecifiedLangs.delete(item.langWithRegion)\n if (defaultFile == null) {\n defaultFile = item.file\n }\n licensePage.push(`LicenseLangString MUILicense ${lcid[item.langWithRegion] || item.lang} \"${item.file}\"`)\n }\n\n for (const l of unspecifiedLangs) {\n licensePage.push(`LicenseLangString MUILicense ${lcid[l]} \"${defaultFile}\"`)\n }\n\n licensePage.push('!insertmacro MUI_PAGE_LICENSE \"$(MUILicense)\"')\n scriptGenerator.macro(\"licensePage\", licensePage)\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.d.ts b/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.d.ts deleted file mode 100644 index a68105c..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { TargetSpecificOptions } from "../../core"; -import { CommonWindowsInstallerConfiguration } from "../.."; -export interface CommonNsisOptions { - /** - * Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode). - * @default true - */ - readonly unicode?: boolean; - /** - * See [GUID vs Application Name](../configuration/nsis#guid-vs-application-name). - */ - readonly guid?: string | null; - /** - * If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings. - * @default true - */ - readonly warningsAsErrors?: boolean; - /** - * @private - * @default false - */ - readonly useZip?: boolean; -} -export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions { - /** - * Whether to create one-click installer or assisted. - * @default true - */ - readonly oneClick?: boolean; - /** - * Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine). - * - * If `oneClick` is `true` (default): Whether to install per all users (per-machine). - * - * If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine. - * - * If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page. - * @default false - */ - readonly perMachine?: boolean; - /** - * *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions. - * @default true - */ - readonly allowElevation?: boolean; - /** - * *assisted installer only.* Whether to allow user to change installation directory. - * @default false - */ - readonly allowToChangeInstallationDirectory?: boolean; - /** - * The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. - * Defaults to `build/installerIcon.ico` or application icon. - */ - readonly installerIcon?: string | null; - /** - * The path to uninstaller icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. - * Defaults to `build/uninstallerIcon.ico` or application icon. - */ - readonly uninstallerIcon?: string | null; - /** - * *assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. - * @default build/installerHeader.bmp - */ - readonly installerHeader?: string | null; - /** - * *one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. - * Defaults to `build/installerHeaderIcon.ico` or application icon. - */ - readonly installerHeaderIcon?: string | null; - /** - * *assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. - * Defaults to `build/installerSidebar.bmp` or `${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp`. Image size 164 × 314 pixels. - */ - readonly installerSidebar?: string | null; - /** - * *assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. - * Defaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp` - */ - readonly uninstallerSidebar?: string | null; - /** - * The uninstaller display name in the control panel. - * @default ${productName} ${version} - */ - readonly uninstallDisplayName?: string; - /** - * The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script). - */ - readonly include?: string | null; - /** - * The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script). - */ - readonly script?: string | null; - /** - * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target="_blank"` for links). - * - * Multiple license files in different languages are supported — use lang postfix (e.g. `_de`, `_ru`)). For example, create files `license_de.txt` and `license_en.txt` in the build resources. - * If OS language is german, `license_de.txt` will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js). - * - * Appropriate license file will be selected by user OS language. - */ - readonly license?: string | null; - /** - * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Setup ${version}.${ext}`. - */ - readonly artifactName?: string | null; - /** - * *one-click installer only.* Whether to delete app data on uninstall. - * @default false - */ - readonly deleteAppDataOnUninstall?: boolean; - /** - * Defaults to `true` for web installer (`nsis-web`) - */ - differentialPackage?: boolean; - /** - * Whether to display a language selection dialog. Not recommended (by default will be detected using OS language). - * @default false - */ - readonly displayLanguageSelector?: boolean; - /** - * The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what. - */ - readonly installerLanguages?: Array | string | null; - /** - * [LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`). - */ - readonly language?: string | null; - /** - * Whether to create multi-language installer. Defaults to `unicode` option value. - */ - readonly multiLanguageInstaller?: boolean; - /** - * Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if `perMachine` is set to `true`. - * @default true - */ - readonly packElevateHelper?: boolean; - /** - * The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files. - * @default [".avi", ".mov", ".m4v", ".mp4", ".m4p", ".qt", ".mkv", ".webm", ".vmdk"] - */ - readonly preCompressedFileExtensions?: Array | string | null; -} -/** - * Portable options. - */ -export interface PortableOptions extends TargetSpecificOptions, CommonNsisOptions { - /** - * The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows. - * @default user - */ - readonly requestExecutionLevel?: "user" | "highest" | "admin"; -} -/** - * Web Installer options. - */ -export interface NsisWebOptions extends NsisOptions { - /** - * The application package download URL. Optional — by default computed using publish configuration. - * - * URL like `https://example.com/download/latest` allows web installer to be version independent (installer will download latest application package). - * Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878). - * - * Custom `X-Arch` http header is set to `32` or `64`. - */ - readonly appPackageUrl?: string | null; - /** - * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`. - */ - readonly artifactName?: string | null; -} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.js b/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.js deleted file mode 100644 index 57efba1..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=nsisOptions.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.js.map b/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.js.map deleted file mode 100644 index 4917f66..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.d.ts b/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.d.ts deleted file mode 100644 index 51d7648..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare class NsisScriptGenerator { - private readonly lines; - addIncludeDir(file: string): void; - addPluginDir(pluginArch: string, dir: string): void; - include(file: string): void; - macro(name: string, lines: Array | NsisScriptGenerator): void; - file(outputName: string | null, file: string): void; - insertMacro(name: string, parameters: string): void; - flags(flags: Array): void; - build(): string; -} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.js b/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.js deleted file mode 100644 index d9a4879..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NsisScriptGenerator = void 0; - -class NsisScriptGenerator { - constructor() { - this.lines = []; - } - - addIncludeDir(file) { - this.lines.push(`!addincludedir "${file}"`); - } - - addPluginDir(pluginArch, dir) { - this.lines.push(`!addplugindir /${pluginArch} "${dir}"`); - } - - include(file) { - this.lines.push(`!include "${file}"`); - } - - macro(name, lines) { - this.lines.push(`!macro ${name}`, ` ${(Array.isArray(lines) ? lines : lines.lines).join("\n ")}`, `!macroend\n`); - } - - file(outputName, file) { - this.lines.push(`File${outputName == null ? "" : ` "/oname=${outputName}"`} "${file}"`); - } - - insertMacro(name, parameters) { - this.lines.push(`!insertmacro ${name} ${parameters}`); - } // without -- !!! - - - flags(flags) { - for (const flagName of flags) { - const variableName = getVarNameForFlag(flagName).replace(/[\-]+(\w|$)/g, (m, p1) => p1.toUpperCase()); - this.lines.push(`!macro _${variableName} _a _b _t _f - $\{StdUtils.TestParameter} $R9 "${flagName}" - StrCmp "$R9" "true" \`$\{_t}\` \`$\{_f}\` -!macroend -!define ${variableName} \`"" ${variableName} ""\` -`); - } - } - - build() { - return this.lines.join("\n") + "\n"; - } - -} - -exports.NsisScriptGenerator = NsisScriptGenerator; - -function getVarNameForFlag(flagName) { - if (flagName === "allusers") { - return "isForAllUsers"; - } - - if (flagName === "currentuser") { - return "isForCurrentUser"; - } - - return "is" + flagName[0].toUpperCase() + flagName.substring(1); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=nsisScriptGenerator.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.js.map b/node_modules/app-builder-lib/out/targets/nsis/nsisScriptGenerator.js.map deleted file mode 100644 index fb0b14c..0000000 --- a/node_modules/app-builder-lib/out/targets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C,QAAD,CAAjB,CAClB,OADkB,CACV,cADU,EACM,CAAC,CAAD,EAAI,EAAJ,KAAW,EAAE,CAAC,WAAH,EADjB,CAArB;AAEA,WAAK,KAAL,CAAW,IAAX,CAAgB,WAAW,YAAY;oCACT,QAAQ;;;UAGlC,YAAY,SAAS,YAAY;CAJrC;AAMD;AACF;;AAED,EAAA,KAAK,GAAA;AACH,WAAO,KAAK,KAAL,CAAW,IAAX,CAAgB,IAAhB,IAAwB,IAA/B;AACD;;AA/C6B;;;;AAkDhC,SAAS,iBAAT,CAA2B,QAA3B,EAA2C;AACzC,MAAI,QAAQ,KAAK,UAAjB,EAA6B;AAC3B,WAAO,eAAP;AACD;;AACD,MAAI,QAAQ,KAAK,aAAjB,EAAgC;AAC9B,WAAO,kBAAP;AACD;;AACD,SAAO,OAAO,QAAQ,CAAC,CAAD,CAAR,CAAY,WAAZ,EAAP,GAAmC,QAAQ,CAAC,SAAT,CAAmB,CAAnB,CAA1C;AACD,C","sourcesContent":["export class NsisScriptGenerator {\n private readonly lines: Array = []\n\n addIncludeDir(file: string) {\n this.lines.push(`!addincludedir \"${file}\"`)\n }\n\n addPluginDir(pluginArch: string, dir: string) {\n this.lines.push(`!addplugindir /${pluginArch} \"${dir}\"`)\n }\n\n include(file: string) {\n this.lines.push(`!include \"${file}\"`)\n }\n\n macro(name: string, lines: Array | NsisScriptGenerator) {\n this.lines.push(\n `!macro ${name}`,\n ` ${(Array.isArray(lines) ? lines : (lines as NsisScriptGenerator).lines).join(\"\\n \")}`,\n `!macroend\\n`\n )\n }\n\n file(outputName: string | null, file: string) {\n this.lines.push(`File${outputName == null ? \"\" : ` \"/oname=${outputName}\"`} \"${file}\"`)\n }\n\n insertMacro(name: string, parameters: string) {\n this.lines.push(`!insertmacro ${name} ${parameters}`)\n }\n\n // without -- !!!\n flags(flags: Array) {\n for (const flagName of flags) {\n const variableName = getVarNameForFlag(flagName)\n .replace(/[\\-]+(\\w|$)/g, (m, p1) => p1.toUpperCase())\n this.lines.push(`!macro _${variableName} _a _b _t _f\n $\\{StdUtils.TestParameter} $R9 \"${flagName}\"\n StrCmp \"$R9\" \"true\" \\`$\\{_t}\\` \\`$\\{_f}\\`\n!macroend\n!define ${variableName} \\`\"\" ${variableName} \"\"\\`\n`)\n }\n }\n\n build() {\n return this.lines.join(\"\\n\") + \"\\n\"\n }\n}\n\nfunction getVarNameForFlag(flagName: string): string {\n if (flagName === \"allusers\") {\n return \"isForAllUsers\"\n }\n if (flagName === \"currentuser\") {\n return \"isForCurrentUser\"\n }\n return \"is\" + flagName[0].toUpperCase() + flagName.substring(1)\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.d.ts b/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.d.ts deleted file mode 100644 index 1676b38..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Arch } from "builder-util"; -import { PackageFileInfo } from "builder-util-runtime"; -import { Lazy } from "lazy-val"; -import { NsisTarget } from "./NsisTarget"; -export declare const nsisTemplatesDir: string; -export declare const NSIS_PATH: Lazy; -export declare class AppPackageHelper { - private readonly elevateHelper; - private readonly archToFileInfo; - private readonly infoToIsDelete; - /** @private */ - refCount: number; - constructor(elevateHelper: CopyElevateHelper); - packArch(arch: Arch, target: NsisTarget): Promise; - finishBuild(): Promise; -} -export declare class CopyElevateHelper { - private readonly copied; - copy(appOutDir: string, target: NsisTarget): Promise; -} diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js b/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js deleted file mode 100644 index 12d04ea..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js +++ /dev/null @@ -1,199 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CopyElevateHelper = exports.AppPackageHelper = exports.NSIS_PATH = exports.nsisTemplatesDir = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _binDownload() { - const data = require("../../binDownload"); - - _binDownload = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _pathManager() { - const data = require("../../util/pathManager"); - - _pathManager = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const nsisTemplatesDir = (0, _pathManager().getTemplatePath)("nsis"); -exports.nsisTemplatesDir = nsisTemplatesDir; -const NSIS_PATH = new (_lazyVal().Lazy)(() => { - const custom = process.env.ELECTRON_BUILDER_NSIS_DIR; - - if (custom != null && custom.length > 0) { - return Promise.resolve(custom.trim()); - } // noinspection SpellCheckingInspection - - - return (0, _binDownload().getBinFromGithub)("nsis", "3.0.3.2", "tUrlDPQtbjcooNbTrjUzLupttWlATLDNWqK57TVr+gAt3wkaxFxBS3k80AzEFJbmSeOWrUooO72FFOVGXcoxhA=="); -}); -exports.NSIS_PATH = NSIS_PATH; - -class AppPackageHelper { - constructor(elevateHelper) { - this.elevateHelper = elevateHelper; - this.archToFileInfo = new Map(); - this.infoToIsDelete = new Map(); - /** @private */ - - this.refCount = 0; - } - - packArch(arch, target) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - let infoPromise = _this.archToFileInfo.get(arch); - - if (infoPromise == null) { - const appOutDir = target.archs.get(arch); - infoPromise = _this.elevateHelper.copy(appOutDir, target).then(() => target.buildAppPackage(appOutDir, arch)); - - _this.archToFileInfo.set(arch, infoPromise); - } - - const info = yield infoPromise; - - if (target.isWebInstaller) { - _this.infoToIsDelete.set(info, false); - } else if (!_this.infoToIsDelete.has(info)) { - _this.infoToIsDelete.set(info, true); - } - - return info; - })(); - } - - finishBuild() { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (--_this2.refCount > 0) { - return; - } - - const filesToDelete = []; - - for (const [info, isDelete] of _this2.infoToIsDelete.entries()) { - if (isDelete) { - filesToDelete.push(info.path); - } - } - - yield _bluebirdLst().default.map(filesToDelete, it => (0, _fsExtraP().unlink)(it)); - })(); - } - -} - -exports.AppPackageHelper = AppPackageHelper; - -class CopyElevateHelper { - constructor() { - this.copied = new Map(); - } - - copy(appOutDir, target) { - if (!target.packager.info.framework.isCopyElevateHelper) { - return Promise.resolve(); - } - - let isPackElevateHelper = target.options.packElevateHelper; - - if (isPackElevateHelper === false && target.options.perMachine === true) { - isPackElevateHelper = true; - - _builderUtil().log.warn("`packElevateHelper = false` is ignored, because `perMachine` is set to `true`"); - } - - if (isPackElevateHelper === false) { - return Promise.resolve(); - } - - let promise = this.copied.get(appOutDir); - - if (promise != null) { - return promise; - } - - promise = NSIS_PATH.value.then(it => { - const outFile = path.join(appOutDir, "resources", "elevate.exe"); - const promise = (0, _fs().copyFile)(path.join(it, "elevate.exe"), outFile, false); - - if (target.packager.platformSpecificBuildOptions.signAndEditExecutable !== false) { - return promise.then(() => target.packager.sign(outFile)); - } - - return promise; - }); - this.copied.set(appOutDir, promise); - return promise; - } - -} exports.CopyElevateHelper = CopyElevateHelper; -// __ts-babel@6.0.4 -//# sourceMappingURL=nsisUtil.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js.map b/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js.map deleted file mode 100644 index 7113d14..0000000 --- a/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/targets/nsis/nsisUtil.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGO,MAAM,gBAAgB,GAAG,oCAAgB,MAAhB,CAAzB;;AAEA,MAAM,SAAS,GAAG,KAAI,eAAJ,EAAS,MAAK;AACrC,QAAM,MAAM,GAAG,OAAO,CAAC,GAAR,CAAY,yBAA3B;;AACA,MAAI,MAAM,IAAI,IAAV,IAAkB,MAAM,CAAC,MAAP,GAAgB,CAAtC,EAAyC;AACvC,WAAO,OAAO,CAAC,OAAR,CAAgB,MAAM,CAAC,IAAP,EAAhB,CAAP;AACD,GAJoC,CAKrC;;;AACA,SAAO,qCAAiB,MAAjB,EAAyB,SAAzB,EAAoC,0FAApC,CAAP;AACD,CAPwB,CAAlB;;;AASD,MAAO,gBAAP,CAAuB;AAO3B,EAAA,WAAA,CAA6B,aAA7B,EAA6D;AAAhC,SAAA,aAAA,GAAA,aAAA;AANZ,SAAA,cAAA,GAAiB,IAAI,GAAJ,EAAjB;AACA,SAAA,cAAA,GAAiB,IAAI,GAAJ,EAAjB;AAEjB;;AACA,SAAA,QAAA,GAAW,CAAX;AAGC;;AAEK,EAAA,QAAN,CAAe,IAAf,EAA2B,MAA3B,EAA6C;AAAA;;AAAA;AA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,SAAhB,EAA2B,OAA3B;AACA,WAAO,OAAP;AACD;;AAlC2B,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, log } from \"builder-util\"\nimport { PackageFileInfo } from \"builder-util-runtime\"\nimport { getBinFromGithub } from \"../../binDownload\"\nimport { copyFile } from \"builder-util/out/fs\"\nimport { unlink } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { getTemplatePath } from \"../../util/pathManager\"\nimport { NsisTarget } from \"./NsisTarget\"\n\nexport const nsisTemplatesDir = getTemplatePath(\"nsis\")\n\nexport const NSIS_PATH = new Lazy(() => {\n const custom = process.env.ELECTRON_BUILDER_NSIS_DIR\n if (custom != null && custom.length > 0) {\n return Promise.resolve(custom.trim())\n }\n // noinspection SpellCheckingInspection\n return getBinFromGithub(\"nsis\", \"3.0.3.2\", \"tUrlDPQtbjcooNbTrjUzLupttWlATLDNWqK57TVr+gAt3wkaxFxBS3k80AzEFJbmSeOWrUooO72FFOVGXcoxhA==\")\n})\n\nexport class AppPackageHelper {\n private readonly archToFileInfo = new Map>()\n private readonly infoToIsDelete = new Map()\n\n /** @private */\n refCount = 0\n\n constructor(private readonly elevateHelper: CopyElevateHelper) {\n }\n\n async packArch(arch: Arch, target: NsisTarget): Promise {\n let infoPromise = this.archToFileInfo.get(arch)\n if (infoPromise == null) {\n const appOutDir = target.archs.get(arch)!\n infoPromise = this.elevateHelper.copy(appOutDir, target)\n .then(() => target.buildAppPackage(appOutDir, arch))\n this.archToFileInfo.set(arch, infoPromise)\n }\n\n const info = await infoPromise\n if (target.isWebInstaller) {\n this.infoToIsDelete.set(info, false)\n }\n else if (!this.infoToIsDelete.has(info)) {\n this.infoToIsDelete.set(info, true)\n }\n return info\n }\n\n async finishBuild(): Promise {\n if (--this.refCount > 0) {\n return\n }\n\n const filesToDelete: Array = []\n for (const [info, isDelete] of this.infoToIsDelete.entries()) {\n if (isDelete) {\n filesToDelete.push(info.path)\n }\n }\n\n await BluebirdPromise.map(filesToDelete, it => unlink(it))\n }\n}\n\nexport class CopyElevateHelper {\n private readonly copied = new Map>()\n\n copy(appOutDir: string, target: NsisTarget): Promise {\n if (!target.packager.info.framework.isCopyElevateHelper) {\n return Promise.resolve()\n }\n\n let isPackElevateHelper = target.options.packElevateHelper\n if (isPackElevateHelper === false && target.options.perMachine === true) {\n isPackElevateHelper = true\n log.warn(\"`packElevateHelper = false` is ignored, because `perMachine` is set to `true`\")\n }\n\n if (isPackElevateHelper === false) {\n return Promise.resolve()\n }\n\n let promise = this.copied.get(appOutDir)\n if (promise != null) {\n return promise\n }\n\n promise = NSIS_PATH.value\n .then(it => {\n const outFile = path.join(appOutDir, \"resources\", \"elevate.exe\")\n const promise = copyFile(path.join(it, \"elevate.exe\"), outFile, false)\n if (target.packager.platformSpecificBuildOptions.signAndEditExecutable !== false) {\n return promise.then(() => target.packager.sign(outFile))\n }\n return promise\n })\n this.copied.set(appOutDir, promise)\n return promise\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/pkg.d.ts b/node_modules/app-builder-lib/out/targets/pkg.d.ts deleted file mode 100644 index 64459c0..0000000 --- a/node_modules/app-builder-lib/out/targets/pkg.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Arch } from "builder-util"; -import { PkgOptions } from ".."; -import { Identity } from "../codeSign/macCodeSign"; -import { Target } from "../core"; -import MacPackager from "../macPackager"; -export declare class PkgTarget extends Target { - private readonly packager; - readonly outDir: string; - readonly options: PkgOptions; - constructor(packager: MacPackager, outDir: string); - build(appPath: string, arch: Arch): Promise; - private customizeDistributionConfiguration; - private buildComponentPackage; -} -export declare function prepareProductBuildArgs(identity: Identity | null, keychain: string | null | undefined): Array; diff --git a/node_modules/app-builder-lib/out/targets/pkg.js b/node_modules/app-builder-lib/out/targets/pkg.js deleted file mode 100644 index 01ba80c..0000000 --- a/node_modules/app-builder-lib/out/targets/pkg.js +++ /dev/null @@ -1,280 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.prepareProductBuildArgs = prepareProductBuildArgs; -exports.PkgTarget = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _license() { - const data = require("../util/license"); - - _license = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _plist() { - const data = require("plist"); - - _plist = function () { - return data; - }; - - return data; -} - -function _appInfo() { - const data = require("../appInfo"); - - _appInfo = function () { - return data; - }; - - return data; -} - -function _macCodeSign() { - const data = require("../codeSign/macCodeSign"); - - _macCodeSign = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const certType = "Developer ID Installer"; // http://www.shanekirk.com/2013/10/creating-flat-packages-in-osx/ -// to use --scripts, we must build .app bundle separately using pkgbuild -// productbuild --scripts doesn't work (because scripts in this case not added to our package) -// https://github.com/electron-userland/electron-osx-sign/issues/96#issuecomment-274986942 - -class PkgTarget extends _core().Target { - constructor(packager, outDir) { - super("pkg"); - this.packager = packager; - this.outDir = outDir; - this.options = Object.assign({ - allowAnywhere: true, - allowCurrentUserHome: true, - allowRootDirectory: true - }, this.packager.config.pkg); - } - - build(appPath, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - const options = _this.options; - const appInfo = packager.appInfo; // pkg doesn't like not ASCII symbols (Could not open package to list files: /Volumes/test/t-gIjdGK/test-project-0/dist/Test App ßW-1.1.0.pkg) - - const artifactName = packager.expandArtifactNamePattern(options, "pkg"); - const artifactPath = path.join(_this.outDir, artifactName); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: "pkg", - file: artifactPath, - arch - }); - const keychainName = (yield packager.codeSigningInfo.value).keychainName; - const appOutDir = _this.outDir; // https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html - - const distInfoFile = path.join(appOutDir, "distribution.xml"); - const innerPackageFile = path.join(appOutDir, `${(0, _appInfo().filterCFBundleIdentifier)(appInfo.id)}.pkg`); - const componentPropertyListFile = path.join(appOutDir, `${(0, _appInfo().filterCFBundleIdentifier)(appInfo.id)}.plist`); - const identity = (yield Promise.all([(0, _macCodeSign().findIdentity)(certType, options.identity || packager.platformSpecificBuildOptions.identity, keychainName), _this.customizeDistributionConfiguration(distInfoFile, appPath), _this.buildComponentPackage(appPath, componentPropertyListFile, innerPackageFile)]))[0]; - - if (identity == null && packager.forceCodeSigning) { - throw new Error(`Cannot find valid "${certType}" to sign standalone installer, please see https://electron.build/code-signing`); - } - - const args = prepareProductBuildArgs(identity, keychainName); - args.push("--distribution", distInfoFile); - args.push(artifactPath); - (0, _builderUtil().use)(options.productbuild, it => args.push(...it)); - yield (0, _builderUtil().exec)("productbuild", args, { - cwd: appOutDir - }); - yield Promise.all([(0, _fsExtraP().unlink)(innerPackageFile), (0, _fsExtraP().unlink)(distInfoFile)]); - yield packager.dispatchArtifactCreated(artifactPath, _this, arch, packager.computeSafeArtifactName(artifactName, "pkg", arch)); - })(); - } - - customizeDistributionConfiguration(distInfoFile, appPath) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - yield (0, _builderUtil().exec)("productbuild", ["--synthesize", "--component", appPath, distInfoFile], { - cwd: _this2.outDir - }); - const options = _this2.options; - let distInfo = yield (0, _fsExtraP().readFile)(distInfoFile, "utf-8"); - const insertIndex = distInfo.lastIndexOf(""); - distInfo = distInfo.substring(0, insertIndex) + ` \n` + distInfo.substring(insertIndex); - - if (options.background != null) { - const background = yield _this2.packager.getResource(options.background.file); - - if (background != null) { - const alignment = options.background.alignment || "center"; // noinspection SpellCheckingInspection - - const scaling = options.background.scaling || "tofit"; - distInfo = distInfo.substring(0, insertIndex) + ` \n` + distInfo.substring(insertIndex); - } - } - - const welcome = yield _this2.packager.getResource(options.welcome); - - if (welcome != null) { - distInfo = distInfo.substring(0, insertIndex) + ` \n` + distInfo.substring(insertIndex); - } - - const license = yield (0, _license().getNotLocalizedLicenseFile)(options.license, _this2.packager); - - if (license != null) { - distInfo = distInfo.substring(0, insertIndex) + ` \n` + distInfo.substring(insertIndex); - } - - const conclusion = yield _this2.packager.getResource(options.conclusion); - - if (conclusion != null) { - distInfo = distInfo.substring(0, insertIndex) + ` \n` + distInfo.substring(insertIndex); - } - - (0, _builderUtil().debug)(distInfo); - yield (0, _fsExtraP().writeFile)(distInfoFile, distInfo); - })(); - } - - buildComponentPackage(appPath, propertyListOutputFile, packageOutputFile) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const options = _this3.options; - const rootPath = path.dirname(appPath); // first produce a component plist template - - yield (0, _builderUtil().exec)("pkgbuild", ["--analyze", "--root", rootPath, propertyListOutputFile]); // process the template plist - - const plistInfo = (0, _plist().parse)((yield (0, _fsExtraP().readFile)(propertyListOutputFile, "utf8"))); - - if (plistInfo.length > 0) { - const packageInfo = plistInfo[0]; // ChildBundles lists all of electron binaries within the .app. - // There is no particular reason for removing that key, except to be as close as possible to - // the PackageInfo generated by previous versions of electron-builder. - - delete packageInfo.ChildBundles; - - if (options.isRelocatable != null) { - packageInfo.BundleIsRelocatable = options.isRelocatable; - } - - if (options.isVersionChecked != null) { - packageInfo.BundleIsVersionChecked = options.isVersionChecked; - } - - if (options.hasStrictIdentifier != null) { - packageInfo.BundleHasStrictIdentifier = options.hasStrictIdentifier; - } - - if (options.overwriteAction != null) { - packageInfo.BundleOverwriteAction = options.overwriteAction; - } - - yield (0, _fsExtraP().writeFile)(propertyListOutputFile, (0, _plist().build)(plistInfo)); - } // now build the package - - - const args = ["--root", rootPath, "--component-plist", propertyListOutputFile]; - (0, _builderUtil().use)(_this3.options.installLocation || "/Applications", it => args.push("--install-location", it)); - - if (options.scripts != null) { - args.push("--scripts", path.resolve(_this3.packager.info.buildResourcesDir, options.scripts)); - } else if (options.scripts !== null) { - const dir = path.join(_this3.packager.info.buildResourcesDir, "pkg-scripts"); - const stat = yield (0, _fs().statOrNull)(dir); - - if (stat != null && stat.isDirectory()) { - args.push("--scripts", dir); - } - } - - args.push(packageOutputFile); - yield (0, _builderUtil().exec)("pkgbuild", args); - })(); - } - -} - -exports.PkgTarget = PkgTarget; - -function prepareProductBuildArgs(identity, keychain) { - const args = []; - - if (identity != null) { - args.push("--sign", identity.hash); - - if (keychain != null) { - args.push("--keychain", keychain); - } - } - - return args; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=pkg.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/pkg.js.map b/node_modules/app-builder-lib/out/targets/pkg.js.map deleted file mode 100644 index 2ed6255..0000000 --- a/node_modules/app-builder-lib/out/targets/pkg.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/pkg.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;A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,CAAC,OAA3D,CAAvB;AACD,OAFD,MAGK,IAAI,OAAO,CAAC,OAAR,KAAoB,IAAxB,EAA8B;AACjC,cAAM,GAAG,GAAG,IAAI,CAAC,IAAL,CAAU,MAAI,CAAC,QAAL,CAAc,IAAd,CAAmB,iBAA7B,EAAgD,aAAhD,CAAZ;AACA,cAAM,IAAI,SAAS,sBAAW,GAAX,CAAnB;;AACA,YAAI,IAAI,IAAI,IAAR,IAAgB,IAAI,CAAC,WAAL,EAApB,EAAwC;AACtC,UAAA,IAAI,CAAC,IAAL,CAAU,WAAV,EAAuB,GAAvB;AACD;AACF;;AAED,MAAA,IAAI,CAAC,IAAL,CAAU,iBAAV;AAEA,YAAM,yBAAK,UAAL,EAAiB,IAAjB,CAAN;AA5D4G;AA6D7G;;AA7JkC;;;;AAgK/B,SAAU,uBAAV,CAAkC,QAAlC,EAA6D,QAA7D,EAAgG;AACpG,QAAM,IAAI,GAAkB,EAA5B;;AACA,MAAI,QAAQ,IAAI,IAAhB,EAAsB;AACpB,IAAA,IAAI,CAAC,IAAL,CAAU,QAAV,EAAoB,QAAQ,CAAC,IAA7B;;AACA,QAAI,QAAQ,IAAI,IAAhB,EAAsB;AACpB,MAAA,IAAI,CAAC,IAAL,CAAU,YAAV,EAAwB,QAAxB;AACD;AACF;;AACD,SAAO,IAAP;AACD,C","sourcesContent":["import { Arch, debug, exec, use } from \"builder-util\"\nimport { statOrNull } from \"builder-util/out/fs\"\nimport { getNotLocalizedLicenseFile } from \"../util/license\"\nimport { readFile, unlink, writeFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { build as buildPlist, parse as parsePlist } from \"plist\"\nimport { PkgOptions } from \"..\"\nimport { filterCFBundleIdentifier } from \"../appInfo\"\nimport { findIdentity, Identity } from \"../codeSign/macCodeSign\"\nimport { Target } from \"../core\"\nimport MacPackager from \"../macPackager\"\n\nconst certType = \"Developer ID Installer\"\n\n// http://www.shanekirk.com/2013/10/creating-flat-packages-in-osx/\n// to use --scripts, we must build .app bundle separately using pkgbuild\n// productbuild --scripts doesn't work (because scripts in this case not added to our package)\n// https://github.com/electron-userland/electron-osx-sign/issues/96#issuecomment-274986942\nexport class PkgTarget extends Target {\n readonly options: PkgOptions = {\n allowAnywhere: true,\n allowCurrentUserHome: true,\n allowRootDirectory: true,\n ...this.packager.config.pkg,\n }\n\n constructor(private readonly packager: MacPackager, readonly outDir: string) {\n super(\"pkg\")\n }\n\n async build(appPath: string, arch: Arch): Promise {\n const packager = this.packager\n const options = this.options\n const appInfo = packager.appInfo\n\n // pkg doesn't like not ASCII symbols (Could not open package to list files: /Volumes/test/t-gIjdGK/test-project-0/dist/Test App ßW-1.1.0.pkg)\n const artifactName = packager.expandArtifactNamePattern(options, \"pkg\")\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"pkg\",\n file: artifactPath,\n arch,\n })\n\n const keychainName = (await packager.codeSigningInfo.value).keychainName\n\n const appOutDir = this.outDir\n // https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html\n const distInfoFile = path.join(appOutDir, \"distribution.xml\")\n\n const innerPackageFile = path.join(appOutDir, `${filterCFBundleIdentifier(appInfo.id)}.pkg`)\n const componentPropertyListFile = path.join(appOutDir, `${filterCFBundleIdentifier(appInfo.id)}.plist`)\n const identity = (await Promise.all([\n findIdentity(certType, options.identity || packager.platformSpecificBuildOptions.identity, keychainName),\n this.customizeDistributionConfiguration(distInfoFile, appPath),\n this.buildComponentPackage(appPath, componentPropertyListFile, innerPackageFile),\n ]))[0]\n\n if (identity == null && packager.forceCodeSigning) {\n throw new Error(`Cannot find valid \"${certType}\" to sign standalone installer, please see https://electron.build/code-signing`)\n }\n\n const args = prepareProductBuildArgs(identity, keychainName)\n args.push(\"--distribution\", distInfoFile)\n args.push(artifactPath)\n use(options.productbuild, it => args.push(...it as any))\n await exec(\"productbuild\", args, {\n cwd: appOutDir,\n })\n await Promise.all([unlink(innerPackageFile), unlink(distInfoFile)])\n\n await packager.dispatchArtifactCreated(artifactPath, this, arch, packager.computeSafeArtifactName(artifactName, \"pkg\", arch))\n }\n\n private async customizeDistributionConfiguration(distInfoFile: string, appPath: string) {\n await exec(\"productbuild\", [\"--synthesize\", \"--component\", appPath, distInfoFile], {\n cwd: this.outDir,\n })\n\n const options = this.options\n let distInfo = await readFile(distInfoFile, \"utf-8\")\n const insertIndex = distInfo.lastIndexOf(\"\")\n distInfo = distInfo.substring(0, insertIndex) + ` \\n` + distInfo.substring(insertIndex)\n\n if (options.background != null) {\n const background = await this.packager.getResource(options.background.file)\n if (background != null) {\n const alignment = options.background.alignment || \"center\"\n // noinspection SpellCheckingInspection\n const scaling = options.background.scaling || \"tofit\"\n distInfo = distInfo.substring(0, insertIndex) + ` \\n` + distInfo.substring(insertIndex)\n }\n }\n\n const welcome = await this.packager.getResource(options.welcome)\n if (welcome != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` \\n` + distInfo.substring(insertIndex)\n }\n\n const license = await getNotLocalizedLicenseFile(options.license, this.packager)\n if (license != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` \\n` + distInfo.substring(insertIndex)\n }\n\n const conclusion = await this.packager.getResource(options.conclusion)\n if (conclusion != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` \\n` + distInfo.substring(insertIndex)\n }\n\n debug(distInfo)\n await writeFile(distInfoFile, distInfo)\n }\n\n private async buildComponentPackage(appPath: string, propertyListOutputFile: string, packageOutputFile: string) {\n const options = this.options\n const rootPath = path.dirname(appPath)\n\n // first produce a component plist template\n await exec(\"pkgbuild\", [\n \"--analyze\",\n \"--root\", rootPath,\n propertyListOutputFile,\n ])\n\n // process the template plist\n const plistInfo = parsePlist(await readFile(propertyListOutputFile, \"utf8\"))\n if (plistInfo.length > 0) {\n const packageInfo = plistInfo[0]\n\n // ChildBundles lists all of electron binaries within the .app.\n // There is no particular reason for removing that key, except to be as close as possible to\n // the PackageInfo generated by previous versions of electron-builder.\n delete packageInfo.ChildBundles\n\n if (options.isRelocatable != null) {\n packageInfo.BundleIsRelocatable = options.isRelocatable\n }\n\n if (options.isVersionChecked != null) {\n packageInfo.BundleIsVersionChecked = options.isVersionChecked\n }\n\n if (options.hasStrictIdentifier != null) {\n packageInfo.BundleHasStrictIdentifier = options.hasStrictIdentifier\n }\n\n if (options.overwriteAction != null) {\n packageInfo.BundleOverwriteAction = options.overwriteAction\n }\n\n await writeFile(propertyListOutputFile, buildPlist(plistInfo))\n }\n\n // now build the package\n const args = [\n \"--root\", rootPath,\n \"--component-plist\", propertyListOutputFile,\n ]\n\n use(this.options.installLocation || \"/Applications\", it => args.push(\"--install-location\", it!))\n if (options.scripts != null) {\n args.push(\"--scripts\", path.resolve(this.packager.info.buildResourcesDir, options.scripts))\n }\n else if (options.scripts !== null) {\n const dir = path.join(this.packager.info.buildResourcesDir, \"pkg-scripts\")\n const stat = await statOrNull(dir)\n if (stat != null && stat.isDirectory()) {\n args.push(\"--scripts\", dir)\n }\n }\n\n args.push(packageOutputFile)\n\n await exec(\"pkgbuild\", args)\n }\n}\n\nexport function prepareProductBuildArgs(identity: Identity | null, keychain: string | null | undefined): Array {\n const args: Array = []\n if (identity != null) {\n args.push(\"--sign\", identity.hash)\n if (keychain != null) {\n args.push(\"--keychain\", keychain)\n }\n }\n return args\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/snap.d.ts b/node_modules/app-builder-lib/out/targets/snap.d.ts deleted file mode 100644 index 2fda47d..0000000 --- a/node_modules/app-builder-lib/out/targets/snap.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Arch } from "builder-util"; -import { SnapOptions } from ".."; -import { Target } from "../core"; -import { LinuxPackager } from "../linuxPackager"; -import { LinuxTargetHelper } from "./LinuxTargetHelper"; -export default class SnapTarget extends Target { - private readonly packager; - private readonly helper; - readonly outDir: string; - readonly options: SnapOptions; - isUseTemplateApp: boolean; - constructor(name: string, packager: LinuxPackager, helper: LinuxTargetHelper, outDir: string); - private replaceDefault; - private readonly isElectron2; - private createDescriptor; - build(appOutDir: string, arch: Arch): Promise; -} diff --git a/node_modules/app-builder-lib/out/targets/snap.js b/node_modules/app-builder-lib/out/targets/snap.js deleted file mode 100644 index 29806f9..0000000 --- a/node_modules/app-builder-lib/out/targets/snap.js +++ /dev/null @@ -1,307 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function semver() { - const data = _interopRequireWildcard(require("semver")); - - semver = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _linuxPackager() { - const data = require("../linuxPackager"); - - _linuxPackager = function () { - return data; - }; - - return data; -} - -function _targetUtil() { - const data = require("./targetUtil"); - - _targetUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -// libxss1, libasound2, gconf2 - was "error while loading shared libraries: libXss.so.1" on Xubuntu 16.04 -// noinspection SpellCheckingInspection -const defaultStagePackages = ["libasound2", "libgconf2-4", "libnotify4", "libnspr4", "libnss3", "libpcre3", "libpulse0", "libxss1", "libxtst6", "libappindicator1", "libsecret-1-0"]; -const defaultPlugs = ["desktop", "desktop-legacy", "home", "x11", "unity7", "browser-support", "network", "gsettings", "pulseaudio", "opengl"]; - -class SnapTarget extends _core().Target { - constructor(name, packager, helper, outDir) { - super(name); - this.packager = packager; - this.helper = helper; - this.outDir = outDir; - this.options = Object.assign({}, this.packager.platformSpecificBuildOptions, this.packager.config[this.name]); - this.isUseTemplateApp = false; - } - - replaceDefault(inList, defaultList) { - const result = (0, _builderUtil().replaceDefault)(inList, defaultList); - - if (result !== defaultList) { - this.isUseTemplateApp = false; - } - - return result; - } - - get isElectron2() { - return semver().gte(this.packager.config.electronVersion || "1.8.3", "2.0.0-beta.1"); - } - - createDescriptor(arch) { - const appInfo = this.packager.appInfo; - const snapName = this.packager.executableName.toLowerCase(); - const options = this.options; - const linuxArchName = (0, _linuxPackager().toAppImageOrSnapArch)(arch); - const plugs = normalizePlugConfiguration(options.plugs); - const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), defaultPlugs); - const desktopPart = this.isElectron2 ? "desktop-gtk3" : "desktop-gtk2"; - const buildPackages = (0, _builderUtilRuntime().asArray)(options.buildPackages); - this.isUseTemplateApp = this.options.useTemplateApp !== false && arch === _builderUtil().Arch.x64 && buildPackages.length === 0 && this.isElectron2; - const appDescriptor = { - command: `command.sh`, - plugs: plugNames - }; - const snap = { - name: snapName, - version: appInfo.version, - summary: options.summary || appInfo.productName, - description: this.helper.getDescription(options), - confinement: options.confinement || "strict", - grade: options.grade || "stable", - architectures: [(0, _builderUtil().toLinuxArchString)(arch)], - apps: { - [snapName]: appDescriptor - }, - parts: { - app: { - plugin: "nil", - "stage-packages": this.replaceDefault(options.stagePackages, defaultStagePackages), - after: this.replaceDefault(options.after, [desktopPart]) - } - } - }; - - if (options.confinement !== "classic") { - appDescriptor.environment = Object.assign({ - TMPDIR: "$XDG_RUNTIME_DIR", - PATH: "$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH", - LD_LIBRARY_PATH: ["$SNAP_LIBRARY_PATH", "$SNAP/usr/lib/" + linuxArchName + "-linux-gnu:$SNAP/usr/lib/" + linuxArchName + "-linux-gnu/pulseaudio", "$SNAP/usr/lib/" + linuxArchName + "-linux-gnu/mesa-egl", "$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/" + linuxArchName + "-linux-gnu:$SNAP/usr/lib/" + linuxArchName + "-linux-gnu", "$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib", "$SNAP/lib/" + linuxArchName + "-linux-gnu:$SNAP/usr/lib/" + linuxArchName + "-linux-gnu"].join(":") - }, options.environment); - } - - if (!this.isUseTemplateApp) { - appDescriptor.adapter = "none"; - } - - if (buildPackages.length > 0) { - snap.parts.app["build-packages"] = buildPackages; - } - - if (plugs != null) { - for (const plugName of plugNames) { - const plugOptions = plugs[plugName]; - - if (plugOptions == null) { - continue; - } - - if (snap.plugs == null) { - snap.plugs = {}; - } - - snap.plugs[plugName] = plugOptions; - } - } - - if (options.assumes != null) { - snap.assumes = (0, _builderUtilRuntime().asArray)(options.assumes); - } - - if (!this.isUseTemplateApp && snap.parts.app.after.includes(desktopPart)) { - // call super build (snapcraftctl build) otherwise /bin/desktop not created - // noinspection SpellCheckingInspection - const desktopPartOverride = { - "override-build": `set -x -snapcraftctl build -export XDG_DATA_DIRS=$SNAPCRAFT_PART_INSTALL/usr/share -update-mime-database $SNAPCRAFT_PART_INSTALL/usr/share/mime - -for dir in $SNAPCRAFT_PART_INSTALL/usr/share/icons/*/; do - if [ -f $dir/index.theme ]; then - if which gtk-update-icon-cache-3.0 &> /dev/null; then - gtk-update-icon-cache-3.0 -q $dir - elif which gtk-update-icon-cache &> /dev/null; then - gtk-update-icon-cache -q $dir - fi - fi -done` - }; - - if (appDescriptor.plugs.includes("desktop") || appDescriptor.plugs.includes("desktop-legacy")) { - desktopPartOverride.stage = ["-./usr/share/fonts/**"]; - } - - snap.parts[desktopPart] = desktopPartOverride; - } - - return snap; - } - - build(appOutDir, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; - const options = _this.options; // tslint:disable-next-line:no-invalid-template-strings - - const artifactName = packager.expandArtifactNamePattern(_this.options, "snap", arch, "${name}_${version}_${arch}.${ext}", false); - const artifactPath = path.join(_this.outDir, artifactName); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: "snap", - file: artifactPath, - arch - }); - - const snap = _this.createDescriptor(arch); - - if (_this.isUseTemplateApp) { - delete snap.parts; - } - - const stageDir = yield (0, _targetUtil().createStageDirPath)(_this, packager, arch); // snapcraft.yaml inside a snap directory - - const snapMetaDir = path.join(stageDir, _this.isUseTemplateApp ? "meta" : "snap"); - const args = ["snap", "--app", appOutDir, "--stage", stageDir, "--arch", (0, _builderUtil().toLinuxArchString)(arch), "--output", artifactPath, "--executable", _this.packager.executableName, "--docker-image", "electronuserland/builder:latest"]; - yield _this.helper.icons; - - if (_this.helper.maxIconPath != null) { - if (!_this.isUseTemplateApp) { - snap.icon = "snap/gui/icon.png"; - } - - args.push("--icon", _this.helper.maxIconPath); - } - - const desktopFile = path.join(snapMetaDir, "gui", `${snap.name}.desktop`); - yield _this.helper.writeDesktopEntry(_this.options, packager.executableName, desktopFile, { - // tslint:disable:no-invalid-template-strings - Icon: "${SNAP}/meta/gui/icon.png" - }); - - if (packager.packagerOptions.effectiveOptionComputed != null && (yield packager.packagerOptions.effectiveOptionComputed({ - snap, - desktopFile - }))) { - return; - } - - yield (0, _fsExtraP().outputFile)(path.join(snapMetaDir, _this.isUseTemplateApp ? "snap.yaml" : "snapcraft.yaml"), (0, _builderUtil().serializeToYaml)(snap)); - const hooksDir = yield packager.getResource(options.hooks, "snap-hooks"); - - if (hooksDir != null) { - args.push("--hooks", hooksDir); - } - - if (_this.isUseTemplateApp) { - args.push("--template-url", "electron2"); - } - - yield (0, _builderUtil().executeAppBuilder)(args); - yield packager.dispatchArtifactCreated(artifactPath, _this, arch, packager.computeSafeArtifactName(artifactName, "snap", arch, false)); - })(); - } - -} - -exports.default = SnapTarget; - -function normalizePlugConfiguration(raw) { - if (raw == null) { - return null; - } - - const result = {}; - - for (const item of Array.isArray(raw) ? raw : [raw]) { - if (typeof item === "string") { - result[item] = null; - } else { - Object.assign(result, item); - } - } - - return result; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=snap.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/snap.js.map b/node_modules/app-builder-lib/out/targets/snap.js.map deleted file mode 100644 index b207b8d..0000000 --- a/node_modules/app-builder-lib/out/targets/snap.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/snap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACA;AACA,MAAM,oBAAoB,GAAG,CAAC,YAAD,EAAe,aAAf,EAA8B,YAA9B,EAA4C,UAA5C,EAAwD,SAAxD,EAAmE,UAAnE,EAA+E,WAA/E,EAA4F,SAA5F,EAAuG,UAAvG,EAAmH,kBAAnH,EAAuI,eAAvI,CAA7B;AACA,MAAM,YAAY,GAAG,CAAC,SAAD,EAAY,gBAAZ,EAA8B,MAA9B,EAAsC,KAAtC,EAA6C,QAA7C,EAAuD,iBAAvD,EAA0E,SAA1E,EAAqF,WAArF,EAAkG,YAAlG,EAAgH,QAAhH,CAArB;;AAEc,MAAO,UAAP,SAA0B,cAA1B,CAAgC;AAK5C,EAAA,WAAA,CAAY,IAAZ,EAA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B;AACD;;AAED,UAAI,KAAI,CAAC,gBAAT,EAA2B;AACzB,QAAA,IAAI,CAAC,IAAL,CAAU,gBAAV,EAA4B,WAA5B;AACD;;AACD,YAAM,sCAAkB,IAAlB,CAAN;AACA,YAAM,QAAQ,CAAC,uBAAT,CAAiC,YAAjC,EAA+C,KAA/C,EAAqD,IAArD,EAA2D,QAAQ,CAAC,uBAAT,CAAiC,YAAjC,EAA+C,MAA/C,EAAuD,IAAvD,EAA6D,KAA7D,CAA3D,CAAN;AA5DuC;AA6DxC;;AA/L2C;;;;AAkM9C,SAAS,0BAAT,CAAoC,GAApC,EAA2G;AACzG,MAAI,GAAG,IAAI,IAAX,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,QAAM,MAAM,GAAQ,EAApB;;AACA,OAAK,MAAM,IAAX,IAAoB,KAAK,CAAC,OAAN,CAAc,GAAd,IAAqB,GAArB,GAA2B,CAAC,GAAD,CAA/C,EAAuD;AACrD,QAAI,OAAO,IAAP,KAAgB,QAApB,EAA8B;AAC5B,MAAA,MAAM,CAAC,IAAD,CAAN,GAAe,IAAf;AACD,KAFD,MAGK;AACH,MAAA,MAAM,CAAC,MAAP,CAAc,MAAd,EAAsB,IAAtB;AACD;AACF;;AACD,SAAO,MAAP;AACD,C","sourcesContent":["import { Arch, executeAppBuilder, replaceDefault as _replaceDefault, serializeToYaml, toLinuxArchString } from \"builder-util\"\nimport { asArray } from \"builder-util-runtime\"\nimport { outputFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { SnapOptions } from \"..\"\nimport { Target } from \"../core\"\nimport { LinuxPackager, toAppImageOrSnapArch } from \"../linuxPackager\"\nimport { PlugDescriptor } from \"../options/SnapOptions\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDirPath } from \"./targetUtil\"\n\n// libxss1, libasound2, gconf2 - was \"error while loading shared libraries: libXss.so.1\" on Xubuntu 16.04\n// noinspection SpellCheckingInspection\nconst defaultStagePackages = [\"libasound2\", \"libgconf2-4\", \"libnotify4\", \"libnspr4\", \"libnss3\", \"libpcre3\", \"libpulse0\", \"libxss1\", \"libxtst6\", \"libappindicator1\", \"libsecret-1-0\"]\nconst defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"pulseaudio\", \"opengl\"]\n\nexport default class SnapTarget extends Target {\n readonly options: SnapOptions = {...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name]}\n\n public isUseTemplateApp = false\n\n constructor(name: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(name)\n }\n\n private replaceDefault(inList: Array | null | undefined, defaultList: Array) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n private get isElectron2(): boolean {\n return semver.gte(this.packager.config.electronVersion || \"1.8.3\", \"2.0.0-beta.1\")\n }\n\n private createDescriptor(arch: Arch): any {\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n const linuxArchName = toAppImageOrSnapArch(arch)\n\n const plugs = normalizePlugConfiguration(options.plugs)\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), defaultPlugs)\n const desktopPart = this.isElectron2 ? \"desktop-gtk3\" : \"desktop-gtk2\"\n\n const buildPackages = asArray(options.buildPackages)\n this.isUseTemplateApp = this.options.useTemplateApp !== false && arch === Arch.x64 && buildPackages.length === 0 && this.isElectron2\n\n const appDescriptor: any = {\n command: `command.sh`,\n plugs: plugNames,\n }\n const snap: any = {\n name: snapName,\n version: appInfo.version,\n summary: options.summary || appInfo.productName,\n description: this.helper.getDescription(options),\n confinement: options.confinement || \"strict\",\n grade: options.grade || \"stable\",\n architectures: [toLinuxArchString(arch)],\n apps: {\n [snapName]: appDescriptor\n },\n parts: {\n app: {\n plugin: \"nil\",\n \"stage-packages\": this.replaceDefault(options.stagePackages, defaultStagePackages),\n after: this.replaceDefault(options.after, [desktopPart]),\n }\n },\n }\n\n if (options.confinement !== \"classic\") {\n appDescriptor.environment = {\n TMPDIR: \"$XDG_RUNTIME_DIR\",\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/usr/lib/\" + linuxArchName + \"-linux-gnu:$SNAP/usr/lib/\" + linuxArchName + \"-linux-gnu/pulseaudio\",\n \"$SNAP/usr/lib/\" + linuxArchName + \"-linux-gnu/mesa-egl\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + linuxArchName + \"-linux-gnu:$SNAP/usr/lib/\" + linuxArchName + \"-linux-gnu\",\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + linuxArchName + \"-linux-gnu:$SNAP/usr/lib/\" + linuxArchName + \"-linux-gnu\"\n ].join(\":\"),\n ...options.environment,\n }\n }\n\n if (!this.isUseTemplateApp) {\n appDescriptor.adapter = \"none\"\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n\n if (snap.plugs == null) {\n snap.plugs = {}\n }\n snap.plugs[plugName] = plugOptions\n }\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n if (!this.isUseTemplateApp && snap.parts.app.after.includes(desktopPart)) {\n // call super build (snapcraftctl build) otherwise /bin/desktop not created\n // noinspection SpellCheckingInspection\n const desktopPartOverride: any = {\n \"override-build\": `set -x\nsnapcraftctl build\nexport XDG_DATA_DIRS=$SNAPCRAFT_PART_INSTALL/usr/share\nupdate-mime-database $SNAPCRAFT_PART_INSTALL/usr/share/mime\n\nfor dir in $SNAPCRAFT_PART_INSTALL/usr/share/icons/*/; do\n if [ -f $dir/index.theme ]; then\n if which gtk-update-icon-cache-3.0 &> /dev/null; then\n gtk-update-icon-cache-3.0 -q $dir\n elif which gtk-update-icon-cache &> /dev/null; then\n gtk-update-icon-cache -q $dir\n fi\n fi\ndone`\n }\n\n if (appDescriptor.plugs.includes(\"desktop\") || appDescriptor.plugs.includes(\"desktop-legacy\")) {\n desktopPartOverride.stage = [\"-./usr/share/fonts/**\"]\n }\n\n snap.parts[desktopPart] = desktopPartOverride\n }\n\n return snap\n }\n\n async build(appOutDir: string, arch: Arch): Promise {\n const packager = this.packager\n const options = this.options\n // tslint:disable-next-line:no-invalid-template-strings\n const artifactName = packager.expandArtifactNamePattern(this.options, \"snap\", arch, \"${name}_${version}_${arch}.${ext}\", false)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"snap\",\n file: artifactPath,\n arch,\n })\n\n const snap: any = this.createDescriptor(arch)\n if (this.isUseTemplateApp) {\n delete snap.parts\n }\n\n const stageDir = await createStageDirPath(this, packager, arch)\n // snapcraft.yaml inside a snap directory\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n\n const args = [\n \"snap\",\n \"--app\", appOutDir,\n \"--stage\", stageDir,\n \"--arch\", toLinuxArchString(arch),\n \"--output\", artifactPath,\n \"--executable\", this.packager.executableName,\n \"--docker-image\", \"electronuserland/builder:latest\",\n ]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n const desktopFile = path.join(snapMetaDir, \"gui\", `${snap.name}.desktop`)\n await this.helper.writeDesktopEntry(this.options, packager.executableName, desktopFile, {\n // tslint:disable:no-invalid-template-strings\n Icon: \"${SNAP}/meta/gui/icon.png\"\n })\n\n if (packager.packagerOptions.effectiveOptionComputed != null && await packager.packagerOptions.effectiveOptionComputed({snap, desktopFile})) {\n return\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await packager.getResource(options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n args.push(\"--template-url\", \"electron2\")\n }\n await executeAppBuilder(args)\n await packager.dispatchArtifactCreated(artifactPath, this, arch, packager.computeSafeArtifactName(artifactName, \"snap\", arch, false))\n }\n}\n\nfunction normalizePlugConfiguration(raw: Array | PlugDescriptor | null | undefined): { [key: string]: PlugDescriptor | null } | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of (Array.isArray(raw) ? raw : [raw])) {\n if (typeof item === \"string\") {\n result[item] = null\n }\n else {\n Object.assign(result, item)\n }\n }\n return result\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/targetFactory.d.ts b/node_modules/app-builder-lib/out/targets/targetFactory.d.ts deleted file mode 100644 index 7fccff2..0000000 --- a/node_modules/app-builder-lib/out/targets/targetFactory.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Arch } from "builder-util"; -import { PlatformSpecificBuildOptions, Platform, Target } from "../index"; -import { PlatformPackager } from "../platformPackager"; -export declare function computeArchToTargetNamesMap(raw: Map>, options: PlatformSpecificBuildOptions, platform: Platform): Map>; -export declare function createTargets(nameToTarget: Map, rawList: Array, outDir: string, packager: PlatformPackager): Array; -export declare function createCommonTarget(target: string, outDir: string, packager: PlatformPackager): Target; -export declare class NoOpTarget extends Target { - readonly options: null; - constructor(name: string); - readonly outDir: string; - build(appOutDir: string, arch: Arch): Promise; -} diff --git a/node_modules/app-builder-lib/out/targets/targetFactory.js b/node_modules/app-builder-lib/out/targets/targetFactory.js deleted file mode 100644 index b4c2f0e..0000000 --- a/node_modules/app-builder-lib/out/targets/targetFactory.js +++ /dev/null @@ -1,155 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.computeArchToTargetNamesMap = computeArchToTargetNamesMap; -exports.createTargets = createTargets; -exports.createCommonTarget = createCommonTarget; -exports.NoOpTarget = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("../index"); - - _index = function () { - return data; - }; - - return data; -} - -function _ArchiveTarget() { - const data = require("./ArchiveTarget"); - - _ArchiveTarget = function () { - return data; - }; - - return data; -} - -const archiveTargets = new Set(["zip", "7z", "tar.xz", "tar.lz", "tar.gz", "tar.bz2"]); - -function computeArchToTargetNamesMap(raw, options, platform) { - for (const targetNames of raw.values()) { - if (targetNames.length > 0) { - // https://github.com/electron-userland/electron-builder/issues/1355 - return raw; - } - } - - const defaultArchs = raw.size === 0 ? [platform === _index().Platform.MAC ? "x64" : process.arch] : Array.from(raw.keys()).map(it => _builderUtil().Arch[it]); - const result = new Map(raw); - - for (const target of (0, _builderUtil().asArray)(options.target).map(it => typeof it === "string" ? { - target: it - } : it)) { - let name = target.target; - let archs = target.arch; - const suffixPos = name.lastIndexOf(":"); - - if (suffixPos > 0) { - name = target.target.substring(0, suffixPos); - - if (archs == null) { - archs = target.target.substring(suffixPos + 1); - } - } - - for (const arch of archs == null ? defaultArchs : (0, _builderUtil().asArray)(archs)) { - (0, _builderUtil().addValue)(result, (0, _builderUtil().archFromString)(arch), name); - } - } - - if (result.size === 0) { - for (const arch of defaultArchs) { - result.set((0, _builderUtil().archFromString)(arch), []); - } - } - - return result; -} - -function createTargets(nameToTarget, rawList, outDir, packager) { - const result = []; - - const mapper = (name, factory) => { - let target = nameToTarget.get(name); - - if (target == null) { - target = factory(outDir); - nameToTarget.set(name, target); - } - - result.push(target); - }; - - const targets = normalizeTargets(rawList, packager.defaultTarget); - packager.createTargets(targets, mapper); - return result; -} - -function normalizeTargets(targets, defaultTarget) { - const list = []; - - for (const t of targets) { - const name = t.toLowerCase().trim(); - - if (name === _index().DEFAULT_TARGET) { - list.push(...defaultTarget); - } else { - list.push(name); - } - } - - return list; -} - -function createCommonTarget(target, outDir, packager) { - if (archiveTargets.has(target)) { - return new (_ArchiveTarget().ArchiveTarget)(target, outDir, packager); - } else if (target === _index().DIR_TARGET) { - return new NoOpTarget(_index().DIR_TARGET); - } else { - throw new Error(`Unknown target: ${target}`); - } -} - -class NoOpTarget extends _index().Target { - constructor(name) { - super(name); - this.options = null; - } - - get outDir() { - throw new Error("NoOpTarget"); - } - - build(appOutDir, arch) {// no build - - return (0, _bluebirdLst().coroutine)(function* () {})(); - } - -} exports.NoOpTarget = NoOpTarget; -// __ts-babel@6.0.4 -//# sourceMappingURL=targetFactory.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/targetFactory.js.map b/node_modules/app-builder-lib/out/targets/targetFactory.js.map deleted file mode 100644 index fb74edc..0000000 --- a/node_modules/app-builder-lib/out/targets/targetFactory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/targetFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA,MAAM,cAAc,GAAG,IAAI,GAAJ,CAAQ,CAAC,KAAD,EAAQ,IAAR,EAAc,QAAd,EAAwB,QAAxB,EAAkC,QAAlC,EAA4C,SAA5C,CAAR,CAAvB;;AAEM,SAAU,2BAAV,CAAsC,GAAtC,EAAqE,OAArE,EAA4G,QAA5G,EAA8H;AAClI,OAAK,MAAM,WAAX,IAA0B,GAAG,CAAC,MAAJ,EAA1B,EAAwC;AACtC,QAAI,WAAW,CAAC,MAAZ,GAAqB,CAAzB,EAA4B;AAC1B;AACA,aAAO,GAAP;A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AlC,CAAP;AACD,GAFD,MAGK,IAAI,MAAM,KAAK,mBAAf,EAA2B;AAC9B,WAAO,IAAI,UAAJ,CAAe,mBAAf,CAAP;AACD,GAFI,MAGA;AACH,UAAM,IAAI,KAAJ,CAAU,mBAAmB,MAAM,EAAnC,CAAN;AACD;AACF;;AAEK,MAAO,UAAP,SAA0B,eAA1B,CAAgC;AAGpC,EAAA,WAAA,CAAY,IAAZ,EAAwB;AACtB,UAAM,IAAN;AAHO,SAAA,OAAA,GAAU,IAAV;AAIR;;AAED,MAAI,MAAJ,GAAU;AACR,UAAM,IAAI,KAAJ,CAAU,YAAV,CAAN;AACD;;AAEK,EAAA,KAAN,CAAY,SAAZ,EAA+B,IAA/B,EAAyC,CACvC;;AADuC;AAExC;;AAbmC,C","sourcesContent":["import { addValue, Arch, archFromString, ArchType, asArray } from \"builder-util\"\nimport { PlatformSpecificBuildOptions, DEFAULT_TARGET, DIR_TARGET, Platform, Target, TargetConfiguration } from \"../index\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { ArchiveTarget } from \"./ArchiveTarget\"\n\nconst archiveTargets = new Set([\"zip\", \"7z\", \"tar.xz\", \"tar.lz\", \"tar.gz\", \"tar.bz2\"])\n\nexport function computeArchToTargetNamesMap(raw: Map>, options: PlatformSpecificBuildOptions, platform: Platform): Map> {\n for (const targetNames of raw.values()) {\n if (targetNames.length > 0) {\n // https://github.com/electron-userland/electron-builder/issues/1355\n return raw\n }\n }\n\n const defaultArchs: Array = raw.size === 0 ? [platform === Platform.MAC ? \"x64\" : process.arch as ArchType] : Array.from(raw.keys()).map(it => Arch[it] as ArchType)\n const result = new Map(raw)\n for (const target of asArray(options.target).map(it => typeof it === \"string\" ? {target: it} : it)) {\n let name = target.target\n let archs = target.arch\n const suffixPos = name.lastIndexOf(\":\")\n if (suffixPos > 0) {\n name = target.target.substring(0, suffixPos)\n if (archs == null) {\n archs = target.target.substring(suffixPos + 1) as ArchType\n }\n }\n\n for (const arch of archs == null ? defaultArchs : asArray(archs)) {\n addValue(result, archFromString(arch), name)\n }\n }\n\n if (result.size === 0) {\n for (const arch of defaultArchs) {\n result.set(archFromString(arch), [])\n }\n }\n\n return result\n}\n\nexport function createTargets(nameToTarget: Map, rawList: Array, outDir: string, packager: PlatformPackager): Array {\n const result: Array = []\n\n const mapper = (name: string, factory: (outDir: string) => Target) => {\n let target = nameToTarget.get(name)\n if (target == null) {\n target = factory(outDir)\n nameToTarget.set(name, target)\n }\n result.push(target)\n }\n\n const targets = normalizeTargets(rawList, packager.defaultTarget)\n packager.createTargets(targets, mapper)\n return result\n}\n\nfunction normalizeTargets(targets: Array, defaultTarget: Array): Array {\n const list: Array = []\n for (const t of targets) {\n const name = t.toLowerCase().trim()\n if (name === DEFAULT_TARGET) {\n list.push(...defaultTarget)\n }\n else {\n list.push(name)\n }\n }\n return list\n}\n\nexport function createCommonTarget(target: string, outDir: string, packager: PlatformPackager): Target {\n if (archiveTargets.has(target)) {\n return new ArchiveTarget(target, outDir, packager)\n }\n else if (target === DIR_TARGET) {\n return new NoOpTarget(DIR_TARGET)\n }\n else {\n throw new Error(`Unknown target: ${target}`)\n }\n}\n\nexport class NoOpTarget extends Target {\n readonly options = null\n\n constructor(name: string) {\n super(name)\n }\n\n get outDir(): string {\n throw new Error(\"NoOpTarget\")\n }\n\n async build(appOutDir: string, arch: Arch): Promise {\n // no build\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/targetUtil.d.ts b/node_modules/app-builder-lib/out/targets/targetUtil.d.ts deleted file mode 100644 index 3b87f30..0000000 --- a/node_modules/app-builder-lib/out/targets/targetUtil.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Target, AppInfo } from "../"; -import { Arch } from "builder-util"; -import { PlatformPackager } from "../platformPackager"; -export declare class StageDir { - readonly dir: string; - constructor(dir: string); - getTempFile(name: string): string; - cleanup(): Promise; - toString(): string; -} -export declare function createStageDir(target: Target, packager: PlatformPackager, arch: Arch): Promise; -export declare function createStageDirPath(target: Target, packager: PlatformPackager, arch: Arch): Promise; -export declare function getWindowsInstallationDirName(appInfo: AppInfo, isTryToUseProductName: boolean): string; diff --git a/node_modules/app-builder-lib/out/targets/targetUtil.js b/node_modules/app-builder-lib/out/targets/targetUtil.js deleted file mode 100644 index 9ff1365..0000000 --- a/node_modules/app-builder-lib/out/targets/targetUtil.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createStageDir = createStageDir; -exports.createStageDirPath = createStageDirPath; -exports.getWindowsInstallationDirName = getWindowsInstallationDirName; -exports.StageDir = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class StageDir { - constructor(dir) { - this.dir = dir; - } - - getTempFile(name) { - return this.dir + path.sep + name; - } - - cleanup() { - if (!_builderUtil().debug.enabled || process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG === "true") { - return (0, _fsExtraP().remove)(this.dir); - } - - return Promise.resolve(); - } - - toString() { - return this.dir; - } - -} - -exports.StageDir = StageDir; - -function createStageDir(_x, _x2, _x3) { - return _createStageDir.apply(this, arguments); -} - -function _createStageDir() { - _createStageDir = (0, _bluebirdLst().coroutine)(function* (target, packager, arch) { - return new StageDir((yield createStageDirPath(target, packager, arch))); - }); - return _createStageDir.apply(this, arguments); -} - -function createStageDirPath(_x4, _x5, _x6) { - return _createStageDirPath.apply(this, arguments); -} // https://github.com/electron-userland/electron-builder/issues/3100 -// https://github.com/electron-userland/electron-builder/commit/2539cfba20dc639128e75c5b786651b652bb4b78 - - -function _createStageDirPath() { - _createStageDirPath = (0, _bluebirdLst().coroutine)(function* (target, packager, arch) { - const tempDir = packager.info.stageDirPathCustomizer(target, packager, arch); - yield (0, _fsExtraP().emptyDir)(tempDir); - return tempDir; - }); - return _createStageDirPath.apply(this, arguments); -} - -function getWindowsInstallationDirName(appInfo, isTryToUseProductName) { - return isTryToUseProductName && /^[-_+0-9a-zA-Z .]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=targetUtil.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/targetUtil.js.map b/node_modules/app-builder-lib/out/targets/targetUtil.js.map deleted file mode 100644 index 27390d5..0000000 --- a/node_modules/app-builder-lib/out/targets/targetUtil.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/targetUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGM,MAAO,QAAP,CAAe;AACnB,EAAA,WAAA,CAAqB,GAArB,EAAgC;AAAX,SAAA,GAAA,GAAA,GAAA;AACpB;;AAED,EAAA,WAAW,CAAC,IAAD,EAAa;AACtB,WAAO,KAAK,GAAL,GAAW,IAAI,CAAC,GAAhB,GAAsB,IAA7B;AACD;;AAED,EAAA,OAAO,GAAA;AACL,QAAI,CAAC,qBAAM,OAAP,IAAkB,OAAO,CAAC,GAAR,CAAY,2CAAZ,KAA4D,MAAlF,EAA0F;AACxF,aAAO,wBAAO,KAAK,GAAZ,CAAP;AACD;;AACD,WAAO,OAAO,CAAC,OAAR,EAAP;AACD;;AAED,EAAA,QAAQ,GAAA;AACN,WAAO,KAAK,GAAZ;AACD;;AAjBkB;;;;SAoBC,c;;;;;kDAAf,WAA8B,MAA9B,EAA8C,QAA9C,EAA+E,IAA/E,EAAyF;AAC9F,WAAO,IAAI,QAAJ,QAAmB,kBAAkB,CAAC,MAAD,EAAS,QAAT,EAAmB,IAAnB,CAArC,EAAP;AACD,G;;;;SAEqB,kB;;EAMtB;AACA;;;;sDAPO,WAAkC,MAAlC,EAAkD,QAAlD,EAAmF,IAAnF,EAA6F;AAClG,UAAM,OAAO,GAAG,QAAQ,CAAC,IAAT,CAAc,sBAAd,CAAqC,MAArC,EAA6C,QAA7C,EAAuD,IAAvD,CAAhB;AACA,UAAM,0BAAS,OAAT,CAAN;AACA,WAAO,OAAP;AACD,G;;;;AAIK,SAAU,6BAAV,CAAwC,OAAxC,EAA0D,qBAA1D,EAAwF;AAC5F,SAAO,qBAAqB,IAAI,sBAAsB,IAAtB,CAA2B,OAAO,CAAC,eAAnC,CAAzB,GAA+E,OAAO,CAAC,eAAvF,GAAyG,OAAO,CAAC,aAAxH;AACD,C","sourcesContent":["import { emptyDir, remove } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { Target, AppInfo } from \"../\"\nimport { Arch, debug } from \"builder-util\"\nimport { PlatformPackager } from \"../platformPackager\"\n\nexport class StageDir {\n constructor(readonly dir: string) {\n }\n\n getTempFile(name: string) {\n return this.dir + path.sep + name\n }\n\n cleanup() {\n if (!debug.enabled || process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG === \"true\") {\n return remove(this.dir)\n }\n return Promise.resolve()\n }\n\n toString() {\n return this.dir\n }\n}\n\nexport async function createStageDir(target: Target, packager: PlatformPackager, arch: Arch): Promise {\n return new StageDir(await createStageDirPath(target, packager, arch))\n}\n\nexport async function createStageDirPath(target: Target, packager: PlatformPackager, arch: Arch): Promise {\n const tempDir = packager.info.stageDirPathCustomizer(target, packager, arch)\n await emptyDir(tempDir)\n return tempDir\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3100\n// https://github.com/electron-userland/electron-builder/commit/2539cfba20dc639128e75c5b786651b652bb4b78\nexport function getWindowsInstallationDirName(appInfo: AppInfo, isTryToUseProductName: boolean): string {\n return isTryToUseProductName && /^[-_+0-9a-zA-Z .]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/targets/tools.d.ts b/node_modules/app-builder-lib/out/targets/tools.d.ts deleted file mode 100644 index 6b2fd3b..0000000 --- a/node_modules/app-builder-lib/out/targets/tools.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Lazy } from "lazy-val"; -export declare function getLinuxToolsPath(): Promise; -export declare const fpmPath: Lazy; -export declare function prefetchBuildTools(): Promise; diff --git a/node_modules/app-builder-lib/out/targets/tools.js b/node_modules/app-builder-lib/out/targets/tools.js deleted file mode 100644 index 5075888..0000000 --- a/node_modules/app-builder-lib/out/targets/tools.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getLinuxToolsPath = getLinuxToolsPath; -exports.prefetchBuildTools = prefetchBuildTools; -exports.fpmPath = void 0; - -function _binDownload() { - const data = require("../binDownload"); - - _binDownload = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getLinuxToolsPath() { - //noinspection SpellCheckingInspection - return (0, _binDownload().getBinFromGithub)("linux-tools", "mac-10.12.3", "SQ8fqIRVXuQVWnVgaMTDWyf2TLAJjJYw3tRSqQJECmgF6qdM7Kogfa6KD49RbGzzMYIFca9Uw3MdsxzOPRWcYw=="); -} - -const fpmPath = new (_lazyVal().Lazy)(() => { - if (process.platform === "win32" || process.env.USE_SYSTEM_FPM === "true") { - return Promise.resolve("fpm"); - } - - return (0, _binDownload().getBin)("fpm").then(it => path.join(it, "fpm")); -}); // noinspection JSUnusedGlobalSymbols - -exports.fpmPath = fpmPath; - -function prefetchBuildTools() { - // yes, we starting to use native Promise - return fpmPath.value; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=tools.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/targets/tools.js.map b/node_modules/app-builder-lib/out/targets/tools.js.map deleted file mode 100644 index 04fec2a..0000000 --- a/node_modules/app-builder-lib/out/targets/tools.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/targets/tools.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAEM,SAAU,iBAAV,GAA2B;AAC/B;AACA,SAAO,qCAAiB,aAAjB,EAAgC,aAAhC,EAA+C,0FAA/C,CAAP;AACD;;AAEM,MAAM,OAAO,GAAG,KAAI,eAAJ,EAAS,MAAK;AACnC,MAAI,OAAO,CAAC,QAAR,KAAqB,OAArB,IAAgC,OAAO,CAAC,GAAR,CAAY,cAAZ,KAA+B,MAAnE,EAA2E;AACzE,WAAO,OAAO,CAAC,OAAR,CAAgB,KAAhB,CAAP;AACD;;AAED,SAAO,2BAAO,KAAP,EACJ,IADI,CACC,EAAE,IAAI,IAAI,CAAC,IAAL,CAAU,EAAV,EAAc,KAAd,CADP,CAAP;AAED,CAPsB,CAAhB,C,CASP;;;;AACM,SAAU,kBAAV,GAA4B;AAChC;AACA,SAAO,OAAO,CAAC,KAAf;AACD,C","sourcesContent":["import { getBin, getBinFromGithub } from \"../binDownload\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\n\nexport function getLinuxToolsPath() {\n //noinspection SpellCheckingInspection\n return getBinFromGithub(\"linux-tools\", \"mac-10.12.3\", \"SQ8fqIRVXuQVWnVgaMTDWyf2TLAJjJYw3tRSqQJECmgF6qdM7Kogfa6KD49RbGzzMYIFca9Uw3MdsxzOPRWcYw==\")\n}\n\nexport const fpmPath = new Lazy(() => {\n if (process.platform === \"win32\" || process.env.USE_SYSTEM_FPM === \"true\") {\n return Promise.resolve(\"fpm\")\n }\n\n return getBin(\"fpm\")\n .then(it => path.join(it, \"fpm\"))\n})\n\n// noinspection JSUnusedGlobalSymbols\nexport function prefetchBuildTools(): Promise {\n // yes, we starting to use native Promise\n return fpmPath.value\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/AppFileWalker.d.ts b/node_modules/app-builder-lib/out/util/AppFileWalker.d.ts deleted file mode 100644 index 1580efe..0000000 --- a/node_modules/app-builder-lib/out/util/AppFileWalker.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -import { Filter } from "builder-util/out/fs"; -import { Stats } from "fs-extra-p"; -import { FileMatcher } from "../fileMatcher"; -import { Packager } from "../packager"; -export declare abstract class FileCopyHelper { - protected readonly matcher: FileMatcher; - readonly filter: Filter | null; - protected readonly packager: Packager; - readonly metadata: Map; - protected constructor(matcher: FileMatcher, filter: Filter | null, packager: Packager); - protected handleFile(file: string, parent: string, fileStat: Stats): Promise | null; - private handleSymlink; -} diff --git a/node_modules/app-builder-lib/out/util/AppFileWalker.js b/node_modules/app-builder-lib/out/util/AppFileWalker.js deleted file mode 100644 index 819177e..0000000 --- a/node_modules/app-builder-lib/out/util/AppFileWalker.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AppFileWalker = exports.FileCopyHelper = void 0; - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const nodeModulesSystemDependentSuffix = `${path.sep}node_modules`; - -function addAllPatternIfNeed(matcher) { - if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) { - matcher.prependPattern("**/*"); - } - - return matcher; -} - -class FileCopyHelper { - constructor(matcher, filter, packager) { - this.matcher = matcher; - this.filter = filter; - this.packager = packager; - this.metadata = new Map(); - } - - handleFile(file, parent, fileStat) { - if (!fileStat.isSymbolicLink()) { - return null; - } - - return (0, _fsExtraP().readlink)(file).then(linkTarget => { - // http://unix.stackexchange.com/questions/105637/is-symlinks-target-relative-to-the-destinations-parent-directory-and-if-so-wh - return this.handleSymlink(fileStat, file, parent, linkTarget); - }); - } - - handleSymlink(fileStat, file, parent, linkTarget) { - const resolvedLinkTarget = path.resolve(parent, linkTarget); - const link = path.relative(this.matcher.from, resolvedLinkTarget); - - if (link.startsWith("..")) { - // outside of project, linked module (https://github.com/electron-userland/electron-builder/issues/675) - return (0, _fsExtraP().stat)(resolvedLinkTarget).then(targetFileStat => { - this.metadata.set(file, targetFileStat); - return targetFileStat; - }); - } else { - const s = fileStat; - s.relativeLink = link; - s.linkRelativeToFile = path.relative(parent, resolvedLinkTarget); - } - - return null; - } - -} - -exports.FileCopyHelper = FileCopyHelper; - -function createAppFilter(matcher, packager) { - if (packager.areNodeModulesHandledExternally) { - return matcher.isEmpty() ? null : matcher.createFilter(); - } - - const nodeModulesFilter = (file, fileStat) => { - return !(fileStat.isDirectory() && file.endsWith(nodeModulesSystemDependentSuffix)); - }; - - if (matcher.isEmpty()) { - return nodeModulesFilter; - } - - const filter = matcher.createFilter(); - return (file, fileStat) => { - if (!nodeModulesFilter(file, fileStat)) { - return false; - } - - return filter(file, fileStat); - }; -} -/** @internal */ - - -class AppFileWalker extends FileCopyHelper { - constructor(matcher, packager) { - super(addAllPatternIfNeed(matcher), createAppFilter(matcher, packager), packager); - } // noinspection JSUnusedGlobalSymbols - - - consume(file, fileStat, parent, siblingNames) { - if (fileStat.isDirectory()) { - // https://github.com/electron-userland/electron-builder/issues/1539 - // but do not filter if we inside node_modules dir - // update: solution disabled, node module resolver should support such setup - if (file.endsWith(nodeModulesSystemDependentSuffix)) { - return false; - } - } else { - // save memory - no need to store stat for directory - this.metadata.set(file, fileStat); - } - - return this.handleFile(file, parent, fileStat); - } - -} exports.AppFileWalker = AppFileWalker; -// __ts-babel@6.0.4 -//# sourceMappingURL=AppFileWalker.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/AppFileWalker.js.map b/node_modules/app-builder-lib/out/util/AppFileWalker.js.map deleted file mode 100644 index fd5c5b2..0000000 --- a/node_modules/app-builder-lib/out/util/AppFileWalker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/AppFileWalker.ts"],"names":[],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;;;;AAEA,MAAM,gCAAgC,GAAG,GAAG,IAAI,CAAC,GAAG,cAApD;;AAEA,SAAS,mBAAT,CAA6B,OAA7B,EAAiD;AAC/C,MAAI,CAAC,OAAO,CAAC,uBAAT,KAAqC,OAAO,CAAC,OAAR,MAAqB,OAAO,CAAC,kBAAR,EAA1D,CAAJ,EAA6F;AAC3F,IAAA,OAAO,CAAC,cAAR,CAAuB,MAAvB;AACD;;AACD,SAAO,OAAP;AACD;;AAEK,MAAgB,cAAhB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;;AArB8C,C","sourcesContent":["import { Filter, FileConsumer } from \"builder-util/out/fs\"\nimport { readlink, stat, Stats } from \"fs-extra-p\"\nimport { FileMatcher } from \"../fileMatcher\"\nimport { Packager } from \"../packager\"\nimport * as path from \"path\"\n\nconst nodeModulesSystemDependentSuffix = `${path.sep}node_modules`\n\nfunction addAllPatternIfNeed(matcher: FileMatcher) {\n if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {\n matcher.prependPattern(\"**/*\")\n }\n return matcher\n}\n\nexport abstract class FileCopyHelper {\n readonly metadata = new Map()\n\n protected constructor(protected readonly matcher: FileMatcher, readonly filter: Filter | null, protected readonly packager: Packager) {\n }\n\n protected handleFile(file: string, parent: string, fileStat: Stats): Promise | null {\n if (!fileStat.isSymbolicLink()) {\n return null\n }\n\n return readlink(file)\n .then((linkTarget): any => {\n // http://unix.stackexchange.com/questions/105637/is-symlinks-target-relative-to-the-destinations-parent-directory-and-if-so-wh\n return this.handleSymlink(fileStat, file, parent, linkTarget)\n })\n }\n\n private handleSymlink(fileStat: Stats, file: string, parent: string, linkTarget: string): Promise | null {\n const resolvedLinkTarget = path.resolve(parent, linkTarget)\n const link = path.relative(this.matcher.from, resolvedLinkTarget)\n if (link.startsWith(\"..\")) {\n // outside of project, linked module (https://github.com/electron-userland/electron-builder/issues/675)\n return stat(resolvedLinkTarget)\n .then(targetFileStat => {\n this.metadata.set(file, targetFileStat)\n return targetFileStat\n })\n }\n else {\n const s = (fileStat as any)\n s.relativeLink = link\n s.linkRelativeToFile = path.relative(parent, resolvedLinkTarget)\n }\n return null\n }\n}\n\nfunction createAppFilter(matcher: FileMatcher, packager: Packager): Filter | null {\n if (packager.areNodeModulesHandledExternally) {\n return matcher.isEmpty() ? null : matcher.createFilter()\n }\n\n const nodeModulesFilter: Filter = (file, fileStat) => {\n return !(fileStat.isDirectory() && file.endsWith(nodeModulesSystemDependentSuffix))\n }\n\n if (matcher.isEmpty()) {\n return nodeModulesFilter\n }\n\n const filter = matcher.createFilter()\n return (file, fileStat) => {\n if (!nodeModulesFilter(file, fileStat)) {\n return false\n }\n return filter(file, fileStat)\n }\n}\n\n/** @internal */\nexport class AppFileWalker extends FileCopyHelper implements FileConsumer {\n constructor(matcher: FileMatcher, packager: Packager) {\n super(addAllPatternIfNeed(matcher), createAppFilter(matcher, packager), packager)\n }\n\n // noinspection JSUnusedGlobalSymbols\n consume(file: string, fileStat: Stats, parent: string, siblingNames: Array): any {\n if (fileStat.isDirectory()) {\n // https://github.com/electron-userland/electron-builder/issues/1539\n // but do not filter if we inside node_modules dir\n // update: solution disabled, node module resolver should support such setup\n if (file.endsWith(nodeModulesSystemDependentSuffix)) {\n return false\n }\n }\n else {\n // save memory - no need to store stat for directory\n this.metadata.set(file, fileStat)\n }\n\n return this.handleFile(file, parent, fileStat)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.d.ts b/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js b/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js deleted file mode 100644 index 50e4e41..0000000 --- a/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js +++ /dev/null @@ -1,192 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NodeModuleCopyHelper = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _fileMatcher() { - const data = require("../fileMatcher"); - - _fileMatcher = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("../platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _AppFileWalker() { - const data = require("./AppFileWalker"); - - _AppFileWalker = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const excludedFiles = new Set([".DS_Store", "node_modules" -/* already in the queue */ -, "CHANGELOG.md", "ChangeLog", "changelog.md", "binding.gyp", ".npmignore"].concat(_fileMatcher().excludedNames.split(","))); -const topLevelExcludedFiles = new Set(["test.js", "karma.conf.js", ".coveralls.yml", "README.md", "readme.markdown", "README", "readme.md", "readme", "test", "__tests__", "tests", "powered-test", "example", "examples", ".bin"]); -/** @internal */ - -class NodeModuleCopyHelper extends _AppFileWalker().FileCopyHelper { - constructor(matcher, packager) { - super(matcher, matcher.isEmpty() ? null : matcher.createFilter(), packager); - } - - collectNodeModules(baseDir, moduleNames, nodeModuleExcludedExts) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const filter = _this.filter; - const metadata = _this.metadata; - const onNodeModuleFile = (0, _platformPackager().resolveFunction)(_this.packager.config.onNodeModuleFile, "onNodeModuleFile"); - const result = []; - const queue = []; - - for (const moduleName of moduleNames) { - const tmpPath = baseDir + path.sep + moduleName; - queue.length = 1; // The path should be corrected in Windows that when the moduleName is Scoped packages named. - - const depPath = path.normalize(tmpPath); - queue[0] = depPath; - - while (queue.length > 0) { - const dirPath = queue.pop(); - const childNames = yield (0, _fsExtraP().readdir)(dirPath); - childNames.sort(); - const isTopLevel = dirPath === depPath; - const dirs = []; // our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map - - const sortedFilePaths = yield _bluebirdLst().default.map(childNames, name => { - if (onNodeModuleFile != null) { - onNodeModuleFile(dirPath + path.sep + name); - } - - if (excludedFiles.has(name) || name.startsWith("._")) { - return null; - } - - for (const ext of nodeModuleExcludedExts) { - if (name.endsWith(ext)) { - return null; - } - } // noinspection SpellCheckingInspection - - - if (isTopLevel && (topLevelExcludedFiles.has(name) || moduleName === "libui-node" && (name === "build" || name === "docs" || name === "src"))) { - return null; - } - - if (dirPath.endsWith("build")) { - if (name === "gyp-mac-tool" || name === "Makefile" || name.endsWith(".mk") || name.endsWith(".gypi") || name.endsWith(".Makefile")) { - return null; - } - } else if (dirPath.endsWith("Release") && (name === ".deps" || name === "obj.target")) { - return null; - } else if (name === "src" && (dirPath.endsWith("keytar") || dirPath.endsWith("keytar-prebuild"))) { - return null; - } else if (dirPath.endsWith("lzma-native") && (name === "build" || name === "deps")) { - return null; - } - - const filePath = dirPath + path.sep + name; - return (0, _fsExtraP().lstat)(filePath).then(stat => { - if (filter != null && !filter(filePath, stat)) { - return null; - } - - if (!stat.isDirectory()) { - metadata.set(filePath, stat); - } - - const consumerResult = _this.handleFile(filePath, dirPath, stat); - - if (consumerResult == null) { - if (stat.isDirectory()) { - dirs.push(name); - return null; - } else { - return filePath; - } - } else { - return consumerResult.then(it => { - // asarUtil can return modified stat (symlink handling) - if ((it == null ? stat : it).isDirectory()) { - dirs.push(name); - return null; - } else { - return filePath; - } - }); - } - }); - }, _fs().CONCURRENCY); - - for (const child of sortedFilePaths) { - if (child != null) { - result.push(child); - } - } - - dirs.sort(); - - for (const child of dirs) { - queue.push(dirPath + path.sep + child); - } - } - } - - return result; - })(); - } - -} exports.NodeModuleCopyHelper = NodeModuleCopyHelper; -// __ts-babel@6.0.4 -//# sourceMappingURL=NodeModuleCopyHelper.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js.map b/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js.map deleted file mode 100644 index 5e472cd..0000000 --- a/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/NodeModuleCopyHelper.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM,aAAa,GAAG,IAAI,GAAJ,CAAQ,CAAC,WAAD,EAAc;AAAe;AAA7B,EAAyD,cAAzD,EAAyE,WAAzE,EAAsF,cAAtF,EAAsG,aAAtG,EAAqH,YAArH,EAAmI,MAAnI,CAA0I,6BAAc,KAAd,CAAoB,GAApB,CAA1I,CAAR,CAAtB;AACA,MAAM,qBAAqB,GAAG,IAAI,GAAJ,CAAQ,CAAC,SAAD,EAAY,eAAZ,EAA6B,gBAA7B,EAA+C,WAA/C,EAA4D,iBAA5D,EAA+E,QAA/E,EAAyF,WAAzF,EAAsG,QAAtG,EAAgH,MAAhH,EAAwH,WAAxH,EAAqI,OAArI,EAA8I,cAA9I,EAA8J,SAA9J,EAAyK,UAAzK,EAAqL,MAArL,CAAR,CAA9B;AAEA;;AACM,MAAO,oBAAP,SAAoC,+BAApC,CAAkD;AACtD,EAAA,WAAA,CAAY,OAAZ,EAAkC,QAAlC,EAAoD;AAClD,UAAM,OAAN,EAAe,OAAO,CAAC,OAAR,KAAoB,IAApB,GAA2B,OAAO,CAAC,YAAR,EAA1C,EAAkE,QAAlE;AACD;;AAEK,EAAA,kBAAN,CAAyB,OAAzB,EAA0C,WAA1C,EAAyE,sBAAzE,EAA8G;AAA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AAED,kBAAI,CAAC,IAAI,CAAC,WAAL,EAAL,EAAyB;AACvB,gBAAA,QAAQ,CAAC,GAAT,CAAa,QAAb,EAAuB,IAAvB;AACD;;AACD,oBAAM,cAAc,GAAG,KAAI,CAAC,UAAL,CAAgB,QAAhB,EAA0B,OAA1B,EAAmC,IAAnC,CAAvB;;AACA,kBAAI,cAAc,IAAI,IAAtB,EAA4B;AAC1B,oBAAI,IAAI,CAAC,WAAL,EAAJ,EAAwB;AACtB,kBAAA,IAAI,CAAC,IAAL,CAAU,IAAV;AACA,yBAAO,IAAP;AACD,iBAHD,MAIK;AACH,yBAAO,QAAP;AACD;AACF,eARD,MASK;AACH,uBAAO,cAAc,CAClB,IADI,CACC,EAAE,IAAG;AACT;AACA,sBAAI,CAAC,EAAE,IAAI,IAAN,GAAa,IAAb,GAAoB,EAArB,EAAyB,WAAzB,EAAJ,EAA4C;AAC1C,oBAAA,IAAI,CAAC,IAAL,CAAU,IAAV;AACA,2BAAO,IAAP;AACD,mBAHD,MAIK;AACH,2BAAO,QAAP;AACD;AACF,iBAVI,CAAP;AAWD;AACF,aAhCI,CAAP;AAiCD,WArE6B,EAqE3B,iBArE2B,CAA9B;;AAuEA,eAAK,MAAM,KAAX,IAAoB,eAApB,EAAqC;AACnC,gBAAI,KAAK,IAAI,IAAb,EAAmB;AACjB,cAAA,MAAM,CAAC,IAAP,CAAY,KAAZ;AACD;AACF;;AAED,UAAA,IAAI,CAAC,IAAL;;AACA,eAAK,MAAM,KAAX,IAAoB,IAApB,EAA0B;AACxB,YAAA,KAAK,CAAC,IAAN,CAAW,OAAO,GAAG,IAAI,CAAC,GAAf,GAAqB,KAAhC;AACD;AACF;AACF;;AACD,aAAO,MAAP;AA3G4G;AA4G7G;;AAjHqD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { CONCURRENCY } from \"builder-util/out/fs\"\nimport { lstat, readdir } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { excludedNames, FileMatcher } from \"../fileMatcher\"\nimport { Packager } from \"../packager\"\nimport { resolveFunction } from \"../platformPackager\"\nimport { FileCopyHelper } from \"./AppFileWalker\"\n\nconst excludedFiles = new Set([\".DS_Store\", \"node_modules\" /* already in the queue */, \"CHANGELOG.md\", \"ChangeLog\", \"changelog.md\", \"binding.gyp\", \".npmignore\"].concat(excludedNames.split(\",\")))\nconst topLevelExcludedFiles = new Set([\"test.js\", \"karma.conf.js\", \".coveralls.yml\", \"README.md\", \"readme.markdown\", \"README\", \"readme.md\", \"readme\", \"test\", \"__tests__\", \"tests\", \"powered-test\", \"example\", \"examples\", \".bin\"])\n\n/** @internal */\nexport class NodeModuleCopyHelper extends FileCopyHelper {\n constructor(matcher: FileMatcher, packager: Packager) {\n super(matcher, matcher.isEmpty() ? null : matcher.createFilter(), packager)\n }\n\n async collectNodeModules(baseDir: string, moduleNames: Iterable, nodeModuleExcludedExts: Array): Promise> {\n const filter = this.filter\n const metadata = this.metadata\n\n const onNodeModuleFile = resolveFunction(this.packager.config.onNodeModuleFile, \"onNodeModuleFile\")\n\n const result: Array = []\n const queue: Array = []\n for (const moduleName of moduleNames) {\n const tmpPath = baseDir + path.sep + moduleName\n queue.length = 1\n // The path should be corrected in Windows that when the moduleName is Scoped packages named.\n const depPath = path.normalize(tmpPath)\n queue[0] = depPath\n\n while (queue.length > 0) {\n const dirPath = queue.pop()!\n\n const childNames = await readdir(dirPath)\n childNames.sort()\n\n const isTopLevel = dirPath === depPath\n const dirs: Array = []\n // our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map\n const sortedFilePaths = await BluebirdPromise.map(childNames, name => {\n if (onNodeModuleFile != null) {\n onNodeModuleFile(dirPath + path.sep + name)\n }\n\n if (excludedFiles.has(name) || name.startsWith(\"._\")) {\n return null\n }\n\n for (const ext of nodeModuleExcludedExts) {\n if (name.endsWith(ext)) {\n return null\n }\n }\n\n // noinspection SpellCheckingInspection\n if (isTopLevel && (topLevelExcludedFiles.has(name) || (moduleName === \"libui-node\" && (name === \"build\" || name === \"docs\" || name === \"src\")))) {\n return null\n }\n\n if (dirPath.endsWith(\"build\")) {\n if (name === \"gyp-mac-tool\" || name === \"Makefile\" || name.endsWith(\".mk\") || name.endsWith(\".gypi\") || name.endsWith(\".Makefile\")) {\n return null\n }\n }\n else if (dirPath.endsWith(\"Release\") && (name === \".deps\" || name === \"obj.target\")) {\n return null\n }\n else if (name === \"src\" && (dirPath.endsWith(\"keytar\") || dirPath.endsWith(\"keytar-prebuild\"))) {\n return null\n }\n else if (dirPath.endsWith(\"lzma-native\") && (name === \"build\" || name === \"deps\")) {\n return null\n }\n\n const filePath = dirPath + path.sep + name\n return lstat(filePath)\n .then(stat => {\n if (filter != null && !filter(filePath, stat)) {\n return null\n }\n\n if (!stat.isDirectory()) {\n metadata.set(filePath, stat)\n }\n const consumerResult = this.handleFile(filePath, dirPath, stat)\n if (consumerResult == null) {\n if (stat.isDirectory()) {\n dirs.push(name)\n return null\n }\n else {\n return filePath\n }\n }\n else {\n return consumerResult\n .then(it => {\n // asarUtil can return modified stat (symlink handling)\n if ((it == null ? stat : it).isDirectory()) {\n dirs.push(name)\n return null\n }\n else {\n return filePath\n }\n })\n }\n })\n }, CONCURRENCY)\n\n for (const child of sortedFilePaths) {\n if (child != null) {\n result.push(child)\n }\n }\n\n dirs.sort()\n for (const child of dirs) {\n queue.push(dirPath + path.sep + child)\n }\n }\n }\n return result\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/appBuilder.d.ts b/node_modules/app-builder-lib/out/util/appBuilder.d.ts deleted file mode 100644 index e706cdd..0000000 --- a/node_modules/app-builder-lib/out/util/appBuilder.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare function executeAppBuilderAsJson(args: Array): Promise; -export declare function objectToArgs(to: Array, argNameToValue: { - [key: string]: string | null; -}): void; diff --git a/node_modules/app-builder-lib/out/util/appBuilder.js b/node_modules/app-builder-lib/out/util/appBuilder.js deleted file mode 100644 index be69417..0000000 --- a/node_modules/app-builder-lib/out/util/appBuilder.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.executeAppBuilderAsJson = executeAppBuilderAsJson; -exports.objectToArgs = objectToArgs; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function executeAppBuilderAsJson(args) { - return (0, _builderUtil().executeAppBuilder)(args).then(rawResult => { - try { - return JSON.parse(rawResult); - } catch (e) { - throw new Error(`Cannot parse result: ${e.message}: "${rawResult}"`); - } - }); -} - -function objectToArgs(to, argNameToValue) { - for (const name of Object.keys(argNameToValue)) { - const value = argNameToValue[name]; - - if (value != null) { - to.push(`--${name}`, value); - } - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=appBuilder.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/appBuilder.js.map b/node_modules/app-builder-lib/out/util/appBuilder.js.map deleted file mode 100644 index b62eda2..0000000 --- a/node_modules/app-builder-lib/out/util/appBuilder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/appBuilder.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,SAAU,uBAAV,CAAqC,IAArC,EAAwD;AAC5D,SAAO,sCAAkB,IAAlB,EACJ,IADI,CACC,SAAS,IAAG;AAChB,QAAI;AACF,aAAO,IAAI,CAAC,KAAL,CAAW,SAAX,CAAP;AACD,KAFD,CAGA,OAAO,CAAP,EAAU;AACR,YAAM,IAAI,KAAJ,CAAU,wBAAwB,CAAC,CAAC,OAAO,MAAM,SAAS,GAA1D,CAAN;AACD;AACF,GARI,CAAP;AASD;;AAEK,SAAU,YAAV,CAAuB,EAAvB,EAA0C,cAA1C,EAA2F;AAC/F,OAAK,MAAM,IAAX,IAAmB,MAAM,CAAC,IAAP,CAAY,cAAZ,CAAnB,EAAgD;AAC9C,UAAM,KAAK,GAAG,cAAc,CAAC,IAAD,CAA5B;;AACA,QAAI,KAAK,IAAI,IAAb,EAAmB;AACjB,MAAA,EAAE,CAAC,IAAH,CAAQ,KAAK,IAAI,EAAjB,EAAqB,KAArB;AACD;AACF;AACF,C","sourcesContent":["import { executeAppBuilder } from \"builder-util\"\n\nexport function executeAppBuilderAsJson(args: Array): Promise {\n return executeAppBuilder(args)\n .then(rawResult => {\n try {\n return JSON.parse(rawResult) as T\n }\n catch (e) {\n throw new Error(`Cannot parse result: ${e.message}: \"${rawResult}\"`)\n }\n })\n}\n\nexport function objectToArgs(to: Array, argNameToValue: { [key: string]: string | null; }): void {\n for (const name of Object.keys(argNameToValue)) {\n const value = argNameToValue[name]\n if (value != null) {\n to.push(`--${name}`, value)\n }\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/appFileCopier.d.ts b/node_modules/app-builder-lib/out/util/appFileCopier.d.ts deleted file mode 100644 index 660b2f3..0000000 --- a/node_modules/app-builder-lib/out/util/appFileCopier.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import { FileTransformer } from "builder-util/out/fs"; -import { Stats } from "fs-extra-p"; -import { Packager } from "../packager"; -import { PlatformPackager } from "../platformPackager"; -import { FileMatcher } from "../fileMatcher"; -export declare function getDestinationPath(file: string, fileSet: ResolvedFileSet): string; -export declare function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager, transformer: FileTransformer): Promise; -export interface ResolvedFileSet { - src: string; - destination: string; - files: Array; - metadata: Map; - transformedFiles?: Map | null; -} -export declare function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise; -export declare function computeFileSets(matchers: Array, transformer: FileTransformer | null, platformPackager: PlatformPackager, isElectronCompile: boolean): Promise>; diff --git a/node_modules/app-builder-lib/out/util/appFileCopier.js b/node_modules/app-builder-lib/out/util/appFileCopier.js deleted file mode 100644 index 655df80..0000000 --- a/node_modules/app-builder-lib/out/util/appFileCopier.js +++ /dev/null @@ -1,459 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getDestinationPath = getDestinationPath; -exports.copyAppFiles = copyAppFiles; -exports.transformFiles = transformFiles; -exports.computeFileSets = computeFileSets; -exports.computeNodeModuleFileSets = computeNodeModuleFileSets; -exports.ELECTRON_COMPILE_SHIM_FILENAME = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _unpackDetector() { - const data = require("../asar/unpackDetector"); - - _unpackDetector = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("../core"); - - _core = function () { - return data; - }; - - return data; -} - -function _fileMatcher() { - const data = require("../fileMatcher"); - - _fileMatcher = function () { - return data; - }; - - return data; -} - -function _fileTransformer() { - const data = require("../fileTransformer"); - - _fileTransformer = function () { - return data; - }; - - return data; -} - -function _appBuilder() { - const data = require("./appBuilder"); - - _appBuilder = function () { - return data; - }; - - return data; -} - -function _AppFileWalker() { - const data = require("./AppFileWalker"); - - _AppFileWalker = function () { - return data; - }; - - return data; -} - -function _NodeModuleCopyHelper() { - const data = require("./NodeModuleCopyHelper"); - - _NodeModuleCopyHelper = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const BOWER_COMPONENTS_PATTERN = `${path.sep}bower_components${path.sep}`; -/** @internal */ - -const ELECTRON_COMPILE_SHIM_FILENAME = "__shim.js"; -exports.ELECTRON_COMPILE_SHIM_FILENAME = ELECTRON_COMPILE_SHIM_FILENAME; - -function getDestinationPath(file, fileSet) { - if (file === fileSet.src) { - return fileSet.destination; - } else { - const src = fileSet.src; - const dest = fileSet.destination; - - if (file.length > src.length && file.startsWith(src) && file[src.length] === path.sep) { - return dest + file.substring(src.length); - } else { - // hoisted node_modules - // not lastIndexOf, to ensure that nested module (top-level module depends on) copied to parent node_modules, not to top-level directory - // project https://github.com/angexis/punchcontrol/commit/cf929aba55c40d0d8901c54df7945e1d001ce022 - const index = file.indexOf(_fileTransformer().NODE_MODULES_PATTERN); - - if (index < 0) { - throw new Error(`File "${file}" not under the source directory "${fileSet.src}"`); - } - - return dest + file.substring(index + 1 - /* leading slash */ - ); - } - } -} - -function copyAppFiles(_x, _x2, _x3) { - return _copyAppFiles.apply(this, arguments); -} // used only for ASAR, if no asar, file transformed on the fly - - -function _copyAppFiles() { - _copyAppFiles = (0, _bluebirdLst().coroutine)(function* (fileSet, packager, transformer) { - const metadata = fileSet.metadata; // search auto unpacked dir - - const taskManager = new (_builderUtil().AsyncTaskManager)(packager.cancellationToken); - const createdParentDirs = new Set(); - const fileCopier = new (_fs().FileCopier)(file => { - // https://github.com/electron-userland/electron-builder/issues/3038 - return !((0, _unpackDetector().isLibOrExe)(file) || file.endsWith(".node")); - }, transformer); - const links = []; - - for (let i = 0, n = fileSet.files.length; i < n; i++) { - const sourceFile = fileSet.files[i]; - const stat = metadata.get(sourceFile); - - if (stat == null) { - // dir - continue; - } - - const destinationFile = getDestinationPath(sourceFile, fileSet); - - if (stat.isSymbolicLink()) { - links.push({ - file: destinationFile, - link: yield (0, _fsExtraP().readlink)(sourceFile) - }); - continue; - } - - const fileParent = path.dirname(destinationFile); - - if (!createdParentDirs.has(fileParent)) { - createdParentDirs.add(fileParent); - yield (0, _fsExtraP().ensureDir)(fileParent); - } - - taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat)); - - if (taskManager.tasks.length > _fs().MAX_FILE_REQUESTS) { - yield taskManager.awaitTasks(); - } - } - - if (taskManager.tasks.length > 0) { - yield taskManager.awaitTasks(); - } - - if (links.length > 0) { - yield _bluebirdLst().default.map(links, it => (0, _fsExtraP().symlink)(it.link, it.file), _fs().CONCURRENCY); - } - }); - return _copyAppFiles.apply(this, arguments); -} - -function transformFiles(_x4, _x5) { - return _transformFiles.apply(this, arguments); -} - -function _transformFiles() { - _transformFiles = (0, _bluebirdLst().coroutine)(function* (transformer, fileSet) { - if (transformer == null) { - return; - } - - let transformedFiles = fileSet.transformedFiles; - - if (fileSet.transformedFiles == null) { - transformedFiles = new Map(); - fileSet.transformedFiles = transformedFiles; - } - - const metadata = fileSet.metadata; - yield _bluebirdLst().default.filter(fileSet.files, (it, index) => { - const fileStat = metadata.get(it); - - if (fileStat == null || !fileStat.isFile()) { - return false; - } - - const transformedValue = transformer(it); - - if (transformedValue == null) { - return false; - } - - if (typeof transformedValue === "object" && "then" in transformedValue) { - return transformedValue.then(it => { - if (it != null) { - transformedFiles.set(index, it); - } - - return false; - }); - } - - transformedFiles.set(index, transformedValue); - return false; - }, _fs().CONCURRENCY); - }); - return _transformFiles.apply(this, arguments); -} - -function computeFileSets(_x6, _x7, _x8, _x9) { - return _computeFileSets.apply(this, arguments); -} - -function _computeFileSets() { - _computeFileSets = (0, _bluebirdLst().coroutine)(function* (matchers, transformer, platformPackager, isElectronCompile) { - const fileSets = []; - const packager = platformPackager.info; - - for (const matcher of matchers) { - const fileWalker = new (_AppFileWalker().AppFileWalker)(matcher, packager); - const fromStat = yield (0, _fs().statOrNull)(matcher.from); - - if (fromStat == null) { - _builderUtil().log.debug({ - directory: matcher.from, - reason: "doesn't exist" - }, `skipped copying`); - - continue; - } - - const files = yield (0, _fs().walk)(matcher.from, fileWalker.filter, fileWalker); - const metadata = fileWalker.metadata; - fileSets.push(validateFileSet({ - src: matcher.from, - files, - metadata, - destination: matcher.to - })); - } - - if (isElectronCompile) { - // cache files should be first (better IO) - fileSets.unshift((yield compileUsingElectronCompile(fileSets[0], packager))); - } - - return fileSets; - }); - return _computeFileSets.apply(this, arguments); -} - -function getNodeModuleExcludedExts(platformPackager) { - // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852) - const result = [".o", ".obj"].concat(_fileMatcher().excludedExts.split(",").map(it => `.${it}`)); - - if (platformPackager.config.includePdb !== true) { - result.push(".pdb"); - } - - if (platformPackager.platform !== _core().Platform.WINDOWS) { - // https://github.com/electron-userland/electron-builder/issues/1738 - result.push(".dll"); - result.push(".exe"); - } - - return result; -} - -function validateFileSet(fileSet) { - if (fileSet.src == null || fileSet.src.length === 0) { - throw new Error("fileset src is empty"); - } - - return fileSet; -} -/** @internal */ - - -function computeNodeModuleFileSets(_x10, _x11) { - return _computeNodeModuleFileSets.apply(this, arguments); -} - -function _computeNodeModuleFileSets() { - _computeNodeModuleFileSets = (0, _bluebirdLst().coroutine)(function* (platformPackager, mainMatcher) { - const args = ["node-dep-tree", "--dir", platformPackager.info.appDir]; - - if (platformPackager.info.framework.getExcludedDependencies != null) { - const excludedDependencies = platformPackager.info.framework.getExcludedDependencies(platformPackager.platform); - - if (excludedDependencies != null) { - for (const name of excludedDependencies) { - args.push("--exclude-dep", name); - } - } - } - - const deps = yield (0, _appBuilder().executeAppBuilderAsJson)(args); - const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager); // mapSeries instead of map because copyNodeModules is concurrent and so, no need to increase queue/pressure - - return yield _bluebirdLst().default.mapSeries(deps, - /*#__PURE__*/ - function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (info) { - const source = info.dir; - let destination; - - if (source.length > mainMatcher.from.length && source.startsWith(mainMatcher.from) && source[mainMatcher.from.length] === path.sep) { - destination = getDestinationPath(source, { - src: mainMatcher.from, - destination: mainMatcher.to, - files: [], - metadata: null - }); - } else { - destination = mainMatcher.to + path.sep + "node_modules"; - } // use main matcher patterns, so, user can exclude some files in such hoisted node modules - // source here includes node_modules, but pattern base should be without because users expect that pattern "!node_modules/loot-core/src{,/**/*}" will work - - - const matcher = new (_fileMatcher().FileMatcher)(path.dirname(source), destination, mainMatcher.macroExpander, mainMatcher.patterns); - const copier = new (_NodeModuleCopyHelper().NodeModuleCopyHelper)(matcher, platformPackager.info); - const names = info.deps; - const files = yield copier.collectNodeModules(source, names, nodeModuleExcludedExts); - return validateFileSet({ - src: source, - destination, - files, - metadata: copier.metadata - }); - }); - - return function (_x14) { - return _ref.apply(this, arguments); - }; - }()); - }); - return _computeNodeModuleFileSets.apply(this, arguments); -} - -function compileUsingElectronCompile(_x12, _x13) { - return _compileUsingElectronCompile.apply(this, arguments); -} function _compileUsingElectronCompile() { - _compileUsingElectronCompile = (0, _bluebirdLst().coroutine)(function* (mainFileSet, packager) { - _builderUtil().log.info("compiling using electron-compile"); - - const electronCompileCache = yield packager.tempDirManager.getTempDir({ - prefix: "electron-compile-cache" - }); - const cacheDir = path.join(electronCompileCache, ".cache"); // clear and create cache dir - - yield (0, _fsExtraP().ensureDir)(cacheDir); - const compilerHost = yield (0, _fileTransformer().createElectronCompilerHost)(mainFileSet.src, cacheDir); - const nextSlashIndex = mainFileSet.src.length + 1; // pre-compute electron-compile to cache dir - we need to process only subdirectories, not direct files of app dir - - yield _bluebirdLst().default.map(mainFileSet.files, file => { - if (file.includes(_fileTransformer().NODE_MODULES_PATTERN) || file.includes(BOWER_COMPONENTS_PATTERN) || !file.includes(path.sep, nextSlashIndex) // ignore not root files - || !mainFileSet.metadata.get(file).isFile()) { - return null; - } - - return compilerHost.compile(file).then(() => null); - }, _fs().CONCURRENCY); - yield compilerHost.saveConfiguration(); - const metadata = new Map(); - const cacheFiles = yield (0, _fs().walk)(cacheDir, file => !file.startsWith("."), { - consume: (file, fileStat) => { - if (fileStat.isFile()) { - metadata.set(file, fileStat); - } - - return null; - } - }); // add shim - - const shimPath = `${mainFileSet.src}${path.sep}${ELECTRON_COMPILE_SHIM_FILENAME}`; - mainFileSet.files.push(shimPath); - mainFileSet.metadata.set(shimPath, { - isFile: () => true, - isDirectory: () => false, - isSymbolicLink: () => false - }); - - if (mainFileSet.transformedFiles == null) { - mainFileSet.transformedFiles = new Map(); - } - - mainFileSet.transformedFiles.set(mainFileSet.files.length - 1, ` -'use strict'; -require('electron-compile').init(__dirname, require('path').resolve(__dirname, '${packager.metadata.main || "index"}'), true); -`); - return { - src: electronCompileCache, - files: cacheFiles, - metadata, - destination: mainFileSet.destination - }; - }); - return _compileUsingElectronCompile.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=appFileCopier.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/appFileCopier.js.map b/node_modules/app-builder-lib/out/util/appFileCopier.js.map deleted file mode 100644 index d54e31a..0000000 --- a/node_modules/app-builder-lib/out/util/appFileCopier.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM,wBAAwB,GAAG,GAAG,IAAI,CAAC,GAAG,mBAAmB,IAAI,CAAC,GAAG,EAAvE;AACA;;AACO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,EAAuB;AACrB,UAAA,QAAQ,CAAC,GAAT,CAAa,IAAb,EAAmB,QAAnB;AACD;;AACD,eAAO,IAAP;AACD;AANoE,KAA9C,CAAzB,CAvByF,CAgCzF;;AACA,UAAM,QAAQ,GAAG,GAAG,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,8BAA8B,EAA/E;AACA,IAAA,WAAW,CAAC,KAAZ,CAAkB,IAAlB,CAAuB,QAAvB;AACA,IAAA,WAAW,CAAC,QAAZ,CAAqB,GAArB,CAAyB,QAAzB,EAAmC;AAAC,MAAA,MAAM,EAAE,MAAM,IAAf;AAAqB,MAAA,WAAW,EAAE,MAAM,KAAxC;AAA+C,MAAA,cAAc,EAAE,MAAM;AAArE,KAAnC;;AACA,QAAI,WAAW,CAAC,gBAAZ,IAAgC,IAApC,EAA0C;AACxC,MAAA,WAAW,CAAC,gBAAZ,GAA+B,IAAI,GAAJ,EAA/B;AACD;;AACD,IAAA,WAAW,CAAC,gBAAZ,CAA6B,GAA7B,CAAiC,WAAW,CAAC,KAAZ,CAAkB,MAAlB,GAA2B,CAA5D,EAA+D;;kFAEiB,QAAQ,CAAC,QAAT,CAAkB,IAAlB,IAA0B,OAAO;CAFjH;AAIA,WAAO;AAAC,MAAA,GAAG,EAAE,oBAAN;AAA4B,MAAA,KAAK,EAAE,UAAnC;AAA+C,MAAA,QAA/C;AAAyD,MAAA,WAAW,EAAE,WAAW,CAAC;AAAlF,KAAP;AACD,G","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { AsyncTaskManager, log } from \"builder-util\"\nimport { CONCURRENCY, FileCopier, Link, MAX_FILE_REQUESTS, FileTransformer, statOrNull, walk } from \"builder-util/out/fs\"\nimport { ensureDir, readlink, Stats, symlink } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { isLibOrExe } from \"../asar/unpackDetector\"\nimport { Platform } from \"../core\"\nimport { Packager } from \"../packager\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { excludedExts, FileMatcher } from \"../fileMatcher\"\nimport { createElectronCompilerHost, NODE_MODULES_PATTERN } from \"../fileTransformer\"\nimport { executeAppBuilderAsJson } from \"./appBuilder\"\nimport { AppFileWalker } from \"./AppFileWalker\"\nimport { NodeModuleCopyHelper } from \"./NodeModuleCopyHelper\"\n\nconst BOWER_COMPONENTS_PATTERN = `${path.sep}bower_components${path.sep}`\n/** @internal */\nexport const ELECTRON_COMPILE_SHIM_FILENAME = \"__shim.js\"\n\nexport function getDestinationPath(file: string, fileSet: ResolvedFileSet) {\n if (file === fileSet.src) {\n return fileSet.destination\n }\n else {\n const src = fileSet.src\n const dest = fileSet.destination\n if (file.length > src.length && file.startsWith(src) && file[src.length] === path.sep) {\n return dest + file.substring(src.length)\n }\n else {\n // hoisted node_modules\n // not lastIndexOf, to ensure that nested module (top-level module depends on) copied to parent node_modules, not to top-level directory\n // project https://github.com/angexis/punchcontrol/commit/cf929aba55c40d0d8901c54df7945e1d001ce022\n const index = file.indexOf(NODE_MODULES_PATTERN)\n if (index < 0) {\n throw new Error(`File \"${file}\" not under the source directory \"${fileSet.src}\"`)\n }\n return dest + file.substring(index + 1 /* leading slash */)\n }\n }\n}\n\nexport async function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager, transformer: FileTransformer) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const createdParentDirs = new Set()\n\n const fileCopier = new FileCopier(file => {\n // https://github.com/electron-userland/electron-builder/issues/3038\n return !(isLibOrExe(file) || file.endsWith(\".node\"))\n }, transformer)\n const links: Array = []\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const sourceFile = fileSet.files[i]\n const stat = metadata.get(sourceFile)\n if (stat == null) {\n // dir\n continue\n }\n\n const destinationFile = getDestinationPath(sourceFile, fileSet)\n if (stat.isSymbolicLink()) {\n links.push({file: destinationFile, link: await readlink(sourceFile)})\n continue\n }\n\n const fileParent = path.dirname(destinationFile)\n if (!createdParentDirs.has(fileParent)) {\n createdParentDirs.add(fileParent)\n await ensureDir(fileParent)\n }\n\n taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n if (links.length > 0) {\n await BluebirdPromise.map(links, it => symlink(it.link, it.file), CONCURRENCY)\n }\n}\n\n// os path separator is used\nexport interface ResolvedFileSet {\n src: string\n destination: string\n\n files: Array\n metadata: Map\n transformedFiles?: Map | null\n}\n\n// used only for ASAR, if no asar, file transformed on the fly\nexport async function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise {\n if (transformer == null) {\n return\n }\n\n let transformedFiles = fileSet.transformedFiles\n if (fileSet.transformedFiles == null) {\n transformedFiles = new Map()\n fileSet.transformedFiles = transformedFiles\n }\n\n const metadata = fileSet.metadata\n await BluebirdPromise.filter(fileSet.files, (it, index) => {\n const fileStat = metadata.get(it)\n if (fileStat == null || !fileStat.isFile()) {\n return false\n }\n\n const transformedValue = transformer(it)\n if (transformedValue == null) {\n return false\n }\n\n if (typeof transformedValue === \"object\" && \"then\" in transformedValue) {\n return (transformedValue as Promise)\n .then(it => {\n if (it != null) {\n transformedFiles!!.set(index, it)\n }\n return false\n })\n }\n transformedFiles!!.set(index, transformedValue as string | Buffer)\n return false\n }, CONCURRENCY)\n}\n\nexport async function computeFileSets(matchers: Array, transformer: FileTransformer | null, platformPackager: PlatformPackager, isElectronCompile: boolean): Promise> {\n const fileSets: Array = []\n const packager = platformPackager.info\n\n for (const matcher of matchers) {\n const fileWalker = new AppFileWalker(matcher, packager)\n\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.debug({directory: matcher.from, reason: \"doesn't exist\"}, `skipped copying`)\n continue\n }\n\n const files = await walk(matcher.from, fileWalker.filter, fileWalker)\n const metadata = fileWalker.metadata\n fileSets.push(validateFileSet({src: matcher.from, files, metadata, destination: matcher.to}))\n }\n\n if (isElectronCompile) {\n // cache files should be first (better IO)\n fileSets.unshift(await compileUsingElectronCompile(fileSets[0], packager))\n }\n return fileSets\n}\n\nfunction getNodeModuleExcludedExts(platformPackager: PlatformPackager) {\n // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)\n const result = [\".o\", \".obj\"].concat(excludedExts.split(\",\").map(it => `.${it}`))\n if (platformPackager.config.includePdb !== true) {\n result.push(\".pdb\")\n }\n if (platformPackager.platform !== Platform.WINDOWS) {\n // https://github.com/electron-userland/electron-builder/issues/1738\n result.push(\".dll\")\n result.push(\".exe\")\n }\n return result\n}\n\nfunction validateFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n if (fileSet.src == null || fileSet.src.length === 0) {\n throw new Error(\"fileset src is empty\")\n }\n return fileSet\n}\n\n/** @internal */\nexport async function computeNodeModuleFileSets(platformPackager: PlatformPackager, mainMatcher: FileMatcher): Promise> {\n const args = [\"node-dep-tree\", \"--dir\", platformPackager.info.appDir]\n if (platformPackager.info.framework.getExcludedDependencies != null) {\n const excludedDependencies = platformPackager.info.framework.getExcludedDependencies(platformPackager.platform)\n if (excludedDependencies != null) {\n for (const name of excludedDependencies) {\n args.push(\"--exclude-dep\", name)\n }\n }\n }\n\n const deps = await executeAppBuilderAsJson>(args)\n const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager)\n // mapSeries instead of map because copyNodeModules is concurrent and so, no need to increase queue/pressure\n return await BluebirdPromise.mapSeries(deps, async info => {\n const source = info.dir\n let destination: string\n if (source.length > mainMatcher.from.length && source.startsWith(mainMatcher.from) && source[mainMatcher.from.length] === path.sep) {\n destination = getDestinationPath(source, {src: mainMatcher.from, destination: mainMatcher.to, files: [], metadata: null as any})\n }\n else {\n destination = mainMatcher.to + path.sep + \"node_modules\"\n }\n\n // use main matcher patterns, so, user can exclude some files in such hoisted node modules\n // source here includes node_modules, but pattern base should be without because users expect that pattern \"!node_modules/loot-core/src{,/**/*}\" will work\n const matcher = new FileMatcher(path.dirname(source), destination, mainMatcher.macroExpander, mainMatcher.patterns)\n const copier = new NodeModuleCopyHelper(matcher, platformPackager.info)\n const names = info.deps\n const files = await copier.collectNodeModules(source, names, nodeModuleExcludedExts)\n return validateFileSet({src: source, destination, files, metadata: copier.metadata})\n })\n}\n\nasync function compileUsingElectronCompile(mainFileSet: ResolvedFileSet, packager: Packager): Promise {\n log.info(\"compiling using electron-compile\")\n\n const electronCompileCache = await packager.tempDirManager.getTempDir({prefix: \"electron-compile-cache\"})\n const cacheDir = path.join(electronCompileCache, \".cache\")\n // clear and create cache dir\n await ensureDir(cacheDir)\n const compilerHost = await createElectronCompilerHost(mainFileSet.src, cacheDir)\n const nextSlashIndex = mainFileSet.src.length + 1\n // pre-compute electron-compile to cache dir - we need to process only subdirectories, not direct files of app dir\n await BluebirdPromise.map(mainFileSet.files, file => {\n if (file.includes(NODE_MODULES_PATTERN) || file.includes(BOWER_COMPONENTS_PATTERN)\n || !file.includes(path.sep, nextSlashIndex) // ignore not root files\n || !mainFileSet.metadata.get(file)!.isFile()) {\n return null\n }\n return compilerHost.compile(file)\n .then(() => null)\n }, CONCURRENCY)\n\n await compilerHost.saveConfiguration()\n\n const metadata = new Map()\n const cacheFiles = await walk(cacheDir, file => !file.startsWith(\".\"), {\n consume: (file, fileStat) => {\n if (fileStat.isFile()) {\n metadata.set(file, fileStat)\n }\n return null\n }\n })\n\n // add shim\n const shimPath = `${mainFileSet.src}${path.sep}${ELECTRON_COMPILE_SHIM_FILENAME}`\n mainFileSet.files.push(shimPath)\n mainFileSet.metadata.set(shimPath, {isFile: () => true, isDirectory: () => false, isSymbolicLink: () => false} as any)\n if (mainFileSet.transformedFiles == null) {\n mainFileSet.transformedFiles = new Map()\n }\n mainFileSet.transformedFiles.set(mainFileSet.files.length - 1, `\n'use strict';\nrequire('electron-compile').init(__dirname, require('path').resolve(__dirname, '${packager.metadata.main || \"index\"}'), true);\n`)\n return {src: electronCompileCache, files: cacheFiles, metadata, destination: mainFileSet.destination}\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/bundledTool.d.ts b/node_modules/app-builder-lib/out/util/bundledTool.d.ts deleted file mode 100644 index aa57a54..0000000 --- a/node_modules/app-builder-lib/out/util/bundledTool.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface ToolInfo { - path: string; - env?: any; -} -export declare function computeEnv(oldValue: string | null | undefined, newValues: Array): string; -export declare function computeToolEnv(libPath: Array): any; diff --git a/node_modules/app-builder-lib/out/util/bundledTool.js b/node_modules/app-builder-lib/out/util/bundledTool.js deleted file mode 100644 index 4b8544c..0000000 --- a/node_modules/app-builder-lib/out/util/bundledTool.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.computeEnv = computeEnv; -exports.computeToolEnv = computeToolEnv; - -function computeEnv(oldValue, newValues) { - const parsedOldValue = oldValue ? oldValue.split(":") : []; - return newValues.concat(parsedOldValue).filter(it => it.length > 0).join(":"); -} - -function computeToolEnv(libPath) { - // noinspection SpellCheckingInspection - return Object.assign({}, process.env, { - DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, libPath) - }); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=bundledTool.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/bundledTool.js.map b/node_modules/app-builder-lib/out/util/bundledTool.js.map deleted file mode 100644 index e3651ff..0000000 --- a/node_modules/app-builder-lib/out/util/bundledTool.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/bundledTool.ts"],"names":[],"mappings":";;;;;;;;AAKM,SAAU,UAAV,CAAqB,QAArB,EAA0D,SAA1D,EAAkF;AACtF,QAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC,KAAT,CAAe,GAAf,CAAH,GAAyB,EAAxD;AACA,SAAO,SAAS,CAAC,MAAV,CAAiB,cAAjB,EAAiC,MAAjC,CAAwC,EAAE,IAAI,EAAE,CAAC,MAAH,GAAY,CAA1D,EAA6D,IAA7D,CAAkE,GAAlE,CAAP;AACD;;AAEK,SAAU,cAAV,CAAyB,OAAzB,EAA+C;AACnD;AACA,SAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACK,OAAO,CAAC,GADb,EACgB;AACd,IAAA,iBAAiB,EAAE,UAAU,CAAC,OAAO,CAAC,GAAR,CAAY,iBAAb,EAAgC,OAAhC;AADf,GADhB,CAAA;AAID,C","sourcesContent":["export interface ToolInfo {\n path: string\n env?: any\n}\n\nexport function computeEnv(oldValue: string | null | undefined, newValues: Array): string {\n const parsedOldValue = oldValue ? oldValue.split(\":\") : []\n return newValues.concat(parsedOldValue).filter(it => it.length > 0).join(\":\")\n}\n\nexport function computeToolEnv(libPath: Array): any {\n // noinspection SpellCheckingInspection\n return {\n ...process.env,\n DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, libPath)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/cacheManager.d.ts b/node_modules/app-builder-lib/out/util/cacheManager.d.ts deleted file mode 100644 index 5c0dead..0000000 --- a/node_modules/app-builder-lib/out/util/cacheManager.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// -import { Arch } from "builder-util"; -import { Hash } from "crypto"; -export interface BuildCacheInfo { - executableDigest: string; -} -export declare class BuildCacheManager { - private readonly executableFile; - static VERSION: string; - readonly cacheDir: string; - readonly cacheInfoFile: string; - readonly cacheFile: string; - cacheInfo: BuildCacheInfo | null; - private newDigest; - constructor(outDir: string, executableFile: string, arch: Arch); - copyIfValid(digest: string): Promise; - save(): Promise; -} -export declare function digest(hash: Hash, files: Array): Promise; diff --git a/node_modules/app-builder-lib/out/util/cacheManager.js b/node_modules/app-builder-lib/out/util/cacheManager.js deleted file mode 100644 index 4110bba..0000000 --- a/node_modules/app-builder-lib/out/util/cacheManager.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.digest = digest; -exports.BuildCacheManager = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class BuildCacheManager { - constructor(outDir, executableFile, arch) { - this.executableFile = executableFile; - this.cacheInfo = null; - this.newDigest = null; - this.cacheDir = path.join(outDir, ".cache", _builderUtil().Arch[arch]); - this.cacheFile = path.join(this.cacheDir, "app.exe"); - this.cacheInfoFile = path.join(this.cacheDir, "info.json"); - } - - copyIfValid(digest) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - _this.newDigest = digest; - _this.cacheInfo = yield (0, _promise().orNullIfFileNotExist)((0, _fsExtraP().readJson)(_this.cacheInfoFile)); - const oldDigest = _this.cacheInfo == null ? null : _this.cacheInfo.executableDigest; - - if (oldDigest !== digest) { - _builderUtil().log.debug({ - oldDigest, - newDigest: digest - }, "no valid cached executable found"); - - return false; - } - - _builderUtil().log.debug({ - cacheFile: _this.cacheFile, - file: _this.executableFile - }, `copying cached executable`); - - try { - yield (0, _fs().copyFile)(_this.cacheFile, _this.executableFile, false); - return true; - } catch (e) { - if (e.code === "ENOENT" || e.code === "ENOTDIR") { - _builderUtil().log.debug({ - error: e.code - }, "copy cached executable failed"); - } else { - _builderUtil().log.warn({ - error: e.stack || e - }, `cannot copy cached executable`); - } - } - - return false; - })(); - } - - save() { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (_this2.newDigest == null) { - throw new Error("call copyIfValid before"); - } - - if (_this2.cacheInfo == null) { - _this2.cacheInfo = { - executableDigest: _this2.newDigest - }; - } else { - _this2.cacheInfo.executableDigest = _this2.newDigest; - } - - try { - yield (0, _fsExtraP().ensureDir)(_this2.cacheDir); - yield Promise.all([(0, _fsExtraP().writeJson)(_this2.cacheInfoFile, _this2.cacheInfo), (0, _fs().copyFile)(_this2.executableFile, _this2.cacheFile, false)]); - } catch (e) { - _builderUtil().log.warn({ - error: e.stack || e - }, `cannot save build cache`); - } - })(); - } - -} - -exports.BuildCacheManager = BuildCacheManager; -BuildCacheManager.VERSION = "0"; - -function digest(_x, _x2) { - return _digest.apply(this, arguments); -} function _digest() { - _digest = (0, _bluebirdLst().coroutine)(function* (hash, files) { - // do not use pipe - better do bulk file read (https://github.com/yarnpkg/yarn/commit/7a63e0d23c46a4564bc06645caf8a59690f04d01) - for (const content of yield _bluebirdLst().default.map(files, it => (0, _fsExtraP().readFile)(it))) { - hash.update(content); - } - - hash.update(BuildCacheManager.VERSION); - return hash.digest("base64"); - }); - return _digest.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=cacheManager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/cacheManager.js.map b/node_modules/app-builder-lib/out/util/cacheManager.js.map deleted file mode 100644 index 2fd9971..0000000 --- a/node_modules/app-builder-lib/out/util/cacheManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/cacheManager.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;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gC,yBAAhC;AACD;AAlBO;AAmBT;;AA9D2B;;;AACrB,iBAAA,CAAA,OAAA,GAAkB,GAAlB;;SAgEa,M;;;;;;0CAAf,WAAsB,IAAtB,EAAkC,KAAlC,EAAsD;AAC3D;AACA,SAAK,MAAM,OAAX,UAA4B,uBAAgB,GAAhB,CAAoB,KAApB,EAA2B,EAAE,IAAI,0BAAS,EAAT,CAAjC,CAA5B,EAA4E;AAC1E,MAAA,IAAI,CAAC,MAAL,CAAY,OAAZ;AACD;;AAED,IAAA,IAAI,CAAC,MAAL,CAAY,iBAAiB,CAAC,OAA9B;AACA,WAAO,IAAI,CAAC,MAAL,CAAY,QAAZ,CAAP;AACD,G","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, log } from \"builder-util\"\nimport { copyFile } from \"builder-util/out/fs\"\nimport { orNullIfFileNotExist } from \"builder-util/out/promise\"\nimport { Hash } from \"crypto\"\nimport { ensureDir, readFile, readJson, writeJson } from \"fs-extra-p\"\nimport * as path from \"path\"\n\nexport interface BuildCacheInfo {\n executableDigest: string\n}\n\nexport class BuildCacheManager {\n static VERSION: string = \"0\"\n\n readonly cacheDir: string\n readonly cacheInfoFile: string\n readonly cacheFile: string\n\n cacheInfo: BuildCacheInfo | null = null\n\n private newDigest: string | null = null\n\n constructor(outDir: string, private readonly executableFile: string, arch: Arch) {\n this.cacheDir = path.join(outDir, \".cache\", Arch[arch])\n this.cacheFile = path.join(this.cacheDir, \"app.exe\")\n this.cacheInfoFile = path.join(this.cacheDir, \"info.json\")\n }\n\n async copyIfValid(digest: string): Promise {\n this.newDigest = digest\n\n this.cacheInfo = await orNullIfFileNotExist(readJson(this.cacheInfoFile))\n const oldDigest = this.cacheInfo == null ? null : this.cacheInfo.executableDigest\n if (oldDigest !== digest) {\n log.debug({oldDigest, newDigest: digest}, \"no valid cached executable found\")\n return false\n }\n\n log.debug({cacheFile: this.cacheFile, file: this.executableFile}, `copying cached executable`)\n try {\n await copyFile(this.cacheFile, this.executableFile, false)\n return true\n }\n catch (e) {\n if (e.code === \"ENOENT\" || e.code === \"ENOTDIR\") {\n log.debug({error: e.code}, \"copy cached executable failed\")\n }\n else {\n log.warn({error: e.stack || e}, `cannot copy cached executable`)\n }\n }\n return false\n }\n\n async save() {\n if (this.newDigest == null) {\n throw new Error(\"call copyIfValid before\")\n }\n\n if (this.cacheInfo == null) {\n this.cacheInfo = {executableDigest: this.newDigest}\n }\n else {\n this.cacheInfo.executableDigest = this.newDigest\n }\n\n try {\n await ensureDir(this.cacheDir)\n await Promise.all([writeJson(this.cacheInfoFile, this.cacheInfo), copyFile(this.executableFile, this.cacheFile, false)])\n }\n catch (e) {\n log.warn({error: e.stack || e}, `cannot save build cache`)\n }\n }\n}\n\nexport async function digest(hash: Hash, files: Array) {\n // do not use pipe - better do bulk file read (https://github.com/yarnpkg/yarn/commit/7a63e0d23c46a4564bc06645caf8a59690f04d01)\n for (const content of await BluebirdPromise.map(files, it => readFile(it))) {\n hash.update(content)\n }\n\n hash.update(BuildCacheManager.VERSION)\n return hash.digest(\"base64\")\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/config.d.ts b/node_modules/app-builder-lib/out/util/config.d.ts deleted file mode 100644 index a1f84e9..0000000 --- a/node_modules/app-builder-lib/out/util/config.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DebugLogger } from "builder-util"; -import { Lazy } from "lazy-val"; -import { Configuration } from "../configuration"; -export declare function getConfig(projectDir: string, configPath: string | null, configFromOptions: Configuration | null | undefined, packageMetadata?: Lazy<{ - [key: string]: any; -} | null>): Promise; -export declare function doMergeConfigs(configuration: Configuration, parentConfiguration: Configuration | null): Configuration; -export declare function validateConfig(config: Configuration, debugLogger: DebugLogger): Promise; -export declare function computeDefaultAppDirectory(projectDir: string, userAppDir: string | null | undefined): Promise; diff --git a/node_modules/app-builder-lib/out/util/config.js b/node_modules/app-builder-lib/out/util/config.js deleted file mode 100644 index 88afced..0000000 --- a/node_modules/app-builder-lib/out/util/config.js +++ /dev/null @@ -1,380 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getConfig = getConfig; -exports.doMergeConfigs = doMergeConfigs; -exports.validateConfig = validateConfig; -exports.computeDefaultAppDirectory = computeDefaultAppDirectory; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _readConfigFile() { - const data = require("read-config-file"); - - _readConfigFile = function () { - return data; - }; - - return data; -} - -function _rectCra() { - const data = require("../presets/rectCra"); - - _rectCra = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -// https://github.com/electron-userland/electron-builder/issues/1847 -function mergePublish(config, configFromOptions) { - // if config from disk doesn't have publish (or object), no need to handle, it will be simply merged by deepAssign - const publish = Array.isArray(config.publish) ? configFromOptions.publish : null; - - if (publish != null) { - delete configFromOptions.publish; - } - - (0, _builderUtil().deepAssign)(config, configFromOptions); - - if (publish == null) { - return; - } - - const listOnDisk = config.publish; - - if (listOnDisk.length === 0) { - config.publish = publish; - } else { - // apply to first - Object.assign(listOnDisk[0], publish); - } -} - -function getConfig(_x, _x2, _x3) { - return _getConfig2.apply(this, arguments); -} // normalize for easy merge - - -function _getConfig2() { - _getConfig2 = (0, _bluebirdLst().coroutine)(function* (projectDir, configPath, configFromOptions, packageMetadata = new (_lazyVal().Lazy)(() => (0, _readConfigFile().orNullIfFileNotExist)((0, _fsExtraP().readJson)(path.join(projectDir, "package.json"))))) { - const configRequest = { - packageKey: "build", - configFilename: "electron-builder", - projectDir, - packageMetadata - }; - const configAndEffectiveFile = yield (0, _readConfigFile().getConfig)(configRequest, configPath); - const config = configAndEffectiveFile == null ? {} : configAndEffectiveFile.result; - - if (configFromOptions != null) { - mergePublish(config, configFromOptions); - } - - if (configAndEffectiveFile != null) { - _builderUtil().log.info({ - file: configAndEffectiveFile.configFile == null ? 'package.json ("build" field)' : configAndEffectiveFile.configFile - }, "loaded configuration"); - } - - if (config.extends == null && config.extends !== null) { - const metadata = (yield packageMetadata.value) || {}; - const devDependencies = metadata.devDependencies; - const dependencies = metadata.dependencies; - - if (dependencies != null && "react-scripts" in dependencies || devDependencies != null && "react-scripts" in devDependencies) { - config.extends = "react-cra"; - } else if (devDependencies != null && "electron-webpack" in devDependencies) { - let file = "electron-webpack/out/electron-builder.js"; - - try { - file = require.resolve(file); - } catch (ignore) { - file = require.resolve("electron-webpack/electron-builder.yml"); - } - - config.extends = `file:${file}`; - } - } - - let parentConfig; - - if (config.extends === "react-cra") { - parentConfig = yield (0, _rectCra().reactCra)(projectDir); - - _builderUtil().log.info({ - preset: config.extends - }, "loaded parent configuration"); - } else if (config.extends != null) { - const parentConfigAndEffectiveFile = yield (0, _readConfigFile().loadParentConfig)(configRequest, config.extends); - - _builderUtil().log.info({ - file: parentConfigAndEffectiveFile.configFile - }, "loaded parent configuration"); - - parentConfig = parentConfigAndEffectiveFile.result; - } else { - parentConfig = null; - } - - return doMergeConfigs(config, parentConfig); - }); - return _getConfig2.apply(this, arguments); -} - -function normalizeFiles(configuration, name) { - let value = configuration[name]; - - if (value == null) { - return; - } - - if (!Array.isArray(value)) { - value = [value]; - } - - itemLoop: for (let i = 0; i < value.length; i++) { - let item = value[i]; - - if (typeof item === "string") { - // merge with previous if possible - if (i !== 0) { - let prevItemIndex = i - 1; - let prevItem; - - do { - prevItem = value[prevItemIndex--]; - } while (prevItem == null); - - if (prevItem.from == null && prevItem.to == null) { - if (prevItem.filter == null) { - prevItem.filter = [item]; - } else { - prevItem.filter.push(item); - } - - value[i] = null; - continue itemLoop; - } - } - - item = { - filter: [item] - }; - value[i] = item; - } else if (Array.isArray(item)) { - throw new Error(`${name} configuration is invalid, nested array not expected for index ${i}: ` + item); - } // make sure that merge logic is not complex - unify different presentations - - - if (item.from === ".") { - item.from = undefined; - } - - if (item.to === ".") { - item.to = undefined; - } - - if (item.filter != null && typeof item.filter === "string") { - item.filter = [item.filter]; - } - } - - configuration[name] = value.filter(it => it != null); -} - -function mergeFiles(configuration, parentConfiguration, mergedConfiguration, name) { - const list = configuration[name]; - const parentList = parentConfiguration[name]; - - if (list == null || parentList == null) { - return; - } - - const result = list.slice(); - mergedConfiguration[name] = result; - - itemLoop: for (const item of parentConfiguration.files) { - for (const existingItem of list) { - if (existingItem.from === item.from && existingItem.to === item.to) { - if (item.filter != null) { - if (existingItem.filter == null) { - existingItem.filter = item.filter.slice(); - } else { - existingItem.filter = item.filter.concat(existingItem.filter); - } - } - - continue itemLoop; - } - } // existing item not found, simply add - - - result.push(item); - } -} - -function doMergeConfigs(configuration, parentConfiguration) { - normalizeFiles(configuration, "files"); - normalizeFiles(configuration, "extraFiles"); - normalizeFiles(configuration, "extraResources"); - - if (parentConfiguration == null) { - return (0, _builderUtil().deepAssign)(getDefaultConfig(), configuration); - } - - normalizeFiles(parentConfiguration, "files"); - normalizeFiles(parentConfiguration, "extraFiles"); - normalizeFiles(parentConfiguration, "extraResources"); - const result = (0, _builderUtil().deepAssign)(getDefaultConfig(), parentConfiguration, configuration); - mergeFiles(configuration, parentConfiguration, result, "files"); - return result; -} - -function getDefaultConfig() { - return { - directories: { - output: "dist", - buildResources: "build" - } - }; -} - -const schemeDataPromise = new (_lazyVal().Lazy)(() => (0, _fsExtraP().readJson)(path.join(__dirname, "..", "..", "scheme.json"))); - -function validateConfig(_x4, _x5) { - return _validateConfig2.apply(this, arguments); -} - -function _validateConfig2() { - _validateConfig2 = (0, _bluebirdLst().coroutine)(function* (config, debugLogger) { - const extraMetadata = config.extraMetadata; - - if (extraMetadata != null) { - if (extraMetadata.build != null) { - throw new (_builderUtil().InvalidConfigurationError)(`--em.build is deprecated, please specify as -c"`); - } - - if (extraMetadata.directories != null) { - throw new (_builderUtil().InvalidConfigurationError)(`--em.directories is deprecated, please specify as -c.directories"`); - } - } // noinspection JSDeprecatedSymbols - - - if (config.npmSkipBuildFromSource === false) { - config.buildDependenciesFromSource = false; - } - - yield (0, _readConfigFile().validateConfig)(config, schemeDataPromise, (message, errors) => { - if (debugLogger.isEnabled) { - debugLogger.add("invalidConfig", JSON.stringify(errors, null, 2)); - } - - return `${message} - -How to fix: -1. Open https://electron.build/configuration/configuration -2. Search the option name on the page. - * Not found? The option was deprecated or not exists (check spelling). - * Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root. -`; - }); - }); - return _validateConfig2.apply(this, arguments); -} - -const DEFAULT_APP_DIR_NAMES = ["app", "www"]; - -function computeDefaultAppDirectory(_x6, _x7) { - return _computeDefaultAppDirectory.apply(this, arguments); -} function _computeDefaultAppDirectory() { - _computeDefaultAppDirectory = (0, _bluebirdLst().coroutine)(function* (projectDir, userAppDir) { - if (userAppDir != null) { - const absolutePath = path.resolve(projectDir, userAppDir); - const stat = yield (0, _fs().statOrNull)(absolutePath); - - if (stat == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Application directory ${userAppDir} doesn't exists`); - } else if (!stat.isDirectory()) { - throw new (_builderUtil().InvalidConfigurationError)(`Application directory ${userAppDir} is not a directory`); - } else if (projectDir === absolutePath) { - _builderUtil().log.warn({ - appDirectory: userAppDir - }, `Specified application directory equals to project dir — superfluous or wrong configuration`); - } - - return absolutePath; - } - - for (const dir of DEFAULT_APP_DIR_NAMES) { - const absolutePath = path.join(projectDir, dir); - const packageJson = path.join(absolutePath, "package.json"); - const stat = yield (0, _fs().statOrNull)(packageJson); - - if (stat != null && stat.isFile()) { - return absolutePath; - } - } - - return projectDir; - }); - return _computeDefaultAppDirectory.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/config.js.map b/node_modules/app-builder-lib/out/util/config.js.map deleted file mode 100644 index 17b964f..0000000 --- a/node_modules/app-builder-lib/out/util/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACA,SAAS,YAAT,CAAsB,MAAtB,EAA6C,iBAA7C,EAA6E;AAC3E;AACA,QAAM,OAAO,GAAG,KAAK,CAAC,OAAN,CAAc,MAAM,CAAC,OAArB,IAAgC,iBAAiB,CAAC,OAAlD,GAA4D,IAA5E;;AACA,MAAI,OAAO,IAAI,IAAf,EAAqB;AACnB,WAAQ,iBAAyB,CAAC,OAAlC;AACD;;AAED,iCAAW,MAAX,EAAmB,iBAAnB;;AAEA,MAAI,OAAO,IAAI,IAAf,EAAqB;AACnB;AACD;;AAED,QAAM,UAAU,GAAG,MAAM,CAAC,OAA1B;;AACA,MAAI,UAAU,CAAC,MAAX,KAAsB,CAA1B,EAA6B;AAC3B,IAAA,MAAM,CAAC,OAAP,GAAiB,OAAjB;AACD,GAFD,MAGK;AAC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AACD;;AACD,aAAO,YAAP;AACD;;AAED,SAAK,MAAM,GAAX,IAAkB,qBAAlB,EAAyC;AACvC,YAAM,YAAY,GAAG,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,GAAtB,CAArB;AACA,YAAM,WAAW,GAAG,IAAI,CAAC,IAAL,CAAU,YAAV,EAAwB,cAAxB,CAApB;AACA,YAAM,IAAI,SAAS,sBAAW,WAAX,CAAnB;;AACA,UAAI,IAAI,IAAI,IAAR,IAAgB,IAAI,CAAC,MAAL,EAApB,EAAmC;AACjC,eAAO,YAAP;AACD;AACF;;AACD,WAAO,UAAP;AACD,G","sourcesContent":["import { DebugLogger, deepAssign, InvalidConfigurationError, log } from \"builder-util\"\nimport { statOrNull } from \"builder-util/out/fs\"\nimport { readJson } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { getConfig as _getConfig, loadParentConfig, orNullIfFileNotExist, ReadConfigRequest, validateConfig as _validateConfig } from \"read-config-file\"\nimport { FileSet } from \"..\"\nimport { Configuration } from \"../configuration\"\nimport { reactCra } from \"../presets/rectCra\"\n\n// https://github.com/electron-userland/electron-builder/issues/1847\nfunction mergePublish(config: Configuration, configFromOptions: Configuration) {\n // if config from disk doesn't have publish (or object), no need to handle, it will be simply merged by deepAssign\n const publish = Array.isArray(config.publish) ? configFromOptions.publish : null\n if (publish != null) {\n delete (configFromOptions as any).publish\n }\n\n deepAssign(config, configFromOptions)\n\n if (publish == null) {\n return\n }\n\n const listOnDisk = config.publish as Array\n if (listOnDisk.length === 0) {\n config.publish = publish\n }\n else {\n // apply to first\n Object.assign(listOnDisk[0], publish)\n }\n}\n\nexport async function getConfig(projectDir: string,\n configPath: string | null,\n configFromOptions: Configuration | null | undefined,\n packageMetadata: Lazy<{ [key: string]: any } | null> = new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, \"package.json\"))))): Promise {\n const configRequest: ReadConfigRequest = {packageKey: \"build\", configFilename: \"electron-builder\", projectDir, packageMetadata}\n const configAndEffectiveFile = await _getConfig(configRequest, configPath)\n const config = configAndEffectiveFile == null ? {} : configAndEffectiveFile.result\n if (configFromOptions != null) {\n mergePublish(config, configFromOptions)\n }\n\n if (configAndEffectiveFile != null) {\n log.info({file: configAndEffectiveFile.configFile == null ? 'package.json (\"build\" field)' : configAndEffectiveFile.configFile}, \"loaded configuration\")\n }\n\n if (config.extends == null && config.extends !== null) {\n const metadata = await packageMetadata.value || {}\n const devDependencies = metadata.devDependencies\n const dependencies = metadata.dependencies\n if ((dependencies != null && \"react-scripts\" in dependencies) || (devDependencies != null && \"react-scripts\" in devDependencies)) {\n config.extends = \"react-cra\"\n }\n else if (devDependencies != null && \"electron-webpack\" in devDependencies) {\n let file = \"electron-webpack/out/electron-builder.js\"\n try {\n file = require.resolve(file)\n }\n catch (ignore) {\n file = require.resolve(\"electron-webpack/electron-builder.yml\")\n }\n config.extends = `file:${file}`\n }\n }\n\n let parentConfig: Configuration | null\n if (config.extends === \"react-cra\") {\n parentConfig = await reactCra(projectDir)\n log.info({preset: config.extends}, \"loaded parent configuration\")\n }\n else if (config.extends != null) {\n const parentConfigAndEffectiveFile = await loadParentConfig(configRequest, config.extends)\n log.info({file: parentConfigAndEffectiveFile.configFile}, \"loaded parent configuration\")\n parentConfig = parentConfigAndEffectiveFile.result\n }\n else {\n parentConfig = null\n }\n\n return doMergeConfigs(config, parentConfig)\n}\n\n// normalize for easy merge\nfunction normalizeFiles(configuration: Configuration, name: \"files\" | \"extraFiles\" | \"extraResources\") {\n let value = configuration[name]\n if (value == null) {\n return\n }\n\n if (!Array.isArray(value)) {\n value = [value]\n }\n\n itemLoop: for (let i = 0; i < value.length; i++) {\n let item = value[i]\n if (typeof item === \"string\") {\n // merge with previous if possible\n if (i !== 0) {\n let prevItemIndex = i - 1\n let prevItem: FileSet\n do {\n prevItem = value[prevItemIndex--] as FileSet\n } while (prevItem == null)\n\n if (prevItem.from == null && prevItem.to == null) {\n if (prevItem.filter == null) {\n prevItem.filter = [item]\n }\n else {\n (prevItem.filter as Array).push(item)\n }\n value[i] = null as any\n continue itemLoop\n }\n }\n\n item = {\n filter: [item],\n }\n value[i] = item\n }\n else if (Array.isArray(item)) {\n throw new Error(`${name} configuration is invalid, nested array not expected for index ${i}: ` + item)\n }\n\n // make sure that merge logic is not complex - unify different presentations\n if (item.from === \".\") {\n item.from = undefined\n }\n\n if (item.to === \".\") {\n item.to = undefined\n }\n\n if (item.filter != null && typeof item.filter === \"string\") {\n item.filter = [item.filter]\n }\n }\n\n configuration[name] = value.filter(it => it != null)\n}\n\nfunction mergeFiles(configuration: Configuration, parentConfiguration: Configuration, mergedConfiguration: Configuration, name: \"files\" | \"extraFiles\" | \"extraResources\") {\n const list = configuration[name] as Array | null\n const parentList = parentConfiguration[name] as Array | null\n if (list == null || parentList == null) {\n return\n }\n\n const result = list.slice()\n mergedConfiguration[name] = result\n\n itemLoop: for (const item of parentConfiguration.files as Array) {\n for (const existingItem of list) {\n if (existingItem.from === item.from && existingItem.to === item.to) {\n if (item.filter != null) {\n if (existingItem.filter == null) {\n existingItem.filter = item.filter.slice()\n }\n else {\n existingItem.filter = (item.filter as Array).concat(existingItem.filter)\n }\n }\n\n continue itemLoop\n }\n }\n\n // existing item not found, simply add\n result.push(item)\n }\n}\n\nexport function doMergeConfigs(configuration: Configuration, parentConfiguration: Configuration | null) {\n normalizeFiles(configuration, \"files\")\n normalizeFiles(configuration, \"extraFiles\")\n normalizeFiles(configuration, \"extraResources\")\n\n if (parentConfiguration == null) {\n return deepAssign(getDefaultConfig(), configuration)\n }\n\n normalizeFiles(parentConfiguration, \"files\")\n normalizeFiles(parentConfiguration, \"extraFiles\")\n normalizeFiles(parentConfiguration, \"extraResources\")\n\n const result = deepAssign(getDefaultConfig(), parentConfiguration, configuration)\n mergeFiles(configuration, parentConfiguration, result, \"files\")\n return result\n}\n\nfunction getDefaultConfig(): Configuration {\n return {\n directories: {\n output: \"dist\",\n buildResources: \"build\",\n },\n }\n}\n\nconst schemeDataPromise = new Lazy(() => readJson(path.join(__dirname, \"..\", \"..\", \"scheme.json\")))\n\nexport async function validateConfig(config: Configuration, debugLogger: DebugLogger) {\n const extraMetadata = config.extraMetadata\n if (extraMetadata != null) {\n if (extraMetadata.build != null) {\n throw new InvalidConfigurationError(`--em.build is deprecated, please specify as -c\"`)\n }\n if (extraMetadata.directories != null) {\n throw new InvalidConfigurationError(`--em.directories is deprecated, please specify as -c.directories\"`)\n }\n }\n\n // noinspection JSDeprecatedSymbols\n if (config.npmSkipBuildFromSource === false) {\n config.buildDependenciesFromSource = false\n }\n\n await _validateConfig(config, schemeDataPromise, (message, errors) => {\n if (debugLogger.isEnabled) {\n debugLogger.add(\"invalidConfig\", JSON.stringify(errors, null, 2))\n }\n\n return `${message}\n\nHow to fix:\n1. Open https://electron.build/configuration/configuration\n2. Search the option name on the page.\n * Not found? The option was deprecated or not exists (check spelling).\n * Found? Check that the option in the appropriate place. e.g. \"title\" only in the \"dmg\", not in the root.\n`\n })\n}\n\nconst DEFAULT_APP_DIR_NAMES = [\"app\", \"www\"]\n\nexport async function computeDefaultAppDirectory(projectDir: string, userAppDir: string | null | undefined): Promise {\n if (userAppDir != null) {\n const absolutePath = path.resolve(projectDir, userAppDir)\n const stat = await statOrNull(absolutePath)\n if (stat == null) {\n throw new InvalidConfigurationError(`Application directory ${userAppDir} doesn't exists`)\n }\n else if (!stat.isDirectory()) {\n throw new InvalidConfigurationError(`Application directory ${userAppDir} is not a directory`)\n }\n else if (projectDir === absolutePath) {\n log.warn({appDirectory: userAppDir}, `Specified application directory equals to project dir — superfluous or wrong configuration`)\n }\n return absolutePath\n }\n\n for (const dir of DEFAULT_APP_DIR_NAMES) {\n const absolutePath = path.join(projectDir, dir)\n const packageJson = path.join(absolutePath, \"package.json\")\n const stat = await statOrNull(packageJson)\n if (stat != null && stat.isFile()) {\n return absolutePath\n }\n }\n return projectDir\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/filter.d.ts b/node_modules/app-builder-lib/out/util/filter.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/util/filter.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/util/filter.js b/node_modules/app-builder-lib/out/util/filter.js deleted file mode 100644 index 82c457a..0000000 --- a/node_modules/app-builder-lib/out/util/filter.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hasMagic = hasMagic; -exports.createFilter = createFilter; - -var path = _interopRequireWildcard(require("path")); - -function _fileTransformer() { - const data = require("../fileTransformer"); - - _fileTransformer = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/** @internal */ -function hasMagic(pattern) { - const set = pattern.set; - - if (set.length > 1) { - return true; - } - - for (const i of set[0]) { - if (typeof i !== "string") { - return true; - } - } - - return false; -} // sometimes, destination may not contain path separator in the end (path to folder), but the src does. So let's ensure paths have path separators in the end - - -function ensureEndSlash(s) { - return s.length === 0 || s.endsWith(path.sep) ? s : s + path.sep; -} - -function getRelativePath(file, srcWithEndSlash) { - if (!file.startsWith(srcWithEndSlash)) { - const index = file.indexOf(_fileTransformer().NODE_MODULES_PATTERN); - - if (index < 0) { - throw new Error(`${file} must be under ${srcWithEndSlash}`); - } else { - return file.substring(index + 1 - /* leading slash */ - ); - } - } - - let relative = file.substring(srcWithEndSlash.length); - - if (path.sep === "\\") { - if (relative.startsWith("\\")) { - // windows problem: double backslash, the above substring call removes root path with a single slash, so here can me some leftovers - relative = relative.substring(1); - } - - relative = relative.replace(/\\/g, "/"); - } - - return relative; -} -/** @internal */ - - -function createFilter(src, patterns, excludePatterns) { - const srcWithEndSlash = ensureEndSlash(src); - return (file, stat) => { - if (src === file) { - return true; - } - - const relative = getRelativePath(file, srcWithEndSlash); // https://github.com/electron-userland/electron-builder/issues/867 - - return minimatchAll(relative, patterns, stat) && (excludePatterns == null || stat.isDirectory() || !minimatchAll(relative, excludePatterns, stat)); - }; -} // https://github.com/joshwnj/minimatch-all/blob/master/index.js - - -function minimatchAll(path, patterns, stat) { - let match = false; - - for (const pattern of patterns) { - // If we've got a match, only re-test for exclusions. - // if we don't have a match, only re-test for inclusions. - if (match !== pattern.negate) { - continue; - } // partial match — pattern: foo/bar.txt path: foo — we must allow foo - // use it only for non-negate patterns: const m = new Minimatch("!node_modules/@(electron-download|electron)/**/*", {dot: true }); m.match("node_modules", true) will return false, but must be true - - - match = pattern.match(path, stat.isDirectory() && !pattern.negate); - } - - return match; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=filter.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/filter.js.map b/node_modules/app-builder-lib/out/util/filter.js.map deleted file mode 100644 index 2fdd298..0000000 --- a/node_modules/app-builder-lib/out/util/filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/filter.ts"],"names":[],"mappings":";;;;;;;;AAGA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACM,SAAU,QAAV,CAAmB,OAAnB,EAAqC;AACzC,QAAM,GAAG,GAAG,OAAO,CAAC,GAApB;;AACA,MAAI,GAAG,CAAC,MAAJ,GAAa,CAAjB,EAAoB;AAClB,WAAO,IAAP;AACD;;AAED,OAAK,MAAM,CAAX,IAAgB,GAAG,CAAC,CAAD,CAAnB,EAAwB;AACtB,QAAI,OAAO,CAAP,KAAa,QAAjB,EAA2B;AACzB,aAAO,IAAP;AACD;AACF;;AAED,SAAO,KAAP;AACD,C,CAED;;;AACA,SAAS,cAAT,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ACA,WAAO,YAAY,CAAC,QAAD,EAAW,QAAX,EAAqB,IAArB,CAAZ,KAA2C,eAAe,IAAI,IAAnB,IAA2B,IAAI,CAAC,WAAL,EAA3B,IAAiD,CAAC,YAAY,CAAC,QAAD,EAAW,eAAX,EAA4B,IAA5B,CAAzG,CAAP;AACD,GARD;AASD,C,CAED;;;AACA,SAAS,YAAT,CAAsB,IAAtB,EAAoC,QAApC,EAAgE,IAAhE,EAA2E;AACzE,MAAI,KAAK,GAAG,KAAZ;;AACA,OAAK,MAAM,OAAX,IAAsB,QAAtB,EAAgC;AAC9B;AACA;AACA,QAAI,KAAK,KAAK,OAAO,CAAC,MAAtB,EAA8B;AAC5B;AACD,KAL6B,CAO9B;AACA;;;AACA,IAAA,KAAK,GAAG,OAAO,CAAC,KAAR,CAAc,IAAd,EAAoB,IAAI,CAAC,WAAL,MAAsB,CAAC,OAAO,CAAC,MAAnD,CAAR;AACD;;AACD,SAAO,KAAP;AACD,C","sourcesContent":["import { Filter } from \"builder-util/out/fs\"\nimport { Stats } from \"fs-extra-p\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport { NODE_MODULES_PATTERN } from \"../fileTransformer\"\n\n/** @internal */\nexport function hasMagic(pattern: Minimatch) {\n const set = pattern.set\n if (set.length > 1) {\n return true\n }\n\n for (const i of set[0]) {\n if (typeof i !== \"string\") {\n return true\n }\n }\n\n return false\n}\n\n// sometimes, destination may not contain path separator in the end (path to folder), but the src does. So let's ensure paths have path separators in the end\nfunction ensureEndSlash(s: string) {\n return s.length === 0 || s.endsWith(path.sep) ? s : (s + path.sep)\n}\n\nfunction getRelativePath(file: string, srcWithEndSlash: string) {\n if (!file.startsWith(srcWithEndSlash)) {\n const index = file.indexOf(NODE_MODULES_PATTERN)\n if (index < 0) {\n throw new Error(`${file} must be under ${srcWithEndSlash}`)\n }\n else {\n return file.substring(index + 1 /* leading slash */)\n }\n }\n\n let relative = file.substring(srcWithEndSlash.length)\n if (path.sep === \"\\\\\") {\n if (relative.startsWith(\"\\\\\")) {\n // windows problem: double backslash, the above substring call removes root path with a single slash, so here can me some leftovers\n relative = relative.substring(1)\n }\n relative = relative.replace(/\\\\/g, \"/\")\n }\n return relative\n}\n\n/** @internal */\nexport function createFilter(src: string, patterns: Array, excludePatterns?: Array | null): Filter {\n const srcWithEndSlash = ensureEndSlash(src)\n return (file, stat) => {\n if (src === file) {\n return true\n }\n\n const relative = getRelativePath(file, srcWithEndSlash)\n // https://github.com/electron-userland/electron-builder/issues/867\n return minimatchAll(relative, patterns, stat) && (excludePatterns == null || stat.isDirectory() || !minimatchAll(relative, excludePatterns, stat))\n }\n}\n\n// https://github.com/joshwnj/minimatch-all/blob/master/index.js\nfunction minimatchAll(path: string, patterns: Array, stat: Stats): boolean {\n let match = false\n for (const pattern of patterns) {\n // If we've got a match, only re-test for exclusions.\n // if we don't have a match, only re-test for inclusions.\n if (match !== pattern.negate) {\n continue\n }\n\n // partial match — pattern: foo/bar.txt path: foo — we must allow foo\n // use it only for non-negate patterns: const m = new Minimatch(\"!node_modules/@(electron-download|electron)/**/*\", {dot: true }); m.match(\"node_modules\", true) will return false, but must be true\n match = pattern.match(path, stat.isDirectory() && !pattern.negate)\n }\n return match\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/flags.d.ts b/node_modules/app-builder-lib/out/util/flags.d.ts deleted file mode 100644 index 10ddbd5..0000000 --- a/node_modules/app-builder-lib/out/util/flags.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function isUseSystemSigncode(): boolean; -export declare function isBuildCacheEnabled(): boolean; -export declare function isAutoDiscoveryCodeSignIdentity(): boolean; diff --git a/node_modules/app-builder-lib/out/util/flags.js b/node_modules/app-builder-lib/out/util/flags.js deleted file mode 100644 index 30f5b6c..0000000 --- a/node_modules/app-builder-lib/out/util/flags.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isUseSystemSigncode = isUseSystemSigncode; -exports.isBuildCacheEnabled = isBuildCacheEnabled; -exports.isAutoDiscoveryCodeSignIdentity = isAutoDiscoveryCodeSignIdentity; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function isUseSystemSigncode() { - return (0, _builderUtil().isEnvTrue)(process.env.USE_SYSTEM_SIGNCODE); -} - -function isBuildCacheEnabled() { - return !(0, _builderUtil().isEnvTrue)(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE); -} - -function isAutoDiscoveryCodeSignIdentity() { - return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== "false"; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=flags.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/flags.js.map b/node_modules/app-builder-lib/out/util/flags.js.map deleted file mode 100644 index f930e2c..0000000 --- a/node_modules/app-builder-lib/out/util/flags.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/flags.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,SAAU,mBAAV,GAA6B;AACjC,SAAO,8BAAU,OAAO,CAAC,GAAR,CAAY,mBAAtB,CAAP;AACD;;AAEK,SAAU,mBAAV,GAA6B;AACjC,SAAO,CAAC,8BAAU,OAAO,CAAC,GAAR,CAAY,oCAAtB,CAAR;AACD;;AAEK,SAAU,+BAAV,GAAyC;AAC7C,SAAO,OAAO,CAAC,GAAR,CAAY,2BAAZ,KAA4C,OAAnD;AACD,C","sourcesContent":["import { isEnvTrue } from \"builder-util\"\n\nexport function isUseSystemSigncode() {\n return isEnvTrue(process.env.USE_SYSTEM_SIGNCODE)\n}\n\nexport function isBuildCacheEnabled() {\n return !isEnvTrue(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE)\n}\n\nexport function isAutoDiscoveryCodeSignIdentity() {\n return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== \"false\"\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/hash.d.ts b/node_modules/app-builder-lib/out/util/hash.d.ts deleted file mode 100644 index 373178f..0000000 --- a/node_modules/app-builder-lib/out/util/hash.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function hashFile(file: string, algorithm?: string, encoding?: "base64" | "hex", options?: any): Promise; diff --git a/node_modules/app-builder-lib/out/util/hash.js b/node_modules/app-builder-lib/out/util/hash.js deleted file mode 100644 index 6eaf2fc..0000000 --- a/node_modules/app-builder-lib/out/util/hash.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hashFile = hashFile; - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function hashFile(file, algorithm = "sha512", encoding = "base64", options) { - return new Promise((resolve, reject) => { - const hash = (0, _crypto().createHash)(algorithm); - hash.on("error", reject).setEncoding(encoding); - (0, _fs().createReadStream)(file, Object.assign({}, options, { - highWaterMark: 1024 * 1024 - /* better to use more memory but hash faster */ - - })).on("error", reject).on("end", () => { - hash.end(); - resolve(hash.read()); - }).pipe(hash, { - end: false - }); - }); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=hash.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/hash.js.map b/node_modules/app-builder-lib/out/util/hash.js.map deleted file mode 100644 index c15b044..0000000 --- a/node_modules/app-builder-lib/out/util/hash.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/hash.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,SAAU,QAAV,CAAmB,IAAnB,EAAiC,SAAA,GAAoB,QAArD,EAA+D,QAAA,GAA6B,QAA5F,EAAsG,OAAtG,EAAmH;AACvH,SAAO,IAAI,OAAJ,CAAoB,CAAC,OAAD,EAAU,MAAV,KAAoB;AAC7C,UAAM,IAAI,GAAG,0BAAW,SAAX,CAAb;AACA,IAAA,IAAI,CACD,EADH,CACM,OADN,EACe,MADf,EAEG,WAFH,CAEe,QAFf;AAIA,gCAAiB,IAAjB,EAAqB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAM,OAAN,EAAa;AAAE,MAAA,aAAa,EAAE,OAAO;AAAK;;AAA7B,KAAb,CAArB,EACG,EADH,CACM,OADN,EACe,MADf,EAEG,EAFH,CAEM,KAFN,EAEa,MAAK;AACd,MAAA,IAAI,CAAC,GAAL;AACA,MAAA,OAAO,CAAC,IAAI,CAAC,IAAL,EAAD,CAAP;AACD,KALH,EAMG,IANH,CAMQ,IANR,EAMc;AAAC,MAAA,GAAG,EAAE;AAAN,KANd;AAOD,GAbM,CAAP;AAcD,C","sourcesContent":["import { createHash } from \"crypto\"\nimport { createReadStream } from \"fs\"\n\nexport function hashFile(file: string, algorithm: string = \"sha512\", encoding: \"base64\" | \"hex\" = \"base64\", options?: any) {\n return new Promise((resolve, reject) => {\n const hash = createHash(algorithm)\n hash\n .on(\"error\", reject)\n .setEncoding(encoding)\n\n createReadStream(file, {...options, highWaterMark: 1024 * 1024 /* better to use more memory but hash faster */})\n .on(\"error\", reject)\n .on(\"end\", () => {\n hash.end()\n resolve(hash.read() as string)\n })\n .pipe(hash, {end: false})\n })\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/langs.d.ts b/node_modules/app-builder-lib/out/util/langs.d.ts deleted file mode 100644 index bb942aa..0000000 --- a/node_modules/app-builder-lib/out/util/langs.d.ts +++ /dev/null @@ -1,189 +0,0 @@ -export declare const bundledLanguages: string[]; -export declare function toLangWithRegion(lang: string): string; -export declare const lcid: any; -export declare const langIdToName: { - ab: string; - aa: string; - af: string; - ak: string; - sq: string; - am: string; - ar: string; - an: string; - hy: string; - as: string; - av: string; - ae: string; - ay: string; - az: string; - bm: string; - ba: string; - eu: string; - be: string; - bn: string; - bh: string; - bi: string; - bs: string; - br: string; - bg: string; - my: string; - ca: string; - ch: string; - ce: string; - ny: string; - zh: string; - cv: string; - kw: string; - co: string; - cr: string; - hr: string; - cs: string; - da: string; - dv: string; - nl: string; - dz: string; - en: string; - eo: string; - et: string; - ee: string; - fo: string; - fj: string; - fi: string; - fr: string; - ff: string; - gl: string; - ka: string; - de: string; - el: string; - gn: string; - gu: string; - ht: string; - ha: string; - he: string; - hz: string; - hi: string; - ho: string; - hu: string; - ia: string; - id: string; - ie: string; - ga: string; - ig: string; - ik: string; - io: string; - is: string; - it: string; - iu: string; - ja: string; - jv: string; - kl: string; - kn: string; - kr: string; - ks: string; - kk: string; - km: string; - ki: string; - rw: string; - ky: string; - kv: string; - kg: string; - ko: string; - ku: string; - kj: string; - la: string; - lb: string; - lg: string; - li: string; - ln: string; - lo: string; - lt: string; - lu: string; - lv: string; - gv: string; - mk: string; - mg: string; - ms: string; - ml: string; - mt: string; - mi: string; - mr: string; - mh: string; - mn: string; - na: string; - nv: string; - nd: string; - ne: string; - ng: string; - nb: string; - nn: string; - no: string; - ii: string; - nr: string; - oc: string; - oj: string; - cu: string; - om: string; - or: string; - os: string; - pa: string; - pi: string; - fa: string; - pl: string; - ps: string; - pt: string; - qu: string; - rm: string; - rn: string; - ro: string; - ru: string; - sa: string; - sc: string; - sd: string; - se: string; - sm: string; - sg: string; - sr: string; - gd: string; - sn: string; - si: string; - sk: string; - sl: string; - so: string; - st: string; - es: string; - su: string; - sw: string; - ss: string; - sv: string; - ta: string; - te: string; - tg: string; - th: string; - ti: string; - bo: string; - tk: string; - tl: string; - tn: string; - to: string; - tr: string; - ts: string; - tt: string; - tw: string; - ty: string; - ug: string; - uk: string; - ur: string; - uz: string; - ve: string; - vi: string; - vo: string; - wa: string; - cy: string; - wo: string; - fy: string; - xh: string; - yi: string; - yo: string; - za: string; - zu: string; -}; diff --git a/node_modules/app-builder-lib/out/util/langs.js b/node_modules/app-builder-lib/out/util/langs.js deleted file mode 100644 index 66a8357..0000000 --- a/node_modules/app-builder-lib/out/util/langs.js +++ /dev/null @@ -1,419 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.toLangWithRegion = toLangWithRegion; -exports.langIdToName = exports.lcid = exports.bundledLanguages = void 0; -const bundledLanguages = ["en_US", "de_DE", "fr_FR", "es_ES", "zh_CN", "zh_TW", "ja_JP", "ko_KR", "it_IT", "nl_NL", "da_DK", "sv_SE", "nb_NO", "fi_FI", "ru_RU", "pt_PT", "pt_BR", "pl_PL", "uk_UA", "cs_CZ", "sk_SK", "hu_HU", "ar_SA", "tr_TR", "th_TH", "vi_VN"]; // todo "ro_RO" "el_GR" "et_EE" "ka_GE" - -exports.bundledLanguages = bundledLanguages; -const langToLangWithRegion = new Map(); - -for (const id of bundledLanguages) { - langToLangWithRegion.set(id.substring(0, id.indexOf("_")), id); -} - -function toLangWithRegion(lang) { - if (lang.includes("_")) { - return lang; - } - - lang = lang.toLowerCase(); - const result = langToLangWithRegion.get(lang); - return result == null ? `${lang}_${lang.toUpperCase()}` : result; -} - -const lcid = { - af_ZA: 1078, - am_ET: 1118, - ar_AE: 14337, - ar_BH: 15361, - ar_DZ: 5121, - ar_EG: 3073, - ar_IQ: 2049, - ar_JO: 11265, - ar_KW: 13313, - ar_LB: 12289, - ar_LY: 4097, - ar_MA: 6145, - ar_OM: 8193, - ar_QA: 16385, - ar_SA: 1025, - ar_SY: 10241, - ar_TN: 7169, - ar_YE: 9217, - arn_CL: 1146, - as_IN: 1101, - az_AZ: 2092, - ba_RU: 1133, - be_BY: 1059, - bg_BG: 1026, - bn_IN: 1093, - bo_BT: 2129, - bo_CN: 1105, - br_FR: 1150, - bs_BA: 8218, - ca_ES: 1027, - co_FR: 1155, - cs_CZ: 1029, - cy_GB: 1106, - da_DK: 1030, - de_AT: 3079, - de_CH: 2055, - de_DE: 1031, - de_LI: 5127, - de_LU: 4103, - div_MV: 1125, - dsb_DE: 2094, - el_GR: 1032, - en_AU: 3081, - en_BZ: 10249, - en_CA: 4105, - en_CB: 9225, - en_GB: 2057, - en_IE: 6153, - en_IN: 18441, - en_JA: 8201, - en_MY: 17417, - en_NZ: 5129, - en_PH: 13321, - en_TT: 11273, - en_US: 1033, - en_ZA: 7177, - en_ZW: 12297, - es_AR: 11274, - es_BO: 16394, - es_CL: 13322, - es_CO: 9226, - es_CR: 5130, - es_DO: 7178, - es_EC: 12298, - es_ES: 3082, - es_GT: 4106, - es_HN: 18442, - es_MX: 2058, - es_NI: 19466, - es_PA: 6154, - es_PE: 10250, - es_PR: 20490, - es_PY: 15370, - es_SV: 17418, - es_UR: 14346, - es_US: 21514, - es_VE: 8202, - et_EE: 1061, - eu_ES: 1069, - fa_IR: 1065, - fi_FI: 1035, - fil_PH: 1124, - fo_FO: 1080, - fr_BE: 2060, - fr_CA: 3084, - fr_CH: 4108, - fr_FR: 1036, - fr_LU: 5132, - fr_MC: 6156, - fy_NL: 1122, - ga_IE: 2108, - gbz_AF: 1164, - gl_ES: 1110, - gsw_FR: 1156, - gu_IN: 1095, - ha_NG: 1128, - he_IL: 1037, - hi_IN: 1081, - hr_BA: 4122, - hr_HR: 1050, - hu_HU: 1038, - hy_AM: 1067, - id_ID: 1057, - ii_CN: 1144, - is_IS: 1039, - it_CH: 2064, - it_IT: 1040, - iu_CA: 2141, - ja_JP: 1041, - ka_GE: 1079, - kh_KH: 1107, - kk_KZ: 1087, - kl_GL: 1135, - kn_IN: 1099, - ko_KR: 1042, - kok_IN: 1111, - ky_KG: 1088, - lb_LU: 1134, - lo_LA: 1108, - lt_LT: 1063, - lv_LV: 1062, - mi_NZ: 1153, - mk_MK: 1071, - ml_IN: 1100, - mn_CN: 2128, - mn_MN: 1104, - moh_CA: 1148, - mr_IN: 1102, - ms_BN: 2110, - ms_MY: 1086, - mt_MT: 1082, - my_MM: 1109, - nb_NO: 1044, - ne_NP: 1121, - nl_BE: 2067, - nl_NL: 1043, - nn_NO: 2068, - ns_ZA: 1132, - oc_FR: 1154, - or_IN: 1096, - pa_IN: 1094, - pl_PL: 1045, - ps_AF: 1123, - pt_BR: 1046, - pt_PT: 2070, - qut_GT: 1158, - quz_BO: 1131, - quz_EC: 2155, - quz_PE: 3179, - rm_CH: 1047, - ro_RO: 1048, - ru_RU: 1049, - rw_RW: 1159, - sa_IN: 1103, - sah_RU: 1157, - se_FI: 3131, - se_NO: 1083, - se_SE: 2107, - si_LK: 1115, - sk_SK: 1051, - sl_SI: 1060, - sma_NO: 6203, - sma_SE: 7227, - smj_NO: 4155, - smj_SE: 5179, - smn_FI: 9275, - sms_FI: 8251, - sq_AL: 1052, - sr_BA: 7194, - sr_SP: 3098, - sv_FI: 2077, - sv_SE: 1053, - sw_KE: 1089, - syr_SY: 1114, - ta_IN: 1097, - te_IN: 1098, - tg_TJ: 1064, - th_TH: 1054, - tk_TM: 1090, - tmz_DZ: 2143, - tn_ZA: 1074, - tr_TR: 1055, - tt_RU: 1092, - ug_CN: 1152, - uk_UA: 1058, - ur_IN: 2080, - ur_PK: 1056, - uz_UZ: 2115, - vi_VN: 1066, - wen_DE: 1070, - wo_SN: 1160, - xh_ZA: 1076, - yo_NG: 1130, - zh_CHS: 4, - zh_CHT: 31748, - zh_CN: 2052, - zh_HK: 3076, - zh_MO: 5124, - zh_SG: 4100, - zh_TW: 1028, - zu_ZA: 1077 -}; // noinspection SpellCheckingInspection - -exports.lcid = lcid; -const langIdToName = { - ab: "Abkhaz", - aa: "Afar", - af: "Afrikaans", - ak: "Akan", - sq: "Albanian", - am: "Amharic", - ar: "Arabic", - an: "Aragonese", - hy: "Armenian", - as: "Assamese", - av: "Avaric", - ae: "Avestan", - ay: "Aymara", - az: "Azerbaijani", - bm: "Bambara", - ba: "Bashkir", - eu: "Basque", - be: "Belarusian", - bn: "Bengali", - bh: "Bihari", - bi: "Bislama", - bs: "Bosnian", - br: "Breton", - bg: "Bulgarian", - my: "Burmese", - ca: "Catalan", - ch: "Chamorro", - ce: "Chechen", - ny: "Chichewa", - zh: "Chinese", - cv: "Chuvash", - kw: "Cornish", - co: "Corsican", - cr: "Cree", - hr: "Croatian", - cs: "Czech", - da: "Danish", - dv: "Divehi", - nl: "Dutch", - dz: "Dzongkha", - en: "English", - eo: "Esperanto", - et: "Estonian", - ee: "Ewe", - fo: "Faroese", - fj: "Fijian", - fi: "Finnish", - fr: "French", - ff: "Fula", - gl: "Galician", - ka: "Georgian", - de: "German", - el: "Greek", - gn: "Guaraní", - gu: "Gujarati", - ht: "Haitian", - ha: "Hausa", - he: "Hebrew", - hz: "Herero", - hi: "Hindi", - ho: "Hiri Motu", - hu: "Hungarian", - ia: "Interlingua", - id: "Indonesian", - ie: "Interlingue", - ga: "Irish", - ig: "Igbo", - ik: "Inupiaq", - io: "Ido", - is: "Icelandic", - it: "Italian", - iu: "Inuktitut", - ja: "Japanese", - jv: "Javanese", - kl: "Kalaallisut", - kn: "Kannada", - kr: "Kanuri", - ks: "Kashmiri", - kk: "Kazakh", - km: "Khmer", - ki: "Kikuyu", - rw: "Kinyarwanda", - ky: "Kyrgyz", - kv: "Komi", - kg: "Kongo", - ko: "Korean", - ku: "Kurdish", - kj: "Kwanyama", - la: "Latin", - lb: "Luxembourgish", - lg: "Ganda", - li: "Limburgish", - ln: "Lingala", - lo: "Lao", - lt: "Lithuanian", - lu: "Luba-Katanga", - lv: "Latvian", - gv: "Manx", - mk: "Macedonian", - mg: "Malagasy", - ms: "Malay", - ml: "Malayalam", - mt: "Maltese", - mi: "Māori", - mr: "Marathi", - mh: "Marshallese", - mn: "Mongolian", - na: "Nauru", - nv: "Navajo", - nd: "Northern Ndebele", - ne: "Nepali", - ng: "Ndonga", - nb: "Norwegian Bokmål", - nn: "Norwegian Nynorsk", - no: "Norwegian", - ii: "Nuosu", - nr: "Southern Ndebele", - oc: "Occitan", - oj: "Ojibwe", - cu: "Old Church Slavonic", - om: "Oromo", - or: "Oriya", - os: "Ossetian", - pa: "Panjabi", - pi: "Pāli", - fa: "Persian", - pl: "Polish", - ps: "Pashto", - pt: "Portuguese", - qu: "Quechua", - rm: "Romansh", - rn: "Kirundi", - ro: "Romanian", - ru: "Russian", - sa: "Sanskrit", - sc: "Sardinian", - sd: "Sindhi", - se: "Northern Sami", - sm: "Samoan", - sg: "Sango", - sr: "Serbian", - gd: "Gaelic", - sn: "Shona", - si: "Sinhala", - sk: "Slovak", - sl: "Slovene", - so: "Somali", - st: "Southern Sotho", - es: "Spanish", - su: "Sundanese", - sw: "Swahili", - ss: "Swati", - sv: "Swedish", - ta: "Tamil", - te: "Telugu", - tg: "Tajik", - th: "Thai", - ti: "Tigrinya", - bo: "Tibetan Standard", - tk: "Turkmen", - tl: "Tagalog", - tn: "Tswana", - to: "Tonga", - tr: "Turkish", - ts: "Tsonga", - tt: "Tatar", - tw: "Twi", - ty: "Tahitian", - ug: "Uyghur", - uk: "Ukrainian", - ur: "Urdu", - uz: "Uzbek", - ve: "Venda", - vi: "Vietnamese", - vo: "Volapük", - wa: "Walloon", - cy: "Welsh", - wo: "Wolof", - fy: "Western Frisian", - xh: "Xhosa", - yi: "Yiddish", - yo: "Yoruba", - za: "Zhuang", - zu: "Zulu" -}; exports.langIdToName = langIdToName; -// __ts-babel@6.0.4 -//# sourceMappingURL=langs.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/langs.js.map b/node_modules/app-builder-lib/out/util/langs.js.map deleted file mode 100644 index 6333fcf..0000000 --- a/node_modules/app-builder-lib/out/util/langs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/langs.ts"],"names":[],"mappings":";;;;;;;AAAO,MAAM,gBAAgB,GAAG,CAC9B,OAD8B,EACrB,OADqB,EACZ,OADY,EACH,OADG,EACM,OADN,EACe,OADf,EACwB,OADxB,EACiC,OADjC,EAC0C,OAD1C,EACmD,OADnD,EAC4D,OAD5D,EACqE,OADrE,EAE9B,OAF8B,EAErB,OAFqB,EAEZ,OAFY,EAEH,OAFG,EAEM,OAFN,EAE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0K1B,EAAA,EAAE,EAAE,WA1KsB;AA2K1B,EAAA,EAAE,EAAE,MA3KsB;AA4K1B,EAAA,EAAE,EAAE,OA5KsB;AA6K1B,EAAA,EAAE,EAAE,OA7KsB;AA8K1B,EAAA,EAAE,EAAE,YA9KsB;AA+K1B,EAAA,EAAE,EAAE,SA/KsB;AAgL1B,EAAA,EAAE,EAAE,SAhLsB;AAiL1B,EAAA,EAAE,EAAE,OAjLsB;AAkL1B,EAAA,EAAE,EAAE,OAlLsB;AAmL1B,EAAA,EAAE,EAAE,iBAnLsB;AAoL1B,EAAA,EAAE,EAAE,OApLsB;AAqL1B,EAAA,EAAE,EAAE,SArLsB;AAsL1B,EAAA,EAAE,EAAE,QAtLsB;AAuL1B,EAAA,EAAE,EAAE,QAvLsB;AAwL1B,EAAA,EAAE,EAAE;AAxLsB,CAArB,C","sourcesContent":["export const bundledLanguages = [\n \"en_US\", \"de_DE\", \"fr_FR\", \"es_ES\", \"zh_CN\", \"zh_TW\", \"ja_JP\", \"ko_KR\", \"it_IT\", \"nl_NL\", \"da_DK\", \"sv_SE\",\n \"nb_NO\", \"fi_FI\", \"ru_RU\", \"pt_PT\", \"pt_BR\", \"pl_PL\", \"uk_UA\", \"cs_CZ\", \"sk_SK\", \"hu_HU\", \"ar_SA\", \"tr_TR\",\n \"th_TH\", \"vi_VN\",\n]\n\n// todo \"ro_RO\" \"el_GR\" \"et_EE\" \"ka_GE\"\n\nconst langToLangWithRegion = new Map()\nfor (const id of bundledLanguages) {\n langToLangWithRegion.set(id.substring(0, id.indexOf(\"_\")), id)\n}\n\nexport function toLangWithRegion(lang: string): string {\n if (lang.includes(\"_\")) {\n return lang\n }\n\n lang = lang.toLowerCase()\n\n const result = langToLangWithRegion.get(lang)\n return result == null ? `${lang}_${lang.toUpperCase()}` : result\n}\n\nexport const lcid: any = {\n af_ZA: 1078,\n am_ET: 1118,\n ar_AE: 14337,\n ar_BH: 15361,\n ar_DZ: 5121,\n ar_EG: 3073,\n ar_IQ: 2049,\n ar_JO: 11265,\n ar_KW: 13313,\n ar_LB: 12289,\n ar_LY: 4097,\n ar_MA: 6145,\n ar_OM: 8193,\n ar_QA: 16385,\n ar_SA: 1025,\n ar_SY: 10241,\n ar_TN: 7169,\n ar_YE: 9217,\n arn_CL: 1146,\n as_IN: 1101,\n az_AZ: 2092,\n ba_RU: 1133,\n be_BY: 1059,\n bg_BG: 1026,\n bn_IN: 1093,\n bo_BT: 2129,\n bo_CN: 1105,\n br_FR: 1150,\n bs_BA: 8218,\n ca_ES: 1027,\n co_FR: 1155,\n cs_CZ: 1029,\n cy_GB: 1106,\n da_DK: 1030,\n de_AT: 3079,\n de_CH: 2055,\n de_DE: 1031,\n de_LI: 5127,\n de_LU: 4103,\n div_MV: 1125,\n dsb_DE: 2094,\n el_GR: 1032,\n en_AU: 3081,\n en_BZ: 10249,\n en_CA: 4105,\n en_CB: 9225,\n en_GB: 2057,\n en_IE: 6153,\n en_IN: 18441,\n en_JA: 8201,\n en_MY: 17417,\n en_NZ: 5129,\n en_PH: 13321,\n en_TT: 11273,\n en_US: 1033,\n en_ZA: 7177,\n en_ZW: 12297,\n es_AR: 11274,\n es_BO: 16394,\n es_CL: 13322,\n es_CO: 9226,\n es_CR: 5130,\n es_DO: 7178,\n es_EC: 12298,\n es_ES: 3082,\n es_GT: 4106,\n es_HN: 18442,\n es_MX: 2058,\n es_NI: 19466,\n es_PA: 6154,\n es_PE: 10250,\n es_PR: 20490,\n es_PY: 15370,\n es_SV: 17418,\n es_UR: 14346,\n es_US: 21514,\n es_VE: 8202,\n et_EE: 1061,\n eu_ES: 1069,\n fa_IR: 1065,\n fi_FI: 1035,\n fil_PH: 1124,\n fo_FO: 1080,\n fr_BE: 2060,\n fr_CA: 3084,\n fr_CH: 4108,\n fr_FR: 1036,\n fr_LU: 5132,\n fr_MC: 6156,\n fy_NL: 1122,\n ga_IE: 2108,\n gbz_AF: 1164,\n gl_ES: 1110,\n gsw_FR: 1156,\n gu_IN: 1095,\n ha_NG: 1128,\n he_IL: 1037,\n hi_IN: 1081,\n hr_BA: 4122,\n hr_HR: 1050,\n hu_HU: 1038,\n hy_AM: 1067,\n id_ID: 1057,\n ii_CN: 1144,\n is_IS: 1039,\n it_CH: 2064,\n it_IT: 1040,\n iu_CA: 2141,\n ja_JP: 1041,\n ka_GE: 1079,\n kh_KH: 1107,\n kk_KZ: 1087,\n kl_GL: 1135,\n kn_IN: 1099,\n ko_KR: 1042,\n kok_IN: 1111,\n ky_KG: 1088,\n lb_LU: 1134,\n lo_LA: 1108,\n lt_LT: 1063,\n lv_LV: 1062,\n mi_NZ: 1153,\n mk_MK: 1071,\n ml_IN: 1100,\n mn_CN: 2128,\n mn_MN: 1104,\n moh_CA: 1148,\n mr_IN: 1102,\n ms_BN: 2110,\n ms_MY: 1086,\n mt_MT: 1082,\n my_MM: 1109,\n nb_NO: 1044,\n ne_NP: 1121,\n nl_BE: 2067,\n nl_NL: 1043,\n nn_NO: 2068,\n ns_ZA: 1132,\n oc_FR: 1154,\n or_IN: 1096,\n pa_IN: 1094,\n pl_PL: 1045,\n ps_AF: 1123,\n pt_BR: 1046,\n pt_PT: 2070,\n qut_GT: 1158,\n quz_BO: 1131,\n quz_EC: 2155,\n quz_PE: 3179,\n rm_CH: 1047,\n ro_RO: 1048,\n ru_RU: 1049,\n rw_RW: 1159,\n sa_IN: 1103,\n sah_RU: 1157,\n se_FI: 3131,\n se_NO: 1083,\n se_SE: 2107,\n si_LK: 1115,\n sk_SK: 1051,\n sl_SI: 1060,\n sma_NO: 6203,\n sma_SE: 7227,\n smj_NO: 4155,\n smj_SE: 5179,\n smn_FI: 9275,\n sms_FI: 8251,\n sq_AL: 1052,\n sr_BA: 7194,\n sr_SP: 3098,\n sv_FI: 2077,\n sv_SE: 1053,\n sw_KE: 1089,\n syr_SY: 1114,\n ta_IN: 1097,\n te_IN: 1098,\n tg_TJ: 1064,\n th_TH: 1054,\n tk_TM: 1090,\n tmz_DZ: 2143,\n tn_ZA: 1074,\n tr_TR: 1055,\n tt_RU: 1092,\n ug_CN: 1152,\n uk_UA: 1058,\n ur_IN: 2080,\n ur_PK: 1056,\n uz_UZ: 2115,\n vi_VN: 1066,\n wen_DE: 1070,\n wo_SN: 1160,\n xh_ZA: 1076,\n yo_NG: 1130,\n zh_CHS: 4,\n zh_CHT: 31748,\n zh_CN: 2052,\n zh_HK: 3076,\n zh_MO: 5124,\n zh_SG: 4100,\n zh_TW: 1028,\n zu_ZA: 1077\n}\n\n// noinspection SpellCheckingInspection\nexport const langIdToName = {\n ab: \"Abkhaz\",\n aa: \"Afar\",\n af: \"Afrikaans\",\n ak: \"Akan\",\n sq: \"Albanian\",\n am: \"Amharic\",\n ar: \"Arabic\",\n an: \"Aragonese\",\n hy: \"Armenian\",\n as: \"Assamese\",\n av: \"Avaric\",\n ae: \"Avestan\",\n ay: \"Aymara\",\n az: \"Azerbaijani\",\n bm: \"Bambara\",\n ba: \"Bashkir\",\n eu: \"Basque\",\n be: \"Belarusian\",\n bn: \"Bengali\",\n bh: \"Bihari\",\n bi: \"Bislama\",\n bs: \"Bosnian\",\n br: \"Breton\",\n bg: \"Bulgarian\",\n my: \"Burmese\",\n ca: \"Catalan\",\n ch: \"Chamorro\",\n ce: \"Chechen\",\n ny: \"Chichewa\",\n zh: \"Chinese\",\n cv: \"Chuvash\",\n kw: \"Cornish\",\n co: \"Corsican\",\n cr: \"Cree\",\n hr: \"Croatian\",\n cs: \"Czech\",\n da: \"Danish\",\n dv: \"Divehi\",\n nl: \"Dutch\",\n dz: \"Dzongkha\",\n en: \"English\",\n eo: \"Esperanto\",\n et: \"Estonian\",\n ee: \"Ewe\",\n fo: \"Faroese\",\n fj: \"Fijian\",\n fi: \"Finnish\",\n fr: \"French\",\n ff: \"Fula\",\n gl: \"Galician\",\n ka: \"Georgian\",\n de: \"German\",\n el: \"Greek\",\n gn: \"Guaraní\",\n gu: \"Gujarati\",\n ht: \"Haitian\",\n ha: \"Hausa\",\n he: \"Hebrew\",\n hz: \"Herero\",\n hi: \"Hindi\",\n ho: \"Hiri Motu\",\n hu: \"Hungarian\",\n ia: \"Interlingua\",\n id: \"Indonesian\",\n ie: \"Interlingue\",\n ga: \"Irish\",\n ig: \"Igbo\",\n ik: \"Inupiaq\",\n io: \"Ido\",\n is: \"Icelandic\",\n it: \"Italian\",\n iu: \"Inuktitut\",\n ja: \"Japanese\",\n jv: \"Javanese\",\n kl: \"Kalaallisut\",\n kn: \"Kannada\",\n kr: \"Kanuri\",\n ks: \"Kashmiri\",\n kk: \"Kazakh\",\n km: \"Khmer\",\n ki: \"Kikuyu\",\n rw: \"Kinyarwanda\",\n ky: \"Kyrgyz\",\n kv: \"Komi\",\n kg: \"Kongo\",\n ko: \"Korean\",\n ku: \"Kurdish\",\n kj: \"Kwanyama\",\n la: \"Latin\",\n lb: \"Luxembourgish\",\n lg: \"Ganda\",\n li: \"Limburgish\",\n ln: \"Lingala\",\n lo: \"Lao\",\n lt: \"Lithuanian\",\n lu: \"Luba-Katanga\",\n lv: \"Latvian\",\n gv: \"Manx\",\n mk: \"Macedonian\",\n mg: \"Malagasy\",\n ms: \"Malay\",\n ml: \"Malayalam\",\n mt: \"Maltese\",\n mi: \"Māori\",\n mr: \"Marathi\",\n mh: \"Marshallese\",\n mn: \"Mongolian\",\n na: \"Nauru\",\n nv: \"Navajo\",\n nd: \"Northern Ndebele\",\n ne: \"Nepali\",\n ng: \"Ndonga\",\n nb: \"Norwegian Bokmål\",\n nn: \"Norwegian Nynorsk\",\n no: \"Norwegian\",\n ii: \"Nuosu\",\n nr: \"Southern Ndebele\",\n oc: \"Occitan\",\n oj: \"Ojibwe\",\n cu: \"Old Church Slavonic\",\n om: \"Oromo\",\n or: \"Oriya\",\n os: \"Ossetian\",\n pa: \"Panjabi\",\n pi: \"Pāli\",\n fa: \"Persian\",\n pl: \"Polish\",\n ps: \"Pashto\",\n pt: \"Portuguese\",\n qu: \"Quechua\",\n rm: \"Romansh\",\n rn: \"Kirundi\",\n ro: \"Romanian\",\n ru: \"Russian\",\n sa: \"Sanskrit\",\n sc: \"Sardinian\",\n sd: \"Sindhi\",\n se: \"Northern Sami\",\n sm: \"Samoan\",\n sg: \"Sango\",\n sr: \"Serbian\",\n gd: \"Gaelic\",\n sn: \"Shona\",\n si: \"Sinhala\",\n sk: \"Slovak\",\n sl: \"Slovene\",\n so: \"Somali\",\n st: \"Southern Sotho\",\n es: \"Spanish\",\n su: \"Sundanese\",\n sw: \"Swahili\",\n ss: \"Swati\",\n sv: \"Swedish\",\n ta: \"Tamil\",\n te: \"Telugu\",\n tg: \"Tajik\",\n th: \"Thai\",\n ti: \"Tigrinya\",\n bo: \"Tibetan Standard\",\n tk: \"Turkmen\",\n tl: \"Tagalog\",\n tn: \"Tswana\",\n to: \"Tonga\",\n tr: \"Turkish\",\n ts: \"Tsonga\",\n tt: \"Tatar\",\n tw: \"Twi\",\n ty: \"Tahitian\",\n ug: \"Uyghur\",\n uk: \"Ukrainian\",\n ur: \"Urdu\",\n uz: \"Uzbek\",\n ve: \"Venda\",\n vi: \"Vietnamese\",\n vo: \"Volapük\",\n wa: \"Walloon\",\n cy: \"Welsh\",\n wo: \"Wolof\",\n fy: \"Western Frisian\",\n xh: \"Xhosa\",\n yi: \"Yiddish\",\n yo: \"Yoruba\",\n za: \"Zhuang\",\n zu: \"Zulu\"\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/license.d.ts b/node_modules/app-builder-lib/out/util/license.d.ts deleted file mode 100644 index 06b1bd6..0000000 --- a/node_modules/app-builder-lib/out/util/license.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { PlatformPackager } from "../platformPackager"; -export declare function getLicenseAssets(fileNames: Array, packager: PlatformPackager): { - file: string; - lang: string; - langWithRegion: string; - langName: any; -}[]; -export declare function getNotLocalizedLicenseFile(custom: string | null | undefined, packager: PlatformPackager, supportedExtension?: Array): Promise; -export declare function getLicenseFiles(packager: PlatformPackager): Promise>; -export interface LicenseFile { - file: string; - lang: string; - langWithRegion: string; - langName: string; -} diff --git a/node_modules/app-builder-lib/out/util/license.js b/node_modules/app-builder-lib/out/util/license.js deleted file mode 100644 index 4174a76..0000000 --- a/node_modules/app-builder-lib/out/util/license.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getLicenseAssets = getLicenseAssets; -exports.getNotLocalizedLicenseFile = getNotLocalizedLicenseFile; -exports.getLicenseFiles = getLicenseFiles; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _langs() { - const data = require("./langs"); - - _langs = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getLicenseAssets(fileNames, packager) { - return fileNames.sort((a, b) => { - const aW = a.includes("_en") ? 0 : 100; - const bW = b.includes("_en") ? 0 : 100; - return aW === bW ? a.localeCompare(b) : aW - bW; - }).map(file => { - let lang = file.match(/_([^.]+)\./)[1]; - let langWithRegion; - - if (lang.includes("_")) { - langWithRegion = lang; - lang = langWithRegion.substring(0, lang.indexOf("_")); - } else { - lang = lang.toLowerCase(); - langWithRegion = (0, _langs().toLangWithRegion)(lang); - } - - return { - file: path.join(packager.buildResourcesDir, file), - lang, - langWithRegion, - langName: _langs().langIdToName[lang] - }; - }); -} - -function getNotLocalizedLicenseFile(_x, _x2) { - return _getNotLocalizedLicenseFile.apply(this, arguments); -} - -function _getNotLocalizedLicenseFile() { - _getNotLocalizedLicenseFile = (0, _bluebirdLst().coroutine)(function* (custom, packager, supportedExtension = ["rtf", "txt", "html"]) { - const possibleFiles = []; - - for (const name of ["license", "eula"]) { - for (const ext of supportedExtension) { - possibleFiles.push(`${name}.${ext}`); - possibleFiles.push(`${name.toUpperCase()}.${ext}`); - possibleFiles.push(`${name}.${ext.toUpperCase()}`); - possibleFiles.push(`${name.toUpperCase()}.${ext.toUpperCase()}`); - } - } - - return yield packager.getResource(custom, ...possibleFiles); - }); - return _getNotLocalizedLicenseFile.apply(this, arguments); -} - -function getLicenseFiles(_x3) { - return _getLicenseFiles.apply(this, arguments); -} function _getLicenseFiles() { - _getLicenseFiles = (0, _bluebirdLst().coroutine)(function* (packager) { - return getLicenseAssets((yield packager.resourceList).filter(it => { - const name = it.toLowerCase(); - return (name.startsWith("license_") || name.startsWith("eula_")) && (name.endsWith(".rtf") || name.endsWith(".txt")); - }), packager); - }); - return _getLicenseFiles.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=license.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/license.js.map b/node_modules/app-builder-lib/out/util/license.js.map deleted file mode 100644 index 6393b53..0000000 --- a/node_modules/app-builder-lib/out/util/license.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/license.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGM,SAAU,gBAAV,CAA2B,SAA3B,EAAqD,QAArD,EAAoF;AACxF,SAAO,SAAS,CAAC,IAAV,CAAe,CAAC,CAAD,EAAI,CAAJ,KAAS;AAC7B,UAAM,EAAE,GAAG,CAAC,CAAC,QAAF,CAAW,KAAX,IAAoB,CAApB,GAAwB,GAAnC;AACA,UAAM,EAAE,GAAG,CAAC,CAAC,QAAF,CAAW,KAAX,IAAoB,CAApB,GAAwB,GAAnC;AACA,WAAO,EAAE,KAAK,EAAP,GAAY,CAAC,CAAC,aAAF,CAAgB,CAAhB,CAAZ,GAAiC,EAAE,GAAG,EAA7C;AACD,G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AL,EAAkB,IAAI,GAAG,CAAC,WAAJ,EAAiB,EAA7D;AACD;AACF;;AAED,iBAAa,QAAQ,CAAC,WAAT,CAAqB,MAArB,EAA6B,GAAG,aAAhC,CAAb;AACD,G;;;;SAEqB,e;;;;;;mDAAf,WAA+B,QAA/B,EAA8D;AACnE,WAAO,gBAAgB,CAAC,OAAO,QAAQ,CAAC,YAAhB,EACrB,MADqB,CACd,EAAE,IAAG;AACX,YAAM,IAAI,GAAG,EAAE,CAAC,WAAH,EAAb;AACA,aAAO,CAAC,IAAI,CAAC,UAAL,CAAgB,UAAhB,KAA+B,IAAI,CAAC,UAAL,CAAgB,OAAhB,CAAhC,MAA8D,IAAI,CAAC,QAAL,CAAc,MAAd,KAAyB,IAAI,CAAC,QAAL,CAAc,MAAd,CAAvF,CAAP;AACD,KAJqB,CAAD,EAIjB,QAJiB,CAAvB;AAKD,G","sourcesContent":["import * as path from \"path\"\nimport { langIdToName, toLangWithRegion } from \"./langs\"\nimport { PlatformPackager } from \"../platformPackager\"\n\nexport function getLicenseAssets(fileNames: Array, packager: PlatformPackager) {\n return fileNames.sort((a, b) => {\n const aW = a.includes(\"_en\") ? 0 : 100\n const bW = b.includes(\"_en\") ? 0 : 100\n return aW === bW ? a.localeCompare(b) : aW - bW\n })\n .map(file => {\n let lang = file.match(/_([^.]+)\\./)![1]\n let langWithRegion\n if (lang.includes(\"_\")) {\n langWithRegion = lang\n lang = langWithRegion.substring(0, lang.indexOf(\"_\"))\n }\n else {\n lang = lang.toLowerCase()\n langWithRegion = toLangWithRegion(lang)\n }\n return {file: path.join(packager.buildResourcesDir, file), lang, langWithRegion, langName: (langIdToName as any)[lang]}\n })\n}\n\nexport async function getNotLocalizedLicenseFile(custom: string | null | undefined, packager: PlatformPackager, supportedExtension: Array = [\"rtf\", \"txt\", \"html\"]): Promise {\n const possibleFiles: Array = []\n for (const name of [\"license\", \"eula\"]) {\n for (const ext of supportedExtension) {\n possibleFiles.push(`${name}.${ext}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext}`)\n possibleFiles.push(`${name}.${ext.toUpperCase()}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext.toUpperCase()}`)\n }\n }\n\n return await packager.getResource(custom, ...possibleFiles)\n}\n\nexport async function getLicenseFiles(packager: PlatformPackager): Promise> {\n return getLicenseAssets((await packager.resourceList)\n .filter(it => {\n const name = it.toLowerCase()\n return (name.startsWith(\"license_\") || name.startsWith(\"eula_\")) && (name.endsWith(\".rtf\") || name.endsWith(\".txt\"))\n }), packager)\n}\n\nexport interface LicenseFile {\n file: string\n lang: string\n langWithRegion: string\n langName: string\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/macosVersion.d.ts b/node_modules/app-builder-lib/out/util/macosVersion.d.ts deleted file mode 100644 index 2f2f4a9..0000000 --- a/node_modules/app-builder-lib/out/util/macosVersion.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function getMacOsVersion(): Promise; -export declare function isMacOsSierra(): Promise; diff --git a/node_modules/app-builder-lib/out/util/macosVersion.js b/node_modules/app-builder-lib/out/util/macosVersion.js deleted file mode 100644 index 062fd0d..0000000 --- a/node_modules/app-builder-lib/out/util/macosVersion.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getMacOsVersion = getMacOsVersion; -exports.isMacOsSierra = isMacOsSierra; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -function semver() { - const data = _interopRequireWildcard(require("semver")); - - semver = function () { - return data; - }; - - return data; -} - -function _log() { - const data = require("builder-util/out/log"); - - _log = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const macOsVersion = new (_lazyVal().Lazy)( -/*#__PURE__*/ -(0, _bluebirdLst().coroutine)(function* () { - const file = yield (0, _fsExtraP().readFile)("/System/Library/CoreServices/SystemVersion.plist", "utf8"); - const matches = /ProductVersion<\/key>[\s\S]*([\d.]+)<\/string>/.exec(file); - - if (!matches) { - throw new Error("Couldn't find the macOS version"); - } - - _log().log.debug({ - version: matches[1] - }, "macOS version"); - - return clean(matches[1]); -})); - -function clean(version) { - return version.split(".").length === 2 ? `${version}.0` : version; -} - -function isOsVersionGreaterThanOrEqualTo(_x) { - return _isOsVersionGreaterThanOrEqualTo.apply(this, arguments); -} - -function _isOsVersionGreaterThanOrEqualTo() { - _isOsVersionGreaterThanOrEqualTo = (0, _bluebirdLst().coroutine)(function* (input) { - return semver().gte((yield macOsVersion.value), clean(input)); - }); - return _isOsVersionGreaterThanOrEqualTo.apply(this, arguments); -} - -function getMacOsVersion() { - return macOsVersion.value; -} - -function isMacOsSierra() { - return _isMacOsSierra.apply(this, arguments); -} function _isMacOsSierra() { - _isMacOsSierra = (0, _bluebirdLst().coroutine)(function* () { - return process.platform === "darwin" && (yield isOsVersionGreaterThanOrEqualTo("10.12.0")); - }); - return _isMacOsSierra.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=macosVersion.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/macosVersion.js.map b/node_modules/app-builder-lib/out/util/macosVersion.js.map deleted file mode 100644 index 8327e8f..0000000 --- a/node_modules/app-builder-lib/out/util/macosVersion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/macosVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM,YAAY,GAAG,KAAI,eAAJ;AAAA;AAAA,8BAAiB,aAAW;AAC/C,QAAM,IAAI,SAAS,0BAAS,kDAAT,EAA6D,MAA7D,CAAnB;AACA,QAAM,OAAO,GAAG,8DAA8D,IAA9D,CAAmE,IAAnE,CAAhB;;AACA,MAAI,CAAC,OAAL,EAAc;AACZ,UAAM,IAAI,KAAJ,CAAU,iCAAV,CAAN;AACD;;AACD,aAAI,KAAJ,CAAU;AAAC,IAAA,OAAO,EAAE,OAAO,CAAC,CAAD;AAAjB,GAAV,EAAiC,eAAjC;;AACA,SAAO,KAAK,CAAC,OAAO,CAAC,CAAD,CAAR,CAAZ;AACD,CARoB,EAArB;;AAUA,SAAS,KAAT,CAAe,OAAf,EAA8B;AAC5B,SAAO,OAAO,CAAC,KAAR,CAAc,GAAd,EAAmB,MAAnB,KAA8B,CAA9B,GAAkC,GAAG,OAAO,IAA5C,GAAmD,OAA1D;AACD;;SAEc,+B;;;;;mEAAf,WAA+C,KAA/C,EAA4D;AAC1D,WAAO,MAAM,GAAC,GAAP,QAAiB,YAAY,CAAC,KAA9B,GAAqC,KAAK,CAAC,KAAD,CAA1C,CAAP;AACD,G;;;;AAEK,SAAU,eAAV,GAAyB;AAC7B,SAAO,YAAY,CAAC,KAApB;AACD;;SAEqB,a;;;;;;iDAAf,aAA4B;AACjC,WAAO,OAAO,CAAC,QAAR,KAAqB,QAArB,WAAuC,+BAA+B,CAAC,SAAD,CAAtE,CAAP;AACD,G","sourcesContent":["import { readFile } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as semver from \"semver\"\nimport { log } from \"builder-util/out/log\"\n\nconst macOsVersion = new Lazy(async () => {\n const file = await readFile(\"/System/Library/CoreServices/SystemVersion.plist\", \"utf8\")\n const matches = /ProductVersion<\\/key>[\\s\\S]*([\\d.]+)<\\/string>/.exec(file)\n if (!matches) {\n throw new Error(\"Couldn't find the macOS version\")\n }\n log.debug({version: matches[1]}, \"macOS version\")\n return clean(matches[1])\n})\n\nfunction clean(version: string) {\n return version.split(\".\").length === 2 ? `${version}.0` : version\n}\n\nasync function isOsVersionGreaterThanOrEqualTo(input: string) {\n return semver.gte(await macOsVersion.value, clean(input))\n}\n\nexport function getMacOsVersion() {\n return macOsVersion.value\n}\n\nexport async function isMacOsSierra() {\n return process.platform === \"darwin\" && await isOsVersionGreaterThanOrEqualTo(\"10.12.0\")\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/macroExpander.d.ts b/node_modules/app-builder-lib/out/util/macroExpander.d.ts deleted file mode 100644 index 7e8607b..0000000 --- a/node_modules/app-builder-lib/out/util/macroExpander.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { AppInfo } from "../appInfo"; -export declare function expandMacro(pattern: string, arch: string | null | undefined, appInfo: AppInfo, extra?: any, isProductNameSanitized?: boolean): string; diff --git a/node_modules/app-builder-lib/out/util/macroExpander.js b/node_modules/app-builder-lib/out/util/macroExpander.js deleted file mode 100644 index 5bbbee1..0000000 --- a/node_modules/app-builder-lib/out/util/macroExpander.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.expandMacro = expandMacro; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function expandMacro(pattern, arch, appInfo, extra = {}, isProductNameSanitized = true) { - if (arch == null) { - pattern = pattern // tslint:disable-next-line:no-invalid-template-strings - .replace("-${arch}", "") // tslint:disable-next-line:no-invalid-template-strings - .replace(" ${arch}", "") // tslint:disable-next-line:no-invalid-template-strings - .replace("_${arch}", "") // tslint:disable-next-line:no-invalid-template-strings - .replace("/${arch}", ""); - } - - return pattern.replace(/\${([_a-zA-Z./*]+)}/g, (match, p1) => { - switch (p1) { - case "productName": - return isProductNameSanitized ? appInfo.productFilename : appInfo.productName; - - case "arch": - if (arch == null) { - // see above, we remove macro if no arch - return ""; - } - - return arch; - - case "author": - const companyName = appInfo.companyName; - - if (companyName == null) { - throw new (_builderUtil().InvalidConfigurationError)(`cannot expand pattern "${pattern}": author is not specified`, "ERR_ELECTRON_BUILDER_AUTHOR_UNSPECIFIED"); - } - - return companyName; - - case "platform": - return process.platform; - - case "channel": - return appInfo.channel || "latest"; - - default: - if (p1 in appInfo) { - return appInfo[p1]; - } - - if (p1.startsWith("env.")) { - const envName = p1.substring("env.".length); - const envValue = process.env[envName]; - - if (envValue == null) { - throw new (_builderUtil().InvalidConfigurationError)(`cannot expand pattern "${pattern}": env ${envName} is not defined`, "ERR_ELECTRON_BUILDER_ENV_NOT_DEFINED"); - } - - return envValue; - } - - const value = extra[p1]; - - if (value == null) { - throw new (_builderUtil().InvalidConfigurationError)(`cannot expand pattern "${pattern}": macro ${p1} is not defined`, "ERR_ELECTRON_BUILDER_MACRO_NOT_DEFINED"); - } else { - return value; - } - - } - }); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=macroExpander.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/macroExpander.js.map b/node_modules/app-builder-lib/out/util/macroExpander.js.map deleted file mode 100644 index 2bbbc95..0000000 --- a/node_modules/app-builder-lib/out/util/macroExpander.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/macroExpander.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGM,SAAU,WAAV,CAAsB,OAAtB,EAAuC,IAAvC,EAAwE,OAAxE,EAA0F,KAAA,GAAa,EAAvG,EAA2G,sBAAsB,GAAG,IAApI,EAAwI;AAC5I,MAAI,IAAI,IAAI,IAAZ,EAAkB;AAChB,IAAA,OAAO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;AACD,iBAAO,QAAP;AACD;;AAED,cAAM,KAAK,GAAG,KAAK,CAAC,EAAD,CAAnB;;AACA,YAAI,KAAK,IAAI,IAAb,EAAmB;AACjB,gBAAM,KAAI,wCAAJ,EAA8B,0BAA0B,OAAO,YAAY,EAAE,iBAA7E,EAAgG,wCAAhG,CAAN;AACD,SAFD,MAGK;AACH,iBAAO,KAAP;AACD;;AA5CL;AA8CD,GA/CM,CAAP;AAgDD,C","sourcesContent":["import { InvalidConfigurationError } from \"builder-util\"\nimport { AppInfo } from \"../appInfo\"\n\nexport function expandMacro(pattern: string, arch: string | null | undefined, appInfo: AppInfo, extra: any = {}, isProductNameSanitized = true): string {\n if (arch == null) {\n pattern = pattern\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\"-${arch}\", \"\")\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\" ${arch}\", \"\")\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\"_${arch}\", \"\")\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\"/${arch}\", \"\")\n }\n\n return pattern.replace(/\\${([_a-zA-Z./*]+)}/g, (match, p1): string => {\n switch (p1) {\n case \"productName\":\n return isProductNameSanitized ? appInfo.productFilename : appInfo.productName\n\n case \"arch\":\n if (arch == null) {\n // see above, we remove macro if no arch\n return \"\"\n }\n return arch\n\n case \"author\":\n const companyName = appInfo.companyName\n if (companyName == null) {\n throw new InvalidConfigurationError(`cannot expand pattern \"${pattern}\": author is not specified`, \"ERR_ELECTRON_BUILDER_AUTHOR_UNSPECIFIED\")\n }\n return companyName\n\n case \"platform\":\n return process.platform\n\n case \"channel\":\n return appInfo.channel || \"latest\"\n\n default:\n if (p1 in appInfo) {\n return (appInfo as any)[p1]\n }\n\n if (p1.startsWith(\"env.\")) {\n const envName = p1.substring(\"env.\".length)\n const envValue = process.env[envName]\n if (envValue == null) {\n throw new InvalidConfigurationError(`cannot expand pattern \"${pattern}\": env ${envName} is not defined`, \"ERR_ELECTRON_BUILDER_ENV_NOT_DEFINED\")\n }\n return envValue\n }\n\n const value = extra[p1]\n if (value == null) {\n throw new InvalidConfigurationError(`cannot expand pattern \"${pattern}\": macro ${p1} is not defined`, \"ERR_ELECTRON_BUILDER_MACRO_NOT_DEFINED\")\n }\n else {\n return value\n }\n }\n })\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/packageDependencies.d.ts b/node_modules/app-builder-lib/out/util/packageDependencies.d.ts deleted file mode 100644 index dc288a2..0000000 --- a/node_modules/app-builder-lib/out/util/packageDependencies.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// -import { Stats } from "fs-extra-p"; -import { Lazy } from "lazy-val"; -export interface Dependency { - name: string; - version: string; - path: string; - extraneous: boolean; - optional: boolean; - dependencies: Map | null; - directDependencyNames: Array | null; - peerDependencies: { - [key: string]: any; - } | null; - optionalDependencies: { - [key: string]: any; - } | null; - realName: string; - link?: string; - parent?: Dependency; - stat?: Stats; -} -export declare function createLazyProductionDeps(projectDir: string): Lazy; diff --git a/node_modules/app-builder-lib/out/util/packageDependencies.js b/node_modules/app-builder-lib/out/util/packageDependencies.js deleted file mode 100644 index 381b4be..0000000 --- a/node_modules/app-builder-lib/out/util/packageDependencies.js +++ /dev/null @@ -1,435 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createLazyProductionDeps = createLazyProductionDeps; -exports.getProductionDependencies = getProductionDependencies; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -// noinspection SpellCheckingInspection -const knownAlwaysIgnoredDevDeps = new Set(["electron-builder-tslint-config", "electron-download", "libui-download", "electron-forge", "electron-packager", "electron-compilers", "prebuild-install", "nan", "electron-webpack", "electron-webpack-ts", "electron-webpack-vue", "@types"]); // noinspection JSUnusedGlobalSymbols - -function createLazyProductionDeps(projectDir) { - return new (_lazyVal().Lazy)(() => getProductionDependencies(projectDir)); -} -/** @internal */ - - -function getProductionDependencies(_x) { - return _getProductionDependencies.apply(this, arguments); -} - -function _getProductionDependencies() { - _getProductionDependencies = (0, _bluebirdLst().coroutine)(function* (folder) { - const result = []; - computeSortedPaths((yield new Collector().collect(folder)), result, false); - return result; - }); - return _getProductionDependencies.apply(this, arguments); -} - -const ignoredProperties = new Set(["description", "author", "bugs", "engines", "repository", "build", "main", "license", "homepage", "scripts", "maintainers", "contributors", "keywords", "devDependencies", "files", "typings", "types", "xo", "resolutions"]); - -function readJson(file) { - return (0, _fsExtraP().readFile)(file, "utf-8").then(it => JSON.parse(it, (key, value) => ignoredProperties.has(key) ? undefined : value)); -} - -function computeSortedPaths(parent, result, isExtraneous) { - const dependencies = parent.dependencies; - - if (dependencies == null) { - return; - } - - for (const dep of dependencies.values()) { - if (dep.extraneous === isExtraneous) { - result.push(dep); - computeSortedPaths(dep, result, isExtraneous); - } - } -} - -class Collector { - constructor() { - this.pathToMetadata = new Map(); - this.unresolved = new Map(); - } - - collect(dir) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const rootDependency = yield readJson(path.join(dir, "package.json")); - yield _this.readInstalled(path.join(dir, "node_modules"), rootDependency, rootDependency.name); - - _this.unmarkExtraneous(rootDependency); - - if (_this.unresolved.size > 0) { - _builderUtil().log.debug({ - unresolved: Array.from(_this.unresolved.keys()).join(", ") - }, "unresolved dependencies after first round"); - - yield _this.resolveUnresolvedHoisted(rootDependency, dir); - } - - return rootDependency; - })(); - } - - resolveUnresolvedHoisted(rootDependency, dir) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - let nameToMetadata = rootDependency.dependencies; - - if (nameToMetadata == null) { - rootDependency.dependencies = new Map(); - nameToMetadata = rootDependency.dependencies; - } - - let parentDir = dir; - - do { - parentDir = path.dirname(parentDir); - - if (parentDir === "" || parentDir.endsWith("/") || parentDir.endsWith("\\")) { - // https://github.com/electron-userland/electron-builder/issues/2220 - const list = Array.from(_this2.unresolved.keys()).filter(it => !_this2.unresolved.get(it)); - - if (list.length === 1 && list[0] === "proton-native") { - // resolve in tests - parentDir = process.cwd(); - } else { - if (list.length !== 0) { - const message = `Unresolved node modules: ${list.join(", ")}`; - - if ((0, _builderUtil().isEnvTrue)(process.env.ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES)) { - _builderUtil().log.warn(message); - } else { - throw new Error(message); - } - } - - break; - } - } - - const parentNodeModulesDir = parentDir + path.sep + "node_modules"; - const dirStat = yield (0, _fs().statOrNull)(parentNodeModulesDir); - - if (dirStat == null || !dirStat.isDirectory()) { - if (dirStat == null || !dirStat.isDirectory()) { - continue; - } - } // https://github.com/electron-userland/electron-builder/issues/2222#issuecomment-339060335 - // step 1: resolve current unresolved - // step n: try to resolve new unresolved in the same parent dir until at least something is resolved in the dir - - - while (true) { - const unresolved = Array.from(_this2.unresolved.keys()); - - _this2.unresolved.clear(); - - const resolved = yield _bluebirdLst().default.map(unresolved, it => { - return _this2.readChildPackage(it, parentNodeModulesDir, rootDependency).catch(e => { - if (e.code === "ENOENT") { - return null; - } else { - throw e; - } - }); - }, _fs().CONCURRENCY); - let hasResolved = false; - - for (const dep of resolved) { - if (dep != null) { - hasResolved = true; - - _this2.unmarkExtraneous(dep); - - nameToMetadata.set(dep.realName, dep); - } - } - - if (!hasResolved) { - break; - } - - _this2.unmarkExtraneous(rootDependency); - - if (_this2.unresolved.size === 0) { - return; - } - } - } while (_this2.unresolved.size > 0); - })(); - } - - readInstalled(nodeModulesDir, dependency, name) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - dependency.realName = name; - dependency.directDependencyNames = dependency.dependencies == null ? null : Object.keys(dependency.dependencies); // mark as extraneous at this point. - // this will be un-marked in unmarkExtraneous, where we mark as not-extraneous everything that is required in some way from the root object. - - dependency.extraneous = true; - dependency.optional = true; - - if (dependency.dependencies == null && dependency.optionalDependencies == null) { - // package has only dev or peer dependencies - no need to check child node_module - dependency.dependencies = null; - return; - } - - const childModules = yield readNodeModulesDir(nodeModulesDir); - - if (childModules == null) { - dependency.dependencies = null; - return; - } - - const deps = yield _bluebirdLst().default.map(childModules, it => _this3.readChildPackage(it, nodeModulesDir, dependency), _fs().CONCURRENCY); - - if (deps.length === 0) { - dependency.dependencies = null; - return; - } - - const nameToMetadata = new Map(); - - for (const dep of deps) { - if (dep != null) { - nameToMetadata.set(dep.realName, dep); - } - } - - dependency.dependencies = nameToMetadata; - })(); - } - - readChildPackage(name, nodeModulesDir, parent) { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const rawDir = path.join(nodeModulesDir, name); - let dir = rawDir; - const stat = yield (0, _fsExtraP().lstat)(dir); - const isSymbolicLink = stat.isSymbolicLink(); - - if (isSymbolicLink) { - dir = yield (0, _promise().orNullIfFileNotExist)((0, _fsExtraP().realpath)(dir)); - - if (dir == null) { - _builderUtil().log.debug({ - path: rawDir - }, "broken symlink"); - - return null; - } - } - - const processed = _this4.pathToMetadata.get(dir); - - if (processed != null) { - return processed; - } - - const metadata = yield (0, _promise().orNullIfFileNotExist)(readJson(path.join(dir, "package.json"))); - - if (metadata == null) { - return null; - } - - if (isSymbolicLink) { - metadata.link = dir; - metadata.stat = stat; - } else { - metadata.parent = parent; // overwrite if already set by project package.json - - metadata.link = undefined; - } - - metadata.path = rawDir; // do not add root project to result - - _this4.pathToMetadata.set(dir, metadata); - - yield _this4.readInstalled(dir + path.sep + "node_modules", metadata, name); - return metadata; - })(); - } - - unmark(deps, obj, unsetOptional, isOptional) { - for (const name of deps) { - const dep = this.findDep(obj, name, isOptional); - - if (dep != null) { - if (unsetOptional) { - dep.optional = false; - } - - if (dep.extraneous) { - this.unmarkExtraneous(dep); - } - } - } - } - - unmarkExtraneous(obj) { - // Mark all non-required deps as extraneous. - // start from the root object and mark as non-extraneous all modules - // that haven't been previously flagged as extraneous then propagate to all their dependencies - obj.extraneous = false; - - if (obj.directDependencyNames != null) { - this.unmark(obj.directDependencyNames, obj, true, false); - } - - if (obj.peerDependencies != null) { - this.unmark(Object.keys(obj.peerDependencies), obj, true, false); - } - - if (obj.optionalDependencies != null) { - this.unmark(Object.keys(obj.optionalDependencies), obj, false, true); - } - } // find the one that will actually be loaded by require() so we can make sure it's valid - - - findDep(obj, name, isOptional) { - if (isIgnoredDep(name)) { - return null; - } - - let r = obj; - let found = null; - - while (r != null && found == null) { - // if r is a valid choice, then use that. - // kinda weird if a pkg depends on itself, but after the first iteration of this loop, it indicates a dep cycle. - found = r.dependencies == null ? null : r.dependencies.get(name); - - if (found == null && r.realName === name) { - found = r; - } - - r = r.link == null ? r.parent : null; - } - - if (found == null) { - this.unresolved.set(name, isOptional); - } - - return found; - } - -} - -function isIgnoredDep(name) { - return knownAlwaysIgnoredDevDeps.has(name) || name.startsWith("@types/"); -} - -function readNodeModulesDir(_x2) { - return _readNodeModulesDir.apply(this, arguments); -} function _readNodeModulesDir() { - _readNodeModulesDir = (0, _bluebirdLst().coroutine)(function* (dir) { - let files; - - try { - files = (yield (0, _fsExtraP().readdir)(dir)).filter(it => !it.startsWith(".") && !knownAlwaysIgnoredDevDeps.has(it)); - } catch (e) { - // error indicates that nothing is installed here - return null; - } - - files.sort(); - const scopes = files.filter(it => it.startsWith("@")); - - if (scopes.length === 0) { - return files; - } - - const result = files.filter(it => !it.startsWith("@")); - const scopeFileList = yield _bluebirdLst().default.map(scopes, it => (0, _fsExtraP().readdir)(path.join(dir, it))); - - for (let i = 0; i < scopes.length; i++) { - const list = scopeFileList[i]; - list.sort(); - - for (const file of list) { - if (!file.startsWith(".")) { - result.push(`${scopes[i]}/${file}`); - } - } - } - - return result; - }); - return _readNodeModulesDir.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=packageDependencies.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/packageDependencies.js.map b/node_modules/app-builder-lib/out/util/packageDependencies.js.map deleted file mode 100644 index 794319f..0000000 --- a/node_modules/app-builder-lib/out/util/packageDependencies.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/packageDependencies.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAuBA;AACA,MAAM,yBAAyB,GAAG,IAAI,GAAJ,CAAQ,CACxC,gCADwC,EACN,mBADM,EACe,gBADf,EAExC,gBAFwC,EAEtB,mBAFsB,EAED,oBAFC,EAGxC,kBAHwC,EAGpB,KAHoB,EAIxC,kBAJwC,EAIpB,qBAJoB,EAIG,sBAJH,EAKxC,QALwC,CAAR,CAAlC,C,CAQA;;AACM,SAAU,wBAAV,CAAmC,UAAnC,EAAqD;AACzD,SAAO,KAAI,eAAJ,EAAS,MAAM,yBAAyB,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CAAC,GAAG,MAAM,CAAC,MAA3B,EAAmC,CAAC,EAApC,EAAwC;AACtC,YAAM,IAAI,GAAG,aAAa,CAAC,CAAD,CAA1B;AACA,MAAA,IAAI,CAAC,IAAL;;AACA,WAAK,MAAM,IAAX,IAAmB,IAAnB,EAAyB;AACvB,YAAI,CAAC,IAAI,CAAC,UAAL,CAAgB,GAAhB,CAAL,EAA2B;AACzB,UAAA,MAAM,CAAC,IAAP,CAAY,GAAG,MAAM,CAAC,CAAD,CAAG,IAAI,IAAI,EAAhC;AACD;AACF;AACF;;AAED,WAAO,MAAP;AACD,G","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { isEnvTrue, log } from \"builder-util\"\nimport { CONCURRENCY, statOrNull } from \"builder-util/out/fs\"\nimport { orNullIfFileNotExist } from \"builder-util/out/promise\"\nimport { lstat, readdir, readFile, realpath, Stats } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\n\nexport interface Dependency {\n name: string\n version: string\n path: string\n extraneous: boolean\n optional: boolean\n\n dependencies: Map | null\n directDependencyNames: Array | null\n peerDependencies: { [key: string]: any } | null\n optionalDependencies: { [key: string]: any } | null\n\n realName: string\n link?: string\n\n parent?: Dependency\n\n // only if link\n stat?: Stats\n}\n\n// noinspection SpellCheckingInspection\nconst knownAlwaysIgnoredDevDeps = new Set([\n \"electron-builder-tslint-config\", \"electron-download\", \"libui-download\",\n \"electron-forge\", \"electron-packager\", \"electron-compilers\",\n \"prebuild-install\", \"nan\",\n \"electron-webpack\", \"electron-webpack-ts\", \"electron-webpack-vue\",\n \"@types\",\n])\n\n// noinspection JSUnusedGlobalSymbols\nexport function createLazyProductionDeps(projectDir: string) {\n return new Lazy(() => getProductionDependencies(projectDir))\n}\n\n/** @internal */\nexport async function getProductionDependencies(folder: string): Promise> {\n const result: Array = []\n computeSortedPaths(await new Collector().collect(folder), result, false)\n return result\n}\n\nconst ignoredProperties = new Set([\"description\", \"author\", \"bugs\", \"engines\", \"repository\", \"build\", \"main\", \"license\", \"homepage\", \"scripts\", \"maintainers\", \"contributors\", \"keywords\", \"devDependencies\", \"files\", \"typings\", \"types\", \"xo\", \"resolutions\"])\n\nfunction readJson(file: string) {\n return readFile(file, \"utf-8\")\n .then(it => JSON.parse(it, (key, value) => ignoredProperties.has(key) ? undefined : value))\n}\n\nfunction computeSortedPaths(parent: Dependency, result: Array, isExtraneous: boolean) {\n const dependencies = parent.dependencies\n if (dependencies == null) {\n return\n }\n\n for (const dep of dependencies.values()) {\n if (dep.extraneous === isExtraneous) {\n result.push(dep)\n computeSortedPaths(dep, result, isExtraneous)\n }\n }\n}\n\nclass Collector {\n readonly pathToMetadata = new Map()\n private unresolved = new Map()\n\n async collect(dir: string) {\n const rootDependency: Dependency = await readJson(path.join(dir, \"package.json\"))\n await this.readInstalled(path.join(dir, \"node_modules\"), rootDependency, rootDependency.name)\n this.unmarkExtraneous(rootDependency)\n\n if (this.unresolved.size > 0) {\n log.debug({unresolved: Array.from(this.unresolved.keys()).join(\", \")}, \"unresolved dependencies after first round\")\n await this.resolveUnresolvedHoisted(rootDependency, dir)\n }\n return rootDependency\n }\n\n private async resolveUnresolvedHoisted(rootDependency: Dependency, dir: string): Promise {\n let nameToMetadata = rootDependency.dependencies\n if (nameToMetadata == null) {\n rootDependency.dependencies = new Map()\n nameToMetadata = rootDependency.dependencies\n }\n\n let parentDir = dir\n do {\n parentDir = path.dirname(parentDir)\n if (parentDir === \"\" || parentDir.endsWith(\"/\") || parentDir.endsWith(\"\\\\\")) {\n // https://github.com/electron-userland/electron-builder/issues/2220\n const list = Array.from(this.unresolved.keys()).filter(it => !this.unresolved.get(it))\n if (list.length === 1 && list[0] === \"proton-native\") {\n // resolve in tests\n parentDir = process.cwd()\n }\n else {\n if (list.length !== 0) {\n const message = `Unresolved node modules: ${list.join(\", \")}`\n if (isEnvTrue(process.env.ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES)) {\n log.warn(message)\n }\n else {\n throw new Error(message)\n }\n }\n break\n }\n }\n\n const parentNodeModulesDir = parentDir + path.sep + \"node_modules\"\n const dirStat = await statOrNull(parentNodeModulesDir)\n if (dirStat == null || !dirStat.isDirectory()) {\n if (dirStat == null || !dirStat.isDirectory()) {\n continue\n }\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2222#issuecomment-339060335\n // step 1: resolve current unresolved\n // step n: try to resolve new unresolved in the same parent dir until at least something is resolved in the dir\n while (true) {\n const unresolved = Array.from(this.unresolved.keys())\n this.unresolved.clear()\n\n const resolved = await BluebirdPromise.map(unresolved, it => {\n return this.readChildPackage(it, parentNodeModulesDir, rootDependency)\n .catch(e => {\n if ((e as NodeJS.ErrnoException).code === \"ENOENT\") {\n return null\n }\n else {\n throw e\n }\n })\n }, CONCURRENCY)\n\n let hasResolved = false\n\n for (const dep of resolved) {\n if (dep != null) {\n hasResolved = true\n this.unmarkExtraneous(dep)\n nameToMetadata.set(dep.realName, dep)\n }\n }\n\n if (!hasResolved) {\n break\n }\n\n this.unmarkExtraneous(rootDependency)\n\n if (this.unresolved.size === 0) {\n return\n }\n }\n }\n while (this.unresolved.size > 0)\n }\n\n private async readInstalled(nodeModulesDir: string, dependency: Dependency, name: string): Promise {\n dependency.realName = name\n dependency.directDependencyNames = dependency.dependencies == null ? null : Object.keys(dependency.dependencies)\n\n // mark as extraneous at this point.\n // this will be un-marked in unmarkExtraneous, where we mark as not-extraneous everything that is required in some way from the root object.\n dependency.extraneous = true\n dependency.optional = true\n\n if (dependency.dependencies == null && dependency.optionalDependencies == null) {\n // package has only dev or peer dependencies - no need to check child node_module\n dependency.dependencies = null\n return\n }\n\n const childModules = await readNodeModulesDir(nodeModulesDir)\n if (childModules == null) {\n dependency.dependencies = null\n return\n }\n\n const deps = await BluebirdPromise.map(childModules, it => this.readChildPackage(it, nodeModulesDir, dependency), CONCURRENCY)\n if (deps.length === 0) {\n dependency.dependencies = null\n return\n }\n\n const nameToMetadata = new Map()\n for (const dep of deps) {\n if (dep != null) {\n nameToMetadata.set(dep.realName, dep)\n }\n }\n dependency.dependencies = nameToMetadata\n }\n\n private async readChildPackage(name: string, nodeModulesDir: string, parent: Dependency): Promise {\n const rawDir = path.join(nodeModulesDir, name)\n let dir: string | null = rawDir\n const stat = await lstat(dir)\n const isSymbolicLink = stat.isSymbolicLink()\n if (isSymbolicLink) {\n dir = await orNullIfFileNotExist(realpath(dir))\n if (dir == null) {\n log.debug({path: rawDir}, \"broken symlink\")\n return null\n }\n }\n\n const processed = this.pathToMetadata.get(dir)\n if (processed != null) {\n return processed\n }\n\n const metadata: Dependency = await orNullIfFileNotExist(readJson(path.join(dir, \"package.json\")))\n if (metadata == null) {\n return null\n }\n\n if (isSymbolicLink) {\n metadata.link = dir\n metadata.stat = stat\n }\n else {\n metadata.parent = parent\n\n // overwrite if already set by project package.json\n metadata.link = undefined\n }\n\n metadata.path = rawDir\n\n // do not add root project to result\n this.pathToMetadata.set(dir, metadata)\n\n await this.readInstalled(dir + path.sep + \"node_modules\", metadata, name)\n return metadata\n }\n\n private unmark(deps: Iterable, obj: Dependency, unsetOptional: boolean, isOptional: boolean) {\n for (const name of deps) {\n const dep = this.findDep(obj, name, isOptional)\n if (dep != null) {\n if (unsetOptional) {\n dep.optional = false\n }\n if (dep.extraneous) {\n this.unmarkExtraneous(dep)\n }\n }\n }\n }\n\n private unmarkExtraneous(obj: Dependency) {\n // Mark all non-required deps as extraneous.\n // start from the root object and mark as non-extraneous all modules\n // that haven't been previously flagged as extraneous then propagate to all their dependencies\n\n obj.extraneous = false\n\n if (obj.directDependencyNames != null) {\n this.unmark(obj.directDependencyNames, obj, true, false)\n }\n\n if (obj.peerDependencies != null) {\n this.unmark(Object.keys(obj.peerDependencies), obj, true, false)\n }\n\n if (obj.optionalDependencies != null) {\n this.unmark(Object.keys(obj.optionalDependencies), obj, false, true)\n }\n }\n\n // find the one that will actually be loaded by require() so we can make sure it's valid\n private findDep(obj: Dependency, name: string, isOptional: boolean) {\n if (isIgnoredDep(name)) {\n return null\n }\n\n let r: Dependency | null | undefined = obj\n let found = null\n while (r != null && found == null) {\n // if r is a valid choice, then use that.\n // kinda weird if a pkg depends on itself, but after the first iteration of this loop, it indicates a dep cycle.\n found = r.dependencies == null ? null : r.dependencies.get(name)\n if (found == null && r.realName === name) {\n found = r\n }\n r = r.link == null ? r.parent : null\n }\n\n if (found == null) {\n this.unresolved.set(name, isOptional)\n }\n return found\n }\n}\n\nfunction isIgnoredDep(name: string) {\n return knownAlwaysIgnoredDevDeps.has(name) || name.startsWith(\"@types/\")\n}\n\nasync function readNodeModulesDir(dir: string): Promise | null> {\n let files: Array\n try {\n files = (await readdir(dir)).filter(it => !it.startsWith(\".\") && !knownAlwaysIgnoredDevDeps.has(it))\n }\n catch (e) {\n // error indicates that nothing is installed here\n return null\n }\n\n files.sort()\n\n const scopes = files.filter(it => it.startsWith(\"@\"))\n if (scopes.length === 0) {\n return files\n }\n\n const result = files.filter(it => !it.startsWith(\"@\"))\n const scopeFileList = await BluebirdPromise.map(scopes, it => readdir(path.join(dir, it)))\n for (let i = 0; i < scopes.length; i++) {\n const list = scopeFileList[i]\n list.sort()\n for (const file of list) {\n if (!file.startsWith(\".\")) {\n result.push(`${scopes[i]}/${file}`)\n }\n }\n }\n\n return result\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/packageMetadata.d.ts b/node_modules/app-builder-lib/out/util/packageMetadata.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/app-builder-lib/out/util/packageMetadata.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/app-builder-lib/out/util/packageMetadata.js b/node_modules/app-builder-lib/out/util/packageMetadata.js deleted file mode 100644 index d61fb05..0000000 --- a/node_modules/app-builder-lib/out/util/packageMetadata.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.readPackageJson = readPackageJson; -exports.checkMetadata = checkMetadata; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function semver() { - const data = _interopRequireWildcard(require("semver")); - - semver = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const normalizeData = require("normalize-package-data"); -/** @internal */ - - -function readPackageJson(_x) { - return _readPackageJson.apply(this, arguments); -} - -function _readPackageJson() { - _readPackageJson = (0, _bluebirdLst().coroutine)(function* (file) { - const data = yield (0, _fsExtraP().readJson)(file); - yield authors(file, data); - normalizeData(data); // remove not required fields because can be used for remote build - - delete data.scripts; - delete data.readme; - return data; - }); - return _readPackageJson.apply(this, arguments); -} - -function authors(_x2, _x3) { - return _authors.apply(this, arguments); -} -/** @internal */ - - -function _authors() { - _authors = (0, _bluebirdLst().coroutine)(function* (file, data) { - if (data.contributors != null) { - return; - } - - let authorData; - - try { - authorData = yield (0, _fsExtraP().readFile)(path.resolve(path.dirname(file), "AUTHORS"), "utf8"); - } catch (ignored) { - return; - } - - data.contributors = authorData.split(/\r?\n/g).map(it => it.replace(/^\s*#.*$/, "").trim()); - }); - return _authors.apply(this, arguments); -} - -function checkMetadata(metadata, devMetadata, appPackageFile, devAppPackageFile) { - const errors = []; - - const reportError = missedFieldName => { - errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`); - }; - - const checkNotEmpty = (name, value) => { - if ((0, _builderUtil().isEmptyOrSpaces)(value)) { - reportError(name); - } - }; - - if (metadata.directories != null) { - errors.push(`"directories" in the root is deprecated, please specify in the "build"`); - } - - checkNotEmpty("name", metadata.name); - - if ((0, _builderUtil().isEmptyOrSpaces)(metadata.description)) { - _builderUtil().log.warn({ - appPackageFile - }, `description is missed in the package.json`); - } - - if (metadata.author == null) { - _builderUtil().log.warn({ - appPackageFile - }, `author is missed in the package.json`); - } - - checkNotEmpty("version", metadata.version); - - if (metadata != null) { - checkDependencies(metadata.dependencies, errors); - } - - if (metadata !== devMetadata) { - if (metadata.build != null) { - errors.push(`'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`); - } - } - - const devDependencies = metadata.devDependencies; - - if (devDependencies != null && "electron-rebuild" in devDependencies) { - _builderUtil().log.info('electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies\n\nTo ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`'); - } - - if (errors.length > 0) { - throw new (_builderUtil().InvalidConfigurationError)(errors.join("\n")); - } -} - -function versionSatisfies(version, range, loose) { - if (version == null) { - return false; - } - - const coerced = semver().coerce(version); - - if (coerced == null) { - return false; - } - - return semver().satisfies(coerced, range, loose); -} - -function checkDependencies(dependencies, errors) { - if (dependencies == null) { - return; - } - - const updaterVersion = dependencies["electron-updater"]; - const requiredElectronUpdaterVersion = "4.0.0"; - - if (updaterVersion != null && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) { - errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}"`); - } - - const swVersion = dependencies["electron-builder-squirrel-windows"]; - - if (swVersion != null && !versionSatisfies(swVersion, ">=20.32.0")) { - errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to "^20.32.0"`); - } - - const deps = ["electron", "electron-prebuilt", "electron-rebuild"]; - - if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== "true") { - deps.push("electron-builder"); - } - - for (const name of deps) { - if (name in dependencies) { - errors.push(`Package "${name}" is only allowed in "devDependencies". ` + `Please remove it from the "dependencies" section in your package.json.`); - } - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=packageMetadata.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/packageMetadata.js.map b/node_modules/app-builder-lib/out/util/packageMetadata.js.map deleted file mode 100644 index 329792f..0000000 --- a/node_modules/app-builder-lib/out/util/packageMetadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGA,MAAM,aAAa,GAAG,OAAO,CAAC,wBAAD,CAA7B;AAEA;;;SACsB,e;;;;;mDAAf,WAA+B,IAA/B,EAA2C;AAChD,UAAM,IAAI,SAAS,0BAAS,IAAT,CAAnB;AACA,UAAM,OAAO,CAAC,IAAD,EAAO,IAAP,CAAb;AACA,IAAA,aAAa,CAAC,IAAD,CAAb,CAHgD,CAIhD;;AACA,WAAO,IAAI,CAAC,OAAZ;AACA,WAAO,IAAI,CAAC,MAAZ;AACA,WAAO,IAAP;AACD,G;;;;SAEc,O;;;AAkBf;;;;2CAlBA,WAAuB,IAAvB,EAAqC,IAArC,EAA8C;AAC5C,QAAI,IAAI,CAAC,YAAL,IAAqB,IAAzB,EAA+B;AAC7B;AACD;;AAED,QAAI,UAAJ;;AACA,QAAI;AACF,MAAA,UAAU,SAAS,0BAAS,IAAI,CAAC,OAAL,CAAa,IAAI,CAAC,OAAL,CAAa,IAAb,CAAb,EAAiC,SAAjC,CAAT,EAAsD,M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S,IAAI,IAAb,IAAqB,CAAC,gBAAgB,CAAC,SAAD,EAAY,WAAZ,CAA1C,EAAoE;AAClE,IAAA,MAAM,CAAC,IAAP,CAAY,gKAAZ;AACD;;AAED,QAAM,IAAI,GAAG,CAAC,UAAD,EAAa,mBAAb,EAAkC,kBAAlC,CAAb;;AACA,MAAI,OAAO,CAAC,GAAR,CAAY,+CAAZ,KAAgE,MAApE,EAA4E;AAC1E,IAAA,IAAI,CAAC,IAAL,CAAU,kBAAV;AACD;;AACD,OAAK,MAAM,IAAX,IAAmB,IAAnB,EAAyB;AACvB,QAAI,IAAI,IAAI,YAAZ,EAA0B;AACxB,MAAA,MAAM,CAAC,IAAP,CAAY,YAAY,IAAI,0CAAhB,GACR,wEADJ;AAED;AACF;AACF,C","sourcesContent":["import { isEmptyOrSpaces, log, InvalidConfigurationError } from \"builder-util\"\nimport { readFile, readJson } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"..\"\n\nconst normalizeData = require(\"normalize-package-data\")\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise {\n const data = await readJson(file)\n await authors(file, data)\n normalizeData(data)\n // remove not required fields because can be used for remote build\n delete data.scripts\n delete data.readme\n return data\n}\n\nasync function authors(file: string, data: any) {\n if (data.contributors != null) {\n return\n }\n\n let authorData\n try {\n authorData = await readFile(path.resolve(path.dirname(file), \"AUTHORS\"), \"utf8\")\n }\n catch (ignored) {\n return\n }\n\n data.contributors = authorData\n .split(/\\r?\\n/g)\n .map(it => it.replace(/^\\s*#.*$/, \"\").trim())\n}\n\n/** @internal */\nexport function checkMetadata(metadata: Metadata, devMetadata: any | null, appPackageFile: string, devAppPackageFile: string): void {\n const errors: Array = []\n const reportError = (missedFieldName: string) => {\n errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)\n }\n\n const checkNotEmpty = (name: string, value: string | null | undefined) => {\n if (isEmptyOrSpaces(value)) {\n reportError(name)\n }\n }\n\n if ((metadata as any).directories != null) {\n errors.push(`\"directories\" in the root is deprecated, please specify in the \"build\"`)\n }\n\n checkNotEmpty(\"name\", metadata.name)\n\n if (isEmptyOrSpaces(metadata.description)) {\n log.warn({appPackageFile}, `description is missed in the package.json`)\n }\n if (metadata.author == null) {\n log.warn({appPackageFile}, `author is missed in the package.json`)\n }\n checkNotEmpty(\"version\", metadata.version)\n\n if (metadata != null) {\n checkDependencies(metadata.dependencies, errors)\n }\n if (metadata !== devMetadata) {\n if (metadata.build != null) {\n errors.push(`'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`)\n }\n }\n\n const devDependencies = (metadata as any).devDependencies\n if (devDependencies != null && \"electron-rebuild\" in devDependencies) {\n log.info('electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies\\n\\nTo ensure your native dependencies are always matched electron version, simply add script `\"postinstall\": \"electron-builder install-app-deps\" to your `package.json`')\n }\n\n if (errors.length > 0) {\n throw new InvalidConfigurationError(errors.join(\"\\n\"))\n }\n}\n\nfunction versionSatisfies(version: string | semver.SemVer | null, range: string | semver.Range, loose?: boolean): boolean {\n if (version == null) {\n return false\n }\n\n const coerced = semver.coerce(version)\n if (coerced == null) {\n return false\n }\n\n return semver.satisfies(coerced, range, loose)\n}\n\nfunction checkDependencies(dependencies: { [key: string]: string } | null | undefined, errors: Array) {\n if (dependencies == null) {\n return\n }\n\n const updaterVersion = dependencies[\"electron-updater\"]\n const requiredElectronUpdaterVersion = \"4.0.0\"\n if (updaterVersion != null && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {\n errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to \"^${requiredElectronUpdaterVersion}\"`)\n }\n\n const swVersion = dependencies[\"electron-builder-squirrel-windows\"]\n if (swVersion != null && !versionSatisfies(swVersion, \">=20.32.0\")) {\n errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to \"^20.32.0\"`)\n }\n\n const deps = [\"electron\", \"electron-prebuilt\", \"electron-rebuild\"]\n if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== \"true\") {\n deps.push(\"electron-builder\")\n }\n for (const name of deps) {\n if (name in dependencies) {\n errors.push(`Package \"${name}\" is only allowed in \"devDependencies\". `\n + `Please remove it from the \"dependencies\" section in your package.json.`)\n }\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/pathManager.d.ts b/node_modules/app-builder-lib/out/util/pathManager.d.ts deleted file mode 100644 index 5169c8f..0000000 --- a/node_modules/app-builder-lib/out/util/pathManager.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function getTemplatePath(file: string): string; -export declare function getVendorPath(file?: string): string; diff --git a/node_modules/app-builder-lib/out/util/pathManager.js b/node_modules/app-builder-lib/out/util/pathManager.js deleted file mode 100644 index 953524f..0000000 --- a/node_modules/app-builder-lib/out/util/pathManager.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getTemplatePath = getTemplatePath; -exports.getVendorPath = getVendorPath; - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const root = path.join(__dirname, "..", ".."); - -function getTemplatePath(file) { - return path.join(root, "templates", file); -} - -function getVendorPath(file) { - return file == null ? path.join(root, "vendor") : path.join(root, "vendor", file); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=pathManager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/pathManager.js.map b/node_modules/app-builder-lib/out/util/pathManager.js.map deleted file mode 100644 index e0a56bc..0000000 --- a/node_modules/app-builder-lib/out/util/pathManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/pathManager.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAEA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAL,CAAU,SAAV,EAAqB,IAArB,EAA2B,IAA3B,CAAb;;AAEM,SAAU,eAAV,CAA0B,IAA1B,EAAsC;AAC1C,SAAO,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,WAAhB,EAA6B,IAA7B,CAAP;AACD;;AAEK,SAAU,aAAV,CAAwB,IAAxB,EAAqC;AACzC,SAAO,IAAI,IAAI,IAAR,GAAe,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,QAAhB,CAAf,GAA2C,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,QAAhB,EAA0B,IAA1B,CAAlD;AACD,C","sourcesContent":["import * as path from \"path\"\n\nconst root = path.join(__dirname, \"..\", \"..\")\n\nexport function getTemplatePath(file: string) {\n return path.join(root, \"templates\", file)\n}\n\nexport function getVendorPath(file?: string) {\n return file == null ? path.join(root, \"vendor\") : path.join(root, \"vendor\", file)\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/repositoryInfo.d.ts b/node_modules/app-builder-lib/out/util/repositoryInfo.d.ts deleted file mode 100644 index 64b2b4e..0000000 --- a/node_modules/app-builder-lib/out/util/repositoryInfo.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SourceRepositoryInfo } from "../core"; -import { Metadata } from ".."; -export declare function getRepositoryInfo(projectDir: string, metadata?: Metadata, devMetadata?: Metadata | null): Promise; diff --git a/node_modules/app-builder-lib/out/util/repositoryInfo.js b/node_modules/app-builder-lib/out/util/repositoryInfo.js deleted file mode 100644 index a51e8a6..0000000 --- a/node_modules/app-builder-lib/out/util/repositoryInfo.js +++ /dev/null @@ -1,153 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getRepositoryInfo = getRepositoryInfo; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _hostedGitInfo() { - const data = require("hosted-git-info"); - - _hostedGitInfo = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getRepositoryInfo(projectDir, metadata, devMetadata) { - return _getInfo(projectDir, (devMetadata == null ? null : devMetadata.repository) || (metadata == null ? null : metadata.repository)); -} - -function getGitUrlFromGitConfig(_x) { - return _getGitUrlFromGitConfig.apply(this, arguments); -} - -function _getGitUrlFromGitConfig() { - _getGitUrlFromGitConfig = (0, _bluebirdLst().coroutine)(function* (projectDir) { - const data = yield (0, _promise().orNullIfFileNotExist)((0, _fsExtraP().readFile)(path.join(projectDir, ".git", "config"), "utf8")); - - if (data == null) { - return null; - } - - const conf = data.split(/\r?\n/); - const i = conf.indexOf('[remote "origin"]'); - - if (i !== -1) { - let u = conf[i + 1]; - - if (!u.match(/^\s*url =/)) { - u = conf[i + 2]; - } - - if (u.match(/^\s*url =/)) { - return u.replace(/^\s*url = /, ""); - } - } - - return null; - }); - return _getGitUrlFromGitConfig.apply(this, arguments); -} - -function _getInfo(_x2, _x3) { - return _getInfo2.apply(this, arguments); -} - -function _getInfo2() { - _getInfo2 = (0, _bluebirdLst().coroutine)(function* (projectDir, repo) { - if (repo != null) { - return parseRepositoryUrl(typeof repo === "string" ? repo : repo.url); - } - - const slug = process.env.TRAVIS_REPO_SLUG || process.env.APPVEYOR_REPO_NAME; - - if (slug != null) { - const splitted = slug.split("/"); - return { - user: splitted[0], - project: splitted[1] - }; - } - - const user = process.env.CIRCLE_PROJECT_USERNAME; - const project = process.env.CIRCLE_PROJECT_REPONAME; - - if (user != null && project != null) { - return { - user, - project - }; - } - - const url = yield getGitUrlFromGitConfig(projectDir); - return url == null ? null : parseRepositoryUrl(url); - }); - return _getInfo2.apply(this, arguments); -} - -function parseRepositoryUrl(url) { - const info = (0, _hostedGitInfo().fromUrl)(url); - - if (info != null) { - delete info.protocols; - delete info.treepath; - delete info.filetemplate; - delete info.bugstemplate; - delete info.gittemplate; - delete info.tarballtemplate; - delete info.sshtemplate; - delete info.sshurltemplate; - delete info.browsetemplate; - delete info.docstemplate; - delete info.httpstemplate; - delete info.shortcuttemplate; - delete info.pathtemplate; - delete info.pathmatch; - delete info.protocols_re; - delete info.committish; - delete info.default; - delete info.opts; - delete info.browsefiletemplate; - delete info.auth; - } - - return info; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=repositoryInfo.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/repositoryInfo.js.map b/node_modules/app-builder-lib/out/util/repositoryInfo.js.map deleted file mode 100644 index a22afdb..0000000 --- a/node_modules/app-builder-lib/out/util/repositoryInfo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/repositoryInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAIM,SAAU,iBAAV,CAA4B,UAA5B,EAAgD,QAAhD,EAAqE,WAArE,EAAkG;A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;AACA,WAAO,IAAI,CAAC,IAAZ;AACA,WAAO,IAAI,CAAC,kBAAZ;AACA,WAAO,IAAI,CAAC,IAAZ;AACD;;AACD,SAAO,IAAP;AACD,C","sourcesContent":["import { orNullIfFileNotExist } from \"builder-util/out/promise\"\nimport { readFile } from \"fs-extra-p\"\nimport { fromUrl, Info } from \"hosted-git-info\"\nimport * as path from \"path\"\nimport { SourceRepositoryInfo } from \"../core\"\nimport { Metadata, RepositoryInfo } from \"..\"\n\nexport function getRepositoryInfo(projectDir: string, metadata?: Metadata, devMetadata?: Metadata | null): Promise {\n return _getInfo(projectDir, (devMetadata == null ? null : devMetadata.repository) || (metadata == null ? null : metadata.repository))\n}\n\nasync function getGitUrlFromGitConfig(projectDir: string): Promise {\n const data = await orNullIfFileNotExist(readFile(path.join(projectDir, \".git\", \"config\"), \"utf8\"))\n if (data == null) {\n return null\n }\n\n const conf = data.split(/\\r?\\n/)\n const i = conf.indexOf('[remote \"origin\"]')\n if (i !== -1) {\n let u = conf[i + 1]\n if (!u.match(/^\\s*url =/)) {\n u = conf[i + 2]\n }\n\n if (u.match(/^\\s*url =/)) {\n return u.replace(/^\\s*url = /, \"\")\n }\n }\n return null\n}\n\nasync function _getInfo(projectDir: string, repo?: RepositoryInfo | string | null): Promise {\n if (repo != null) {\n return parseRepositoryUrl(typeof repo === \"string\" ? repo : repo.url)\n }\n\n const slug = process.env.TRAVIS_REPO_SLUG || process.env.APPVEYOR_REPO_NAME\n if (slug != null) {\n const splitted = slug.split(\"/\")\n return {\n user: splitted[0],\n project: splitted[1],\n }\n }\n\n const user = process.env.CIRCLE_PROJECT_USERNAME\n const project = process.env.CIRCLE_PROJECT_REPONAME\n if (user != null && project != null) {\n return {\n user,\n project,\n }\n }\n\n const url = await getGitUrlFromGitConfig(projectDir)\n return url == null ? null : parseRepositoryUrl(url)\n}\n\nfunction parseRepositoryUrl(url: string): Info {\n const info: any = fromUrl(url)\n if (info != null) {\n delete info.protocols\n delete info.treepath\n delete info.filetemplate\n delete info.bugstemplate\n delete info.gittemplate\n delete info.tarballtemplate\n delete info.sshtemplate\n delete info.sshurltemplate\n delete info.browsetemplate\n delete info.docstemplate\n delete info.httpstemplate\n delete info.shortcuttemplate\n delete info.pathtemplate\n delete info.pathmatch\n delete info.protocols_re\n delete info.committish\n delete info.default\n delete info.opts\n delete info.browsefiletemplate\n delete info.auth\n }\n return info\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/timer.d.ts b/node_modules/app-builder-lib/out/util/timer.d.ts deleted file mode 100644 index 705f3ff..0000000 --- a/node_modules/app-builder-lib/out/util/timer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface Timer { - end(): void; -} -export declare class DevTimer implements Timer { - private readonly label; - private start; - constructor(label: string); - endAndGet(): string; - end(): void; -} -export declare function time(label: string): Timer; diff --git a/node_modules/app-builder-lib/out/util/timer.js b/node_modules/app-builder-lib/out/util/timer.js deleted file mode 100644 index e44bbc6..0000000 --- a/node_modules/app-builder-lib/out/util/timer.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.time = time; -exports.DevTimer = void 0; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -class DevTimer { - constructor(label) { - this.label = label; - this.start = process.hrtime(); - } - - endAndGet() { - const end = process.hrtime(this.start); - return `${end[0]}s ${Math.round(end[1] / 1000000)}ms`; - } - - end() { - console.info(`${this.label}: ${this.endAndGet()}`); - } - -} - -exports.DevTimer = DevTimer; - -class ProductionTimer { - end() {// ignore - } - -} - -function time(label) { - return _builderUtil().debug.enabled ? new DevTimer(label) : new ProductionTimer(); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=timer.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/timer.js.map b/node_modules/app-builder-lib/out/util/timer.js.map deleted file mode 100644 index 7c7b1ae..0000000 --- a/node_modules/app-builder-lib/out/util/timer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/timer.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMM,MAAO,QAAP,CAAe;AAGnB,EAAA,WAAA,CAA6B,KAA7B,EAA0C;AAAb,SAAA,KAAA,GAAA,KAAA;AAFrB,SAAA,KAAA,GAAQ,OAAO,CAAC,MAAR,EAAR;AAGP;;AAED,EAAA,SAAS,GAAA;AACP,UAAM,GAAG,GAAG,OAAO,CAAC,MAAR,CAAe,KAAK,KAApB,CAAZ;AACA,WAAO,GAAG,GAAG,CAAC,CAAD,CAAG,KAAK,IAAI,CAAC,KAAL,CAAW,GAAG,CAAC,CAAD,CAAH,GAAS,OAApB,CAA4B,IAAjD;AACD;;AAED,EAAA,GAAG,GAAA;AACD,IAAA,OAAO,CAAC,IAAR,CAAa,GAAG,KAAK,KAAK,KAAK,KAAK,SAAL,EAAgB,EAA/C;AACD;;AAbkB;;;;AAgBrB,MAAM,eAAN,CAAqB;AACnB,EAAA,GAAG,GAAA,CACD;AACD;;AAHkB;;AAMf,SAAU,IAAV,CAAe,KAAf,EAA4B;AAChC,SAAO,qBAAM,OAAN,GAAgB,IAAI,QAAJ,CAAa,KAAb,CAAhB,GAAsC,IAAI,eAAJ,EAA7C;AACD,C","sourcesContent":["import { debug } from \"builder-util\"\n\nexport interface Timer {\n end(): void\n}\n\nexport class DevTimer implements Timer {\n private start = process.hrtime()\n\n constructor(private readonly label: string) {\n }\n\n endAndGet(): string {\n const end = process.hrtime(this.start)\n return `${end[0]}s ${Math.round(end[1] / 1000000)}ms`\n }\n\n end(): void {\n console.info(`${this.label}: ${this.endAndGet()}`)\n }\n}\n\nclass ProductionTimer implements Timer {\n end(): void {\n // ignore\n }\n}\n\nexport function time(label: string): Timer {\n return debug.enabled ? new DevTimer(label) : new ProductionTimer()\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/util/yarn.d.ts b/node_modules/app-builder-lib/out/util/yarn.d.ts deleted file mode 100644 index 4e5fd5f..0000000 --- a/node_modules/app-builder-lib/out/util/yarn.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// -import { Lazy } from "lazy-val"; -import { Configuration } from "../configuration"; -import { Dependency } from "./packageDependencies"; -export declare function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall?: boolean): Promise; -export interface DesktopFrameworkInfo { - version: string; - useCustomDist: boolean; -} -export declare function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean): any; -export interface RebuildOptions { - frameworkInfo: DesktopFrameworkInfo; - productionDeps?: Lazy>; - platform?: NodeJS.Platform; - arch?: string; - buildFromSource?: boolean; - additionalArgs?: Array | null; -} diff --git a/node_modules/app-builder-lib/out/util/yarn.js b/node_modules/app-builder-lib/out/util/yarn.js deleted file mode 100644 index b9979b8..0000000 --- a/node_modules/app-builder-lib/out/util/yarn.js +++ /dev/null @@ -1,242 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.installOrRebuild = installOrRebuild; -exports.getGypEnv = getGypEnv; -exports.rebuild = rebuild; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _os() { - const data = require("os"); - - _os = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function installOrRebuild(_x, _x2, _x3) { - return _installOrRebuild.apply(this, arguments); -} - -function _installOrRebuild() { - _installOrRebuild = (0, _bluebirdLst().coroutine)(function* (config, appDir, options, forceInstall = false) { - const effectiveOptions = Object.assign({ - buildFromSource: config.buildDependenciesFromSource === true, - additionalArgs: (0, _builderUtil().asArray)(config.npmArgs) - }, options); - - if (forceInstall || !(yield (0, _fs().exists)(path.join(appDir, "node_modules")))) { - yield installDependencies(appDir, effectiveOptions); - } else { - yield rebuild(appDir, effectiveOptions); - } - }); - return _installOrRebuild.apply(this, arguments); -} - -function getElectronGypCacheDir() { - return path.join((0, _os().homedir)(), ".electron-gyp"); -} - -function getGypEnv(frameworkInfo, platform, arch, buildFromSource) { - const npmConfigArch = arch === "armv7l" ? "arm" : arch; - const common = Object.assign({}, process.env, { - npm_config_arch: npmConfigArch, - npm_config_target_arch: npmConfigArch, - npm_config_platform: platform, - npm_config_build_from_source: buildFromSource, - // required for node-pre-gyp - npm_config_target_platform: platform, - npm_config_update_binary: true, - npm_config_fallback_to_build: true - }); - - if (platform === "win32") { - common.npm_config_target_libc = "unknown"; - } - - if (!frameworkInfo.useCustomDist) { - return common; - } // https://github.com/nodejs/node-gyp/issues/21 - - - return Object.assign({}, common, { - npm_config_disturl: "https://atom.io/download/electron", - npm_config_target: frameworkInfo.version, - npm_config_runtime: "electron", - npm_config_devdir: getElectronGypCacheDir() - }); -} - -function installDependencies(appDir, options) { - const platform = options.platform || process.platform; - const arch = options.arch || process.arch; - const additionalArgs = options.additionalArgs; - - _builderUtil().log.info({ - platform, - arch, - appDir - }, `installing production dependencies`); - - let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS; - const execArgs = ["install", "--production"]; - - if (!isRunningYarn(execPath)) { - if (process.env.NPM_NO_BIN_LINKS === "true") { - execArgs.push("--no-bin-links"); - } - - execArgs.push("--cache-min", "999999999"); - } - - if (execPath == null) { - execPath = getPackageToolPath(); - } else { - execArgs.unshift(execPath); - execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node"; - } - - if (additionalArgs != null) { - execArgs.push(...additionalArgs); - } - - return (0, _builderUtil().spawn)(execPath, execArgs, { - cwd: appDir, - env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true) - }); -} - -function getPackageToolPath() { - if (process.env.FORCE_YARN === "true") { - return process.platform === "win32" ? "yarn.cmd" : "yarn"; - } else { - return process.platform === "win32" ? "npm.cmd" : "npm"; - } -} - -function isRunningYarn(execPath) { - const userAgent = process.env.npm_config_user_agent; - return process.env.FORCE_YARN === "true" || execPath != null && path.basename(execPath).startsWith("yarn") || userAgent != null && /\byarn\b/.test(userAgent); -} -/** @internal */ - - -function rebuild(_x4, _x5) { - return _rebuild.apply(this, arguments); -} function _rebuild() { - _rebuild = (0, _bluebirdLst().coroutine)(function* (appDir, options) { - const nativeDeps = yield _bluebirdLst().default.filter((yield options.productionDeps.value), it => (0, _fs().exists)(path.join(it.path, "binding.gyp")), { - concurrency: 8 - }); - - if (nativeDeps.length === 0) { - _builderUtil().log.info("no native production dependencies"); - - return; - } - - const platform = options.platform || process.platform; - const arch = options.arch || process.arch; - const additionalArgs = options.additionalArgs; - - _builderUtil().log.info({ - platform, - arch - }, "rebuilding native production dependencies"); - - let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS; - const isYarn = isRunningYarn(execPath); - const execArgs = []; - - if (execPath == null) { - execPath = getPackageToolPath(); - } else { - execArgs.push(execPath); - execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node"; - } - - const env = getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true); - - if (isYarn) { - execArgs.push("run", "install"); - - if (additionalArgs != null) { - execArgs.push(...additionalArgs); - } - - yield _bluebirdLst().default.map(nativeDeps, dep => { - _builderUtil().log.info({ - name: dep.name - }, `rebuilding native dependency`); - - return (0, _builderUtil().spawn)(execPath, execArgs, { - cwd: dep.path, - env - }).catch(error => { - if (dep.optional) { - _builderUtil().log.warn({ - dep: dep.name - }, "cannot build optional native dep"); - } else { - throw error; - } - }); - }, { - concurrency: process.platform === "win32" ? 1 : 2 - }); - } else { - execArgs.push("rebuild"); - - if (additionalArgs != null) { - execArgs.push(...additionalArgs); - } - - execArgs.push(...nativeDeps.map(it => `${it.name}@${it.version}`)); - yield (0, _builderUtil().spawn)(execPath, execArgs, { - cwd: appDir, - env - }); - } - }); - return _rebuild.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=yarn.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/util/yarn.js.map b/node_modules/app-builder-lib/out/util/yarn.js.map deleted file mode 100644 index 55bd18c..0000000 --- a/node_modules/app-builder-lib/out/util/yarn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;SAIsB,gB;;;;;oDAAf,WAAgC,MAAhC,EAAuD,MAAvD,EAAuE,OAAvE,EAAgG,YAAA,GAAwB,KAAxH,EAA6H;AAClI,UAAM,gBAAgB,GAAA,MAAA,CAAA,MAAA,CAAA;AACpB,MAAA,eAAe,EAAE,MAAM,CAAC,2BAAP,KAAuC,IADpC;AAEpB,MAAA,cAAc,EAAE,4BAAQ,MAAM,CAAC,OAAf;AAFI,KAAA,EAEwB,OAFxB,CAAtB;;AAKA,QAAI,YAAY,IAAI,QAAQ,kBAAO,IAAI,CAAC,IAAL,CAAU,MAAV,EAAkB,cAAlB,CAAP,CAAR,CAApB,EAAwE;AACtE,YAAM,mBAAmB,CAAC,MAAD,EAAS,gBAAT,CAAzB;AACD,KAFD,MAGK;AACH,YAAM,OAAO,CAAC,MAAD,EAAS,gBAAT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I,cAAc,IAAI,IAAtB,EAA4B;AAC1B,QAAA,QAAQ,CAAC,IAAT,CAAc,GAAG,cAAjB;AACD;;AACD,MAAA,QAAQ,CAAC,IAAT,CAAc,GAAG,UAAU,CAAC,GAAX,CAAe,EAAE,IAAI,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAA7C,CAAjB;AACA,YAAM,0BAAM,QAAN,EAAgB,QAAhB,EAA0B;AAC9B,QAAA,GAAG,EAAE,MADyB;AAE9B,QAAA;AAF8B,OAA1B,CAAN;AAID;AACF,G","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { asArray, log, spawn } from \"builder-util\"\nimport { exists } from \"builder-util/out/fs\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { Dependency } from \"./packageDependencies\"\n\nexport async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall: boolean = false) {\n const effectiveOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs), ...options\n }\n\n if (forceInstall || !(await exists(path.join(appDir, \"node_modules\")))) {\n await installDependencies(appDir, effectiveOptions)\n }\n else {\n await rebuild(appDir, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform === \"win32\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: \"https://atom.io/download/electron\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nfunction installDependencies(appDir: string, options: RebuildOptions): Promise {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n log.info({platform, arch, appDir}, `installing production dependencies`)\n let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS\n const execArgs = [\"install\", \"--production\"]\n\n if (!isRunningYarn(execPath)) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n execArgs.push(\"--cache-min\", \"999999999\")\n }\n\n if (execPath == null) {\n execPath = getPackageToolPath()\n }\n else {\n execArgs.unshift(execPath)\n execPath = process.env.npm_node_execpath || process.env.NODE_EXE || \"node\"\n }\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n return spawn(execPath, execArgs, {\n cwd: appDir,\n env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n })\n}\n\nfunction getPackageToolPath() {\n if (process.env.FORCE_YARN === \"true\") {\n return process.platform === \"win32\" ? \"yarn.cmd\" : \"yarn\"\n }\n else {\n return process.platform === \"win32\" ? \"npm.cmd\" : \"npm\"\n }\n}\n\nfunction isRunningYarn(execPath: string | null | undefined) {\n const userAgent = process.env.npm_config_user_agent\n return process.env.FORCE_YARN === \"true\" ||\n (execPath != null && path.basename(execPath).startsWith(\"yarn\")) ||\n (userAgent != null && /\\byarn\\b/.test(userAgent))\n}\n\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps?: Lazy>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array | null\n}\n\n/** @internal */\nexport async function rebuild(appDir: string, options: RebuildOptions) {\n const nativeDeps = await BluebirdPromise.filter(await options.productionDeps!.value, it => exists(path.join(it.path, \"binding.gyp\")), {concurrency: 8})\n if (nativeDeps.length === 0) {\n log.info(\"no native production dependencies\")\n return\n }\n\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n log.info({platform, arch}, \"rebuilding native production dependencies\")\n\n let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS\n const isYarn = isRunningYarn(execPath)\n const execArgs: Array = []\n if (execPath == null) {\n execPath = getPackageToolPath()\n }\n else {\n execArgs.push(execPath)\n execPath = process.env.npm_node_execpath || process.env.NODE_EXE || \"node\"\n }\n\n const env = getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true)\n if (isYarn) {\n execArgs.push(\"run\", \"install\")\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n await BluebirdPromise.map(nativeDeps, dep => {\n log.info({name: dep.name}, `rebuilding native dependency`)\n return spawn(execPath!, execArgs, {\n cwd: dep.path,\n env,\n })\n .catch(error => {\n if (dep.optional) {\n log.warn({dep: dep.name}, \"cannot build optional native dep\")\n }\n else {\n throw error\n }\n })\n }, {concurrency: process.platform === \"win32\" ? 1 : 2})\n }\n else {\n execArgs.push(\"rebuild\")\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n execArgs.push(...nativeDeps.map(it => `${it.name}@${it.version}`))\n await spawn(execPath, execArgs, {\n cwd: appDir,\n env,\n })\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/vm/MonoVm.d.ts b/node_modules/app-builder-lib/out/vm/MonoVm.d.ts deleted file mode 100644 index f144803..0000000 --- a/node_modules/app-builder-lib/out/vm/MonoVm.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -import { SpawnOptions, ExecFileOptions } from "child_process"; -import { ExtraSpawnOptions } from "builder-util"; -import { VmManager } from "./vm"; -export declare class MonoVmManager extends VmManager { - constructor(); - exec(file: string, args: Array, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise; - spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise; -} diff --git a/node_modules/app-builder-lib/out/vm/MonoVm.js b/node_modules/app-builder-lib/out/vm/MonoVm.js deleted file mode 100644 index c8b957c..0000000 --- a/node_modules/app-builder-lib/out/vm/MonoVm.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.MonoVmManager = void 0; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _vm() { - const data = require("./vm"); - - _vm = function () { - return data; - }; - - return data; -} - -class MonoVmManager extends _vm().VmManager { - constructor() { - super(); - } - - exec(file, args, options, isLogOutIfDebug = true) { - return (0, _builderUtil().exec)("mono", [file].concat(args), Object.assign({}, options), isLogOutIfDebug); - } - - spawn(file, args, options, extraOptions) { - return (0, _builderUtil().spawn)("mono", [file].concat(args), options, extraOptions); - } - -} exports.MonoVmManager = MonoVmManager; -// __ts-babel@6.0.4 -//# sourceMappingURL=MonoVm.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/vm/MonoVm.js.map b/node_modules/app-builder-lib/out/vm/MonoVm.js.map deleted file mode 100644 index 1f96140..0000000 --- a/node_modules/app-builder-lib/out/vm/MonoVm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/vm/MonoVm.ts"],"names":[],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,aAAP,SAA6B,eAA7B,CAAsC;AAC1C,EAAA,WAAA,GAAA;AACE;AACD;;AAED,EAAA,IAAI,CAAC,IAAD,EAAe,IAAf,EAAoC,OAApC,EAA+D,eAAe,GAAG,IAAjF,EAAqF;AACvF,WAAO,yBAAK,MAAL,EAAa,CAAC,IAAD,EAAO,MAAP,CAAc,IAAd,CAAb,EAAgC,MAAA,CAAA,MAAA,CAAA,EAAA,EAClC,OADkC,CAAhC,EAEJ,eAFI,CAAP;AAGD;;AAED,EAAA,KAAK,CAAC,IAAD,EAAe,IAAf,EAAoC,OAApC,EAA4D,YAA5D,EAA4F;AAC/F,WAAO,0BAAM,MAAN,EAAc,CAAC,IAAD,EAAO,MAAP,CAAc,IAAd,CAAd,EAAmC,OAAnC,EAA4C,YAA5C,CAAP;AACD;;AAbyC,C","sourcesContent":["import { SpawnOptions, ExecFileOptions } from \"child_process\"\nimport { exec, ExtraSpawnOptions, spawn } from \"builder-util\"\nimport { VmManager } from \"./vm\"\n\nexport class MonoVmManager extends VmManager {\n constructor() {\n super()\n }\n\n exec(file: string, args: Array, options?: ExecFileOptions, isLogOutIfDebug = true): Promise {\n return exec(\"mono\", [file].concat(args), {\n ...options,\n }, isLogOutIfDebug)\n }\n\n spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise {\n return spawn(\"mono\", [file].concat(args), options, extraOptions)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/vm/ParallelsVm.d.ts b/node_modules/app-builder-lib/out/vm/ParallelsVm.d.ts deleted file mode 100644 index 1d912b7..0000000 --- a/node_modules/app-builder-lib/out/vm/ParallelsVm.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare function macPathToParallelsWindows(file: string): string; -export interface ParallelsVm { - id: string; - name: string; - os: "win-10" | "ubuntu" | "elementary"; - state: "running" | "suspended" | "stopped"; -} diff --git a/node_modules/app-builder-lib/out/vm/ParallelsVm.js b/node_modules/app-builder-lib/out/vm/ParallelsVm.js deleted file mode 100644 index f287623..0000000 --- a/node_modules/app-builder-lib/out/vm/ParallelsVm.js +++ /dev/null @@ -1,189 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parseVmList = parseVmList; -exports.macPathToParallelsWindows = macPathToParallelsWindows; -exports.ParallelsVmManager = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _child_process() { - const data = require("child_process"); - - _child_process = function () { - return data; - }; - - return data; -} - -function _vm() { - const data = require("./vm"); - - _vm = function () { - return data; - }; - - return data; -} - -/** @internal */ -function parseVmList(_x) { - return _parseVmList.apply(this, arguments); -} -/** @internal */ - - -function _parseVmList() { - _parseVmList = (0, _bluebirdLst().coroutine)(function* (debugLogger) { - // do not log output if debug - it is huge, logged using debugLogger - let rawList = yield (0, _builderUtil().exec)("prlctl", ["list", "-i", "-s", "name"], undefined, false); - debugLogger.add("parallels.list", rawList); - rawList = rawList.substring(rawList.indexOf("ID:")); // let match: Array | null - - const result = []; - - for (const info of rawList.split("\n\n").map(it => it.trim()).filter(it => it.length > 0)) { - const vm = {}; - - for (const line of info.split("\n")) { - const meta = /^([^:("]+): (.*)$/.exec(line); - - if (meta == null) { - continue; - } - - const key = meta[1].toLowerCase(); - - if (key === "id" || key === "os" || key === "name" || key === "state" || key === "name") { - vm[key] = meta[2].trim(); - } - } - - result.push(vm); - } - - return result; - }); - return _parseVmList.apply(this, arguments); -} - -class ParallelsVmManager extends _vm().VmManager { - constructor(vm) { - super(); - this.vm = vm; - this.isExitHookAdded = false; - this.startPromise = this.doStartVm(); - } - - get pathSep() { - return "/"; - } - - handleExecuteError(error) { - if (error.message.includes("Unable to open new session in this virtual machine")) { - throw new Error(`Please ensure that your are logged in "${this.vm.name}" parallels virtual machine. In the future please do not stop VM, but suspend.\n\n${error.message}`); - } - - _builderUtil().log.warn("ensure that 'Share folders' is set to 'All Disks', see https://goo.gl/E6XphP"); - - throw error; - } - - exec(file, args, options) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - yield _this.ensureThatVmStarted(); // it is important to use "--current-user" to execute command under logged in user - to access certs. - - return yield (0, _builderUtil().exec)("prlctl", ["exec", _this.vm.id, "--current-user", file.startsWith("/") ? macPathToParallelsWindows(file) : file].concat(args), options).catch(error => _this.handleExecuteError(error)); - })(); - } - - spawn(file, args, options, extraOptions) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - yield _this2.ensureThatVmStarted(); - return yield (0, _builderUtil().spawn)("prlctl", ["exec", _this2.vm.id, file].concat(args), options, extraOptions).catch(error => _this2.handleExecuteError(error)); - })(); - } - - doStartVm() { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const vmId = _this3.vm.id; - const state = _this3.vm.state; - - if (state === "running") { - return; - } - - if (!_this3.isExitHookAdded) { - _this3.isExitHookAdded = true; - - require("async-exit-hook")(callback => { - const stopArgs = ["suspend", vmId]; - - if (callback == null) { - (0, _child_process().execFileSync)("prlctl", stopArgs); - } else { - (0, _builderUtil().exec)("prlctl", stopArgs).then(callback).catch(callback); - } - }); - } - - yield (0, _builderUtil().exec)("prlctl", ["start", vmId]); - })(); - } - - ensureThatVmStarted() { - let startPromise = this.startPromise; - - if (startPromise == null) { - startPromise = this.doStartVm(); - this.startPromise = startPromise; - } - - return startPromise; - } - - toVmFile(file) { - // https://stackoverflow.com/questions/4742992/cannot-access-network-drive-in-powershell-running-as-administrator - return macPathToParallelsWindows(file); - } - -} - -exports.ParallelsVmManager = ParallelsVmManager; - -function macPathToParallelsWindows(file) { - if (file.startsWith("C:\\")) { - return file; - } - - return "\\\\Mac\\Host\\" + file.replace(/\//g, "\\"); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=ParallelsVm.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/vm/ParallelsVm.js.map b/node_modules/app-builder-lib/out/vm/ParallelsVm.js.map deleted file mode 100644 index 6c34cb9..0000000 --- a/node_modules/app-builder-lib/out/vm/ParallelsVm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/vm/ParallelsVm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA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AApC,EAAgD;AACpD,MAAI,IAAI,CAAC,UAAL,CAAgB,MAAhB,CAAJ,EAA6B;AAC3B,WAAO,IAAP;AACD;;AACD,SAAO,oBAAoB,IAAI,CAAC,OAAL,CAAa,KAAb,EAAoB,IAApB,CAA3B;AACD,C","sourcesContent":["import { exec, spawn, DebugLogger, ExtraSpawnOptions, log } from \"builder-util\"\nimport { SpawnOptions, execFileSync, ExecFileOptions } from \"child_process\"\nimport { VmManager } from \"./vm\"\n\n/** @internal */\nexport async function parseVmList(debugLogger: DebugLogger) {\n // do not log output if debug - it is huge, logged using debugLogger\n let rawList = await exec(\"prlctl\", [\"list\", \"-i\", \"-s\", \"name\"], undefined, false)\n debugLogger.add(\"parallels.list\", rawList)\n\n rawList = rawList.substring(rawList.indexOf(\"ID:\"))\n\n // let match: Array | null\n const result: Array = []\n for (const info of rawList.split(\"\\n\\n\").map(it => it.trim()).filter(it => it.length > 0)) {\n const vm: any = {}\n for (const line of info.split(\"\\n\")) {\n const meta = /^([^:(\"]+): (.*)$/.exec(line)\n if (meta == null) {\n continue\n }\n\n const key = meta[1].toLowerCase()\n if (key === \"id\" || key === \"os\" || key === \"name\" || key === \"state\" || key === \"name\") {\n vm[key] = meta[2].trim()\n }\n }\n result.push(vm)\n }\n return result\n}\n\n/** @internal */\nexport class ParallelsVmManager extends VmManager {\n private startPromise: Promise\n\n private isExitHookAdded = false\n\n constructor(private readonly vm: ParallelsVm) {\n super()\n\n this.startPromise = this.doStartVm()\n }\n\n get pathSep(): string {\n return \"/\"\n }\n\n private handleExecuteError(error: Error): any {\n if (error.message.includes(\"Unable to open new session in this virtual machine\")) {\n throw new Error(`Please ensure that your are logged in \"${this.vm.name}\" parallels virtual machine. In the future please do not stop VM, but suspend.\\n\\n${error.message}`)\n }\n\n log.warn(\"ensure that 'Share folders' is set to 'All Disks', see https://goo.gl/E6XphP\")\n throw error\n }\n\n async exec(file: string, args: Array, options?: ExecFileOptions): Promise {\n await this.ensureThatVmStarted()\n // it is important to use \"--current-user\" to execute command under logged in user - to access certs.\n return await exec(\"prlctl\", [\"exec\", this.vm.id, \"--current-user\", file.startsWith(\"/\") ? macPathToParallelsWindows(file) : file].concat(args), options)\n .catch(error => this.handleExecuteError(error))\n }\n\n async spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise {\n await this.ensureThatVmStarted()\n return await spawn(\"prlctl\", [\"exec\", this.vm.id, file].concat(args), options, extraOptions)\n .catch(error => this.handleExecuteError(error))\n }\n\n private async doStartVm() {\n const vmId = this.vm.id\n const state = this.vm.state\n if (state === \"running\") {\n return\n }\n\n if (!this.isExitHookAdded) {\n this.isExitHookAdded = true\n require(\"async-exit-hook\")((callback: (() => void) | null) => {\n const stopArgs = [\"suspend\", vmId]\n if (callback == null) {\n execFileSync(\"prlctl\", stopArgs)\n }\n else {\n exec(\"prlctl\", stopArgs)\n .then(callback)\n .catch(callback)\n }\n })\n }\n await exec(\"prlctl\", [\"start\", vmId])\n }\n\n private ensureThatVmStarted() {\n let startPromise = this.startPromise\n if (startPromise == null) {\n startPromise = this.doStartVm()\n this.startPromise = startPromise\n }\n return startPromise\n }\n\n toVmFile(file: string): string {\n // https://stackoverflow.com/questions/4742992/cannot-access-network-drive-in-powershell-running-as-administrator\n return macPathToParallelsWindows(file)\n }\n}\n\nexport function macPathToParallelsWindows(file: string) {\n if (file.startsWith(\"C:\\\\\")) {\n return file\n }\n return \"\\\\\\\\Mac\\\\Host\\\\\" + file.replace(/\\//g, \"\\\\\")\n}\n\nexport interface ParallelsVm {\n id: string\n name: string\n os: \"win-10\" | \"ubuntu\" | \"elementary\"\n state: \"running\" | \"suspended\" | \"stopped\"\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/vm/WineVm.d.ts b/node_modules/app-builder-lib/out/vm/WineVm.d.ts deleted file mode 100644 index 708d967..0000000 --- a/node_modules/app-builder-lib/out/vm/WineVm.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// -import { SpawnOptions, ExecFileOptions } from "child_process"; -import { ExtraSpawnOptions } from "builder-util"; -import { VmManager } from "./vm"; -export declare class WineVmManager extends VmManager { - constructor(); - exec(file: string, args: Array, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise; - spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise; - toVmFile(file: string): string; -} diff --git a/node_modules/app-builder-lib/out/vm/WineVm.js b/node_modules/app-builder-lib/out/vm/WineVm.js deleted file mode 100644 index a21c2dd..0000000 --- a/node_modules/app-builder-lib/out/vm/WineVm.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.WineVmManager = void 0; - -function _wine() { - const data = require("../wine"); - - _wine = function () { - return data; - }; - - return data; -} - -function _vm() { - const data = require("./vm"); - - _vm = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class WineVmManager extends _vm().VmManager { - constructor() { - super(); - } - - exec(file, args, options, isLogOutIfDebug = true) { - return (0, _wine().execWine)(file, null, args, options); - } - - spawn(file, args, options, extraOptions) { - throw new Error("Unsupported"); - } - - toVmFile(file) { - return path.win32.join("Z:", file); - } - -} exports.WineVmManager = WineVmManager; -// __ts-babel@6.0.4 -//# sourceMappingURL=WineVm.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/vm/WineVm.js.map b/node_modules/app-builder-lib/out/vm/WineVm.js.map deleted file mode 100644 index b497423..0000000 --- a/node_modules/app-builder-lib/out/vm/WineVm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/vm/WineVm.ts"],"names":[],"mappings":";;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAEM,MAAO,aAAP,SAA6B,eAA7B,CAAsC;AAC1C,EAAA,WAAA,GAAA;AACE;AACD;;AAED,EAAA,IAAI,CAAC,IAAD,EAAe,IAAf,EAAoC,OAApC,EAA+D,eAAe,GAAG,IAAjF,EAAqF;AACvF,WAAO,sBAAS,IAAT,EAAe,IAAf,EAAqB,IAArB,EAA2B,OAA3B,CAAP;AACD;;AAED,EAAA,KAAK,CAAC,IAAD,EAAe,IAAf,EAAoC,OAApC,EAA4D,YAA5D,EAA4F;AAC/F,UAAM,IAAI,KAAJ,CAAU,aAAV,CAAN;AACD;;AAED,EAAA,QAAQ,CAAC,IAAD,EAAa;AACnB,WAAO,IAAI,CAAC,KAAL,CAAW,IAAX,CAAgB,IAAhB,EAAsB,IAAtB,CAAP;AACD;;AAfyC,C","sourcesContent":["import { SpawnOptions, ExecFileOptions } from \"child_process\"\nimport { ExtraSpawnOptions } from \"builder-util\"\nimport { execWine } from \"../wine\"\nimport { VmManager } from \"./vm\"\nimport * as path from \"path\"\n\nexport class WineVmManager extends VmManager {\n constructor() {\n super()\n }\n\n exec(file: string, args: Array, options?: ExecFileOptions, isLogOutIfDebug = true): Promise {\n return execWine(file, null, args, options)\n }\n\n spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise {\n throw new Error(\"Unsupported\")\n }\n\n toVmFile(file: string): string {\n return path.win32.join(\"Z:\", file)\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/vm/vm.d.ts b/node_modules/app-builder-lib/out/vm/vm.d.ts deleted file mode 100644 index c59b10d..0000000 --- a/node_modules/app-builder-lib/out/vm/vm.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// -import { DebugLogger, ExtraSpawnOptions } from "builder-util"; -import { ExecFileOptions, SpawnOptions } from "child_process"; -export declare class VmManager { - readonly pathSep: string; - exec(file: string, args: Array, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise; - spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise; - toVmFile(file: string): string; -} -export declare function getWindowsVm(debugLogger: DebugLogger): Promise; diff --git a/node_modules/app-builder-lib/out/vm/vm.js b/node_modules/app-builder-lib/out/vm/vm.js deleted file mode 100644 index 595d613..0000000 --- a/node_modules/app-builder-lib/out/vm/vm.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getWindowsVm = getWindowsVm; -exports.VmManager = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _ParallelsVm() { - const data = require("./ParallelsVm"); - - _ParallelsVm = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class VmManager { - get pathSep() { - return path.sep; - } - - exec(file, args, options, isLogOutIfDebug = true) { - return (0, _builderUtil().exec)(file, args, options, isLogOutIfDebug); - } - - spawn(file, args, options, extraOptions) { - return (0, _builderUtil().spawn)(file, args, options, extraOptions); - } - - toVmFile(file) { - return file; - } - -} - -exports.VmManager = VmManager; - -function getWindowsVm(_x) { - return _getWindowsVm.apply(this, arguments); -} function _getWindowsVm() { - _getWindowsVm = (0, _bluebirdLst().coroutine)(function* (debugLogger) { - const vmList = (yield (0, _ParallelsVm().parseVmList)(debugLogger)).filter(it => it.os === "win-10"); - - if (vmList.length === 0) { - throw new (_builderUtil().InvalidConfigurationError)("Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required)"); - } // prefer running or suspended vm - - - return new (_ParallelsVm().ParallelsVmManager)(vmList.find(it => it.state === "running") || vmList.find(it => it.state === "suspended") || vmList[0]); - }); - return _getWindowsVm.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=vm.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/vm/vm.js.map b/node_modules/app-builder-lib/out/vm/vm.js.map deleted file mode 100644 index 1d40ed3..0000000 --- a/node_modules/app-builder-lib/out/vm/vm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/vm/vm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,MAAO,SAAP,CAAgB;AACpB,MAAI,OAAJ,GAAW;AACT,WAAO,IAAI,CAAC,GAAZ;AACD;;AAED,EAAA,IAAI,CAAC,IAAD,EAAe,IAAf,EAAoC,OAApC,EAA+D,eAAe,GAAG,IAAjF,EAAqF;AACvF,WAAO,yBAAK,IAAL,EAAW,IAAX,EAAiB,OAAjB,EAA0B,eAA1B,CAAP;AACD;;AAED,EAAA,KAAK,CAAC,IAAD,EAAe,IAAf,EAAoC,OAApC,EAA4D,YAA5D,EAA4F;AAC/F,WAAO,0BAAM,IAAN,EAAY,IAAZ,EAAkB,OAAlB,EAA2B,YAA3B,CAAP;AACD;;AAED,EAAA,QAAQ,CAAC,IAAD,EAAa;AACnB,WAAO,IAAP;AACD;;AAfmB;;;;SAkBA,Y;;;;;;gDAAf,WAA4B,WAA5B,EAAoD;AACzD,UAAM,MAAM,GAAG,OAAO,gCAAY,WAAZ,CAAP,EAAiC,MAAjC,CAAwC,EAAE,IAAI,EAAE,CAAC,EAAH,KAAU,QAAxD,CAAf;;AACA,QAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AACvB,YAAM,KAAI,wCAAJ,EAA8B,iFAA9B,CAAN;AACD,KAJwD,CAMzD;;;AACA,WAAO,KAAI,iCAAJ,EAAuB,MAAM,CAAC,IAAP,CAAY,EAAE,IAAI,EAAE,CAAC,KAAH,KAAa,SAA/B,KAA6C,MAAM,CAAC,IAAP,CAAY,EAAE,IAAI,EAAE,CAAC,KAAH,KAAa,WAA/B,CAA7C,IAA4F,MAAM,CAAC,CAAD,CAAzH,CAAP;AACD,G","sourcesContent":["import { DebugLogger, exec, ExtraSpawnOptions, InvalidConfigurationError, spawn } from \"builder-util\"\nimport { ExecFileOptions, SpawnOptions } from \"child_process\"\nimport * as path from \"path\"\nimport { ParallelsVmManager, parseVmList } from \"./ParallelsVm\"\n\nexport class VmManager {\n get pathSep(): string {\n return path.sep\n }\n\n exec(file: string, args: Array, options?: ExecFileOptions, isLogOutIfDebug = true): Promise {\n return exec(file, args, options, isLogOutIfDebug)\n }\n\n spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise {\n return spawn(file, args, options, extraOptions)\n }\n\n toVmFile(file: string): string {\n return file\n }\n}\n\nexport async function getWindowsVm(debugLogger: DebugLogger): Promise {\n const vmList = (await parseVmList(debugLogger)).filter(it => it.os === \"win-10\")\n if (vmList.length === 0) {\n throw new InvalidConfigurationError(\"Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required)\")\n }\n\n // prefer running or suspended vm\n return new ParallelsVmManager(vmList.find(it => it.state === \"running\") || vmList.find(it => it.state === \"suspended\") || vmList[0])\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/winPackager.d.ts b/node_modules/app-builder-lib/out/winPackager.d.ts deleted file mode 100644 index 84c54ca..0000000 --- a/node_modules/app-builder-lib/out/winPackager.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Arch } from "builder-util"; -import { FileTransformer } from "builder-util/out/fs"; -import { Lazy } from "lazy-val"; -import { CertificateFromStoreInfo, CertificateInfo, FileCodeSigningInfo } from "./codeSign/windowsCodeSign"; -import { AfterPackContext } from "./configuration"; -import { Target } from "./core"; -import { RequestedExecutionLevel, WindowsConfiguration } from "./options/winOptions"; -import { Packager } from "./packager"; -import { PlatformPackager } from "./platformPackager"; -import { VmManager } from "./vm/vm"; -export declare class WinPackager extends PlatformPackager { - readonly cscInfo: Lazy; - private _iconPath; - readonly vm: Lazy; - readonly computedPublisherName: Lazy; - readonly lazyCertInfo: Lazy; - readonly isForceCodeSigningVerification: boolean; - constructor(info: Packager); - readonly defaultTarget: Array; - protected doGetCscPassword(): string | undefined | null; - createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void; - getIconPath(): Promise; - sign(file: string, logMessagePrefix?: string): Promise; - private doSign; - signAndEditResources(file: string, arch: Arch, outDir: string, internalName?: string | null, requestedExecutionLevel?: RequestedExecutionLevel | null): Promise; - private isSignDlls; - protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null; - protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise; -} diff --git a/node_modules/app-builder-lib/out/winPackager.js b/node_modules/app-builder-lib/out/winPackager.js deleted file mode 100644 index 274e91c..0000000 --- a/node_modules/app-builder-lib/out/winPackager.js +++ /dev/null @@ -1,608 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.WinPackager = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _isCi() { - const data = _interopRequireDefault(require("is-ci")); - - _isCi = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _codesign() { - const data = require("./codeSign/codesign"); - - _codesign = function () { - return data; - }; - - return data; -} - -function _windowsCodeSign() { - const data = require("./codeSign/windowsCodeSign"); - - _windowsCodeSign = function () { - return data; - }; - - return data; -} - -function _core() { - const data = require("./core"); - - _core = function () { - return data; - }; - - return data; -} - -function _platformPackager() { - const data = require("./platformPackager"); - - _platformPackager = function () { - return data; - }; - - return data; -} - -function _NsisTarget() { - const data = require("./targets/nsis/NsisTarget"); - - _NsisTarget = function () { - return data; - }; - - return data; -} - -function _nsisUtil() { - const data = require("./targets/nsis/nsisUtil"); - - _nsisUtil = function () { - return data; - }; - - return data; -} - -function _WebInstallerTarget() { - const data = require("./targets/nsis/WebInstallerTarget"); - - _WebInstallerTarget = function () { - return data; - }; - - return data; -} - -function _targetFactory() { - const data = require("./targets/targetFactory"); - - _targetFactory = function () { - return data; - }; - - return data; -} - -function _cacheManager() { - const data = require("./util/cacheManager"); - - _cacheManager = function () { - return data; - }; - - return data; -} - -function _flags() { - const data = require("./util/flags"); - - _flags = function () { - return data; - }; - - return data; -} - -function _timer() { - const data = require("./util/timer"); - - _timer = function () { - return data; - }; - - return data; -} - -function _vm() { - const data = require("./vm/vm"); - - _vm = function () { - return data; - }; - - return data; -} - -function _wine() { - const data = require("./wine"); - - _wine = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class WinPackager extends _platformPackager().PlatformPackager { - constructor(info) { - var _this; - - super(info, _core().Platform.WINDOWS); - _this = this; - this.cscInfo = new (_lazyVal().Lazy)(() => { - const platformSpecificBuildOptions = this.platformSpecificBuildOptions; - - if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) { - return this.vm.value.then(vm => (0, _windowsCodeSign().getCertificateFromStoreInfo)(platformSpecificBuildOptions, vm)).catch(e => { - // https://github.com/electron-userland/electron-builder/pull/2397 - if (platformSpecificBuildOptions.sign == null) { - throw e; - } else { - _builderUtil().log.debug({ - error: e - }, "getCertificateFromStoreInfo error"); - - return null; - } - }); - } - - const certificateFile = platformSpecificBuildOptions.certificateFile; - - if (certificateFile != null) { - const certificatePassword = this.getCscPassword(); - return Promise.resolve({ - file: certificateFile, - password: certificatePassword == null ? null : certificatePassword.trim() - }); - } - - const cscLink = this.getCscLink("WIN_CSC_LINK"); - - if (cscLink == null) { - return Promise.resolve(null); - } - - return (0, _codesign().downloadCertificate)(cscLink, this.info.tempDirManager, this.projectDir) // before then - .catch(e => { - if (e instanceof _builderUtil().InvalidConfigurationError) { - throw new (_builderUtil().InvalidConfigurationError)(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`); - } else { - throw e; - } - }).then(path => { - return { - file: path, - password: this.getCscPassword() - }; - }); - }); - this._iconPath = new (_lazyVal().Lazy)(() => this.getOrConvertIcon("ico")); - this.vm = new (_lazyVal().Lazy)(() => process.platform === "win32" ? Promise.resolve(new (_vm().VmManager)()) : (0, _vm().getWindowsVm)(this.debugLogger)); - this.computedPublisherName = new (_lazyVal().Lazy)( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const publisherName = _this.platformSpecificBuildOptions.publisherName; - - if (publisherName === null) { - return null; - } else if (publisherName != null) { - return (0, _builderUtil().asArray)(publisherName); - } - - const certInfo = yield _this.lazyCertInfo.value; - return certInfo == null ? null : [certInfo.commonName]; - })); - this.lazyCertInfo = new (_lazyVal().Lazy)( - /*#__PURE__*/ - (0, _bluebirdLst().coroutine)(function* () { - const cscInfo = yield _this.cscInfo.value; - - if (cscInfo == null) { - return null; - } - - if ("subject" in cscInfo) { - const bloodyMicrosoftSubjectDn = cscInfo.subject; - return { - commonName: (0, _builderUtilRuntime().parseDn)(bloodyMicrosoftSubjectDn).get("CN"), - bloodyMicrosoftSubjectDn - }; - } - - const cscFile = cscInfo.file; - - if (cscFile == null) { - return null; - } - - return yield (0, _windowsCodeSign().getCertInfo)(cscFile, cscInfo.password || ""); - })); - } - - get isForceCodeSigningVerification() { - return this.platformSpecificBuildOptions.verifyUpdateCodeSignature !== false; - } - - get defaultTarget() { - return ["nsis"]; - } - - doGetCscPassword() { - return (0, _platformPackager().chooseNotNull)((0, _platformPackager().chooseNotNull)(this.platformSpecificBuildOptions.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword()); - } - - createTargets(targets, mapper) { - let copyElevateHelper; - - const getCopyElevateHelper = () => { - if (copyElevateHelper == null) { - copyElevateHelper = new (_nsisUtil().CopyElevateHelper)(); - } - - return copyElevateHelper; - }; - - let helper; - - const getHelper = () => { - if (helper == null) { - helper = new (_nsisUtil().AppPackageHelper)(getCopyElevateHelper()); - } - - return helper; - }; - - for (const name of targets) { - if (name === _core().DIR_TARGET) { - continue; - } - - if (name === "nsis" || name === "portable") { - mapper(name, outDir => new (_NsisTarget().NsisTarget)(this, outDir, name, getHelper())); - } else if (name === "nsis-web") { - // package file format differs from nsis target - mapper(name, outDir => new (_WebInstallerTarget().WebInstallerTarget)(this, path.join(outDir, name), name, new (_nsisUtil().AppPackageHelper)(getCopyElevateHelper()))); - } else { - const targetClass = (() => { - switch (name) { - case "squirrel": - try { - return require("electron-builder-squirrel-windows").default; - } catch (e) { - throw new (_builderUtil().InvalidConfigurationError)(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`); - } - - case "appx": - return require("./targets/AppxTarget").default; - - case "msi": - return require("./targets/MsiTarget").default; - - default: - return null; - } - })(); - - mapper(name, outDir => targetClass === null ? (0, _targetFactory().createCommonTarget)(name, outDir, this) : new targetClass(this, outDir, name)); - } - } - } - - getIconPath() { - return this._iconPath.value; - } - - sign(file, logMessagePrefix) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const signOptions = { - path: file, - name: _this2.appInfo.productName, - site: yield _this2.appInfo.computePackageUrl(), - options: _this2.platformSpecificBuildOptions - }; - const cscInfo = yield _this2.cscInfo.value; - - if (cscInfo == null) { - if (_this2.platformSpecificBuildOptions.sign != null) { - yield (0, _windowsCodeSign().sign)(signOptions, _this2); - } else if (_this2.forceCodeSigning) { - throw new (_builderUtil().InvalidConfigurationError)(`App is not signed and "forceCodeSigning" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`); - } - - return; - } - - if (logMessagePrefix == null) { - logMessagePrefix = "signing"; - } - - if ("file" in cscInfo) { - _builderUtil().log.info({ - file: _builderUtil().log.filePath(file), - certificateFile: cscInfo.file - }, logMessagePrefix); - } else { - const info = cscInfo; - - _builderUtil().log.info({ - file: _builderUtil().log.filePath(file), - subject: info.subject, - thumbprint: info.thumbprint, - store: info.store, - user: info.isLocalMachineStore ? "local machine" : "current user" - }, logMessagePrefix); - } - - yield _this2.doSign(Object.assign({}, signOptions, { - cscInfo, - options: Object.assign({}, _this2.platformSpecificBuildOptions) - })); - })(); - } - - doSign(options) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - for (let i = 0; i < 3; i++) { - try { - yield (0, _windowsCodeSign().sign)(options, _this3); - break; - } catch (e) { - // https://github.com/electron-userland/electron-builder/issues/1414 - const message = e.message; - - if (message != null && message.includes("Couldn't resolve host name")) { - _builderUtil().log.warn({ - error: message, - attempt: i + 1 - }, `cannot sign`); - - continue; - } - - throw e; - } - } - })(); - } - - signAndEditResources(file, arch, outDir, internalName, requestedExecutionLevel) { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const appInfo = _this4.appInfo; - const files = []; - const args = [file, "--set-version-string", "FileDescription", appInfo.productName, "--set-version-string", "ProductName", appInfo.productName, "--set-version-string", "LegalCopyright", appInfo.copyright, "--set-file-version", appInfo.buildVersion, "--set-product-version", appInfo.getVersionInWeirdWindowsForm()]; - - if (internalName != null) { - args.push("--set-version-string", "InternalName", internalName, "--set-version-string", "OriginalFilename", ""); - } - - if (requestedExecutionLevel != null && requestedExecutionLevel !== "asInvoker") { - args.push("--set-requested-execution-level", requestedExecutionLevel); - } - - (0, _builderUtil().use)(appInfo.companyName, it => args.push("--set-version-string", "CompanyName", it)); - (0, _builderUtil().use)(_this4.platformSpecificBuildOptions.legalTrademarks, it => args.push("--set-version-string", "LegalTrademarks", it)); - const iconPath = yield _this4.getIconPath(); - (0, _builderUtil().use)(iconPath, it => { - files.push(it); - args.push("--set-icon", it); - }); - const config = _this4.config; - const cscInfoForCacheDigest = !(0, _flags().isBuildCacheEnabled)() || _isCi().default || config.electronDist != null ? null : yield _this4.cscInfo.value; - let buildCacheManager = null; // resources editing doesn't change executable for the same input and executed quickly - no need to complicate - - if (cscInfoForCacheDigest != null) { - const cscFile = cscInfoForCacheDigest.file; - - if (cscFile != null) { - files.push(cscFile); - } - - const timer = (0, _timer().time)("executable cache"); - const hash = (0, _crypto().createHash)("sha512"); - hash.update(config.electronVersion || "no electronVersion"); - hash.update(config.muonVersion || "no muonVersion"); - hash.update(JSON.stringify(_this4.platformSpecificBuildOptions)); - hash.update(JSON.stringify(args)); - hash.update(_this4.platformSpecificBuildOptions.certificateSha1 || "no certificateSha1"); - hash.update(_this4.platformSpecificBuildOptions.certificateSubjectName || "no subjectName"); - buildCacheManager = new (_cacheManager().BuildCacheManager)(outDir, file, arch); - - if (yield buildCacheManager.copyIfValid((yield (0, _cacheManager().digest)(hash, files)))) { - timer.end(); - return; - } - - timer.end(); - } - - const timer = (0, _timer().time)("wine&sign"); // rcedit crashed of executed using wine, resourcehacker works - - if (process.platform === "win32" || _this4.info.framework.name === "electron") { - const vendorPath = yield (0, _windowsCodeSign().getSignVendorPath)(); - yield (0, _wine().execWine)(path.join(vendorPath, "rcedit-ia32.exe"), path.join(vendorPath, "rcedit-x64.exe"), args); - } - - yield _this4.sign(file); - timer.end(); - - if (buildCacheManager != null) { - yield buildCacheManager.save(); - } - })(); - } - - isSignDlls() { - return this.platformSpecificBuildOptions.signDlls === true; - } - - createTransformerForExtraFiles(packContext) { - if (this.platformSpecificBuildOptions.signAndEditExecutable === false) { - return null; - } - - return file => { - if (file.endsWith(".exe") || this.isSignDlls() && file.endsWith(".dll")) { - const parentDir = path.dirname(file); - - if (parentDir !== packContext.appOutDir) { - return new (_fs().CopyFileTransformer)(file => this.sign(file)); - } - } - - return null; - }; - } - - signApp(packContext, isAsar) { - var _this5 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const exeFileName = `${_this5.appInfo.productFilename}.exe`; - - if (_this5.platformSpecificBuildOptions.signAndEditExecutable === false) { - return; - } - - yield _bluebirdLst().default.map((0, _fsExtraP().readdir)(packContext.appOutDir), file => { - if (file === exeFileName) { - return _this5.signAndEditResources(path.join(packContext.appOutDir, exeFileName), packContext.arch, packContext.outDir, path.basename(exeFileName, ".exe"), _this5.platformSpecificBuildOptions.requestedExecutionLevel); - } else if (file.endsWith(".exe") || _this5.isSignDlls() && file.endsWith(".dll")) { - return _this5.sign(path.join(packContext.appOutDir, file)); - } - - return null; - }); - - if (!isAsar) { - return; - } - - const outResourcesDir = path.join(packContext.appOutDir, "resources", "app.asar.unpacked"); - yield _bluebirdLst().default.map((0, _promise().orIfFileNotExist)((0, _fsExtraP().readdir)(outResourcesDir), []), file => { - if (file.endsWith(".exe") || file.endsWith(".dll")) { - return _this5.sign(path.join(outResourcesDir, file)); - } else { - return null; - } - }); - })(); - } - -} exports.WinPackager = WinPackager; -// __ts-babel@6.0.4 -//# sourceMappingURL=winPackager.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/winPackager.js.map b/node_modules/app-builder-lib/out/winPackager.js.map deleted file mode 100644 index 1942bba..0000000 --- a/node_modules/app-builder-lib/out/winPackager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/winPackager.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AA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AAC,MAAvG,EAA+G,IAAI,CAAC,QAAL,CAAc,WAAd,EAA2B,MAA3B,CAA/G,EAAmJ,MAAI,CAAC,4BAAL,CAAkC,uBAArL,CAAP;AACD,SAFD,MAGK,IAAI,IAAI,CAAC,QAAL,CAAc,MAAd,KAA0B,MAAI,CAAC,UAAL,MAAqB,IAAI,CAAC,QAAL,CAAc,MAAd,CAAnD,EAA2E;AAC9E,iBAAO,MAAI,CAAC,IAAL,CAAU,IAAI,CAAC,IAAL,CAAU,WAAW,CAAC,SAAtB,EAAiC,IAAjC,CAAV,CAAP;AACD;;AACD,eAAO,IAAP;AACD,OARK,CAAN;;AAUA,UAAI,CAAC,MAAL,EAAa;AACX;AACD;;AAED,YAAM,eAAe,GAAG,IAAI,CAAC,IAAL,CAAU,WAAW,CAAC,SAAtB,EAAiC,WAAjC,EAA8C,mBAA9C,CAAxB;AACA,YAAM,uBAAgB,GAAhB,CAAoB,iCAAiB,yBAAQ,eAAR,CAAjB,EAA2C,EAA3C,CAApB,EAAqE,IAAD,IAAsB;AAC9F,YAAI,IAAI,CAAC,QAAL,CAAc,MAAd,KAAyB,IAAI,CAAC,QAAL,CAAc,MAAd,CAA7B,EAAoD;AAClD,iBAAO,MAAI,CAAC,IAAL,CAAU,IAAI,CAAC,IAAL,CAAU,eAAV,EAA2B,IAA3B,CAAV,CAAP;AACD,SAFD,MAGK;AACH,iBAAO,IAAP;AACD;AACF,OAPK,CAAN;AArBoE;AA6BrE;;AAnWoE,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, InvalidConfigurationError, log, use } from \"builder-util\"\nimport { parseDn } from \"builder-util-runtime\"\nimport { CopyFileTransformer, FileTransformer } from \"builder-util/out/fs\"\nimport { orIfFileNotExist } from \"builder-util/out/promise\"\nimport { createHash } from \"crypto\"\nimport { readdir } from \"fs-extra-p\"\nimport isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { downloadCertificate } from \"./codeSign/codesign\"\nimport { CertificateFromStoreInfo, CertificateInfo, FileCodeSigningInfo, getCertificateFromStoreInfo, getCertInfo, getSignVendorPath, sign, WindowsSignOptions } from \"./codeSign/windowsCodeSign\"\nimport { AfterPackContext } from \"./configuration\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { RequestedExecutionLevel, WindowsConfiguration } from \"./options/winOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport AppXTarget from \"./targets/AppxTarget\"\nimport { NsisTarget } from \"./targets/nsis/NsisTarget\"\nimport { AppPackageHelper, CopyElevateHelper } from \"./targets/nsis/nsisUtil\"\nimport { WebInstallerTarget } from \"./targets/nsis/WebInstallerTarget\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\nimport { BuildCacheManager, digest } from \"./util/cacheManager\"\nimport { isBuildCacheEnabled } from \"./util/flags\"\nimport { time } from \"./util/timer\"\nimport { getWindowsVm, VmManager } from \"./vm/vm\"\nimport { execWine } from \"./wine\"\n\nexport class WinPackager extends PlatformPackager {\n readonly cscInfo = new Lazy(() => {\n const platformSpecificBuildOptions = this.platformSpecificBuildOptions\n if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) {\n return this.vm.value\n .then(vm => getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))\n .catch(e => {\n // https://github.com/electron-userland/electron-builder/pull/2397\n if (platformSpecificBuildOptions.sign == null) {\n throw e\n }\n else {\n log.debug({error: e}, \"getCertificateFromStoreInfo error\")\n return null\n }\n })\n }\n\n const certificateFile = platformSpecificBuildOptions.certificateFile\n if (certificateFile != null) {\n const certificatePassword = this.getCscPassword()\n return Promise.resolve({\n file: certificateFile,\n password: certificatePassword == null ? null : certificatePassword.trim(),\n })\n }\n\n const cscLink = this.getCscLink(\"WIN_CSC_LINK\")\n if (cscLink == null) {\n return Promise.resolve(null)\n }\n\n return downloadCertificate(cscLink, this.info.tempDirManager, this.projectDir)\n // before then\n .catch(e => {\n if (e instanceof InvalidConfigurationError) {\n throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)\n }\n else {\n throw e\n }\n })\n .then(path => {\n return {\n file: path!!,\n password: this.getCscPassword(),\n }\n })\n })\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"ico\"))\n\n readonly vm = new Lazy(() => process.platform === \"win32\" ? Promise.resolve(new VmManager()) : getWindowsVm(this.debugLogger))\n\n readonly computedPublisherName = new Lazy | null>(async () => {\n const publisherName = (this.platformSpecificBuildOptions as WindowsConfiguration).publisherName\n if (publisherName === null) {\n return null\n }\n else if (publisherName != null) {\n return asArray(publisherName)\n }\n\n const certInfo = await this.lazyCertInfo.value\n return certInfo == null ? null : [certInfo.commonName]\n })\n\n readonly lazyCertInfo = new Lazy(async () => {\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n return null\n }\n\n if (\"subject\" in cscInfo) {\n const bloodyMicrosoftSubjectDn = (cscInfo as CertificateFromStoreInfo).subject\n return {\n commonName: parseDn(bloodyMicrosoftSubjectDn).get(\"CN\")!!,\n bloodyMicrosoftSubjectDn,\n }\n }\n\n const cscFile = (cscInfo as FileCodeSigningInfo).file\n if (cscFile == null) {\n return null\n }\n return await getCertInfo(cscFile, (cscInfo as FileCodeSigningInfo).password || \"\")\n })\n\n get isForceCodeSigningVerification(): boolean {\n return this.platformSpecificBuildOptions.verifyUpdateCodeSignature !== false\n }\n\n constructor(info: Packager) {\n super(info, Platform.WINDOWS)\n }\n\n get defaultTarget(): Array {\n return [\"nsis\"]\n }\n\n protected doGetCscPassword(): string | undefined | null {\n return chooseNotNull(chooseNotNull(this.platformSpecificBuildOptions.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword())\n }\n\n createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let copyElevateHelper: CopyElevateHelper | null\n const getCopyElevateHelper = () => {\n if (copyElevateHelper == null) {\n copyElevateHelper = new CopyElevateHelper()\n }\n return copyElevateHelper\n }\n\n let helper: AppPackageHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new AppPackageHelper(getCopyElevateHelper())\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n if (name === \"nsis\" || name === \"portable\") {\n mapper(name, outDir => new NsisTarget(this, outDir, name, getHelper()))\n }\n else if (name === \"nsis-web\") {\n // package file format differs from nsis target\n mapper(name, outDir => new WebInstallerTarget(this, path.join(outDir, name), name, new AppPackageHelper(getCopyElevateHelper())))\n }\n else {\n const targetClass: typeof NsisTarget | typeof AppXTarget | null = (() => {\n switch (name) {\n case \"squirrel\":\n try {\n return require(\"electron-builder-squirrel-windows\").default\n }\n catch (e) {\n throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)\n }\n\n case \"appx\":\n return require(\"./targets/AppxTarget\").default\n\n case \"msi\":\n return require(\"./targets/MsiTarget\").default\n\n default:\n return null\n }\n })()\n\n mapper(name, outDir => targetClass === null ? createCommonTarget(name, outDir, this) : new (targetClass as any)(this, outDir, name))\n }\n }\n }\n\n getIconPath() {\n return this._iconPath.value\n }\n\n async sign(file: string, logMessagePrefix?: string): Promise {\n const signOptions: WindowsSignOptions = {\n path: file,\n name: this.appInfo.productName,\n site: await this.appInfo.computePackageUrl(),\n options: this.platformSpecificBuildOptions,\n }\n\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n if (this.platformSpecificBuildOptions.sign != null) {\n await sign(signOptions, this)\n }\n else if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(`App is not signed and \"forceCodeSigning\" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`)\n }\n return\n }\n\n if (logMessagePrefix == null) {\n logMessagePrefix = \"signing\"\n }\n\n if (\"file\" in cscInfo) {\n log.info({\n file: log.filePath(file),\n certificateFile: (cscInfo as FileCodeSigningInfo).file,\n }, logMessagePrefix)\n }\n else {\n const info = cscInfo as CertificateFromStoreInfo\n log.info({\n file: log.filePath(file),\n subject: info.subject,\n thumbprint: info.thumbprint,\n store: info.store,\n user: info.isLocalMachineStore ? \"local machine\" : \"current user\",\n }, logMessagePrefix)\n }\n\n await this.doSign({\n ...signOptions,\n cscInfo,\n options: {\n ...this.platformSpecificBuildOptions,\n },\n })\n }\n\n private async doSign(options: WindowsSignOptions) {\n for (let i = 0; i < 3; i++) {\n try {\n await sign(options, this)\n break\n }\n catch (e) {\n // https://github.com/electron-userland/electron-builder/issues/1414\n const message = e.message\n if (message != null && message.includes(\"Couldn't resolve host name\")) {\n log.warn({error: message, attempt: i + 1}, `cannot sign`)\n continue\n }\n throw e\n }\n }\n }\n\n async signAndEditResources(file: string, arch: Arch, outDir: string, internalName?: string | null, requestedExecutionLevel?: RequestedExecutionLevel | null) {\n const appInfo = this.appInfo\n\n const files: Array = []\n\n const args = [\n file,\n \"--set-version-string\", \"FileDescription\", appInfo.productName,\n \"--set-version-string\", \"ProductName\", appInfo.productName,\n \"--set-version-string\", \"LegalCopyright\", appInfo.copyright,\n \"--set-file-version\", appInfo.buildVersion,\n \"--set-product-version\", appInfo.getVersionInWeirdWindowsForm(),\n ]\n\n if (internalName != null) {\n args.push(\n \"--set-version-string\", \"InternalName\", internalName,\n \"--set-version-string\", \"OriginalFilename\", \"\",\n )\n }\n\n if (requestedExecutionLevel != null && requestedExecutionLevel !== \"asInvoker\") {\n args.push(\"--set-requested-execution-level\", requestedExecutionLevel)\n }\n\n use(appInfo.companyName, it => args.push(\"--set-version-string\", \"CompanyName\", it!))\n use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push(\"--set-version-string\", \"LegalTrademarks\", it!))\n const iconPath = await this.getIconPath()\n use(iconPath, it => {\n files.push(it)\n args.push(\"--set-icon\", it)\n })\n\n const config = this.config\n const cscInfoForCacheDigest = !isBuildCacheEnabled() || isCI || config.electronDist != null ? null : await this.cscInfo.value\n let buildCacheManager: BuildCacheManager | null = null\n // resources editing doesn't change executable for the same input and executed quickly - no need to complicate\n if (cscInfoForCacheDigest != null) {\n const cscFile = (cscInfoForCacheDigest as FileCodeSigningInfo).file\n if (cscFile != null) {\n files.push(cscFile)\n }\n\n const timer = time(\"executable cache\")\n const hash = createHash(\"sha512\")\n hash.update(config.electronVersion || \"no electronVersion\")\n hash.update(config.muonVersion || \"no muonVersion\")\n hash.update(JSON.stringify(this.platformSpecificBuildOptions))\n hash.update(JSON.stringify(args))\n hash.update(this.platformSpecificBuildOptions.certificateSha1 || \"no certificateSha1\")\n hash.update(this.platformSpecificBuildOptions.certificateSubjectName || \"no subjectName\")\n\n buildCacheManager = new BuildCacheManager(outDir, file, arch)\n if (await buildCacheManager.copyIfValid(await digest(hash, files))) {\n timer.end()\n return\n }\n timer.end()\n }\n\n const timer = time(\"wine&sign\")\n // rcedit crashed of executed using wine, resourcehacker works\n if (process.platform === \"win32\" || this.info.framework.name === \"electron\") {\n const vendorPath = await getSignVendorPath()\n await execWine(path.join(vendorPath, \"rcedit-ia32.exe\"), path.join(vendorPath, \"rcedit-x64.exe\"), args)\n }\n\n await this.sign(file)\n timer.end()\n\n if (buildCacheManager != null) {\n await buildCacheManager.save()\n }\n }\n\n private isSignDlls(): boolean {\n return this.platformSpecificBuildOptions.signDlls === true\n }\n\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return null\n }\n\n return file => {\n if (file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\"))) {\n const parentDir = path.dirname(file)\n if (parentDir !== packContext.appOutDir) {\n return new CopyFileTransformer(file => this.sign(file))\n }\n }\n return null\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise {\n const exeFileName = `${this.appInfo.productFilename}.exe`\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return\n }\n\n await BluebirdPromise.map(readdir(packContext.appOutDir), (file: string): any => {\n if (file === exeFileName) {\n return this.signAndEditResources(path.join(packContext.appOutDir, exeFileName), packContext.arch, packContext.outDir, path.basename(exeFileName, \".exe\"), this.platformSpecificBuildOptions.requestedExecutionLevel)\n }\n else if (file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\"))) {\n return this.sign(path.join(packContext.appOutDir, file))\n }\n return null\n })\n\n if (!isAsar) {\n return\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n await BluebirdPromise.map(orIfFileNotExist(readdir(outResourcesDir), []), (file: string): any => {\n if (file.endsWith(\".exe\") || file.endsWith(\".dll\")) {\n return this.sign(path.join(outResourcesDir, file))\n }\n else {\n return null\n }\n })\n }\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/out/wine.d.ts b/node_modules/app-builder-lib/out/wine.d.ts deleted file mode 100644 index d073dd4..0000000 --- a/node_modules/app-builder-lib/out/wine.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -import { ExecFileOptions } from "child_process"; -/** @private */ -export declare function execWine(file: string, file64?: string | null, appArgs?: Array, options?: ExecFileOptions): Promise; -/** @private */ -export declare function prepareWindowsExecutableArgs(args: Array, exePath: string): string[]; diff --git a/node_modules/app-builder-lib/out/wine.js b/node_modules/app-builder-lib/out/wine.js deleted file mode 100644 index 2bbdd60..0000000 --- a/node_modules/app-builder-lib/out/wine.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.execWine = execWine; -exports.prepareWindowsExecutableArgs = prepareWindowsExecutableArgs; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -/** @private */ -function execWine(file, file64 = null, appArgs = [], options = {}) { - if (process.platform === "win32") { - if (options.timeout == null) { - // 2 minutes - options.timeout = 120 * 1000; - } - - return (0, _builderUtil().exec)(file, appArgs, options); - } - - const commandArgs = ["wine", "--ia32", file]; - - if (file64 != null) { - commandArgs.push("--x64", file64); - } - - if (appArgs.length > 0) { - commandArgs.push("--args", JSON.stringify(appArgs)); - } - - return (0, _builderUtil().executeAppBuilder)(commandArgs, undefined, options); -} -/** @private */ - - -function prepareWindowsExecutableArgs(args, exePath) { - if (process.platform !== "win32") { - args.unshift(exePath); - } - - return args; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=wine.js.map \ No newline at end of file diff --git a/node_modules/app-builder-lib/out/wine.js.map b/node_modules/app-builder-lib/out/wine.js.map deleted file mode 100644 index 60cbc97..0000000 --- a/node_modules/app-builder-lib/out/wine.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/wine.ts"],"names":[],"mappings":";;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AACM,SAAU,QAAV,CAAmB,IAAnB,EAAiC,MAAA,GAAwB,IAAzD,EAA+D,OAAA,GAAyB,EAAxF,EAA4F,OAAA,GAA2B,EAAvH,EAAyH;AAC7H,MAAI,OAAO,CAAC,QAAR,KAAqB,OAAzB,EAAkC;AAChC,QAAI,OAAO,CAAC,OAAR,IAAmB,IAAvB,EAA6B;AAC3B;AACA,MAAA,OAAO,CAAC,OAAR,GAAkB,MAAM,IAAxB;AACD;;AACD,WAAO,yBAAK,IAAL,EAAW,OAAX,EAAoB,OAApB,CAAP;AACD;;AAED,QAAM,WAAW,GAAG,CAClB,MADkB,EAElB,QAFkB,EAER,IAFQ,CAApB;;AAIA,MAAI,MAAM,IAAI,IAAd,EAAoB;AAClB,IAAA,WAAW,CAAC,IAAZ,CAAiB,OAAjB,EAA0B,MAA1B;AACD;;AACD,MAAI,OAAO,CAAC,MAAR,GAAiB,CAArB,EAAwB;AACtB,IAAA,WAAW,CAAC,IAAZ,CAAiB,QAAjB,EAA2B,IAAI,CAAC,SAAL,CAAe,OAAf,CAA3B;AACD;;AACD,SAAO,sCAAkB,WAAlB,EAA+B,SAA/B,EAA0C,OAA1C,CAAP;AACD;AAED;;;AACM,SAAU,4BAAV,CAAuC,IAAvC,EAA4D,OAA5D,EAA2E;AAC/E,MAAI,OAAO,CAAC,QAAR,KAAqB,OAAzB,EAAkC;AAChC,IAAA,IAAI,CAAC,OAAL,CAAa,OAAb;AACD;;AACD,SAAO,IAAP;AACD,C","sourcesContent":["import { ExecFileOptions } from \"child_process\"\nimport { exec, executeAppBuilder } from \"builder-util\"\n\n/** @private */\nexport function execWine(file: string, file64: string | null = null, appArgs: Array = [], options: ExecFileOptions = {}): Promise {\n if (process.platform === \"win32\") {\n if (options.timeout == null) {\n // 2 minutes\n options.timeout = 120 * 1000\n }\n return exec(file, appArgs, options)\n }\n\n const commandArgs = [\n \"wine\",\n \"--ia32\", file,\n ]\n if (file64 != null) {\n commandArgs.push(\"--x64\", file64)\n }\n if (appArgs.length > 0) {\n commandArgs.push(\"--args\", JSON.stringify(appArgs))\n }\n return executeAppBuilder(commandArgs, undefined, options)\n}\n\n/** @private */\nexport function prepareWindowsExecutableArgs(args: Array, exePath: string) {\n if (process.platform !== \"win32\") {\n args.unshift(exePath)\n }\n return args\n}"],"sourceRoot":""} diff --git a/node_modules/app-builder-lib/package.json b/node_modules/app-builder-lib/package.json deleted file mode 100644 index 24bd326..0000000 --- a/node_modules/app-builder-lib/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_from": "app-builder-lib@20.38.4", - "_id": "app-builder-lib@20.38.4", - "_inBundle": false, - "_integrity": "sha512-JbuAJQBndcCW6BJVIb2tPjM5wiuIjz2LUlbyVxNIawM2wFKUBV9kr0N3RNBJFxcrCEuA9oprMUCoymJdrMUVfA==", - "_location": "/app-builder-lib", - "_phantomChildren": { - "ms": "2.1.1" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "app-builder-lib@20.38.4", - "name": "app-builder-lib", - "escapedName": "app-builder-lib", - "rawSpec": "20.38.4", - "saveSpec": null, - "fetchSpec": "20.38.4" - }, - "_requiredBy": [ - "/dmg-builder", - "/electron-builder" - ], - "_resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-20.38.4.tgz", - "_shasum": "71a515d01f4f2bd48a67495804f659a46c35303c", - "_spec": "app-builder-lib@20.38.4", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", - "author": { - "name": "Vladimir Krivosheev" - }, - "bugs": { - "url": "https://github.com/electron-userland/electron-builder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "7zip-bin": "~4.1.0", - "app-builder-bin": "2.6.1", - "async-exit-hook": "^2.0.1", - "bluebird-lst": "^1.0.6", - "builder-util": "9.6.1", - "builder-util-runtime": "8.1.0", - "chromium-pickle-js": "^0.2.0", - "debug": "^4.1.0", - "ejs": "^2.6.1", - "electron-osx-sign": "0.4.11", - "electron-publish": "20.38.3", - "fs-extra-p": "^7.0.0", - "hosted-git-info": "^2.7.1", - "is-ci": "^2.0.0", - "isbinaryfile": "^3.0.3", - "js-yaml": "^3.12.0", - "lazy-val": "^1.0.3", - "minimatch": "^3.0.4", - "normalize-package-data": "^2.4.0", - "plist": "^3.0.1", - "read-config-file": "3.2.0", - "sanitize-filename": "^1.6.1", - "semver": "^5.6.0", - "temp-file": "^3.3.2" - }, - "deprecated": false, - "description": "electron-builder lib", - "engines": { - "node": ">=6.11.4" - }, - "files": [ - "out", - "templates", - "scheme.json", - "certs/root_certs.keychain" - ], - "homepage": "https://github.com/electron-userland/electron-builder", - "keywords": [ - "electron", - "builder", - "build", - "installer", - "install", - "packager", - "pack", - "nsis", - "app", - "dmg", - "pkg", - "msi", - "exe", - "setup", - "Windows", - "OS X", - "MacOS", - "Mac", - "appx", - "snap", - "portable" - ], - "license": "MIT", - "main": "out/index.js", - "name": "app-builder-lib", - "repository": { - "type": "git", - "url": "git+https://github.com/electron-userland/electron-builder.git" - }, - "typings": "./out/index.d.ts", - "version": "20.38.4" -} diff --git a/node_modules/app-builder-lib/scheme.json b/node_modules/app-builder-lib/scheme.json deleted file mode 100644 index f02c298..0000000 --- a/node_modules/app-builder-lib/scheme.json +++ /dev/null @@ -1,5696 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "AppImageOptions": { - "additionalProperties": false, - "properties": { - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "category": { - "description": "The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).", - "type": [ - "null", - "string" - ] - }, - "description": { - "description": "As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux.", - "type": [ - "null", - "string" - ] - }, - "desktop": { - "description": "The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value)." - }, - "license": { - "description": "The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.", - "type": [ - "null", - "string" - ] - }, - "mimeTypes": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing." - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "synopsis": { - "description": "The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).", - "type": [ - "null", - "string" - ] - }, - "systemIntegration": { - "default": "ask", - "description": "The system integration installation.", - "enum": [ - "ask", - "doNotAsk" - ], - "type": "string" - } - }, - "title": "AppImageOptions", - "type": "object" - }, - "AppXOptions": { - "additionalProperties": false, - "properties": { - "addAutoLaunchExtension": { - "description": "Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.", - "type": "boolean" - }, - "applicationId": { - "description": "The application id. Defaults to `identityName`. Can’t start with numbers.", - "type": "string" - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "backgroundColor": { - "default": "#464646", - "description": "The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx).", - "type": [ - "null", - "string" - ] - }, - "displayName": { - "description": "A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).\nDefaults to the application product name.", - "type": [ - "null", - "string" - ] - }, - "electronUpdaterAware": { - "default": false, - "type": "boolean" - }, - "identityName": { - "description": "The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](/configuration/configuration#Metadata-name).", - "type": [ - "null", - "string" - ] - }, - "languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store.\nThe first entry (index 0) will be the default language.\nDefaults to en-US if omitted." - }, - "makeappxArgs": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "publisher": { - "description": "The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.", - "type": [ - "null", - "string" - ] - }, - "publisherDisplayName": { - "description": "A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx).\nDefaults to company name from the application metadata.", - "type": [ - "null", - "string" - ] - } - }, - "title": "AppXOptions", - "type": "object" - }, - "AsarOptions": { - "additionalProperties": false, - "properties": { - "externalAllowed": { - "default": false, - "description": "Allows external asar files.", - "type": "boolean" - }, - "ordering": { - "type": [ - "null", - "string" - ] - }, - "smartUnpack": { - "default": true, - "description": "Whether to automatically unpack executables files.", - "type": "boolean" - } - }, - "title": "AsarOptions", - "type": "object" - }, - "BintrayOptions": { - "additionalProperties": false, - "description": "[Bintray](https://bintray.com/) options. Requires an API key. An API key can be obtained from the user [profile](https://bintray.com/profile/edit) page (\"Edit Your Profile\" -> API Key).\nDefine `BT_TOKEN` environment variable.", - "properties": { - "component": { - "description": "The Bintray component (Debian only).", - "type": [ - "null", - "string" - ] - }, - "distribution": { - "default": "stable", - "description": "The Bintray distribution (Debian only).", - "type": [ - "null", - "string" - ] - }, - "owner": { - "description": "The owner.", - "type": [ - "null", - "string" - ] - }, - "package": { - "description": "The Bintray package name.", - "type": [ - "null", - "string" - ] - }, - "provider": { - "description": "The provider. Must be `bintray`.", - "enum": [ - "bintray" - ], - "type": "string" - }, - "publishAutoUpdate": { - "default": true, - "description": "Whether to publish auto update info files.\n\nAuto update relies only on the first provider in the list (you can specify several publishers).\nThus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.", - "type": "boolean" - }, - "publisherName": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "repo": { - "default": "generic", - "description": "The Bintray repository name.", - "type": [ - "null", - "string" - ] - }, - "token": { - "type": [ - "null", - "string" - ] - }, - "updaterCacheDirName": { - "type": [ - "null", - "string" - ] - }, - "user": { - "description": "The Bintray user account. Used in cases where the owner is an organization.", - "type": [ - "null", - "string" - ] - } - }, - "required": [ - "provider" - ], - "title": "BintrayOptions", - "type": "object" - }, - "CustomPublishOptions": { - "additionalProperties": { - }, - "properties": { - "provider": { - "$ref": "#/definitions/PublishProvider", - "description": "The provider." - }, - "publishAutoUpdate": { - "default": true, - "description": "Whether to publish auto update info files.\n\nAuto update relies only on the first provider in the list (you can specify several publishers).\nThus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.", - "type": "boolean" - }, - "publisherName": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "updaterCacheDirName": { - "type": [ - "null", - "string" - ] - } - }, - "required": [ - "provider" - ], - "title": "CustomPublishOptions", - "type": "object" - }, - "DebOptions": { - "additionalProperties": false, - "properties": { - "afterInstall": { - "type": [ - "null", - "string" - ] - }, - "afterRemove": { - "type": [ - "null", - "string" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "category": { - "description": "The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).", - "type": [ - "null", - "string" - ] - }, - "compression": { - "anyOf": [ - { - "enum": [ - "bzip2", - "gz", - "xz" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "xz", - "description": "The compression type." - }, - "depends": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Package dependencies. Defaults to `[\"gconf2\", \"gconf-service\", \"libnotify4\", \"libappindicator1\", \"libxtst6\", \"libnss3\"]`." - }, - "description": { - "description": "As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux.", - "type": [ - "null", - "string" - ] - }, - "desktop": { - "description": "The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value)." - }, - "fpm": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "*Advanced only* The [fpm](https://github.com/jordansissel/fpm/wiki#usage) options.\n\nExample: `[\"--before-install=build/deb-preinstall.sh\", \"--after-upgrade=build/deb-postinstall.sh\"]`" - }, - "icon": { - "type": "string" - }, - "maintainer": { - "type": [ - "null", - "string" - ] - }, - "mimeTypes": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing." - }, - "packageCategory": { - "description": "The [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section).", - "type": [ - "null", - "string" - ] - }, - "priority": { - "description": "The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute.", - "type": [ - "null", - "string" - ] - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "synopsis": { - "description": "The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).", - "type": [ - "null", - "string" - ] - }, - "vendor": { - "type": [ - "null", - "string" - ] - } - }, - "title": "DebOptions", - "type": "object" - }, - "DmgContent": { - "additionalProperties": false, - "properties": { - "name": { - "description": "The name of the file within the DMG. Defaults to basename of `path`.", - "type": "string" - }, - "path": { - "description": "The path of the file within the DMG.", - "type": "string" - }, - "type": { - "enum": [ - "dir", - "file", - "link" - ], - "type": "string" - }, - "x": { - "type": "number" - }, - "y": { - "type": "number" - } - }, - "required": [ - "x", - "y" - ], - "title": "DmgContent", - "type": "object" - }, - "DmgOptions": { - "additionalProperties": false, - "properties": { - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "background": { - "description": "The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\nIf background is not specified, use `window.size`. Default locations expected background size to be 540x380.", - "type": [ - "null", - "string" - ] - }, - "backgroundColor": { - "description": "The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.", - "type": [ - "null", - "string" - ] - }, - "contents": { - "description": "The content — to customize icon locations.", - "items": { - "$ref": "#/definitions/DmgContent" - }, - "type": "array" - }, - "format": { - "default": "UDZO", - "description": "The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).", - "enum": [ - "UDBZ", - "UDCO", - "UDRO", - "UDRW", - "UDZO", - "ULFO" - ], - "type": "string" - }, - "icon": { - "description": "The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to the application icon (`build/icon.icns`).", - "type": [ - "null", - "string" - ] - }, - "iconSize": { - "default": 80, - "description": "The size of all the icons inside the DMG.", - "type": [ - "null", - "number" - ] - }, - "iconTextSize": { - "default": 12, - "description": "The size of all the icon texts inside the DMG.", - "type": [ - "null", - "number" - ] - }, - "internetEnabled": { - "default": false, - "description": "Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).", - "type": "boolean" - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "title": { - "default": "${productName} ${version}", - "description": "The title of the produced DMG, which will be shown when mounted (volume name).\n\nMacro `${productName}`, `${version}` and `${name}` are supported.", - "type": [ - "null", - "string" - ] - }, - "window": { - "$ref": "#/definitions/DmgWindow", - "description": "The DMG windows position and size." - } - }, - "title": "DmgOptions", - "type": "object" - }, - "DmgWindow": { - "additionalProperties": false, - "properties": { - "height": { - "description": "The height. Defaults to background image height or 380.", - "type": "number" - }, - "width": { - "description": "The width. Defaults to background image width or 540.", - "type": "number" - }, - "x": { - "default": 400, - "description": "The X position relative to left of the screen.", - "type": "number" - }, - "y": { - "default": 100, - "description": "The Y position relative to top of the screen.", - "type": "number" - } - }, - "title": "DmgWindow", - "type": "object" - }, - "ElectronDownloadOptions": { - "additionalProperties": false, - "properties": { - "arch": { - "type": "string" - }, - "cache": { - "description": "The [cache location](https://github.com/electron-userland/electron-download#cache-location).", - "type": [ - "null", - "string" - ] - }, - "customDir": { - "type": [ - "null", - "string" - ] - }, - "customFilename": { - "type": [ - "null", - "string" - ] - }, - "isVerifyChecksum": { - "type": "boolean" - }, - "mirror": { - "description": "The mirror.", - "type": [ - "null", - "string" - ] - }, - "platform": { - "enum": [ - "darwin", - "linux", - "mas", - "win32" - ], - "type": "string" - }, - "strictSSL": { - "type": "boolean" - }, - "version": { - "type": "string" - } - }, - "title": "ElectronDownloadOptions", - "type": "object" - }, - "FileAssociation": { - "additionalProperties": false, - "description": "File associations.\n\nmacOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)) and NSIS only.\n\nOn Windows works only if [nsis.perMachine](https://electron.build/configuration/configuration#NsisOptions-perMachine) is set to `true`.", - "properties": { - "description": { - "description": "*windows-only.* The description.", - "type": [ - "null", - "string" - ] - }, - "ext": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ], - "description": "The extension (minus the leading period). e.g. `png`." - }, - "icon": { - "description": "The path to icon (`.icns` for MacOS and `.ico` for Windows), relative to `build` (build resources directory). Defaults to `${firstExt}.icns`/`${firstExt}.ico` (if several extensions specified, first is used) or to application icon.\n\nNot supported on Linux, file issue if need (default icon will be `x-office-document`).", - "type": [ - "null", - "string" - ] - }, - "isPackage": { - "description": "*macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.", - "type": "boolean" - }, - "mimeType": { - "description": "*linux-only.* The mime-type.", - "type": [ - "null", - "string" - ] - }, - "name": { - "description": "The name. e.g. `PNG`. Defaults to `ext`.", - "type": [ - "null", - "string" - ] - }, - "role": { - "default": "Editor", - "description": "*macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.", - "type": "string" - } - }, - "required": [ - "ext" - ], - "title": "FileAssociation", - "type": "object" - }, - "FileSet": { - "additionalProperties": false, - "properties": { - "filter": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ], - "description": "The [glob patterns](/file-patterns)." - }, - "from": { - "description": "The source path relative to the project directory.", - "type": "string" - }, - "to": { - "description": "The destination path relative to the app's content directory for `extraFiles` and the app's resource directory for `extraResources`.", - "type": "string" - } - }, - "title": "FileSet", - "type": "object" - }, - "GenericServerOptions": { - "additionalProperties": false, - "description": "Generic (any HTTP(S) server) options.\nIn all publish options [File Macros](/file-patterns#file-macros) are supported.", - "properties": { - "channel": { - "default": "latest", - "description": "The channel.", - "type": [ - "null", - "string" - ] - }, - "provider": { - "description": "The provider. Must be `generic`.", - "enum": [ - "generic" - ], - "type": "string" - }, - "publishAutoUpdate": { - "default": true, - "description": "Whether to publish auto update info files.\n\nAuto update relies only on the first provider in the list (you can specify several publishers).\nThus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.", - "type": "boolean" - }, - "publisherName": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "updaterCacheDirName": { - "type": [ - "null", - "string" - ] - }, - "url": { - "description": "The base url. e.g. `https://bucket_name.s3.amazonaws.com`.", - "type": "string" - }, - "useMultipleRangeRequest": { - "description": "Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.", - "type": "boolean" - } - }, - "required": [ - "provider", - "url" - ], - "title": "GenericServerOptions", - "type": "object" - }, - "GithubOptions": { - "additionalProperties": false, - "description": "[GitHub](https://help.github.com/articles/about-releases/) options.\n\nGitHub [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) is required. You can generate by going to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). The access token should have the repo scope/permission.\nDefine `GH_TOKEN` environment variable.", - "properties": { - "host": { - "default": "github.com", - "description": "The host (including the port if need).", - "type": [ - "null", - "string" - ] - }, - "owner": { - "description": "The owner.", - "type": [ - "null", - "string" - ] - }, - "private": { - "description": "Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](/auto-update#private-github-update-repo).", - "type": [ - "null", - "boolean" - ] - }, - "protocol": { - "anyOf": [ - { - "enum": [ - "http", - "https" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "https", - "description": "The protocol. GitHub Publisher supports only `https`." - }, - "provider": { - "description": "The provider. Must be `github`.", - "enum": [ - "github" - ], - "type": "string" - }, - "publishAutoUpdate": { - "default": true, - "description": "Whether to publish auto update info files.\n\nAuto update relies only on the first provider in the list (you can specify several publishers).\nThus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.", - "type": "boolean" - }, - "publisherName": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "releaseType": { - "anyOf": [ - { - "enum": [ - "draft", - "prerelease", - "release" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "draft", - "description": "The type of release. By default `draft` release will be created.\n\nAlso you can set release type using environment variable. If `EP_DRAFT`is set to `true` — `draft`, if `EP_PRE_RELEASE`is set to `true` — `prerelease`." - }, - "repo": { - "description": "The repository name. [Detected automatically](#github-repository-and-bintray-package).", - "type": [ - "null", - "string" - ] - }, - "token": { - "description": "The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](/auto-update#appupdatersetfeedurloptions).", - "type": [ - "null", - "string" - ] - }, - "updaterCacheDirName": { - "type": [ - "null", - "string" - ] - }, - "vPrefixedTagName": { - "default": true, - "description": "Whether to use `v`-prefixed tag name.", - "type": "boolean" - } - }, - "required": [ - "provider" - ], - "title": "GithubOptions", - "type": "object" - }, - "LinuxConfiguration": { - "additionalProperties": false, - "properties": { - "appId": { - "default": "com.electron.${name}", - "description": "The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n[Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.", - "type": [ - "null", - "string" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).", - "type": [ - "null", - "string" - ] - }, - "asar": { - "anyOf": [ - { - "$ref": "#/definitions/AsarOptions" - }, - { - "type": [ - "null", - "boolean" - ] - } - ], - "default": true, - "description": "Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).\n\nNode modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work." - }, - "asarUnpack": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive." - }, - "category": { - "description": "The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).", - "type": [ - "null", - "string" - ] - }, - "compression": { - "anyOf": [ - { - "enum": [ - "maximum", - "normal", - "store" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "normal", - "description": "The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time." - }, - "cscKeyPassword": { - "type": [ - "null", - "string" - ] - }, - "cscLink": { - "type": [ - "null", - "string" - ] - }, - "depends": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "description": { - "description": "As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux.", - "type": [ - "null", - "string" - ] - }, - "desktop": { - "description": "The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value)." - }, - "detectUpdateChannel": { - "default": true, - "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.", - "type": "boolean" - }, - "electronUpdaterCompatibility": { - "description": "The [electron-updater compatibility](/auto-update#compatibility) semver range.", - "type": [ - "null", - "string" - ] - }, - "executableName": { - "description": "The executable name. Defaults to `productName`.\nCannot be specified per target, allowed only in the `linux`.", - "type": [ - "null", - "string" - ] - }, - "extraFiles": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "extraResources": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "fileAssociations": { - "anyOf": [ - { - "$ref": "#/definitions/FileAssociation" - }, - { - "items": { - "$ref": "#/definitions/FileAssociation" - }, - "type": "array" - } - ], - "description": "The file associations." - }, - "files": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "forceCodeSigning": { - "description": "Whether to fail if app will be not code signed.", - "type": "boolean" - }, - "generateUpdatesFilesForAllChannels": { - "default": false, - "description": "Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).", - "type": "boolean" - }, - "icon": { - "description": "The path to icon set directory or one png file, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. The icon filename must contain the size (e.g. 32x32.png) of the icon.\nBy default will be generated automatically based on the macOS icns file.", - "type": "string" - }, - "maintainer": { - "description": "The maintainer. Defaults to [author](/configuration/configuration#Metadata-author).", - "type": [ - "null", - "string" - ] - }, - "mimeTypes": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing." - }, - "packageCategory": { - "description": "backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place", - "type": [ - "null", - "string" - ] - }, - "protocols": { - "anyOf": [ - { - "$ref": "#/definitions/Protocol" - }, - { - "items": { - "$ref": "#/definitions/Protocol" - }, - "type": "array" - } - ], - "description": "The URL protocol schemes." - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "releaseInfo": { - "$ref": "#/definitions/ReleaseInfo", - "description": "The release info. Intended for command line usage:\n\n```\n-c.releaseInfo.releaseNotes=\"new features\"\n```" - }, - "synopsis": { - "description": "The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).", - "type": [ - "null", - "string" - ] - }, - "target": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "default": "AppImage", - "description": "Target package type: list of `AppImage`, `snap`, `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n\nelectron-builder [docker image](/multi-platform-build#docker) can be used to build Linux targets on any platform.\n\nPlease [do not put an AppImage into another archive](https://github.com/probonopd/AppImageKit/wiki/Creating-AppImages#common-mistake) like a .zip or .tar.gz." - }, - "vendor": { - "description": "The vendor. Defaults to [author](/configuration/configuration#Metadata-author).", - "type": [ - "null", - "string" - ] - } - }, - "title": "LinuxConfiguration", - "type": "object" - }, - "LinuxTargetSpecificOptions": { - "additionalProperties": false, - "properties": { - "afterInstall": { - "type": [ - "null", - "string" - ] - }, - "afterRemove": { - "type": [ - "null", - "string" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "category": { - "description": "The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).", - "type": [ - "null", - "string" - ] - }, - "compression": { - "anyOf": [ - { - "enum": [ - "bzip2", - "gz", - "xz" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "xz", - "description": "The compression type." - }, - "depends": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Package dependencies." - }, - "description": { - "description": "As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux.", - "type": [ - "null", - "string" - ] - }, - "desktop": { - "description": "The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value)." - }, - "fpm": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "*Advanced only* The [fpm](https://github.com/jordansissel/fpm/wiki#usage) options.\n\nExample: `[\"--before-install=build/deb-preinstall.sh\", \"--after-upgrade=build/deb-postinstall.sh\"]`" - }, - "icon": { - "type": "string" - }, - "maintainer": { - "type": [ - "null", - "string" - ] - }, - "mimeTypes": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing." - }, - "packageCategory": { - "description": "The package category.", - "type": [ - "null", - "string" - ] - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "synopsis": { - "description": "The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).", - "type": [ - "null", - "string" - ] - }, - "vendor": { - "type": [ - "null", - "string" - ] - } - }, - "title": "LinuxTargetSpecificOptions", - "type": "object" - }, - "MacConfiguration": { - "additionalProperties": false, - "properties": { - "appId": { - "default": "com.electron.${name}", - "description": "The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n[Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.", - "type": [ - "null", - "string" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).", - "type": [ - "null", - "string" - ] - }, - "asar": { - "anyOf": [ - { - "$ref": "#/definitions/AsarOptions" - }, - { - "type": [ - "null", - "boolean" - ] - } - ], - "default": true, - "description": "Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).\n\nNode modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work." - }, - "asarUnpack": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive." - }, - "binaries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Paths of any extra binaries that need to be signed." - }, - "bundleShortVersion": { - "description": "The `CFBundleShortVersionString`. Do not use it unless you need to.", - "type": [ - "null", - "string" - ] - }, - "bundleVersion": { - "description": "The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).", - "type": [ - "null", - "string" - ] - }, - "category": { - "description": "The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n\nFor example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n\nValid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).", - "type": [ - "null", - "string" - ] - }, - "compression": { - "anyOf": [ - { - "enum": [ - "maximum", - "normal", - "store" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "normal", - "description": "The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time." - }, - "cscInstallerKeyPassword": { - "type": [ - "null", - "string" - ] - }, - "cscInstallerLink": { - "type": [ - "null", - "string" - ] - }, - "cscKeyPassword": { - "type": [ - "null", - "string" - ] - }, - "cscLink": { - "type": [ - "null", - "string" - ] - }, - "darkModeSupport": { - "default": false, - "description": "Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.", - "type": "boolean" - }, - "detectUpdateChannel": { - "default": true, - "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.", - "type": "boolean" - }, - "electronLanguages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ], - "description": "The electron locales. By default Electron locales used as is." - }, - "electronUpdaterCompatibility": { - "description": "The [electron-updater compatibility](/auto-update#compatibility) semver range.", - "type": [ - "null", - "string" - ] - }, - "entitlements": { - "description": "The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\nMAS entitlements is specified in the [mas](/configuration/mas).", - "type": [ - "null", - "string" - ] - }, - "entitlementsInherit": { - "description": "The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\nOtherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist).\n\nThis option only applies when signing with `entitlements` provided.", - "type": [ - "null", - "string" - ] - }, - "extendInfo": { - "description": "The extra entries for `Info.plist`." - }, - "extraDistFiles": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "Extra files to put in archive. Not applicable for `tar.*`." - }, - "extraFiles": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "extraResources": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "fileAssociations": { - "anyOf": [ - { - "$ref": "#/definitions/FileAssociation" - }, - { - "items": { - "$ref": "#/definitions/FileAssociation" - }, - "type": "array" - } - ], - "description": "The file associations." - }, - "files": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "forceCodeSigning": { - "description": "Whether to fail if app will be not code signed.", - "type": "boolean" - }, - "generateUpdatesFilesForAllChannels": { - "default": false, - "description": "Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).", - "type": "boolean" - }, - "helperBundleId": { - "default": "${appBundleIdentifier}.helper", - "description": "The bundle identifier to use in the application helper's plist.", - "type": [ - "null", - "string" - ] - }, - "icon": { - "default": "build/icon.icns", - "description": "The path to application icon.", - "type": [ - "null", - "string" - ] - }, - "identity": { - "description": "The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\nMAS installer identity is specified in the [mas](/configuration/mas).", - "type": [ - "null", - "string" - ] - }, - "minimumSystemVersion": { - "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.", - "type": [ - "null", - "string" - ] - }, - "protocols": { - "anyOf": [ - { - "$ref": "#/definitions/Protocol" - }, - { - "items": { - "$ref": "#/definitions/Protocol" - }, - "type": "array" - } - ], - "description": "The URL protocol schemes." - }, - "provisioningProfile": { - "description": "The path to the provisioning profile to use when signing, absolute or relative to the app root.", - "type": [ - "null", - "string" - ] - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "releaseInfo": { - "$ref": "#/definitions/ReleaseInfo", - "description": "The release info. Intended for command line usage:\n\n```\n-c.releaseInfo.releaseNotes=\"new features\"\n```" - }, - "requirements": { - "description": "Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.", - "type": [ - "null", - "string" - ] - }, - "target": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "enum": [ - "7z", - "default", - "dir", - "dmg", - "mas", - "mas-dev", - "pkg", - "tar.bz2", - "tar.gz", - "tar.lz", - "tar.xz", - "zip" - ], - "type": "string" - } - ] - }, - "type": "array" - }, - { - "enum": [ - "7z", - "default", - "dir", - "dmg", - "mas", - "mas-dev", - "pkg", - "tar.bz2", - "tar.gz", - "tar.lz", - "tar.xz", - "zip" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac)." - }, - "type": { - "anyOf": [ - { - "enum": [ - "development", - "distribution" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "distribution", - "description": "Whether to sign app for development or for distribution." - } - }, - "title": "MacConfiguration", - "type": "object" - }, - "MasConfiguration": { - "additionalProperties": false, - "properties": { - "appId": { - "default": "com.electron.${name}", - "description": "The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n[Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.", - "type": [ - "null", - "string" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).", - "type": [ - "null", - "string" - ] - }, - "asar": { - "anyOf": [ - { - "$ref": "#/definitions/AsarOptions" - }, - { - "type": [ - "null", - "boolean" - ] - } - ], - "default": true, - "description": "Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).\n\nNode modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work." - }, - "asarUnpack": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive." - }, - "binaries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Paths of any extra binaries that need to be signed." - }, - "bundleShortVersion": { - "description": "The `CFBundleShortVersionString`. Do not use it unless you need to.", - "type": [ - "null", - "string" - ] - }, - "bundleVersion": { - "description": "The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).", - "type": [ - "null", - "string" - ] - }, - "category": { - "description": "The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n\nFor example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n\nValid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).", - "type": [ - "null", - "string" - ] - }, - "compression": { - "anyOf": [ - { - "enum": [ - "maximum", - "normal", - "store" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "normal", - "description": "The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time." - }, - "cscInstallerKeyPassword": { - "type": [ - "null", - "string" - ] - }, - "cscInstallerLink": { - "type": [ - "null", - "string" - ] - }, - "cscKeyPassword": { - "type": [ - "null", - "string" - ] - }, - "cscLink": { - "type": [ - "null", - "string" - ] - }, - "darkModeSupport": { - "default": false, - "description": "Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.", - "type": "boolean" - }, - "detectUpdateChannel": { - "default": true, - "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.", - "type": "boolean" - }, - "electronLanguages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ], - "description": "The electron locales. By default Electron locales used as is." - }, - "electronUpdaterCompatibility": { - "description": "The [electron-updater compatibility](/auto-update#compatibility) semver range.", - "type": [ - "null", - "string" - ] - }, - "entitlements": { - "description": "The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\nOtherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.plist).", - "type": [ - "null", - "string" - ] - }, - "entitlementsInherit": { - "description": "The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\nOtherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.inherit.plist).", - "type": [ - "null", - "string" - ] - }, - "extendInfo": { - "description": "The extra entries for `Info.plist`." - }, - "extraDistFiles": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "Extra files to put in archive. Not applicable for `tar.*`." - }, - "extraFiles": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "extraResources": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "fileAssociations": { - "anyOf": [ - { - "$ref": "#/definitions/FileAssociation" - }, - { - "items": { - "$ref": "#/definitions/FileAssociation" - }, - "type": "array" - } - ], - "description": "The file associations." - }, - "files": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "forceCodeSigning": { - "description": "Whether to fail if app will be not code signed.", - "type": "boolean" - }, - "generateUpdatesFilesForAllChannels": { - "default": false, - "description": "Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).", - "type": "boolean" - }, - "helperBundleId": { - "default": "${appBundleIdentifier}.helper", - "description": "The bundle identifier to use in the application helper's plist.", - "type": [ - "null", - "string" - ] - }, - "icon": { - "default": "build/icon.icns", - "description": "The path to application icon.", - "type": [ - "null", - "string" - ] - }, - "identity": { - "description": "The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\nMAS installer identity is specified in the [mas](/configuration/mas).", - "type": [ - "null", - "string" - ] - }, - "minimumSystemVersion": { - "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.", - "type": [ - "null", - "string" - ] - }, - "protocols": { - "anyOf": [ - { - "$ref": "#/definitions/Protocol" - }, - { - "items": { - "$ref": "#/definitions/Protocol" - }, - "type": "array" - } - ], - "description": "The URL protocol schemes." - }, - "provisioningProfile": { - "description": "The path to the provisioning profile to use when signing, absolute or relative to the app root.", - "type": [ - "null", - "string" - ] - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "releaseInfo": { - "$ref": "#/definitions/ReleaseInfo", - "description": "The release info. Intended for command line usage:\n\n```\n-c.releaseInfo.releaseNotes=\"new features\"\n```" - }, - "requirements": { - "description": "Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.", - "type": [ - "null", - "string" - ] - }, - "target": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "enum": [ - "7z", - "default", - "dir", - "dmg", - "mas", - "mas-dev", - "pkg", - "tar.bz2", - "tar.gz", - "tar.lz", - "tar.xz", - "zip" - ], - "type": "string" - } - ] - }, - "type": "array" - }, - { - "enum": [ - "7z", - "default", - "dir", - "dmg", - "mas", - "mas-dev", - "pkg", - "tar.bz2", - "tar.gz", - "tar.lz", - "tar.xz", - "zip" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac)." - }, - "type": { - "anyOf": [ - { - "enum": [ - "development", - "distribution" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "distribution", - "description": "Whether to sign app for development or for distribution." - } - }, - "title": "MasConfiguration", - "type": "object" - }, - "MetadataDirectories": { - "additionalProperties": false, - "properties": { - "app": { - "description": "The application directory (containing the application package.json), defaults to `app`, `www` or working directory.", - "type": [ - "null", - "string" - ] - }, - "buildResources": { - "default": "build", - "description": "The path to build resources.\n\nPlease note — build resources is not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`", - "type": [ - "null", - "string" - ] - }, - "output": { - "default": "dist", - "description": "The output directory. [File macros](/file-patterns#file-macros) are supported.", - "type": [ - "null", - "string" - ] - } - }, - "title": "MetadataDirectories", - "type": "object" - }, - "MsiOptions": { - "additionalProperties": false, - "properties": { - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "createDesktopShortcut": { - "default": true, - "description": "Whether to create desktop shortcut. Set to `always` if to recreate also on reinstall (even if removed by user).", - "enum": [ - "always", - false, - true - ] - }, - "createStartMenuShortcut": { - "default": true, - "description": "Whether to create start menu shortcut.", - "type": "boolean" - }, - "menuCategory": { - "default": false, - "description": "Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value.", - "type": [ - "string", - "boolean" - ] - }, - "oneClick": { - "default": true, - "description": "One-click installation.", - "type": "boolean" - }, - "perMachine": { - "default": false, - "description": "Whether to install per all users (per-machine).", - "type": "boolean" - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "runAfterFinish": { - "default": true, - "description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.", - "type": "boolean" - }, - "shortcutName": { - "description": "The name that will be used for all shortcuts. Defaults to the application name.", - "type": [ - "null", - "string" - ] - }, - "upgradeCode": { - "description": "The [upgrade code](https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx). Optional, by default generated using app id.", - "type": [ - "null", - "string" - ] - }, - "warningsAsErrors": { - "default": true, - "description": "If `warningsAsErrors` is `true` (default): treat warnings as errors. If `warningsAsErrors` is `false`: allow warnings.", - "type": "boolean" - } - }, - "title": "MsiOptions", - "type": "object" - }, - "NsisOptions": { - "additionalProperties": false, - "properties": { - "allowElevation": { - "default": true, - "description": "*assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.", - "type": "boolean" - }, - "allowToChangeInstallationDirectory": { - "default": false, - "description": "*assisted installer only.* Whether to allow user to change installation directory.", - "type": "boolean" - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Setup ${version}.${ext}`.", - "type": [ - "null", - "string" - ] - }, - "createDesktopShortcut": { - "default": true, - "description": "Whether to create desktop shortcut. Set to `always` if to recreate also on reinstall (even if removed by user).", - "enum": [ - "always", - false, - true - ] - }, - "createStartMenuShortcut": { - "default": true, - "description": "Whether to create start menu shortcut.", - "type": "boolean" - }, - "deleteAppDataOnUninstall": { - "default": false, - "description": "*one-click installer only.* Whether to delete app data on uninstall.", - "type": "boolean" - }, - "differentialPackage": { - "description": "Defaults to `true` for web installer (`nsis-web`)", - "type": "boolean" - }, - "displayLanguageSelector": { - "default": false, - "description": "Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).", - "type": "boolean" - }, - "guid": { - "description": "See [GUID vs Application Name](../configuration/nsis#guid-vs-application-name).", - "type": [ - "null", - "string" - ] - }, - "include": { - "description": "The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).", - "type": [ - "null", - "string" - ] - }, - "installerHeader": { - "default": "build/installerHeader.bmp", - "description": "*assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.", - "type": [ - "null", - "string" - ] - }, - "installerHeaderIcon": { - "description": "*one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/installerHeaderIcon.ico` or application icon.", - "type": [ - "null", - "string" - ] - }, - "installerIcon": { - "description": "The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/installerIcon.ico` or application icon.", - "type": [ - "null", - "string" - ] - }, - "installerLanguages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what." - }, - "installerSidebar": { - "description": "*assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`. Image size 164 × 314 pixels.", - "type": [ - "null", - "string" - ] - }, - "language": { - "description": "[LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).", - "type": [ - "null", - "string" - ] - }, - "license": { - "description": "The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n\nMultiple license files in different languages are supported — use lang postfix (e.g. `_de`, `_ru`)). For example, create files `license_de.txt` and `license_en.txt` in the build resources.\nIf OS language is german, `license_de.txt` will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js).\n\nAppropriate license file will be selected by user OS language.", - "type": [ - "null", - "string" - ] - }, - "menuCategory": { - "default": false, - "description": "Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value.", - "type": [ - "string", - "boolean" - ] - }, - "multiLanguageInstaller": { - "description": "Whether to create multi-language installer. Defaults to `unicode` option value.", - "type": "boolean" - }, - "oneClick": { - "default": true, - "description": "Whether to create one-click installer or assisted.", - "type": "boolean" - }, - "packElevateHelper": { - "default": true, - "description": "Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if `perMachine` is set to `true`.", - "type": "boolean" - }, - "perMachine": { - "default": false, - "description": "Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).\n\nIf `oneClick` is `true` (default): Whether to install per all users (per-machine).\n\nIf `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.\n\nIf `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.", - "type": "boolean" - }, - "preCompressedFileExtensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "default": [ - ".avi", - ".mov", - ".m4v", - ".mp4", - ".m4p", - ".qt", - ".mkv", - ".webm", - ".vmdk" - ], - "description": "The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files." - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "runAfterFinish": { - "default": true, - "description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.", - "type": "boolean" - }, - "script": { - "description": "The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).", - "type": [ - "null", - "string" - ] - }, - "shortcutName": { - "description": "The name that will be used for all shortcuts. Defaults to the application name.", - "type": [ - "null", - "string" - ] - }, - "unicode": { - "default": true, - "description": "Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).", - "type": "boolean" - }, - "uninstallDisplayName": { - "default": "${productName} ${version}", - "description": "The uninstaller display name in the control panel.", - "type": "string" - }, - "uninstallerIcon": { - "description": "The path to uninstaller icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/uninstallerIcon.ico` or application icon.", - "type": [ - "null", - "string" - ] - }, - "uninstallerSidebar": { - "description": "*assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`", - "type": [ - "null", - "string" - ] - }, - "useZip": { - "default": false, - "type": "boolean" - }, - "warningsAsErrors": { - "default": true, - "description": "If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.", - "type": "boolean" - } - }, - "title": "NsisOptions", - "type": "object" - }, - "NsisWebOptions": { - "additionalProperties": false, - "description": "Web Installer options.", - "properties": { - "allowElevation": { - "default": true, - "description": "*assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.", - "type": "boolean" - }, - "allowToChangeInstallationDirectory": { - "default": false, - "description": "*assisted installer only.* Whether to allow user to change installation directory.", - "type": "boolean" - }, - "appPackageUrl": { - "description": "The application package download URL. Optional — by default computed using publish configuration.\n\nURL like `https://example.com/download/latest` allows web installer to be version independent (installer will download latest application package).\nPlease note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).\n\nCustom `X-Arch` http header is set to `32` or `64`.", - "type": [ - "null", - "string" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`.", - "type": [ - "null", - "string" - ] - }, - "createDesktopShortcut": { - "default": true, - "description": "Whether to create desktop shortcut. Set to `always` if to recreate also on reinstall (even if removed by user).", - "enum": [ - "always", - false, - true - ] - }, - "createStartMenuShortcut": { - "default": true, - "description": "Whether to create start menu shortcut.", - "type": "boolean" - }, - "deleteAppDataOnUninstall": { - "default": false, - "description": "*one-click installer only.* Whether to delete app data on uninstall.", - "type": "boolean" - }, - "differentialPackage": { - "description": "Defaults to `true` for web installer (`nsis-web`)", - "type": "boolean" - }, - "displayLanguageSelector": { - "default": false, - "description": "Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).", - "type": "boolean" - }, - "guid": { - "description": "See [GUID vs Application Name](../configuration/nsis#guid-vs-application-name).", - "type": [ - "null", - "string" - ] - }, - "include": { - "description": "The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).", - "type": [ - "null", - "string" - ] - }, - "installerHeader": { - "default": "build/installerHeader.bmp", - "description": "*assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.", - "type": [ - "null", - "string" - ] - }, - "installerHeaderIcon": { - "description": "*one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/installerHeaderIcon.ico` or application icon.", - "type": [ - "null", - "string" - ] - }, - "installerIcon": { - "description": "The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/installerIcon.ico` or application icon.", - "type": [ - "null", - "string" - ] - }, - "installerLanguages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what." - }, - "installerSidebar": { - "description": "*assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`. Image size 164 × 314 pixels.", - "type": [ - "null", - "string" - ] - }, - "language": { - "description": "[LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).", - "type": [ - "null", - "string" - ] - }, - "license": { - "description": "The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n\nMultiple license files in different languages are supported — use lang postfix (e.g. `_de`, `_ru`)). For example, create files `license_de.txt` and `license_en.txt` in the build resources.\nIf OS language is german, `license_de.txt` will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js).\n\nAppropriate license file will be selected by user OS language.", - "type": [ - "null", - "string" - ] - }, - "menuCategory": { - "default": false, - "description": "Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value.", - "type": [ - "string", - "boolean" - ] - }, - "multiLanguageInstaller": { - "description": "Whether to create multi-language installer. Defaults to `unicode` option value.", - "type": "boolean" - }, - "oneClick": { - "default": true, - "description": "Whether to create one-click installer or assisted.", - "type": "boolean" - }, - "packElevateHelper": { - "default": true, - "description": "Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if `perMachine` is set to `true`.", - "type": "boolean" - }, - "perMachine": { - "default": false, - "description": "Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).\n\nIf `oneClick` is `true` (default): Whether to install per all users (per-machine).\n\nIf `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.\n\nIf `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.", - "type": "boolean" - }, - "preCompressedFileExtensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "default": [ - ".avi", - ".mov", - ".m4v", - ".mp4", - ".m4p", - ".qt", - ".mkv", - ".webm", - ".vmdk" - ], - "description": "The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files." - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "runAfterFinish": { - "default": true, - "description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.", - "type": "boolean" - }, - "script": { - "description": "The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).", - "type": [ - "null", - "string" - ] - }, - "shortcutName": { - "description": "The name that will be used for all shortcuts. Defaults to the application name.", - "type": [ - "null", - "string" - ] - }, - "unicode": { - "default": true, - "description": "Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).", - "type": "boolean" - }, - "uninstallDisplayName": { - "default": "${productName} ${version}", - "description": "The uninstaller display name in the control panel.", - "type": "string" - }, - "uninstallerIcon": { - "description": "The path to uninstaller icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `build/uninstallerIcon.ico` or application icon.", - "type": [ - "null", - "string" - ] - }, - "uninstallerSidebar": { - "description": "*assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\nDefaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`", - "type": [ - "null", - "string" - ] - }, - "useZip": { - "default": false, - "type": "boolean" - }, - "warningsAsErrors": { - "default": true, - "description": "If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.", - "type": "boolean" - } - }, - "title": "NsisWebOptions", - "type": "object" - }, - "PkgBackgroundOptions": { - "additionalProperties": false, - "description": "Options for the background image in a PKG installer", - "properties": { - "alignment": { - "anyOf": [ - { - "enum": [ - "bottom", - "bottomleft", - "bottomright", - "center", - "left", - "right", - "top", - "topleft", - "topright" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "center", - "description": "Alignment of the background image.\nOptions are: center, left, right, top, bottom, topleft, topright, bottomleft, bottomright" - }, - "file": { - "description": "Path to the image to use as an installer background.", - "type": "string" - }, - "scaling": { - "anyOf": [ - { - "enum": [ - "none", - "proportional", - "tofit" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "tofit", - "description": "Scaling of the background image.\nOptions are: tofit, none, proportional" - } - }, - "title": "PkgBackgroundOptions", - "type": "object" - }, - "PkgOptions": { - "additionalProperties": false, - "description": "macOS product archive options.", - "properties": { - "allowAnywhere": { - "default": true, - "description": "Whether can be installed at the root of any volume, including non-system volumes. Otherwise, it cannot be installed at the root of a volume.\n\nCorresponds to [enable_anywhere](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).", - "type": [ - "null", - "boolean" - ] - }, - "allowCurrentUserHome": { - "default": true, - "description": "Whether can be installed into the current user’s home directory.\nA home directory installation is done as the current user (not as root), and it cannot write outside of the home directory.\nIf the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.\n\nCorresponds to [enable_currentUserHome](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).", - "type": [ - "null", - "boolean" - ] - }, - "allowRootDirectory": { - "default": true, - "description": "Whether can be installed into the root directory. Should usually be `true` unless the product can be installed only to the user’s home directory.\n\nCorresponds to [enable_localSystem](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).", - "type": [ - "null", - "boolean" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "background": { - "anyOf": [ - { - "$ref": "#/definitions/PkgBackgroundOptions" - }, - { - "type": "null" - } - ], - "description": "Options for the background image for the installer." - }, - "conclusion": { - "description": "The path to the conclusion file. This may be used to customize the text on the final \"Summary\" page of the installer.", - "type": [ - "null", - "string" - ] - }, - "hasStrictIdentifier": { - "default": true, - "description": "Require identical bundle identifiers at install path?", - "type": [ - "null", - "boolean" - ] - }, - "identity": { - "description": "The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.", - "type": [ - "null", - "string" - ] - }, - "installLocation": { - "default": "/Applications", - "description": "The install location. [Do not use it](https://stackoverflow.com/questions/12863944/how-do-you-specify-a-default-install-location-to-home-with-pkgbuild) to create per-user package.\nMostly never you will need to change this option. `/Applications` would install it as expected into `/Applications` if the local system domain is chosen, or into `$HOME/Applications` if the home installation is chosen.", - "type": [ - "null", - "string" - ] - }, - "isRelocatable": { - "default": true, - "description": "Install bundle over previous version if moved by user?", - "type": [ - "null", - "boolean" - ] - }, - "isVersionChecked": { - "default": true, - "description": "Don't install bundle if newer version on disk?", - "type": [ - "null", - "boolean" - ] - }, - "license": { - "description": "The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).", - "type": [ - "null", - "string" - ] - }, - "overwriteAction": { - "anyOf": [ - { - "enum": [ - "update", - "upgrade" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "upgrade", - "description": "Specifies how an existing version of the bundle on disk should be handled when the version in\nthe package is installed.\n\nIf you specify upgrade, the bundle in the package atomi-cally replaces any version on disk;\nthis has the effect of deleting old paths that no longer exist in the new version of\nthe bundle.\n\nIf you specify update, the bundle in the package overwrites the version on disk, and any files\nnot contained in the package will be left intact; this is appropriate when you are delivering\nan update-only package.\n\nAnother effect of update is that the package bundle will not be installed at all if there is\nnot already a version on disk; this allows a package to deliver an update for an app that\nthe user might have deleted." - }, - "productbuild": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "should be not documented, only to experiment" - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "scripts": { - "default": "build/pkg-scripts", - "description": "The scripts directory, relative to `build` (build resources directory).\nThe scripts can be in any language so long as the files are marked executable and have the appropriate shebang indicating the path to the interpreter.\nScripts are required to be executable (`chmod +x file`).", - "type": [ - "null", - "string" - ] - }, - "welcome": { - "description": "The path to the welcome file. This may be used to customize the text on the Introduction page of the installer.", - "type": [ - "null", - "string" - ] - } - }, - "title": "PkgOptions", - "type": "object" - }, - "PlugDescriptor": { - "additionalProperties": { - "anyOf": [ - { - "additionalProperties": { - }, - "type": "object" - }, - { - "type": "null" - } - ] - }, - "title": "PlugDescriptor", - "type": "object" - }, - "PortableOptions": { - "additionalProperties": false, - "description": "Portable options.", - "properties": { - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "guid": { - "description": "See [GUID vs Application Name](../configuration/nsis#guid-vs-application-name).", - "type": [ - "null", - "string" - ] - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "requestExecutionLevel": { - "default": "user", - "description": "The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows.", - "enum": [ - "admin", - "highest", - "user" - ], - "type": "string" - }, - "unicode": { - "default": true, - "description": "Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).", - "type": "boolean" - }, - "useZip": { - "default": false, - "type": "boolean" - }, - "warningsAsErrors": { - "default": true, - "description": "If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.", - "type": "boolean" - } - }, - "title": "PortableOptions", - "type": "object" - }, - "Protocol": { - "additionalProperties": false, - "description": "URL Protocol Schemes. Protocols to associate the app with. macOS only.\n\nPlease note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).", - "properties": { - "name": { - "description": "The name. e.g. `IRC server URL`.", - "type": "string" - }, - "role": { - "default": "Editor", - "description": "*macOS-only* The app’s role with respect to the type.", - "enum": [ - "Editor", - "None", - "Shell", - "Viewer" - ], - "type": "string" - }, - "schemes": { - "description": "The schemes. e.g. `[\"irc\", \"ircs\"]`.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name", - "schemes" - ], - "title": "Protocol", - "type": "object" - }, - "PublishProvider": { - "enum": [ - "bintray", - "custom", - "generic", - "github", - "s3", - "spaces" - ], - "title": "PublishProvider", - "type": "string" - }, - "ReleaseInfo": { - "additionalProperties": false, - "properties": { - "releaseDate": { - "description": "The release date.", - "type": "string" - }, - "releaseName": { - "description": "The release name.", - "type": [ - "null", - "string" - ] - }, - "releaseNotes": { - "description": "The release notes.", - "type": [ - "null", - "string" - ] - }, - "releaseNotesFile": { - "description": "The path to release notes file. Defaults to `release-notes-${platform}.md` (where `platform` it is current platform — `mac`, `linux` or `windows`) or `release-notes.md` in the [build resources](#MetadataDirectories-buildResources).", - "type": [ - "null", - "string" - ] - } - }, - "title": "ReleaseInfo", - "type": "object" - }, - "S3Options": { - "additionalProperties": false, - "properties": { - "acl": { - "anyOf": [ - { - "enum": [ - "private", - "public-read" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "public-read", - "description": "The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n\nPlease see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128)." - }, - "bucket": { - "description": "The bucket name.", - "type": "string" - }, - "channel": { - "default": "latest", - "description": "The update channel.", - "type": [ - "null", - "string" - ] - }, - "encryption": { - "anyOf": [ - { - "enum": [ - "AES256", - "aws:kms" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Server-side encryption algorithm to use for the object." - }, - "endpoint": { - "description": "The endpoint URI to send requests to. The default endpoint is built from the configured region.\nThe endpoint should be a string like `https://{service}.{region}.amazonaws.com`.", - "type": [ - "null", - "string" - ] - }, - "path": { - "default": "/", - "description": "The directory path.", - "type": [ - "null", - "string" - ] - }, - "provider": { - "description": "The provider. Must be `s3`.", - "enum": [ - "s3" - ], - "type": "string" - }, - "publishAutoUpdate": { - "default": true, - "description": "Whether to publish auto update info files.\n\nAuto update relies only on the first provider in the list (you can specify several publishers).\nThus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.", - "type": "boolean" - }, - "publisherName": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "region": { - "description": "The region. Is determined and set automatically when publishing.", - "type": [ - "null", - "string" - ] - }, - "storageClass": { - "anyOf": [ - { - "enum": [ - "REDUCED_REDUNDANCY", - "STANDARD", - "STANDARD_IA" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "STANDARD", - "description": "The type of storage to use for the object." - }, - "updaterCacheDirName": { - "type": [ - "null", - "string" - ] - } - }, - "required": [ - "bucket", - "provider" - ], - "title": "S3Options", - "type": "object" - }, - "SnapOptions": { - "additionalProperties": false, - "properties": { - "after": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Specifies any [parts](https://snapcraft.io/docs/reference/parts) that should be built before this part.\nDefaults to `[\"desktop-gtk2\"\"]`.\n\nIf list contains `default`, it will be replaced to default list, so, `[\"default\", \"foo\"]` can be used to add custom parts `foo` in addition to defaults." - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "assumes": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The list of features that must be supported by the core in order for this snap to install." - }, - "buildPackages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The list of debian packages needs to be installed for building this snap." - }, - "category": { - "description": "The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).", - "type": [ - "null", - "string" - ] - }, - "confinement": { - "anyOf": [ - { - "enum": [ - "classic", - "devmode", - "strict" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "strict", - "description": "The type of [confinement](https://snapcraft.io/docs/reference/confinement) supported by the snap." - }, - "description": { - "description": "As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux.", - "type": [ - "null", - "string" - ] - }, - "desktop": { - "description": "The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value)." - }, - "environment": { - "anyOf": [ - { - }, - { - "type": "null" - } - ], - "description": "The custom environment. Defaults to `{\"TMPDIR: \"$XDG_RUNTIME_DIR\"}`. If you set custom, it will be merged with default." - }, - "grade": { - "anyOf": [ - { - "enum": [ - "devel", - "stable" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "stable", - "description": "The quality grade of the snap. It can be either `devel` (i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels)." - }, - "hooks": { - "default": "build/snap-hooks", - "description": "The [hooks](https://docs.snapcraft.io/build-snaps/hooks) directory, relative to `build` (build resources directory).", - "type": [ - "null", - "string" - ] - }, - "mimeTypes": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing." - }, - "plugs": { - "anyOf": [ - { - "$ref": "#/definitions/PlugDescriptor" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/PlugDescriptor" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The list of [plugs](https://snapcraft.io/docs/reference/interfaces).\nDefaults to `[\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"pulseaudio\", \"opengl\"]`.\n\nIf list contains `default`, it will be replaced to default list, so, `[\"default\", \"foo\"]` can be used to add custom plug `foo` in addition to defaults.\n\nAdditional attributes can be specified using object instead of just name of plug:\n```\n[\n {\n \"browser-sandbox\": {\n \"interface\": \"browser-support\",\n \"allow-sandbox\": true\n },\n },\n \"another-simple-plug-name\"\n]\n```" - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "stagePackages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The list of Ubuntu packages to use that are needed to support the `app` part creation. Like `depends` for `deb`.\nDefaults to `[\"libasound2\", \"libgconf2-4\", \"libnotify4\", \"libnspr4\", \"libnss3\", \"libpcre3\", \"libpulse0\", \"libxss1\", \"libxtst6\"]`.\n\nIf list contains `default`, it will be replaced to default list, so, `[\"default\", \"foo\"]` can be used to add custom package `foo` in addition to defaults." - }, - "summary": { - "description": "The 78 character long summary. Defaults to [productName](/configuration/configuration#Configuration-productName).", - "type": [ - "null", - "string" - ] - }, - "synopsis": { - "description": "The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).", - "type": [ - "null", - "string" - ] - }, - "useTemplateApp": { - "description": "Whether to use template snap. Defaults to `true` if `stagePackages` not specified.", - "type": "boolean" - } - }, - "title": "SnapOptions", - "type": "object" - }, - "SpacesOptions": { - "additionalProperties": false, - "description": "[DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.\nAccess key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.", - "properties": { - "acl": { - "anyOf": [ - { - "enum": [ - "private", - "public-read" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "public-read", - "description": "The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822)." - }, - "channel": { - "default": "latest", - "description": "The update channel.", - "type": [ - "null", - "string" - ] - }, - "name": { - "description": "The space name.", - "type": "string" - }, - "path": { - "default": "/", - "description": "The directory path.", - "type": [ - "null", - "string" - ] - }, - "provider": { - "description": "The provider. Must be `spaces`.", - "enum": [ - "spaces" - ], - "type": "string" - }, - "publishAutoUpdate": { - "default": true, - "description": "Whether to publish auto update info files.\n\nAuto update relies only on the first provider in the list (you can specify several publishers).\nThus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.", - "type": "boolean" - }, - "publisherName": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "region": { - "description": "The region (e.g. `nyc3`).", - "type": "string" - }, - "updaterCacheDirName": { - "type": [ - "null", - "string" - ] - } - }, - "required": [ - "name", - "provider", - "region" - ], - "title": "SpacesOptions", - "type": "object" - }, - "SquirrelWindowsOptions": { - "additionalProperties": false, - "properties": { - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template).", - "type": [ - "null", - "string" - ] - }, - "iconUrl": { - "description": "A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). Defaults to the Electron icon.\n\nPlease note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http.\n\nIf you don't plan to build windows installer, you can omit it.\nIf your project repository is public on GitHub, it will be `https://github.com/${u}/${p}/blob/master/build/icon.ico?raw=true` by default.", - "type": [ - "null", - "string" - ] - }, - "loadingGif": { - "description": "The path to a .gif file to display during install. `build/install-spinner.gif` will be used if exists (it is a recommended way to set)\n(otherwise [default](https://github.com/electron/windows-installer/blob/master/resources/install-spinner.gif)).", - "type": [ - "null", - "string" - ] - }, - "msi": { - "description": "Whether to create an MSI installer. Defaults to `false` (MSI is not created).", - "type": "boolean" - }, - "name": { - "description": "https://github.com/electron-userland/electron-builder/issues/1743", - "type": "string" - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "remoteReleases": { - "description": "A URL to your existing updates. Or `true` to automatically set to your GitHub repository. If given, these will be downloaded to create delta updates.", - "type": [ - "null", - "string", - "boolean" - ] - }, - "remoteToken": { - "description": "Authentication token for remote updates", - "type": [ - "null", - "string" - ] - }, - "useAppIdAsId": { - "description": "Use `appId` to identify package instead of `name`.", - "type": "boolean" - } - }, - "title": "SquirrelWindowsOptions", - "type": "object" - }, - "TargetConfiguration": { - "additionalProperties": false, - "properties": { - "arch": { - "anyOf": [ - { - "items": { - "enum": [ - "arm64", - "armv7l", - "ia32", - "x64" - ], - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "arm64", - "armv7l", - "ia32", - "x64" - ], - "type": "string" - } - ], - "description": "The arch or list of archs." - }, - "target": { - "description": "The target name. e.g. `snap`.", - "type": "string" - } - }, - "required": [ - "target" - ], - "title": "TargetConfiguration", - "type": "object" - }, - "WindowsConfiguration": { - "additionalProperties": false, - "properties": { - "additionalCertificateFile": { - "description": "The path to an additional certificate file you want to add to the signature block.", - "type": [ - "null", - "string" - ] - }, - "appId": { - "default": "com.electron.${name}", - "description": "The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n[Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.", - "type": [ - "null", - "string" - ] - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).", - "type": [ - "null", - "string" - ] - }, - "asar": { - "anyOf": [ - { - "$ref": "#/definitions/AsarOptions" - }, - { - "type": [ - "null", - "boolean" - ] - } - ], - "default": true, - "description": "Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).\n\nNode modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work." - }, - "asarUnpack": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive." - }, - "certificateFile": { - "description": "The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\nPlease see [Code Signing](/code-signing).", - "type": [ - "null", - "string" - ] - }, - "certificatePassword": { - "description": "The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\nPlease see [Code Signing](/code-signing).", - "type": [ - "null", - "string" - ] - }, - "certificateSha1": { - "description": "The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).", - "type": [ - "null", - "string" - ] - }, - "certificateSubjectName": { - "description": "The name of the subject of the signing certificate. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).", - "type": [ - "null", - "string" - ] - }, - "compression": { - "anyOf": [ - { - "enum": [ - "maximum", - "normal", - "store" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "normal", - "description": "The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time." - }, - "cscKeyPassword": { - "type": [ - "null", - "string" - ] - }, - "cscLink": { - "type": [ - "null", - "string" - ] - }, - "detectUpdateChannel": { - "default": true, - "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.", - "type": "boolean" - }, - "electronUpdaterCompatibility": { - "description": "The [electron-updater compatibility](/auto-update#compatibility) semver range.", - "type": [ - "null", - "string" - ] - }, - "extraFiles": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "extraResources": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "fileAssociations": { - "anyOf": [ - { - "$ref": "#/definitions/FileAssociation" - }, - { - "items": { - "$ref": "#/definitions/FileAssociation" - }, - "type": "array" - } - ], - "description": "The file associations." - }, - "files": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "forceCodeSigning": { - "description": "Whether to fail if app will be not code signed.", - "type": "boolean" - }, - "generateUpdatesFilesForAllChannels": { - "default": false, - "description": "Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).", - "type": "boolean" - }, - "icon": { - "default": "build/icon.ico", - "description": "The path to application icon.", - "type": [ - "null", - "string" - ] - }, - "legalTrademarks": { - "description": "The trademarks and registered trademarks.", - "type": [ - "null", - "string" - ] - }, - "protocols": { - "anyOf": [ - { - "$ref": "#/definitions/Protocol" - }, - { - "items": { - "$ref": "#/definitions/Protocol" - }, - "type": "array" - } - ], - "description": "The URL protocol schemes." - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "publisherName": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "[The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\nDefaults to common name from your code signing certificate." - }, - "releaseInfo": { - "$ref": "#/definitions/ReleaseInfo", - "description": "The release info. Intended for command line usage:\n\n```\n-c.releaseInfo.releaseNotes=\"new features\"\n```" - }, - "requestedExecutionLevel": { - "anyOf": [ - { - "enum": [ - "asInvoker", - "highestAvailable", - "requireAdministrator" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "asInvoker", - "description": "The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\nCannot be specified per target, allowed only in the `win`." - }, - "rfc3161TimeStampServer": { - "default": "http://timestamp.comodoca.com/rfc3161", - "description": "The URL of the RFC 3161 time stamp server.", - "type": [ - "null", - "string" - ] - }, - "sign": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The custom function (or path to file or module id) to sign Windows executable." - }, - "signAndEditExecutable": { - "default": true, - "description": "Whether to sign and add metadata to executable. Advanced option.", - "type": "boolean" - }, - "signDlls": { - "default": false, - "description": "Whether to sign DLL files. Advanced option.", - "type": "boolean" - }, - "signingHashAlgorithms": { - "anyOf": [ - { - "items": { - "enum": [ - "sha1", - "sha256" - ], - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": "['sha1', 'sha256']", - "description": "Array of signing algorithms used. For AppX `sha256` is always used." - }, - "target": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "default": "nsis", - "description": "The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable](/configuration/nsis#portable) app without installation), `appx`, `msi`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\nAppX package can be built only on Windows 10.\n\nTo use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency." - }, - "timeStampServer": { - "default": "http://timestamp.verisign.com/scripts/timstamp.dll", - "description": "The URL of the time stamp server.", - "type": [ - "null", - "string" - ] - }, - "verifyUpdateCodeSignature": { - "default": true, - "description": "Whether to verify the signature of an available update before installation.\nThe [publisher name](#publisherName) will be used for the signature verification.", - "type": "boolean" - } - }, - "title": "WindowsConfiguration", - "type": "object" - } - }, - "description": "Configuration Options", - "properties": { - "afterAllArtifactBuild": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild)." - }, - "afterPack": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign)." - }, - "afterSign": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format)." - }, - "apk": { - "anyOf": [ - { - "$ref": "#/definitions/LinuxTargetSpecificOptions" - }, - { - "type": "null" - } - ] - }, - "appId": { - "default": "com.electron.${name}", - "description": "The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n[Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.", - "type": [ - "null", - "string" - ] - }, - "appImage": { - "anyOf": [ - { - "$ref": "#/definitions/AppImageOptions" - }, - { - "type": "null" - } - ], - "description": "AppImage options." - }, - "appx": { - "anyOf": [ - { - "$ref": "#/definitions/AppXOptions" - }, - { - "type": "null" - } - ] - }, - "artifactBuildCompleted": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The function (or path to file or module id) to be run on artifact build completed." - }, - "artifactBuildStarted": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The function (or path to file or module id) to be run on artifact build start." - }, - "artifactName": { - "description": "The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).", - "type": [ - "null", - "string" - ] - }, - "asar": { - "anyOf": [ - { - "$ref": "#/definitions/AsarOptions" - }, - { - "type": [ - "null", - "boolean" - ] - } - ], - "default": true, - "description": "Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).\n\nNode modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work." - }, - "asarUnpack": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive." - }, - "beforeBuild": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n\nIf provided and `node_modules` are missing, it will not invoke production dependencies check." - }, - "buildDependenciesFromSource": { - "default": false, - "description": "Whether to build the application native dependencies from source.", - "type": "boolean" - }, - "buildVersion": { - "description": "The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\nIf `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_NUMBER` or `bamboo.buildNumber` env defined, it will be used as a build version (`version.build_number`).", - "type": [ - "null", - "string" - ] - }, - "compression": { - "anyOf": [ - { - "enum": [ - "maximum", - "normal", - "store" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "normal", - "description": "The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time." - }, - "copyright": { - "default": "Copyright © year ${author}", - "description": "The human-readable copyright line for the app.", - "type": [ - "null", - "string" - ] - }, - "cscKeyPassword": { - "type": [ - "null", - "string" - ] - }, - "cscLink": { - "type": [ - "null", - "string" - ] - }, - "deb": { - "anyOf": [ - { - "$ref": "#/definitions/DebOptions" - }, - { - "type": "null" - } - ], - "description": "Debian package options." - }, - "detectUpdateChannel": { - "default": true, - "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.", - "type": "boolean" - }, - "directories": { - "anyOf": [ - { - "$ref": "#/definitions/MetadataDirectories" - }, - { - "type": "null" - } - ] - }, - "dmg": { - "anyOf": [ - { - "$ref": "#/definitions/DmgOptions" - }, - { - "type": "null" - } - ], - "description": "macOS DMG options." - }, - "electronCompile": { - "description": "Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.", - "type": "boolean" - }, - "electronDist": { - "description": "The path to custom Electron build (e.g. `~/electron/out/R`).", - "type": "string" - }, - "electronDownload": { - "$ref": "#/definitions/ElectronDownloadOptions", - "description": "The [electron-download](https://github.com/electron-userland/electron-download#usage) options." - }, - "electronUpdaterCompatibility": { - "description": "The [electron-updater compatibility](/auto-update#compatibility) semver range.", - "type": [ - "null", - "string" - ] - }, - "electronVersion": { - "description": "The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.", - "type": [ - "null", - "string" - ] - }, - "extends": { - "description": "The name of a built-in configuration preset or path to config file (relative to project dir). Currently, only `react-cra` is supported.\n\nIf `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.", - "type": [ - "null", - "string" - ] - }, - "extraFiles": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "extraMetadata": { - "description": "Inject properties to `package.json`." - }, - "extraResources": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "fileAssociations": { - "anyOf": [ - { - "$ref": "#/definitions/FileAssociation" - }, - { - "items": { - "$ref": "#/definitions/FileAssociation" - }, - "type": "array" - } - ], - "description": "The file associations." - }, - "files": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/FileSet" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "forceCodeSigning": { - "description": "Whether to fail if app will be not code signed.", - "type": "boolean" - }, - "framework": { - "description": "The framework name. One of `electron`, `proton-native`, `libui`. Defaults to `electron`.", - "type": [ - "null", - "string" - ] - }, - "freebsd": { - "anyOf": [ - { - "$ref": "#/definitions/LinuxTargetSpecificOptions" - }, - { - "type": "null" - } - ] - }, - "generateUpdatesFilesForAllChannels": { - "default": false, - "description": "Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).", - "type": "boolean" - }, - "icon": { - "type": [ - "null", - "string" - ] - }, - "includePdb": { - "default": false, - "description": "Whether to include PDB files.", - "type": "boolean" - }, - "launchUiVersion": { - "description": "*libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.", - "type": [ - "null", - "string", - "boolean" - ] - }, - "linux": { - "anyOf": [ - { - "$ref": "#/definitions/LinuxConfiguration" - }, - { - "type": "null" - } - ], - "description": "Options related to how build Linux targets." - }, - "mac": { - "anyOf": [ - { - "$ref": "#/definitions/MacConfiguration" - }, - { - "type": "null" - } - ], - "description": "Options related to how build macOS targets." - }, - "mas": { - "anyOf": [ - { - "$ref": "#/definitions/MasConfiguration" - }, - { - "type": "null" - } - ], - "description": "MAS (Mac Application Store) options." - }, - "msi": { - "anyOf": [ - { - "$ref": "#/definitions/MsiOptions" - }, - { - "type": "null" - } - ] - }, - "muonVersion": { - "description": "The version of muon you are packaging for.", - "type": [ - "null", - "string" - ] - }, - "nodeGypRebuild": { - "default": false, - "description": "Whether to execute `node-gyp rebuild` before starting to package the app.\n\nDon't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.", - "type": "boolean" - }, - "nodeVersion": { - "description": "*libui-based frameworks only* The version of NodeJS you are packaging for.\nYou can set it to `current` to set the Node.js version that you use to run.", - "type": [ - "null", - "string" - ] - }, - "npmArgs": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "Additional command line arguments to use when installing app native deps." - }, - "npmRebuild": { - "default": true, - "description": "Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.", - "type": "boolean" - }, - "npmSkipBuildFromSource": { - "type": "boolean" - }, - "nsis": { - "anyOf": [ - { - "$ref": "#/definitions/NsisOptions" - }, - { - "type": "null" - } - ] - }, - "nsisWeb": { - "anyOf": [ - { - "$ref": "#/definitions/NsisWebOptions" - }, - { - "type": "null" - } - ] - }, - "onNodeModuleFile": { - "anyOf": [ - { - "typeof": "function" - }, - { - "type": [ - "null", - "string" - ] - } - ], - "description": "The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file." - }, - "p5p": { - "anyOf": [ - { - "$ref": "#/definitions/LinuxTargetSpecificOptions" - }, - { - "type": "null" - } - ] - }, - "pacman": { - "anyOf": [ - { - "$ref": "#/definitions/LinuxTargetSpecificOptions" - }, - { - "type": "null" - } - ] - }, - "pkg": { - "anyOf": [ - { - "$ref": "#/definitions/PkgOptions" - }, - { - "type": "null" - } - ], - "description": "macOS PKG options." - }, - "portable": { - "anyOf": [ - { - "$ref": "#/definitions/PortableOptions" - }, - { - "type": "null" - } - ] - }, - "productName": { - "description": "As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).", - "type": [ - "null", - "string" - ] - }, - "protocols": { - "anyOf": [ - { - "$ref": "#/definitions/Protocol" - }, - { - "items": { - "$ref": "#/definitions/Protocol" - }, - "type": "array" - } - ], - "description": "The URL protocol schemes." - }, - "protonNodeVersion": { - "type": [ - "null", - "string" - ] - }, - "publish": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GithubOptions" - }, - { - "$ref": "#/definitions/S3Options" - }, - { - "$ref": "#/definitions/SpacesOptions" - }, - { - "$ref": "#/definitions/GenericServerOptions" - }, - { - "$ref": "#/definitions/BintrayOptions" - }, - { - "$ref": "#/definitions/CustomPublishOptions" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "readonly": { - "default": false, - "description": "Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).", - "type": "boolean" - }, - "releaseInfo": { - "$ref": "#/definitions/ReleaseInfo", - "description": "The release info. Intended for command line usage:\n\n```\n-c.releaseInfo.releaseNotes=\"new features\"\n```" - }, - "remoteBuild": { - "default": true, - "description": "Whether to build using Electron Build Service if target not supported on current OS.", - "type": "boolean" - }, - "removePackageScripts": { - "default": true, - "description": "Whether to remove `scripts` field from `package.json` files.", - "type": "boolean" - }, - "rpm": { - "anyOf": [ - { - "$ref": "#/definitions/LinuxTargetSpecificOptions" - }, - { - "type": "null" - } - ] - }, - "snap": { - "anyOf": [ - { - "$ref": "#/definitions/SnapOptions" - }, - { - "type": "null" - } - ], - "description": "Snap options." - }, - "squirrelWindows": { - "anyOf": [ - { - "$ref": "#/definitions/SquirrelWindowsOptions" - }, - { - "type": "null" - } - ] - }, - "target": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/TargetConfiguration" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - { - "type": [ - "null", - "string" - ] - } - ] - }, - "win": { - "anyOf": [ - { - "$ref": "#/definitions/WindowsConfiguration" - }, - { - "type": "null" - } - ], - "description": "Options related to how build Windows targets." - } - }, - "type": "object" -} - diff --git a/node_modules/app-builder-lib/templates/appx/appxmanifest.xml b/node_modules/app-builder-lib/templates/appx/appxmanifest.xml deleted file mode 100644 index d01c43b..0000000 --- a/node_modules/app-builder-lib/templates/appx/appxmanifest.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - ${displayName} - ${publisherDisplayName} - ${description} - ${logo} - - - ${resourceLanguages} - - - - - - - - - - - ${lockScreen} - ${defaultTile} - ${splashScreen} - - ${extensions} - - - diff --git a/node_modules/app-builder-lib/templates/appx/priconfig.xml b/node_modules/app-builder-lib/templates/appx/priconfig.xml deleted file mode 100644 index 2a4b2e1..0000000 --- a/node_modules/app-builder-lib/templates/appx/priconfig.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/128x128.png b/node_modules/app-builder-lib/templates/icons/electron-linux/128x128.png deleted file mode 100644 index 0c136f4..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/128x128.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/16x16.png b/node_modules/app-builder-lib/templates/icons/electron-linux/16x16.png deleted file mode 100644 index 6193049..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/16x16.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/24x24.png b/node_modules/app-builder-lib/templates/icons/electron-linux/24x24.png deleted file mode 100644 index 7d913ad..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/24x24.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/256x256.png b/node_modules/app-builder-lib/templates/icons/electron-linux/256x256.png deleted file mode 100644 index 7bef37a..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/256x256.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/32x32.png b/node_modules/app-builder-lib/templates/icons/electron-linux/32x32.png deleted file mode 100644 index 4b9c45f..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/32x32.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/48x48.png b/node_modules/app-builder-lib/templates/icons/electron-linux/48x48.png deleted file mode 100644 index 8fef48a..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/48x48.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/64x64.png b/node_modules/app-builder-lib/templates/icons/electron-linux/64x64.png deleted file mode 100644 index 651fd19..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/64x64.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/electron-linux/96x96.png b/node_modules/app-builder-lib/templates/icons/electron-linux/96x96.png deleted file mode 100644 index 120e375..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/electron-linux/96x96.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/1024x1024.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/1024x1024.png deleted file mode 100644 index eea5227..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/1024x1024.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/128x128.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/128x128.png deleted file mode 100644 index 9a999c0..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/128x128.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/16x16.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/16x16.png deleted file mode 100644 index f76e682..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/16x16.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/24x24.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/24x24.png deleted file mode 100644 index 14b4287..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/24x24.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/256x256.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/256x256.png deleted file mode 100644 index 738f585..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/256x256.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/32x32.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/32x32.png deleted file mode 100644 index 4527814..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/32x32.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/48x48.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/48x48.png deleted file mode 100644 index 0c70d5a..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/48x48.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/512x512.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/512x512.png deleted file mode 100644 index cb7759e..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/512x512.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/64x64.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/64x64.png deleted file mode 100644 index 10931b6..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/64x64.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/linux/96x96.png b/node_modules/app-builder-lib/templates/icons/proton-native/linux/96x96.png deleted file mode 100644 index d571f4d..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/linux/96x96.png and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.icns b/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.icns deleted file mode 100644 index e95e349..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.icns and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.ico b/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.ico deleted file mode 100644 index a92d8e7..0000000 Binary files a/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.ico and /dev/null differ diff --git a/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.svg b/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.svg deleted file mode 100644 index e79d06b..0000000 --- a/node_modules/app-builder-lib/templates/icons/proton-native/proton-native.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/linux/after-install.tpl b/node_modules/app-builder-lib/templates/linux/after-install.tpl deleted file mode 100644 index 6c2f3ea..0000000 --- a/node_modules/app-builder-lib/templates/linux/after-install.tpl +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Link to the binary -ln -sf '/opt/${productFilename}/${executable}' '/usr/local/bin/${executable}' diff --git a/node_modules/app-builder-lib/templates/linux/after-remove.tpl b/node_modules/app-builder-lib/templates/linux/after-remove.tpl deleted file mode 100644 index 6a1c910..0000000 --- a/node_modules/app-builder-lib/templates/linux/after-remove.tpl +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Delete the link to the binary -rm -f '/usr/local/bin/${executable}' diff --git a/node_modules/app-builder-lib/templates/linux/desktop.tpl b/node_modules/app-builder-lib/templates/linux/desktop.tpl deleted file mode 100644 index 5c78a5a..0000000 --- a/node_modules/app-builder-lib/templates/linux/desktop.tpl +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Name=<%= title %> -Comment=<%= comment %> -Exec=<%= executable %> -Terminal=false -Type=Application diff --git a/node_modules/app-builder-lib/templates/msi/WixUI_Assisted.wxs b/node_modules/app-builder-lib/templates/msi/WixUI_Assisted.wxs deleted file mode 100644 index 40af5c3..0000000 --- a/node_modules/app-builder-lib/templates/msi/WixUI_Assisted.wxs +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - 1 - WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NOT Installed - - - - - - - \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/msi/template.xml b/node_modules/app-builder-lib/templates/msi/template.xml deleted file mode 100644 index 3113cf1..0000000 --- a/node_modules/app-builder-lib/templates/msi/template.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - = 601]]> - - - - - - - - - {{ if (iconPath) { }} - - - {{ } -}} - - {{ if (isAssisted || isRunAfterFinish) { }} - - {{ } -}} - - - {{ if (isPerMachine) { }} - - {{ } else { }} - - {{ } -}} - - {{ if (isAssisted) { }} - - - - - - {{ } else if (isRunAfterFinish) { }} - - - - - {{ } -}} - - - - - - - - {{ if (isCreateDesktopShortcut) { }} - - {{ } -}} - - - {{ if (isCreateStartMenuShortcut) { }} - - {{ } }} - - - - - - - - {{-dirs}} - - - {{-files}} - - - \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/assistedInstaller.nsh b/node_modules/app-builder-lib/templates/nsis/assistedInstaller.nsh deleted file mode 100644 index 7778f7f..0000000 --- a/node_modules/app-builder-lib/templates/nsis/assistedInstaller.nsh +++ /dev/null @@ -1,132 +0,0 @@ -!include UAC.nsh - -!ifndef INSTALL_MODE_PER_ALL_USERS - !include multiUserUi.nsh -!endif - -!ifndef BUILD_UNINSTALLER - !ifndef HIDE_RUN_AFTER_FINISH - Function StartApp - ${if} ${isUpdated} - StrCpy $1 "--updated" - ${else} - StrCpy $1 "" - ${endif} - ${StdUtils.ExecShellAsUser} $0 "$launchLink" "open" "$1" - FunctionEnd - - !define MUI_FINISHPAGE_RUN - !define MUI_FINISHPAGE_RUN_FUNCTION "StartApp" - !endif - - !ifmacrodef customWelcomePage - !insertmacro customWelcomePage - !endif - - !ifmacrodef licensePage - !insertmacro skipPageIfUpdated - !insertmacro licensePage - !endif - - !ifndef INSTALL_MODE_PER_ALL_USERS - !insertmacro PAGE_INSTALL_MODE - !endif - - !ifdef allowToChangeInstallationDirectory - !include StrContains.nsh - - !insertmacro skipPageIfUpdated - !insertmacro MUI_PAGE_DIRECTORY - - # pageDirectory leave doesn't work (it seems because $INSTDIR is set after custom leave function) - # so, we use instfiles pre - !define MUI_PAGE_CUSTOMFUNCTION_PRE instFilesPre - - # sanitize the MUI_PAGE_DIRECTORY result to make sure it has a application name sub-folder - Function instFilesPre - ${If} ${FileExists} "$INSTDIR\*" - ${StrContains} $0 "${APP_FILENAME}" $INSTDIR - ${If} $0 == "" - StrCpy $INSTDIR "$INSTDIR\${APP_FILENAME}" - ${endIf} - ${endIf} - FunctionEnd - !endif - !insertmacro MUI_PAGE_INSTFILES - !insertmacro MUI_PAGE_FINISH -!else - !insertmacro MUI_UNPAGE_WELCOME - !ifndef INSTALL_MODE_PER_ALL_USERS - !insertmacro PAGE_INSTALL_MODE - !endif - !insertmacro MUI_UNPAGE_INSTFILES - !insertmacro MUI_UNPAGE_FINISH -!endif - -!macro initMultiUser - !ifdef INSTALL_MODE_PER_ALL_USERS - !insertmacro setInstallModePerAllUsers - !else - ${If} ${UAC_IsInnerInstance} - ${AndIfNot} ${UAC_IsAdmin} - # special return value for outer instance so it knows we did not have admin rights - SetErrorLevel 0x666666 - Quit - ${endIf} - - !ifndef MULTIUSER_INIT_TEXT_ADMINREQUIRED - !define MULTIUSER_INIT_TEXT_ADMINREQUIRED "$(^Caption) requires administrator privileges." - !endif - - !ifndef MULTIUSER_INIT_TEXT_POWERREQUIRED - !define MULTIUSER_INIT_TEXT_POWERREQUIRED "$(^Caption) requires at least Power User privileges." - !endif - - !ifndef MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE - !define MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE "Your user account does not have sufficient privileges to install $(^Name) for all users of this computer." - !endif - - # checks registry for previous installation path (both for upgrading, reinstall, or uninstall) - StrCpy $hasPerMachineInstallation "0" - StrCpy $hasPerUserInstallation "0" - - # set installation mode to setting from a previous installation - ReadRegStr $perMachineInstallationFolder HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation - ${if} $perMachineInstallationFolder != "" - StrCpy $hasPerMachineInstallation "1" - ${endif} - - ReadRegStr $perUserInstallationFolder HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation - ${if} $perUserInstallationFolder != "" - StrCpy $hasPerUserInstallation "1" - ${endif} - - ${GetParameters} $R0 - ${GetOptions} $R0 "/allusers" $R1 - ${IfNot} ${Errors} - StrCpy $hasPerMachineInstallation "1" - StrCpy $hasPerUserInstallation "0" - ${EndIf} - - ${GetOptions} $R0 "/currentuser" $R1 - ${IfNot} ${Errors} - StrCpy $hasPerMachineInstallation "0" - StrCpy $hasPerUserInstallation "1" - ${EndIf} - - ${if} $hasPerUserInstallation == "1" - ${andif} $hasPerMachineInstallation == "0" - !insertmacro setInstallModePerUser - ${elseif} $hasPerUserInstallation == "0" - ${andif} $hasPerMachineInstallation == "1" - !insertmacro setInstallModePerAllUsers - ${else} - # if there is no installation, or there is both per-user and per-machine - !ifdef INSTALL_MODE_PER_ALL_USERS - !insertmacro setInstallModePerAllUsers - !else - !insertmacro setInstallModePerUser - !endif - ${endif} - !endif -!macroend diff --git a/node_modules/app-builder-lib/templates/nsis/assistedMessages.yml b/node_modules/app-builder-lib/templates/nsis/assistedMessages.yml deleted file mode 100755 index e627431..0000000 --- a/node_modules/app-builder-lib/templates/nsis/assistedMessages.yml +++ /dev/null @@ -1,317 +0,0 @@ -# assisted installer messages, see messages.yml for one-click installer messages -chooseInstallationOptions: - en: Choose Installation Options - de: Installationsoption wählen - ru: Выберите опции установки - sk: Vyberte možnosti inštalácie - fr: Choisis les options d'installation - hu_HU: Telepítési opciók kiválasztása - pt_BR: Escolha uma opção de instalação - zh_CN: 安装选项 - tr_TR: Yükleme Ayarlarını Seçin - sv_SE: Välj alternativ för installation - pl_PL: Wybierz opcje instalacji - no: Velg alternativer for installering - nl_NL: Kies installatie-opties - it_IT: Scegli opzioni di installazione - fi: Valitse asennusvaihtoehdot - es: Elegir opciones de instalación - da: Vælg Installeringsmuligheder - ja: インストールオプションの選択 -chooseUninstallationOptions: - en: Choose Uninstallation Options - de: Deinstallationsoption wählen - ru: Выберите опции удаления - sk: Vyberte možnosti odinštalovania - fr: Choisis les options de désinstallation - hu_HU: Eltávolítási opciók kiválasztása - pt_BR: Escolha uma opção de desinstalação - zh_CN: 卸载选项 - tr_TR: Kaldırma Ayarlarını Seçin - sv_SE: Välj alternativ för avinstallation - pl_PL: Wybierz opcje dezinstalacji - no: Velg alternativer for avinstallering - nl_NL: Kies verwijderings-opties - it_IT: Scegli opzioni di disinstallazione - fi: Valitse asennuksen poistovaihtoehdot - es: Elegir opciones de desinstalación - da: Vælg Afinstalleringsmuligheder - ja: アンインストールオプションの選択 -whichInstallationShouldBeRemoved: - en: Which installation should be removed? - de: Welche Installation soll entfernt werden? - ru: Какую из установленных программ следует удалить? - sk: Ktorá inštalácia by mala byt odstránená? - fr: Quelle installation doit être supprimée ? - hu_HU: Melyik telepítést távolítsuk el? - pt_BR: Qual instalação deve ser removida? - zh_CN: 需要移除哪个安装? - tr_TR: Hangi Yükleme Kaldırılsın? - sv_SE: Vilken installation ska tas bort? - pl_PL: Którą instalację chcesz usunąć? - no: Hvilken installasjon skal fjernes? - nl_NL: Welke installatie moet worden verwijderd? - it_IT: Quale installazione intendi rimuovere? - fi: Mikä asennus pitäisi poistaa? - es: ¿Qué tipo de instalación debe eliminarse? - da: Hvilken installering skal fjernes? - ja: どれをアンインストールしますか? -whoShouldThisApplicationBeInstalledFor: - en: Who should this application be installed for? - de: Für wen soll diese Anwendung installiert werden? - ru: Для кого следует установить это приложение? - sk: Pre koho sa ma táto aplikacia inštalovať? - fr: Pour qui cette application doit-elle être installée ? - hu_HU: Kinek legyen ez az alkalmazás telepítve? - pt_BR: Para quem esta aplicação deve ser instalada? - zh_CN: 为哪位用户安装该应用? - tr_TR: Bu Uygulama Kimler için Kurulsun? - sv_SE: Vem ska den här applikationen installeras för? - pl_PL: Dla kogo zainstalować tę aplikację? - no: Hvem skal dette programmet installeres for? - nl_NL: Voor wie moet deze applicatie worden geïnstalleerd? - it_IT: Per chi dovrebbe essere installata questa applicazione? - fi: Kenen käyttöön tämä sovellus pitäisi asentaa? - es: ¿Para quién se instalará esta aplicación? - da: Hvem skal denne applikation installeres til? - ja: どのユーザーにインストールしますか? -selectUserMode: - en: Please select whether you wish to make this software available to all users or just yourself - de: Bitte wählen Sie, ob Sie die Anwendung nur für sich oder für alle Benutzer installieren möchten. - ru: Выбери, хочешь ли ты сделать эту программу доступной для всех пользователей или только для себя - sk: Prosím vyberte či sa ma tento softvér inštalovať len pre Vás alebo pre všetkých uživateľov - fr: "Choisis pour qui ce logiciel doit être accessible : pour tous les utilisateurs ou juste pour toi ?" - hu_HU: Válaszd ki, hogy a szoftver elérhető legyen-e minden felhasználó számára, vagy csak neked - pt_BR: Por favor, selecione se este software deve estar disponível apenas para você ou para todos usuários - zh_CN: 请选择为当前用户还是所有用户安装该软件 - tr_TR: Lütfen bu yazılımı tüm kullanıcılar için mi yoksa sadece kendiniz mi kullanmak istediğinizi seçin - sv_SE: Välj om du vill göra den här mjukvaran tillgänglig för alla användare eller bara för dig - pl_PL: Wybierz, czy to oprogramowanie ma być dostępne dla wszystkich użytkowników, czy tylko dla Ciebie - no: Velg om du vil gjøre denne programvaren tilgjengelig for alle brukerne eller bare deg selv - nl_NL: Selecteer of je deze software beschikbaar wilt maken voor alle gebruikers of alleen voor jezelf. - it_IT: Seleziona se desideri rendere questo software accessibile a tutti gli utenti o solo a te - fi: Valitse, haluatko tämän ohjelmiston kaikkien käyttäjien vai pelkästään itsesi käyttöön - es: Elige si deseas que este software esté disponible para todos los usuarios o solo para ti. - da: Vælg, om du vil gøre denne software tilgængelig for andre brugere, eller kun for dig selv - ja: このソフトウェアをすべてのユーザーが使用できるようにするか、現在のユーザーのみ使用するかを選択してください -whichInstallationRemove: - en: This software is installed both per-machine (all users) and per-user.\nWhich installation you wish to remove? - de: Die Anwendung wurde für alle Benutzer und pro Benutzer installiert.\nWelche Installation möchten Sie entfernen? - ru: Эта программа установлена для всего компьютера (для всех пользователей) и для отдельного пользователя.\nКакую из установленных программ ты хочешь удалить? - sk: Tento softvér je nainštalovaný pre Vás a súčasne pre všetkých uživateľov.\nKtorú inštaláciu si želáte odstraniť? - fr: Ce logiciel est installé à la fois par machine (tous les utilisateurs) et par utilisateur.\nQuelle installation veux-tu supprimer ? - hu_HU: Ez a szoftver számítógépenként (minden felhasználó) és felhasználónként is telepítve van.\nMelyik telepítést szeretnéd eltávolítani? - pt_BR: Este software é instalado por máquina (todos os usuários) e por usuário. Qual instalação você deseja remover? - zh_CN: 该软件已为所有用户和当前用户安装.\n您希望移除哪个安装? - tr_TR: Bu yazılım hem makine başına (tüm kullanıcılar) hem de kullanıcı başına yüklenir.\nKaldırmak istediğiniz kurulum? - sv_SE: Den här mjukvaran är installerad både ”per dator” (alla användare) och ”per användare”.\nVilken installation vill du ta bort? - pl_PL: To oprogramowanie zostało zainstalowane zarówno dla urządzenia (wszyscy użytkownicy), jak i dla użytkownika.\nKtórą instalację chcesz usunąć? - no: Denne programvaren er installert både per-maskin (alle brukere) og per-bruker. Hvilken installasjon vil du fjerne? - nl_NL: Deze software is zowel per apparaat (alle gebruikers) als per gebruiker geïnstalleerd. Welke installatie wil je verwijderen? - it_IT: Questo software è stato installato sia per computer (tutti gli utenti) sia per utente.\nQuale installazione desideri rimuovere? - fi: Tämä ohjelmisto on asennettu sekä konekohtaisesti (kaikki käyttäjät) että käyttäjäkohtaisesti.\nMinkä asennuksen haluat poistaa? - es: Este software se ha instalado para la máquina (todos los usuarios) y para el usuario.\n¿Qué instalación quieres eliminar? - da: Denne software er installeret både pr. maskine (alle brugere) og pr. bruger./nHvilken installering ønsker du at fjerne? - ja: このソフトウェアは、マシンごと(すべてのユーザー)とユーザーごとにインストールされています。\ nどちらを削除しますか? -freshInstallForAll: - en: Fresh install for all users. (will prompt for admin credentials) - de: Neuinstallation für alle Benutzer durchführen. (Administratorrechte benötigt) - ru: Новая установка для всех пользователей. (потребуются права администратора) - sk: Nová inštalácia pre všetkých uživateľov. (will prompt for admin credentials) - fr: Nouvelle installation pour tous les utilisateurs. (demandera les identifiants administrateur) - hu_HU: Új telepítés minden felhasználó számára. (Az adminisztrátor hitelesítő adataira lesz szükség.) - pt_BR: Instalação limpa para todos os usuários. (irá solicitar credenciais de administrador) - zh_CN: 为所有用户进行全新安装. (需要管理员资格) - tr_TR: Tüm kullanıcılar için yeni yükleme. (yönetici kimlik bilgilerini soracaktır) - sv_SE: Ny installation för alla användare. (kommer att begära adminbehörighet) - pl_PL: Nowa instalacja dla wszystkich użytkowników (potrzebne będą dane administratora). - no: Ny installasjon for alle brukere. (vil be om administratorlegitimasjon) - nl_NL: Nieuwe installatie voor alle gebruikers. (zal om beheerder-gegevens vragen) - it_IT: Re-installa per tutti gli utenti. (Richiede le credenziali di amministratore) - fi: Uusi asennus kaikille käyttäjille (pyytää ylläpitäjän käyttäjätunnuksia) - es: Instalación nueva para todos los usuarios (se pedirán los credenciales del administrador) - da: Ny installering til alle brugere. (Vil medføre administrations-legitimationsoplysninger) - ja: すべてのユーザーに新規インストール(管理者権限が必要) -freshInstallForCurrent: - en: Fresh install for current user only. - de: Neuinstallation nur für den aktuellen Benutzer durchführen. - ru: Новая установка только для текущего пользователя. - fr: Nouvelle installation uniquement pour l'utilisateur actuel. - hu_HU: Új telepítés csak a jelenlegi felhasználó számára. - pt_BR: Instalação limpa somente para o usuário atual. - zh_CN: 仅为当前用户进行全新安装. - tr_TR: Sadece mevcut kullanıcı için yeni yükleme. - sv_SE: Ny installation endast för den aktuella användaren. - pl_PL: Nowa instalacja wyłącznie dla obecnego użytkownika. - no: Ny installasjon kun for nåværende bruker. - nl_NL: Nieuwe installatie alleen voor huidige gebruiker. - it_IT: Re-installa solo per l'utente attuale. - fi: Uusi asennus vain nykyiselle käyttäjälle. - es: Instalación nueva solo para el usuario actual. - da: Ny installering kun til nuværende bruger. - ja: 現在のユーザーのみ新規インストール -onlyForMe: - en: Only for &me - de: Nur für &mich - ru: Только для &меня - sk: Iba pre mňa - fr: Juste pour moi - hu_HU: Csak az én számomra - pt_BR: Apenas para &mim - zh_CN: 仅为我安装 - tr_TR: Sadece benim için - sv_SE: Endast för &mig - pl_PL: Tylko dla &mnie - no: Kun for &meg - nl_NL: Alleen voor &mij - it_IT: Solo per &me - fi: Vain minulle - es: Solo para mí. - da: Kun til mig - ja: 現在のユーザーのみにインストールする -forAll: - en: Anyone who uses this computer (&all users) - de: Für alle Benutzer dieses Computers (&alle Benutzer) - ru: Для &всех пользователей данного компьютера - sk: Pre každého kto použiva tento počitač (všetci uživatelia) - fr: Pour tous ceux qui utilisent cet ordinateur (tous les utilisateurs) - hu_HU: Bárki számára, aki ezt a számítógépet használja (minden felhasználó) - pt_BR: Para todos que usam esta máquina (&todos os usuários) - zh_CN: 为使用这台电脑的任何人安装 (所有用户) - tr_TR: Bu bilgisayarı kullanan herkes (ve tüm kullanıcılar) - sv_SE: Alla som använder den här datorn (alla användare) - pl_PL: Każdy korzystający z tego komputera (wszyscy użytkownicy) - no: Alle som bruker denne datamaskinen (alle brukere) - nl_NL: Iedereen die deze computer gebruikt (alle gebruikers) - it_IT: Per chiunque usi questo computer (tutti gli utenti) - fi: Kaikille, jotka käyttävät tätä tietokonetta (kaikki käyttäjät) - es: Cualquiera que utilice este ordenador (todos los usuarios) - da: Enhver, der bruger denne computer (alle brugere) - ja: このコンピューターを使用しているすべてのユーザー用にインストールする -loginWithAdminAccount: - en: You need to login with an account that is a member of the admin group to continue... - de: Um die Installation fortzusetzen müssen Sie sich mit einem Administrator-Account anmelden... - ru: Чтобы продолжить, тебе нужно войти в учетную запись, которая входит в группу администраторов... - sk: Pre pokračovanie sa musíte zalogovať s účtom ktorý patrí do skupiny adminstrátorov... - fr: Tu dois te connecter avec un compte ayant des droits d'administrateur pour continuer... - hu_HU: A folytatáshoz adminisztrátori jogokkal rendelkező fiókkal kell bejelentkezned... - pt_BR: Você precisa realizar o login com uma conta que é membro do grupo de administração para continuar... - zh_CN: 您需要用属于管理员群组的用户账户登录来继续... - tr_TR: Devam etmek için yönetici grubunun üyesi olan bir hesapla giriş yapmanız gerekiyor.. - sv_SE: Du måste logga in med ett konto som är medlem i admingruppen för att fortsätta... - pl_PL: Musisz się zalogować za pomocą konta będącego członkiem grupy administratora, by kontynuować... - no: Du må logge inn med en konto som er medlem av administrasjonsgruppen for å fortsette... - nl_NL: Je dient in te loggen met een account dat lid is van de beheerdersgroep om verder te gaan... - it_IT: Devi accedere con un account incluso nel gruppo amministratore per continuare... - fi: Jatkaaksesi sinun on kirjauduttava käyttäjätilillä, joka on ylläpitäjäryhmän jäsen... - es: Para continuar, tienes que iniciar sesión con una cuenta que pertenezca al grupo de administradores... - da: Du skal logge ind med en konto, der er medlem af administrationsgruppen for at kunne fortsætte... - ja: 続行するには、管理者権限アカウントでログインする必要があります... -perUserInstallExists: - en: There is already a per-user installation. - de: Es existiert bereits eine Installtion für den ausgewählten Benutzer. - ru: Уже есть установленная программа для отдельного пользователя. - fr: Il y a déjà une installation par utilisateur. - hu_HU: Már van egy felhasználónkénti telepítés. - pt_BR: Já existe uma instalação por usuário. - zh_CN: 已经存在一个安装到当前用户的安装. - tr_TR: Her kullanıcı için zaten bir kurulum var. - sv_SE: Det finns redan en ”per användare”-installation. - pl_PL: Instalacja dla użytkownika już istnieje. - no: Det er allerede en per-bruker-installasjon. - nl_NL: Er is al een installatie 'per gebruiker'. - it_IT: È già presente un'installazione per utente. - fi: Tämä on jo käyttäjäkohtainen asennus. - es: Ya hay una instalación por usuario. - da: Der er allerede en pr. bruger installation. - ja: すでに現在のユーザーにインストールされています。 -perUserInstall: - en: There is a per-user installation. - de: Benutzerinstallation bereits vorhanden. - ru: Есть установленная программа для отдельного пользователя. - fr: Il y a une installation par utilisateur. - hu_HU: Van felhasználónkénti telepítés. - pt_BR: Existe uma instalação por usuário. - zh_CN: 存在一个安装到当前用户的安装. - tr_TR: Kullanıcı başına bir kurulum var. - sv_SE: Det finns en ”per användare”-installation. - pl_PL: Instalacja dla użytkownika istnieje. - no: Det er en per-bruker-installasjon. - nl_NL: Er is een installatie 'per gebruiker'. - it_IT: È presente un'installazione per utente. - fi: Käyttäjäkohtainen asennus on olemassa. - es: Hay una instalación por usuario. - da: Der er en pr. bruger installation. - ja: ユーザーごとのインストールがあります。 -perMachineInstallExists: - en: There is already a per-machine installation. - de: Es existiert bereits eine Installation für diesen Computer. - ru: Уже есть установленная программа для всего компьютера. - fr: Il y a déjà une installation par machine. - hu_HU: Már van egy számítógépenkénti telepítés. - pt_BR: Já existe uma instalação por máquina. - zh_CN: 已经存在一个安装到所有用户的安装. - tr_TR: Zaten makine başına bir kurulum var. - sv_SE: Det finns redan en ”per dator”-installation. - pl_PL: Instalacja dla urządzenia już istnieje. - no: Det er allerede en per-maskin-installasjon. - nl_NL: Er is al een installatie 'per apparaat'. - it_IT: È già presente un'installazione per computer. - fi: Tämä on jo tietokonekohtainen asennus. - es: Ya hay una instalación por máquina. - da: Der er allerede en pr. maskine installation. - ja: 既にすべてのユーザー用にインストールされています。 -perMachineInstall: - en: There is a per-machine installation. - de: Es existiert eine Installation für diesen Computer. - ru: Есть установленная программа для всего компьютера. - fr: Il y a une installation par machine. - hu_HU: Van számítógépenkénti telepítés. - pt_BR: Existe uma instalação por máquina. - zh_CN: 存在一个安装到所有用户的安装. - tr_TR: Makine başına bir yükleme var. - sv_SE: Det finns en ”per dator”-installation. - pl_PL: Instalacja dla urządzenia istnieje. - no: Det er en per-maskin-installasjon. - nl_NL: Er is een installatie 'per apparaat'. - it_IT: È presente un'installazione per computer. - fi: Tietokonekohtainen asennus on olemassa. - es: Hay una instalación por máquina. - da: Der er en pr. maskine installation. - ja: すべてのユーザー用のインストールがあります。 -reinstallUpgrade: - en: Will reinstall/upgrade. - de: Die Anwendung wird aktualisiert. - ru: Игра будет переустановлена/обновлена. - fr: Va réinstaller/mettre à jour. - hu_HU: Újratelepít/frissít. - pt_BR: Irá reinstalar/atualizar. - zh_CN: 即将重新安装/升级. - tr_TR: Yeniden yükleme/yükseltme - sv_SE: Kommer att ominstallera/uppgradera. - pl_PL: Nastąpi ponowna instalacja/aktualizacja. - no: Vil installere på nytt / oppgradere. - nl_NL: Zal opnieuw installeren/upgraden. - it_IT: Re-installa/aggiorna il programma. - fi: Asennetaan uudelleen/päivitetään. - es: Se reinstalará/actualizará. - da: Reinstallerer/opgraderer. - ja: 再インストール/アップグレードします。 -uninstall: - en: Will uninstall. - de: Die Anwendung wird deinstalliert. - ru: Игра будет удалена. - fr: Va désinstaller. - hu_HU: Eltávolít. - pt_BR: Irá desinstalar. - zh_CN: 即将卸载. - tr_TR: Kaldıralacak. - sv_SE: Kommer att avinstallera. - pl_PL: Nastąpi dezinstalacja. - no: Vil avinstallere. - nl_NL: Zal installatie verwijderen. - it_IT: Disinstalla il programma. - fi: Poistetaan asennus. - es: Se desinstalará. - da: Afinstallerer. - ja: アンインストールします。 diff --git a/node_modules/app-builder-lib/templates/nsis/common.nsh b/node_modules/app-builder-lib/templates/nsis/common.nsh deleted file mode 100644 index b949005..0000000 --- a/node_modules/app-builder-lib/templates/nsis/common.nsh +++ /dev/null @@ -1,88 +0,0 @@ -!include x64.nsh -!include WinVer.nsh - -BrandingText "${PRODUCT_NAME} ${VERSION}" -ShowInstDetails nevershow -SpaceTexts none -!ifdef BUILD_UNINSTALLER - ShowUninstDetails nevershow -!endif -FileBufSize 64 -Name "${PRODUCT_NAME}" - -!define APP_EXECUTABLE_FILENAME "${PRODUCT_FILENAME}.exe" -!define UNINSTALL_FILENAME "Uninstall ${PRODUCT_FILENAME}.exe" - -!macro check64BitAndSetRegView - ${IfNot} ${AtLeastWin7} - MessageBox MB_OK "$(win7Required)" - Quit - ${EndIf} - - !ifdef APP_64 - ${If} ${RunningX64} - SetRegView 64 - ${Else} - !ifndef APP_32 - MessageBox MB_OK|MB_ICONEXCLAMATION "$(x64WinRequired)" - Quit - !endif - ${EndIf} - !endif -!macroend - -# avoid exit code 2 -!macro quitSuccess - SetErrorLevel 0 - Quit -!macroend - -!macro setLinkVars - # old desktop shortcut (could exist or not since the user might has selected to delete it) - ReadRegStr $oldShortcutName SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" ShortcutName - ${if} $oldShortcutName == "" - StrCpy $oldShortcutName "${PRODUCT_FILENAME}" - ${endIf} - StrCpy $oldDesktopLink "$DESKTOP\$oldShortcutName.lnk" - - # new desktop shortcut (will be created/renamed in case of a fresh installation or if the user haven't deleted the initial one) - StrCpy $newDesktopLink "$DESKTOP\${SHORTCUT_NAME}.lnk" - - ReadRegStr $oldMenuDirectory SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" MenuDirectory - ${if} $oldMenuDirectory == "" - StrCpy $oldStartMenuLink "$SMPROGRAMS\$oldShortcutName.lnk" - ${else} - StrCpy $oldStartMenuLink "$SMPROGRAMS\$oldMenuDirectory\$oldShortcutName.lnk" - ${endIf} - - # new menu shortcut (will be created/renamed in case of a fresh installation or if the user haven't deleted the initial one) - !ifdef MENU_FILENAME - StrCpy $newStartMenuLink "$SMPROGRAMS\${MENU_FILENAME}\${SHORTCUT_NAME}.lnk" - !else - StrCpy $newStartMenuLink "$SMPROGRAMS\${SHORTCUT_NAME}.lnk" - !endif -!macroend - -!macro skipPageIfUpdated - !define UniqueID ${__LINE__} - - Function skipPageIfUpdated_${UniqueID} - ${if} ${isUpdated} - Abort - ${endif} - FunctionEnd - - !define MUI_PAGE_CUSTOMFUNCTION_PRE skipPageIfUpdated_${UniqueID} - !undef UniqueID -!macroend - -!macro StartApp - Var /GLOBAL startAppArgs - ${if} ${isUpdated} - StrCpy $startAppArgs "--updated" - ${else} - StrCpy $startAppArgs "" - ${endif} - - ${StdUtils.ExecShellAsUser} $0 "$launchLink" "open" "$startAppArgs" -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/empty-license.txt b/node_modules/app-builder-lib/templates/nsis/empty-license.txt deleted file mode 100644 index 37d7092..0000000 --- a/node_modules/app-builder-lib/templates/nsis/empty-license.txt +++ /dev/null @@ -1 +0,0 @@ -Loading... \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/FileAssociation.nsh b/node_modules/app-builder-lib/templates/nsis/include/FileAssociation.nsh deleted file mode 100644 index 1cabaf4..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/FileAssociation.nsh +++ /dev/null @@ -1,132 +0,0 @@ -; fileassoc.nsh -; File association helper macros -; Written by Saivert -; -; Features automatic backup system and UPDATEFILEASSOC macro for -; shell change notification. -; -; |> How to use <| -; To associate a file with an application so you can double-click it in explorer, use -; the APP_ASSOCIATE macro like this: -; -; Example: -; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "Description of txt files" \ -; "$INSTDIR\myapp.exe,0" "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\"" -; -; Never insert the APP_ASSOCIATE macro multiple times, it is only ment -; to associate an application with a single file and using the -; the "open" verb as default. To add more verbs (actions) to a file -; use the APP_ASSOCIATE_ADDVERB macro. -; -; Example: -; !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "Edit with myapp" \ -; "$INSTDIR\myapp.exe /edit $\"%1$\"" -; -; To have access to more options when registering the file association use the -; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the -; standard action (default verb). -; -; Note, that this script takes into account user versus global installs. -; To properly work you must initialize the SHELL_CONTEXT variable via SetShellVarContext. -; -; And finally: To remove the association from the registry use the APP_UNASSOCIATE -; macro. Here is another example just to wrap it up: -; !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile" -; -; |> Note <| -; When defining your file class string always use the short form of your application title -; then a period (dot) and the type of file. This keeps the file class sort of unique. -; Examples: -; Winamp.Playlist -; NSIS.Script -; Photoshop.JPEGFile -; -; |> Tech info <| -; The registry key layout for a global file association is: -; -; HKEY_LOCAL_MACHINE\Software\Classes -; <".ext"> = -; = <"description"> -; shell -; = <"menu-item text"> -; command = <"command string"> -; -; -; The registry key layout for a per-user file association is: -; -; HKEY_CURRENT_USER\Software\Classes -; <".ext"> = -; = <"description"> -; shell -; = <"menu-item text"> -; command = <"command string"> -; - -!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND - ; Backup the previously associated file class - ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" "" - WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0" - - WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}" - - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell" "" "open" - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open" "" `${COMMANDTEXT}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open\command" "" `${COMMAND}` -!macroend - -!macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND - ; Backup the previously associated file class - ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" "" - WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0" - - WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}" - StrCmp "${SHELLNEW}" "0" +2 - WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}\ShellNew" "NullFile" "" - - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell" "" `${DEFAULTVERB}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}` -!macroend - -!macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}` - WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}` -!macroend - -!macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB - DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}\shell\${VERB}` -!macroend - - -!macro APP_UNASSOCIATE EXT FILECLASS - ; Backup the previously associated file class - ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" `${FILECLASS}_backup` - WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "$R0" - - DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}` -!macroend - -!macro APP_ASSOCIATE_GETFILECLASS OUTPUT EXT - ReadRegStr ${OUTPUT} SHELL_CONTEXT "Software\Classes\.${EXT}" "" -!macroend - - -; !defines for use with SHChangeNotify -!ifdef SHCNE_ASSOCCHANGED -!undef SHCNE_ASSOCCHANGED -!endif -!define SHCNE_ASSOCCHANGED 0x08000000 -!ifdef SHCNF_FLUSH -!undef SHCNF_FLUSH -!endif -!define SHCNF_FLUSH 0x1000 - -!macro UPDATEFILEASSOC -; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we -; can update the shell. - System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)" -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/StdUtils.nsh b/node_modules/app-builder-lib/templates/nsis/include/StdUtils.nsh deleted file mode 100644 index 511e004..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/StdUtils.nsh +++ /dev/null @@ -1,496 +0,0 @@ -################################################################################# -# StdUtils plug-in for NSIS -# Copyright (C) 2004-2018 LoRd_MuldeR -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# -# http://www.gnu.org/licenses/lgpl-2.1.txt -################################################################################# - -# DEVELOPER NOTES: -# - Please see "https://github.com/lordmulder/stdutils/" for news and updates! -# - Please see "Docs\StdUtils\StdUtils.html" for detailed function descriptions! -# - Please see "Examples\StdUtils\StdUtilsTest.nsi" for usage examples! - -################################################################################# -# FUNCTION DECLARTIONS -################################################################################# - -!ifndef ___STDUTILS__NSH___ -!define ___STDUTILS__NSH___ - -!define StdUtils.Time '!insertmacro _StdU_Time' #time(), as in C standard library -!define StdUtils.GetMinutes '!insertmacro _StdU_GetMinutes' #GetSystemTimeAsFileTime(), returns the number of minutes -!define StdUtils.GetHours '!insertmacro _StdU_GetHours' #GetSystemTimeAsFileTime(), returns the number of hours -!define StdUtils.GetDays '!insertmacro _StdU_GetDays' #GetSystemTimeAsFileTime(), returns the number of days -!define StdUtils.Rand '!insertmacro _StdU_Rand' #rand(), as in C standard library -!define StdUtils.RandMax '!insertmacro _StdU_RandMax' #rand(), as in C standard library, with maximum value -!define StdUtils.RandMinMax '!insertmacro _StdU_RandMinMax' #rand(), as in C standard library, with minimum/maximum value -!define StdUtils.RandList '!insertmacro _StdU_RandList' #rand(), as in C standard library, with list support -!define StdUtils.RandBytes '!insertmacro _StdU_RandBytes' #Generates random bytes, returned as Base64-encoded string -!define StdUtils.FormatStr '!insertmacro _StdU_FormatStr' #sprintf(), as in C standard library, one '%d' placeholder -!define StdUtils.FormatStr2 '!insertmacro _StdU_FormatStr2' #sprintf(), as in C standard library, two '%d' placeholders -!define StdUtils.FormatStr3 '!insertmacro _StdU_FormatStr3' #sprintf(), as in C standard library, three '%d' placeholders -!define StdUtils.ScanStr '!insertmacro _StdU_ScanStr' #sscanf(), as in C standard library, one '%d' placeholder -!define StdUtils.ScanStr2 '!insertmacro _StdU_ScanStr2' #sscanf(), as in C standard library, two '%d' placeholders -!define StdUtils.ScanStr3 '!insertmacro _StdU_ScanStr3' #sscanf(), as in C standard library, three '%d' placeholders -!define StdUtils.TrimStr '!insertmacro _StdU_TrimStr' #Remove whitspaces from string, left and right -!define StdUtils.TrimStrLeft '!insertmacro _StdU_TrimStrLeft' #Remove whitspaces from string, left side only -!define StdUtils.TrimStrRight '!insertmacro _StdU_TrimStrRight' #Remove whitspaces from string, right side only -!define StdUtils.RevStr '!insertmacro _StdU_RevStr' #Reverse a string, e.g. "reverse me" <-> "em esrever" -!define StdUtils.ValidFileName '!insertmacro _StdU_ValidFileName' #Test whether string is a valid file name - no paths allowed -!define StdUtils.ValidPathSpec '!insertmacro _StdU_ValidPathSpec' #Test whether string is a valid full(!) path specification -!define StdUtils.ValidDomainName '!insertmacro _StdU_ValidDomain' #Test whether string is a valid host name or domain name -!define StdUtils.StrToUtf8 '!insertmacro _StdU_StrToUtf8' #Convert string from Unicode (UTF-16) or ANSI to UTF-8 bytes -!define StdUtils.StrFromUtf8 '!insertmacro _StdU_StrFromUtf8' #Convert string from UTF-8 bytes to Unicode (UTF-16) or ANSI -!define StdUtils.SHFileMove '!insertmacro _StdU_SHFileMove' #SHFileOperation(), using the FO_MOVE operation -!define StdUtils.SHFileCopy '!insertmacro _StdU_SHFileCopy' #SHFileOperation(), using the FO_COPY operation -!define StdUtils.AppendToFile '!insertmacro _StdU_AppendToFile' #Append contents of an existing file to another file -!define StdUtils.ExecShellAsUser '!insertmacro _StdU_ExecShlUser' #ShellExecute() as NON-elevated user from elevated installer -!define StdUtils.InvokeShellVerb '!insertmacro _StdU_InvkeShlVrb' #Invokes a "shell verb", e.g. for pinning items to the taskbar -!define StdUtils.ExecShellWaitEx '!insertmacro _StdU_ExecShlWaitEx' #ShellExecuteEx(), returns the handle of the new process -!define StdUtils.WaitForProcEx '!insertmacro _StdU_WaitForProcEx' #WaitForSingleObject(), e.g. to wait for a running process -!define StdUtils.GetParameter '!insertmacro _StdU_GetParameter' #Get the value of a specific command-line option -!define StdUtils.TestParameter '!insertmacro _StdU_TestParameter' #Test whether a specific command-line option has been set -!define StdUtils.ParameterCnt '!insertmacro _StdU_ParameterCnt' #Get number of command-line tokens, similar to argc in main() -!define StdUtils.ParameterStr '!insertmacro _StdU_ParameterStr' #Get the n-th command-line token, similar to argv[i] in main() -!define StdUtils.GetAllParameters '!insertmacro _StdU_GetAllParams' #Get complete command-line, but without executable name -!define StdUtils.GetRealOSVersion '!insertmacro _StdU_GetRealOSVer' #Get the *real* Windows version number, even on Windows 8.1+ -!define StdUtils.GetRealOSBuildNo '!insertmacro _StdU_GetRealOSBld' #Get the *real* Windows build number, even on Windows 8.1+ -!define StdUtils.GetRealOSName '!insertmacro _StdU_GetRealOSStr' #Get the *real* Windows version, as a "friendly" name -!define StdUtils.GetOSEdition '!insertmacro _StdU_GetOSEdition' #Get the Windows edition, i.e. "workstation" or "server" -!define StdUtils.GetOSReleaseId '!insertmacro _StdU_GetOSRelIdNo' #Get the Windows release identifier (on Windows 10) -!define StdUtils.VerifyOSVersion '!insertmacro _StdU_VrfyRealOSVer' #Compare *real* operating system to an expected version number -!define StdUtils.VerifyOSBuildNo '!insertmacro _StdU_VrfyRealOSBld' #Compare *real* operating system to an expected build number -!define StdUtils.HashText '!insertmacro _StdU_HashText' #Compute hash from text string (CRC32, MD5, SHA1/2/3, BLAKE2) -!define StdUtils.HashFile '!insertmacro _StdU_HashFile' #Compute hash from file (CRC32, MD5, SHA1/2/3, BLAKE2) -!define StdUtils.NormalizePath '!insertmacro _StdU_NormalizePath' #Simplifies the path to produce a direct, well-formed path -!define StdUtils.GetParentPath '!insertmacro _StdU_GetParentPath' #Get parent path by removing the last component from the path -!define StdUtils.SplitPath '!insertmacro _StdU_SplitPath' #Split the components of the given path -!define StdUtils.GetDrivePart '!insertmacro _StdU_GetDrivePart' #Get drive component of path -!define StdUtils.GetDirectoryPart '!insertmacro _StdU_GetDirPart' #Get directory component of path -!define StdUtils.GetFileNamePart '!insertmacro _StdU_GetFNamePart' #Get file name component of path -!define StdUtils.GetExtensionPart '!insertmacro _StdU_GetExtnPart' #Get file extension component of path -!define StdUtils.TimerCreate '!insertmacro _StdU_TimerCreate' #Create a new event-timer that will be triggered periodically -!define StdUtils.TimerDestroy '!insertmacro _StdU_TimerDestroy' #Destroy a running timer created with TimerCreate() -!define StdUtils.ProtectStr '!insertmacro _StdU_PrtctStr' #Protect a given String using Windows' DPAPI -!define StdUtils.UnprotectStr '!insertmacro _StdU_UnprtctStr' #Unprotect a string that was protected via ProtectStr() -!define StdUtils.GetLibVersion '!insertmacro _StdU_GetLibVersion' #Get the current StdUtils library version (for debugging) -!define StdUtils.SetVerbose '!insertmacro _StdU_SetVerbose' #Enable or disable "verbose" mode (for debugging) - - -################################################################################# -# MACRO DEFINITIONS -################################################################################# - -!macro _StdU_Time out - StdUtils::Time /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetMinutes out - StdUtils::GetMinutes /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetHours out - StdUtils::GetHours /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetDays out - StdUtils::GetDays /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_Rand out - StdUtils::Rand /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_RandMax out max - push ${max} - StdUtils::RandMax /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_RandMinMax out min max - push ${min} - push ${max} - StdUtils::RandMinMax /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_RandList count max - push ${max} - push ${count} - StdUtils::RandList /NOUNLOAD -!macroend - -!macro _StdU_RandBytes out count - push ${count} - StdUtils::RandBytes /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_FormatStr out format val - push `${format}` - push ${val} - StdUtils::FormatStr /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_FormatStr2 out format val1 val2 - push `${format}` - push ${val1} - push ${val2} - StdUtils::FormatStr2 /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_FormatStr3 out format val1 val2 val3 - push `${format}` - push ${val1} - push ${val2} - push ${val3} - StdUtils::FormatStr3 /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ScanStr out format input default - push `${format}` - push `${input}` - push ${default} - StdUtils::ScanStr /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ScanStr2 out1 out2 format input default1 default2 - push `${format}` - push `${input}` - push ${default1} - push ${default2} - StdUtils::ScanStr2 /NOUNLOAD - pop ${out1} - pop ${out2} -!macroend - -!macro _StdU_ScanStr3 out1 out2 out3 format input default1 default2 default3 - push `${format}` - push `${input}` - push ${default1} - push ${default2} - push ${default3} - StdUtils::ScanStr3 /NOUNLOAD - pop ${out1} - pop ${out2} - pop ${out3} -!macroend - -!macro _StdU_TrimStr var - push ${var} - StdUtils::TrimStr /NOUNLOAD - pop ${var} -!macroend - -!macro _StdU_TrimStrLeft var - push ${var} - StdUtils::TrimStrLeft /NOUNLOAD - pop ${var} -!macroend - -!macro _StdU_TrimStrRight var - push ${var} - StdUtils::TrimStrRight /NOUNLOAD - pop ${var} -!macroend - -!macro _StdU_RevStr var - push ${var} - StdUtils::RevStr /NOUNLOAD - pop ${var} -!macroend - -!macro _StdU_ValidFileName out test - push `${test}` - StdUtils::ValidFileName /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ValidPathSpec out test - push `${test}` - StdUtils::ValidPathSpec /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ValidDomain out test - push `${test}` - StdUtils::ValidDomainName /NOUNLOAD - pop ${out} -!macroend - - -!macro _StdU_StrToUtf8 out str - push `${str}` - StdUtils::StrToUtf8 /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_StrFromUtf8 out trnc str - push ${trnc} - push `${str}` - StdUtils::StrFromUtf8 /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_SHFileMove out from to hwnd - push `${from}` - push `${to}` - push ${hwnd} - StdUtils::SHFileMove /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_SHFileCopy out from to hwnd - push `${from}` - push `${to}` - push ${hwnd} - StdUtils::SHFileCopy /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_AppendToFile out from dest offset maxlen - push `${from}` - push `${dest}` - push ${offset} - push ${maxlen} - StdUtils::AppendToFile /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ExecShlUser out file verb args - push `${file}` - push `${verb}` - push `${args}` - StdUtils::ExecShellAsUser /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_InvkeShlVrb out path file verb_id - push "${path}" - push "${file}" - push ${verb_id} - StdUtils::InvokeShellVerb /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ExecShlWaitEx out_res out_val file verb args - push `${file}` - push `${verb}` - push `${args}` - StdUtils::ExecShellWaitEx /NOUNLOAD - pop ${out_res} - pop ${out_val} -!macroend - -!macro _StdU_WaitForProcEx out handle - push `${handle}` - StdUtils::WaitForProcEx /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetParameter out name default - push `${name}` - push `${default}` - StdUtils::GetParameter /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_TestParameter out name - push `${name}` - StdUtils::TestParameter /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ParameterCnt out - StdUtils::ParameterCnt /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_ParameterStr out index - push ${index} - StdUtils::ParameterStr /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetAllParams out truncate - push `${truncate}` - StdUtils::GetAllParameters /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetRealOSVer out_major out_minor out_spack - StdUtils::GetRealOsVersion /NOUNLOAD - pop ${out_major} - pop ${out_minor} - pop ${out_spack} -!macroend - -!macro _StdU_GetRealOSBld out - StdUtils::GetRealOsBuildNo /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetRealOSStr out - StdUtils::GetRealOsName /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_VrfyRealOSVer out major minor spack - push `${major}` - push `${minor}` - push `${spack}` - StdUtils::VerifyRealOsVersion /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_VrfyRealOSBld out build - push `${build}` - StdUtils::VerifyRealOsBuildNo /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetOSEdition out - StdUtils::GetOsEdition /NOUNLOAD - pop ${out} -!macroend - - -!macro _StdU_GetOSRelIdNo out - StdUtils::GetOsReleaseId /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_HashText out type text - push `${type}` - push `${text}` - StdUtils::HashText /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_HashFile out type file - push `${type}` - push `${file}` - StdUtils::HashFile /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_NormalizePath out path - push `${path}` - StdUtils::NormalizePath /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetParentPath out path - push `${path}` - StdUtils::GetParentPath /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_SplitPath out_drive out_dir out_fname out_ext path - push `${path}` - StdUtils::SplitPath /NOUNLOAD - pop ${out_drive} - pop ${out_dir} - pop ${out_fname} - pop ${out_ext} -!macroend - -!macro _StdU_GetDrivePart out path - push `${path}` - StdUtils::GetDrivePart /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetDirPart out path - push `${path}` - StdUtils::GetDirectoryPart /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetFNamePart out path - push `${path}` - StdUtils::GetFileNamePart /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetExtnPart out path - push `${path}` - StdUtils::GetExtensionPart /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_TimerCreate out callback interval - GetFunctionAddress ${out} ${callback} - push ${out} - push ${interval} - StdUtils::TimerCreate /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_TimerDestroy out timer_id - push ${timer_id} - StdUtils::TimerDestroy /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_PrtctStr out dpsc salt text - push `${dpsc}` - push `${salt}` - push `${text}` - StdUtils::ProtectStr /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_UnprtctStr out trnc salt data - push `${trnc}` - push `${salt}` - push `${data}` - StdUtils::UnprotectStr /NOUNLOAD - pop ${out} -!macroend - -!macro _StdU_GetLibVersion out_ver out_tst - StdUtils::GetLibVersion /NOUNLOAD - pop ${out_ver} - pop ${out_tst} -!macroend - -!macro _StdU_SetVerbose enable - Push ${enable} - StdUtils::SetVerboseMode /NOUNLOAD -!macroend - - -################################################################################# -# MAGIC NUMBERS -################################################################################# - -!define StdUtils.Const.ShellVerb.PinToTaskbar 0 -!define StdUtils.Const.ShellVerb.UnpinFromTaskbar 1 -!define StdUtils.Const.ShellVerb.PinToStart 2 -!define StdUtils.Const.ShellVerb.UnpinFromStart 3 - -!endif # !___STDUTILS__NSH___ diff --git a/node_modules/app-builder-lib/templates/nsis/include/StrContains.nsh b/node_modules/app-builder-lib/templates/nsis/include/StrContains.nsh deleted file mode 100644 index c7d395c..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/StrContains.nsh +++ /dev/null @@ -1,48 +0,0 @@ -; StrContains -; This function does a case sensitive searches for an occurrence of a substring in a string. -; It returns the substring if it is found. -; Otherwise it returns null(""). -; Written by kenglish_hi -; Adapted from StrReplace written by dandaman32 - - -Var STR_HAYSTACK -Var STR_NEEDLE -Var STR_CONTAINS_VAR_1 -Var STR_CONTAINS_VAR_2 -Var STR_CONTAINS_VAR_3 -Var STR_CONTAINS_VAR_4 -Var STR_RETURN_VAR - -Function StrContains - Exch $STR_NEEDLE - Exch 1 - Exch $STR_HAYSTACK - ; Uncomment to debug - ;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK ' - StrCpy $STR_RETURN_VAR "" - StrCpy $STR_CONTAINS_VAR_1 -1 - StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE - StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK - loop: - IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1 - StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1 - StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found - StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done - Goto loop - found: - StrCpy $STR_RETURN_VAR $STR_NEEDLE - Goto done - done: - Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the - Exch $STR_RETURN_VAR -FunctionEnd - -!macro _StrContainsConstructor OUT NEEDLE HAYSTACK - Push `${HAYSTACK}` - Push `${NEEDLE}` - Call StrContains - Pop `${OUT}` -!macroend - -!define StrContains '!insertmacro "_StrContainsConstructor"' \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/UAC.nsh b/node_modules/app-builder-lib/templates/nsis/include/UAC.nsh deleted file mode 100644 index 08979ab..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/UAC.nsh +++ /dev/null @@ -1,299 +0,0 @@ -/*** UAC Plug-in *** - -Interactive User (MediumIL) Admin user (HighIL) -***[Setup.exe]************* ***[Setup.exe]************** -* * * * -* +++[.OnInit]+++++++++++ * * +++[.OnInit]++++++++++++ * -* + UAC_RunElevated >---+-+----> * + + * -* + NSIS.Quit + * * + + * -* +++++++++++++++++++++++ * * ++++++++++++++++++++++++ * -* * * * -* * * * -* +++[Section]+++++++++++ * * +++[Section]++++++++++++ * -* + + * /--+-+- -** -** Get integrity level of current process -** -**/ -!macro UAC_GetIntegrityLevel outvar -UAC::_ 6 -!if "${outvar}" != "s" - Pop ${outvar} -!endif -!macroend - - - -/* UAC_IsAdmin -** -** Is the current process running with administrator privileges? Result in $0 -** -** ${If} ${UAC_IsAdmin} ... -** -**/ -!macro UAC_IsAdmin -UAC::_ 2 -!macroend -!define UAC_IsAdmin `"" UAC_IsAdmin ""` -!macro _UAC_IsAdmin _a _b _t _f -!insertmacro _UAC_MakeLL_Cmp _!= 0 2s -!macroend - - - -/* UAC_IsInnerInstance -** -** Does the current process have a NSIS/UAC parent process that is part of the elevation operation? -** -** ${If} ${UAC_IsInnerInstance} ... -** -**/ -!macro UAC_IsInnerInstance -UAC::_ 3 -!macroend -!define UAC_IsInnerInstance `"" UAC_IsInnerInstance ""` -!macro _UAC_IsInnerInstance _a _b _t _f -!insertmacro _UAC_MakeLL_Cmp _!= 0 3s -!macroend - - - -/* UAC_PageElevation_OnInit, UAC_PageElevation_OnGuiInit, -** -** Helper macros for elevation on a custom elevation page, see the DualMode example for more information. -** -**/ -!macro UAC_Notify_OnGuiInit -UAC::_ 4 -!macroend -!macro UAC_PageElevation_OnGuiInit -!insertmacro UAC_Notify_OnGuiInit -!macroend -!macro UAC_PageElevation_OnInit -UAC::_ 5 -${IfThen} ${Errors} ${|} Quit ${|} -!macroend - - - -/* UAC_AsUser_Call -** -** Calls a function or label in the user process instance. -** All the UAC_AsUser_* macros use this helper macro. -** -**/ -!define UAC_SYNCREGISTERS 0x1 -;define UAC_SYNCSTACK 0x2 -!define UAC_SYNCOUTDIR 0x4 -!define UAC_SYNCINSTDIR 0x8 -;define UAC_CLEARERRFLAG 0x10 -!macro UAC_AsUser_Call type name flags -push $0 -Get${type}Address $0 ${name} -!verbose push -!verbose ${UAC_VERBOSE} -!insertmacro _UAC_ParseDefineFlagsToInt _UAC_AsUser_Call__flags ${flags} -!verbose pop -StrCpy $0 "1$0:${_UAC_AsUser_Call__flags}" -!undef _UAC_AsUser_Call__flags -Exch $0 -UAC::_ -!macroend - - - -/* -** UAC_AsUser_GetSection -*/ -!macro UAC_AsUser_GetSection secprop secidx outvar -!insertmacro _UAC_AsUser_GenOp ${outvar} SectionGet${secprop} ${secidx} "" -!macroend - - - -/* -** UAC_AsUser_GetGlobalVar -** UAC_AsUser_GetGlobal -*/ -!macro UAC_AsUser_GetGlobalVar var -!insertmacro _UAC_AsUser_GenOp ${var} StrCpy "" ${var} -!macroend -!macro UAC_AsUser_GetGlobal outvar srcvar -!insertmacro _UAC_AsUser_GenOp ${outvar} StrCpy "" ${srcvar} -!macroend - - - -/* -** UAC_AsUser_ExecShell -** -** Call ExecShell in the user process instance. -** -*/ -!macro UAC_AsUser_ExecShell verb command params workdir show -!insertmacro _UAC_IncL -goto _UAC_L_E_${__UAC_L} -_UAC_L_F_${__UAC_L}: -ExecShell "${verb}" "${command}" '${params}' ${show} -return -_UAC_L_E_${__UAC_L}: -!if "${workdir}" != "" - push $outdir - SetOutPath "${workdir}" -!endif -!insertmacro UAC_AsUser_Call Label _UAC_L_F_${__UAC_L} ${UAC_SYNCREGISTERS}|${UAC_SYNCOUTDIR}|${UAC_SYNCINSTDIR} #|${UAC_CLEARERRFLAG} -!if "${workdir}" != "" - pop $outdir - SetOutPath $outdir -!endif -!macroend - - - -!macro _UAC_MakeLL_Cmp cmpop cmp pluginparams -!insertmacro _LOGICLIB_TEMP -UAC::_ ${pluginparams} -pop $_LOGICLIB_TEMP -!insertmacro ${cmpop} $_LOGICLIB_TEMP ${cmp} `${_t}` `${_f}` -!macroend -!macro _UAC_definemath def val1 op val2 -!define /math _UAC_definemath "${val1}" ${op} ${val2} -!ifdef ${def} - !undef ${def} -!endif -!define ${def} "${_UAC_definemath}" -!undef _UAC_definemath -!macroend -!macro _UAC_ParseDefineFlags_orin parse outflags -!searchparse /noerrors ${${parse}} "" _UAC_ParseDefineFlags_orin_f1 "|" _UAC_ParseDefineFlags_orin_f2 -!define _UAC_ParseDefineFlags_orin_this ${_UAC_ParseDefineFlags_orin_f1} -!undef ${parse} -!define ${parse} ${_UAC_ParseDefineFlags_orin_f2} -!define _UAC_ParseDefineFlags_orin_saveout ${${outflags}} -!undef ${outflags} -!define /math ${outflags} "${_UAC_ParseDefineFlags_orin_saveout}" | "${_UAC_ParseDefineFlags_orin_this}" -!undef _UAC_ParseDefineFlags_orin_saveout -!undef _UAC_ParseDefineFlags_orin_this -!ifdef _UAC_ParseDefineFlags_orin_f1 - !undef _UAC_ParseDefineFlags_orin_f1 -!endif -!ifdef _UAC_ParseDefineFlags_orin_f2 - !undef _UAC_ParseDefineFlags_orin_f2 -!endif -!macroend -!macro _UAC_ParseDefineFlags_Begin _outdef _in -!define _UAC_PDF${_outdef}_parse "${_in}" -!define _UAC_PDF${_outdef}_flags "" -!define _UAC_PDF${_outdef}_r 0 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x1 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x2 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x4 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x8 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x10 -!macroend -!macro _UAC_ParseDefineFlags_End _outdef -!define ${_outdef} ${_UAC_PDF${_outdef}_r} -!undef _UAC_PDF${_outdef}_r -!undef _UAC_PDF${_outdef}_flags -!undef _UAC_PDF${_outdef}_parse -!macroend -!macro _UAC_ParseDefineFlags_IncludeFlag _outdef flag -!if ${_UAC_PDF${_outdef}_flags} & ${flag} - !insertmacro _UAC_definemath _UAC_PDF${_outdef}_r ${_UAC_PDF${_outdef}_r} | ${flag} -!endif -!macroend -!macro _UAC_ParseDefineFlagsToInt _outdef _in -!insertmacro _UAC_ParseDefineFlags_Begin _UAC_ParseDefineFlagsToInt_tmp "${_in}" -!define ${_outdef} ${_UAC_PDF_UAC_ParseDefineFlagsToInt_tmp_flags} -!insertmacro _UAC_ParseDefineFlags_End _UAC_ParseDefineFlagsToInt_tmp -!undef _UAC_ParseDefineFlagsToInt_tmp -!macroend -!macro _UAC_IncL -!insertmacro _UAC_definemath __UAC_L "${__UAC_L}" + 1 -!macroend -!macro _UAC_AsUser_GenOp outvar op opparam1 opparam2 -!define _UAC_AUGOGR_ID _UAC_AUGOGR_OP${outvar}${op}${opparam1}${opparam2} -!ifndef ${_UAC_AUGOGR_ID} ;Has this exact action been done before? - !if ${outvar} == $0 - !define ${_UAC_AUGOGR_ID} $1 - !else - !define ${_UAC_AUGOGR_ID} $0 - !endif - !if "${opparam1}" == "" - !define _UAC_AUGOGR_OPP1 ${${_UAC_AUGOGR_ID}} - !define _UAC_AUGOGR_OPP2 ${opparam2} - !else - !define _UAC_AUGOGR_OPP1 ${opparam1} - !define _UAC_AUGOGR_OPP2 ${${_UAC_AUGOGR_ID}} - !endif - goto ${_UAC_AUGOGR_ID}_C - ${_UAC_AUGOGR_ID}_F: - ${op} ${_UAC_AUGOGR_OPP1} ${_UAC_AUGOGR_OPP2} - return - ${_UAC_AUGOGR_ID}_C: - !undef _UAC_AUGOGR_OPP1 - !undef _UAC_AUGOGR_OPP2 -!endif -push ${${_UAC_AUGOGR_ID}} -!insertmacro UAC_AsUser_Call Label ${_UAC_AUGOGR_ID}_F ${UAC_SYNCREGISTERS} -StrCpy ${outvar} ${${_UAC_AUGOGR_ID}} -pop ${${_UAC_AUGOGR_ID}} -!undef _UAC_AUGOGR_ID -!macroend - - - -!verbose pop -!endif /* UAC_HDR__INC */ \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh b/node_modules/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh deleted file mode 100644 index b6d0098..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +++ /dev/null @@ -1,70 +0,0 @@ -!include "getProcessInfo.nsh" -!include "nsProcess.nsh" - -# http://nsis.sourceforge.net/Allow_only_one_installer_instance -!macro ALLOW_ONLY_ONE_INSTALLER_INSTANCE - BringToFront - !define /ifndef SYSTYPE_PTR p ; NSIS v3.0+ - System::Call 'kernel32::CreateMutex(${SYSTYPE_PTR}0, i1, t"${APP_GUID}")?e' - Pop $0 - IntCmpU $0 183 0 launch launch ; ERROR_ALREADY_EXISTS - StrLen $0 "$(^SetupCaption)" - IntOp $0 $0 + 1 ; GetWindowText count includes \0 - StrCpy $1 "" ; Start FindWindow with NULL - loop: - FindWindow $1 "#32770" "" "" $1 - StrCmp 0 $1 notfound - System::Call 'user32::GetWindowText(${SYSTYPE_PTR}r1, t.r2, ir0)' - StrCmp $2 "$(^SetupCaption)" 0 loop - SendMessage $1 0x112 0xF120 0 /TIMEOUT=2000 ; WM_SYSCOMMAND:SC_RESTORE to restore the window if it is minimized - System::Call "user32::SetForegroundWindow(${SYSTYPE_PTR}r1)" - notfound: - Abort - launch: -!macroend - -Var pid - -!macro CHECK_APP_RUNNING - ${GetProcessInfo} 0 $pid $1 $2 $3 $4 - ${if} $3 != "${APP_EXECUTABLE_FILENAME}" - ${if} ${isUpdated} - # allow app to exit without explicit kill - Sleep 100 - ${endIf} - - ${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0 - ${if} $R0 == 0 - ${if} ${isUpdated} - # allow app to exit without explicit kill - Sleep 1000 - Goto doStopProcess - ${endIf} - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(appRunning)" /SD IDOK IDOK doStopProcess - Quit - - doStopProcess: - - DetailPrint `Closing running "${PRODUCT_NAME}"...` - - # https://github.com/electron-userland/electron-builder/issues/2516#issuecomment-372009092 - ExecWait `taskkill /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"` $R0 - # to ensure that files are not "in-use" - Sleep 100 - - ${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0 - ${if} $R0 == 0 - # wait to give a chance to exit gracefully - Sleep 1000 - # do not use /t tree kill - app was killed softly already - ExecWait `taskkill /f /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"` $R0 - ${If} $R0 != 0 - DetailPrint `Waiting for "${PRODUCT_NAME}" to close (taskkill exit code $R0).` - Sleep 2000 - ${endIf} - ${endIf} - ${endIf} - ${endIf} - - ${nsProcess::Unload} -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/extractAppPackage.nsh b/node_modules/app-builder-lib/templates/nsis/include/extractAppPackage.nsh deleted file mode 100644 index 79a0f2c..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/extractAppPackage.nsh +++ /dev/null @@ -1,57 +0,0 @@ -!macro extractEmbeddedAppPackage - !ifdef COMPRESS - SetCompress off - !endif - - Var /GLOBAL packageArch - - !ifdef APP_64 - StrCpy $packageArch "64" - - !ifdef APP_32 - ${if} ${RunningX64} - !insertmacro x64_app_files - ${else} - !insertmacro ia32_app_files - ${endIf} - !else - !insertmacro x64_app_files - !endif - !else - !insertmacro ia32_app_files - !endif - - !ifdef COMPRESS - SetCompress "${COMPRESS}" - !endif - - !ifdef ZIP_COMPRESSION - nsisunz::Unzip "$PLUGINSDIR\app-$packageArch.zip" "$INSTDIR" - !else - !insertmacro extractUsing7za "$PLUGINSDIR\app-$packageArch.7z" - !endif - - # after decompression - ${if} $packageArch == "64" - !ifmacrodef customFiles_x64 - !insertmacro customFiles_x64 - !endif - ${else} - !ifmacrodef customFiles_ia32 - !insertmacro customFiles_ia32 - !endif - ${endIf} -!macroend - -!macro x64_app_files - File /oname=$PLUGINSDIR\app-64.${COMPRESSION_METHOD} "${APP_64}" -!macroend - -!macro ia32_app_files - StrCpy $packageArch "32" - File /oname=$PLUGINSDIR\app-32.${COMPRESSION_METHOD} "${APP_32}" -!macroend - -!macro extractUsing7za FILE - Nsis7z::Extract "${FILE}" -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/getProcessInfo.nsh b/node_modules/app-builder-lib/templates/nsis/include/getProcessInfo.nsh deleted file mode 100644 index 9c44a8a..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/getProcessInfo.nsh +++ /dev/null @@ -1,157 +0,0 @@ -; NSIS PROCESS INFO LIBRARY - GetProcessInfo.nsh -; Version 1.1 - Mar 28th, 2011 -; -; Description: -; Gets process information. -; -; Usage example: -; ${GetProcessInfo} 0 $0 $1 $2 $3 $4 -; DetailPrint "pid=$0 parent_pid=$1 priority=$2 process_name=$3 exe=$4" -; -; History: -; 1.1 - 28/03/2011 - Added uninstall function, include guards, file header. Fixed getting full exe path on pre vista systems. (Sergius) -; - -!ifndef GETPROCESSINFO_INCLUDED -!define GETPROCESSINFO_INCLUDED - -!define PROCESSINFO.TH32CS_SNAPPROCESS 2 -!define PROCESSINFO.INVALID_HANDLE_VALUE -1 - -!define GetProcessInfo '!insertmacro GetProcessInfo' - -;@in pid_in - if 0 - get current process info -;@out pid_out - real process id (may be useful, if pid_in=0) -;@out ppid - parent process id -;@out priority -;@out name - name of process -;@out fullname - fully-qualified path of process -!macro GetProcessInfo pid_in pid_out ppid priority name fullname - Push ${pid_in} - !ifdef BUILD_UNINSTALLER - Call un._GetProcessInfo - !else - Call _GetProcessInfo - !endif - ;name;pri;ppid;fname;pid; - Pop ${name} - Pop ${priority} - Pop ${ppid} - Pop ${fullname} - Pop ${pid_out} -!macroend - -!macro FUNC_GETPROCESSINFO - Exch $R3 ;pid - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - Push $R0 ;hSnapshot - Push $R1 ;result - Push $R9 ;PROCESSENTRY32;MODULEENTRY32 and so on - Push $R8 - - ;zero registers to waste trash, if error occurred - StrCpy $0 "" - StrCpy $1 "" - StrCpy $2 "" - StrCpy $3 "" - StrCpy $4 "" - StrCpy $5 "" - - IntCmp $R3 0 0 skip_pid_detection skip_pid_detection - System::Call 'kernel32::GetCurrentProcess() i.R0' - System::Call "Kernel32::GetProcessId(i R0) i.R3" - -skip_pid_detection: - System::Call 'Kernel32::CreateToolhelp32Snapshot(i ${PROCESSINFO.TH32CS_SNAPPROCESS},i R3) i.R0' - - IntCmp $R0 ${PROCESSINFO.INVALID_HANDLE_VALUE} end ;someting wrong - - ;$R9=PROCESSENTRY32 - ;typedef struct tagPROCESSENTRY32 { - ; DWORD dwSize; - ; DWORD cntUsage; - ; DWORD th32ProcessID; - ; ULONG_PTR th32DefaultHeapID; - ; DWORD th32ModuleID; - ; DWORD cntThreads; - ; DWORD th32ParentProcessID; - ; LONG pcPriClassBase; - ; DWORD dwFlags; - ; TCHAR szExeFile[MAX_PATH]; - ;}PROCESSENTRY32, *PPROCESSENTRY32; - ;dwSize=4*9+2*260 - - System::Alloc 1024 - pop $R9 - System::Call "*$R9(i 556)" - - System::Call 'Kernel32::Process32FirstW(i R0, i $R9) i.R1' - StrCmp $R1 0 end - -nnext_iteration: - System::Call "*$R9(i,i,i.R1)" ;get PID - IntCmp $R1 $R3 exitloop - - System::Call 'Kernel32::Process32NextW(i R0, i $R9) i.R1' - IntCmp $R1 0 0 nnext_iteration nnext_iteration - -exitloop: - ;$0 - pid - ;$1 - threads - ;$2 - ppid - ;$3 - priority - ;$4 - process name - System::Call "*$R9(i,i,i.r0,i,i,i.r1,i.r2,i.r3,i,&w256.r4)" ; Get next module - - ;free: - System::Free $R9 - System::Call "Kernel32::CloseToolhelp32Snapshot(i R0)" - - ;=============== - ;now get full path and commandline - - System::Call "Kernel32::OpenProcess(i 1040, i 0, i r0)i .R0" - - StrCmp $R0 0 end - - IntOp $R8 0 + 256 - System::Call "psapi::GetModuleFileNameExW(i R0,i 0,t .r5, *i $R8)i .R1" - -end: - Pop $R8 - Pop $R9 - Pop $R1 - Pop $R0 - Exch $5 - Exch 1 - Exch $4 - Exch 2 - Exch $3 - Exch 3 - Exch $2 - Exch 4 - Pop $1 - Exch 4 - Exch $0 - Exch 5 - Pop $R3 -!macroend ;FUNC_GETPROCESSINFO - -!ifndef BUILD_UNINSTALLER -Function _GetProcessInfo - !insertmacro FUNC_GETPROCESSINFO -FunctionEnd -!endif - -!ifdef BUILD_UNINSTALLER -Function un._GetProcessInfo - !insertmacro FUNC_GETPROCESSINFO -FunctionEnd -!endif - -!endif ;GETPROCESSINFO_INCLUDED \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/installUtil.nsh b/node_modules/app-builder-lib/templates/nsis/include/installUtil.nsh deleted file mode 100644 index b256389..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/installUtil.nsh +++ /dev/null @@ -1,181 +0,0 @@ -!macro moveFile FROM TO - ClearErrors - Rename `${FROM}` `${TO}` - ${if} ${errors} - # not clear - can NSIS rename on another drive or not, so, in case of error, just copy - ClearErrors - !insertmacro copyFile `${FROM}` `${TO}` - Delete `${FROM}` - ${endif} -!macroend - -!macro copyFile FROM TO - ${StdUtils.GetParentPath} $R5 `${TO}` - CreateDirectory `$R5` - ClearErrors - CopyFiles /SILENT `${FROM}` `${TO}` -!macroend - -Function GetInQuotes - Exch $R0 - Push $R1 - Push $R2 - Push $R3 - - StrCpy $R2 -1 - IntOp $R2 $R2 + 1 - StrCpy $R3 $R0 1 $R2 - StrCmp $R3 "" 0 +3 - StrCpy $R0 "" - Goto Done - StrCmp $R3 '"' 0 -5 - - IntOp $R2 $R2 + 1 - StrCpy $R0 $R0 "" $R2 - - StrCpy $R2 0 - IntOp $R2 $R2 + 1 - StrCpy $R3 $R0 1 $R2 - StrCmp $R3 "" 0 +3 - StrCpy $R0 "" - Goto Done - StrCmp $R3 '"' 0 -5 - - StrCpy $R0 $R0 $R2 - Done: - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -!macro GetInQuotes Var Str - Push "${Str}" - Call GetInQuotes - Pop "${Var}" -!macroend - -Function GetFileParent - Exch $R0 - Push $R1 - Push $R2 - Push $R3 - - StrCpy $R1 0 - StrLen $R2 $R0 - - loop: - IntOp $R1 $R1 + 1 - IntCmp $R1 $R2 get 0 get - StrCpy $R3 $R0 1 -$R1 - StrCmp $R3 "\" get - Goto loop - - get: - StrCpy $R0 $R0 -$R1 - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -Var /GLOBAL isTryToKeepShortcuts - -!macro setIsTryToKeepShortcuts - StrCpy $isTryToKeepShortcuts "true" - !ifdef allowToChangeInstallationDirectory - ${ifNot} ${isUpdated} - StrCpy $isTryToKeepShortcuts "false" - ${endIf} - !endif -!macroend - -# https://nsis-dev.github.io/NSIS-Forums/html/t-172971.html -!macro readReg VAR ROOT_KEY SUB_KEY NAME - ${if} "${ROOT_KEY}" == "SHELL_CONTEXT" - ReadRegStr "${VAR}" SHELL_CONTEXT "${SUB_KEY}" "${NAME}" - ${elseif} "${ROOT_KEY}" == "HKEY_CURRENT_USER" - ReadRegStr "${VAR}" HKEY_CURRENT_USER "${SUB_KEY}" "${NAME}" - ${elseif} "${ROOT_KEY}" == "HKEY_LOCAL_MACHINE" - ReadRegStr "${VAR}" HKEY_LOCAL_MACHINE "${SUB_KEY}" "${NAME}" - ${else} - MessageBox MB_OK "Unsupported ${ROOT_KEY}" - ${endif} -!macroend - -# http://stackoverflow.com/questions/24595887/waiting-for-nsis-uninstaller-to-finish-in-nsis-installer-either-fails-or-the-uni -Function uninstallOldVersion - Var /GLOBAL uninstallerFileName - Var /GLOBAL installationDir - Var /GLOBAL uninstallString - Var /GLOBAL rootKey - - ClearErrors - Exch $rootKey - - !insertmacro readReg $uninstallString "$rootKey" "${UNINSTALL_REGISTRY_KEY}" UninstallString - ${if} $uninstallString == "" - !ifdef UNINSTALL_REGISTRY_KEY_2 - !insertmacro readReg $uninstallString "$rootKey" "${UNINSTALL_REGISTRY_KEY_2}" UninstallString - !endif - ${if} $uninstallString == "" - Goto Done - ${endif} - ${endif} - - # uninstaller should be copied out of app installation dir (because this dir will be deleted), so, extract uninstaller file name - !insertmacro GetInQuotes $uninstallerFileName "$uninstallString" - - !insertmacro readReg $installationDir "$rootKey" "${INSTALL_REGISTRY_KEY}" InstallLocation - ${if} $installationDir == "" - ${andIf} $uninstallerFileName != "" - # https://github.com/electron-userland/electron-builder/issues/735#issuecomment-246918567 - Push $uninstallerFileName - Call GetFileParent - Pop $installationDir - ${endif} - - ${if} $installationDir == "" - ${andIf} $uninstallerFileName == "" - Goto Done - ${endif} - - !insertmacro moveFile "$uninstallerFileName" "$PLUGINSDIR\old-uninstaller.exe" - StrCpy $uninstallerFileName "$PLUGINSDIR\old-uninstaller.exe" - - ${if} $installMode == "CurrentUser" - ${orIf} $rootKey == "HKEY_CURRENT_USER" - StrCpy $0 "/currentuser" - ${else} - StrCpy $0 "/allusers" - ${endif} - - !insertMacro setIsTryToKeepShortcuts - - ${if} $isTryToKeepShortcuts == "true" - !insertmacro readReg $R5 "$rootKey" "${INSTALL_REGISTRY_KEY}" KeepShortcuts - # if true, it means that old uninstaller supports --keep-shortcuts flag - ${if} $R5 == "true" - ${andIf} ${FileExists} "$appExe" - StrCpy $0 "$0 --keep-shortcuts" - ${endIf} - ${endIf} - - ${if} ${isDeleteAppData} - StrCpy $0 "$0 --delete-app-data" - ${else} - # always pass --updated flag - to ensure that if DELETE_APP_DATA_ON_UNINSTALL is defined, user data will be not removed - StrCpy $0 "$0 --updated" - ${endif} - - ExecWait '"$uninstallerFileName" /S /KEEP_APP_DATA $0 _?=$installationDir' - - Done: -FunctionEnd - -!macro uninstallOldVersion ROOT_KEY - Push "${ROOT_KEY}" - Call uninstallOldVersion -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/installer.nsh b/node_modules/app-builder-lib/templates/nsis/include/installer.nsh deleted file mode 100644 index 2423390..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/installer.nsh +++ /dev/null @@ -1,212 +0,0 @@ -# functions (nsis macro) for installer - -!include "extractAppPackage.nsh" - -!ifdef APP_PACKAGE_URL - !include webPackage.nsh -!endif - -!macro installApplicationFiles - !ifdef APP_BUILD_DIR - File /r "${APP_BUILD_DIR}\*.*" - !else - !ifdef APP_PACKAGE_URL - Var /GLOBAL packageFile - Var /GLOBAL isPackageFileExplicitlySpecified - - ${StdUtils.GetParameter} $packageFile "package-file" "" - ${if} $packageFile == "" - !ifdef APP_64_NAME - !ifdef APP_32_NAME - ${if} ${RunningX64} - StrCpy $packageFile "${APP_64_NAME}" - StrCpy $1 "${APP_64_HASH}" - ${else} - StrCpy $packageFile "${APP_32_NAME}" - StrCpy $1 "${APP_32_HASH}" - ${endif} - !else - StrCpy $packageFile "${APP_64_NAME}" - StrCpy $1 "${APP_64_HASH}" - !endif - !else - StrCpy $packageFile "${APP_32_NAME}" - StrCpy $1 "${APP_32_HASH}" - !endif - StrCpy $4 "$packageFile" - StrCpy $packageFile "$EXEDIR/$packageFile" - StrCpy $isPackageFileExplicitlySpecified "false" - ${else} - StrCpy $isPackageFileExplicitlySpecified "true" - ${endIf} - - # we do not check file hash is specifed explicitly using --package-file because it is clear that user definitly want to use this file and it is user responsibility to check - # 1. auto-updater uses --package-file and validates checksum - # 2. user can user another package file (use case - one installer suitable for any app version (use latest version)) - ${if} ${FileExists} "$packageFile" - ${if} $isPackageFileExplicitlySpecified == "true" - Goto fun_extract - ${else} - ${StdUtils.HashFile} $3 "SHA2-512" "$packageFile" - ${if} $3 == $1 - Goto fun_extract - ${else} - MessageBox MB_OK "Package file $4 found locally, but checksum doesn't match — expected $1, actual $3.$\r$\nLocal file is ignored and package will be downloaded from Internet." - ${endIf} - ${endIf} - ${endIf} - - !insertmacro downloadApplicationFiles - - fun_extract: - !insertmacro extractUsing7za "$packageFile" - - # electron always uses per user app data - ${if} $installMode == "all" - SetShellVarContext current - ${endif} - - !insertmacro moveFile "$packageFile" "$LOCALAPPDATA\${APP_PACKAGE_STORE_FILE}" - - ${if} $installMode == "all" - SetShellVarContext all - ${endif} - !else - !insertmacro extractEmbeddedAppPackage - # electron always uses per user app data - ${if} $installMode == "all" - SetShellVarContext current - ${endif} - !insertmacro copyFile "$EXEPATH" "$LOCALAPPDATA\${APP_INSTALLER_STORE_FILE}" - ${if} $installMode == "all" - SetShellVarContext all - ${endif} - !endif - !endif - - File "/oname=${UNINSTALL_FILENAME}" "${UNINSTALLER_OUT_FILE}" -!macroend - -!macro registryAddInstallInfo - WriteRegStr SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" InstallLocation "$INSTDIR" - WriteRegStr SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" KeepShortcuts "true" - WriteRegStr SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" ShortcutName "${SHORTCUT_NAME}" - !ifdef MENU_FILENAME - WriteRegStr SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" MenuDirectory "${MENU_FILENAME}" - !endif - - ${if} $installMode == "all" - StrCpy $0 "/allusers" - StrCpy $1 "" - ${else} - StrCpy $0 "/currentuser" - StrCpy $1 "" - ${endIf} - - WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" DisplayName "${UNINSTALL_DISPLAY_NAME}$1" - # https://github.com/electron-userland/electron-builder/issues/750 - StrCpy $2 "$INSTDIR\${UNINSTALL_FILENAME}" - WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" UninstallString '"$2" $0' - WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" QuietUninstallString '"$2" $0 /S' - - WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "DisplayVersion" "${VERSION}" - !ifdef UNINSTALLER_ICON - WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "DisplayIcon" "$INSTDIR\uninstallerIcon.ico" - !else - WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "DisplayIcon" "$appExe,0" - !endif - - !ifdef COMPANY_NAME - WriteRegStr SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "Publisher" "${COMPANY_NAME}" - !endif - WriteRegDWORD SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" NoModify 1 - WriteRegDWORD SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" NoRepair 1 - - # allow user to define ESTIMATED_SIZE to avoid GetSize call - !ifdef ESTIMATED_SIZE - IntFmt $0 "0x%08X" ${ESTIMATED_SIZE} - !else - ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 - IntFmt $0 "0x%08X" $0 - !endif - WriteRegDWORD SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" "EstimatedSize" "$0" -!macroend - -!macro cleanupOldMenuDirectory - ${if} $oldMenuDirectory != "" - !ifdef MENU_FILENAME - ${if} $oldMenuDirectory != "${MENU_FILENAME}" - RMDir "$SMPROGRAMS\$oldMenuDirectory" - ${endIf} - !else - RMDir "$SMPROGRAMS\$oldMenuDirectory" - !endif - ${endIf} -!macroend - -!macro createMenuDirectory - !ifdef MENU_FILENAME - CreateDirectory "$SMPROGRAMS\${MENU_FILENAME}" - ClearErrors - !endif -!macroend - -!macro addStartMenuLink keepShortcuts - !ifndef DO_NOT_CREATE_START_MENU_SHORTCUT - # The keepShortcuts mechanism is NOT enabled. - # Menu shortcut will be recreated. - ${if} $keepShortcuts == "false" - !insertmacro cleanupOldMenuDirectory - !insertmacro createMenuDirectory - - CreateShortCut "$newStartMenuLink" "$appExe" "" "$appExe" 0 "" "" "${APP_DESCRIPTION}" - # clear error (if shortcut already exists) - ClearErrors - WinShell::SetLnkAUMI "$newStartMenuLink" "${APP_ID}" - # The keepShortcuts mechanism IS enabled. - # The menu shortcut could either not exist (it shouldn't be recreated) or exist in an obsolete location. - ${elseif} $oldStartMenuLink != $newStartMenuLink - ${andIf} ${FileExists} "$oldStartMenuLink" - !insertmacro createMenuDirectory - - Rename $oldStartMenuLink $newStartMenuLink - WinShell::UninstShortcut "$oldStartMenuLink" - WinShell::SetLnkAUMI "$newStartMenuLink" "${APP_ID}" - - !insertmacro cleanupOldMenuDirectory - ${endIf} - !endif -!macroend - -!macro addDesktopLink keepShortcuts - !ifndef DO_NOT_CREATE_DESKTOP_SHORTCUT - # https://github.com/electron-userland/electron-builder/pull/1432 - ${ifNot} ${isNoDesktopShortcut} - # The keepShortcuts mechanism is NOT enabled. - # Shortcuts will be recreated. - ${if} $keepShortcuts == "false" - CreateShortCut "$newDesktopLink" "$appExe" "" "$appExe" 0 "" "" "${APP_DESCRIPTION}" - ClearErrors - WinShell::SetLnkAUMI "$newDesktopLink" "${APP_ID}" - # The keepShortcuts mechanism IS enabled. - # The desktop shortcut could exist in an obsolete location (due to name change). - ${elseif} $oldDesktopLink != $newDesktopLink - ${orIf} ${FileExists} "$oldDesktopLink" - Rename $oldDesktopLink $newDesktopLink - WinShell::UninstShortcut "$oldDesktopLink" - WinShell::SetLnkAUMI "$newDesktopLink" "${APP_ID}" - - !ifdef RECREATE_DESKTOP_SHORTCUT - ${elseif} $oldDesktopLink != $newDesktopLink - ${orIfNot} ${FileExists} "$oldDesktopLink" - ${ifNot} ${isUpdated} - CreateShortCut "$newDesktopLink" "$appExe" "" "$appExe" 0 "" "" "${APP_DESCRIPTION}" - ClearErrors - WinShell::SetLnkAUMI "$newDesktopLink" "${APP_ID}" - ${endIf} - !endif - ${endIf} - System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)' - ${endIf} - !endif -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/include/nsProcess.nsh b/node_modules/app-builder-lib/templates/nsis/include/nsProcess.nsh deleted file mode 100644 index 9ef6098..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/nsProcess.nsh +++ /dev/null @@ -1,28 +0,0 @@ -!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess` - -!macro nsProcess::FindProcess _FILE _ERR - nsProcess::_FindProcess /NOUNLOAD `${_FILE}` - Pop ${_ERR} -!macroend - - -!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess` - -!macro nsProcess::KillProcess _FILE _ERR - nsProcess::_KillProcess /NOUNLOAD `${_FILE}` - Pop ${_ERR} -!macroend - -!define nsProcess::CloseProcess `!insertmacro nsProcess::CloseProcess` - -!macro nsProcess::CloseProcess _FILE _ERR - nsProcess::_CloseProcess /NOUNLOAD `${_FILE}` - Pop ${_ERR} -!macroend - - -!define nsProcess::Unload `!insertmacro nsProcess::Unload` - -!macro nsProcess::Unload - nsProcess::_Unload -!macroend diff --git a/node_modules/app-builder-lib/templates/nsis/include/webPackage.nsh b/node_modules/app-builder-lib/templates/nsis/include/webPackage.nsh deleted file mode 100644 index 44ff5d6..0000000 --- a/node_modules/app-builder-lib/templates/nsis/include/webPackage.nsh +++ /dev/null @@ -1,41 +0,0 @@ -!macro downloadApplicationFiles - Var /GLOBAL packageUrl - Var /GLOBAL packageArch - - StrCpy $packageUrl "${APP_PACKAGE_URL}" - StrCpy $packageArch "${APP_PACKAGE_URL}" - - !ifdef APP_PACKAGE_URL_IS_INCOMLETE - !ifdef APP_64_NAME - !ifdef APP_32_NAME - ${if} ${RunningX64} - StrCpy $packageUrl "$packageUrl/${APP_64_NAME}" - ${else} - StrCpy $packageUrl "$packageUrl/${APP_32_NAME}" - ${endif} - !else - StrCpy $packageUrl "$packageUrl/${APP_64_NAME}" - !endif - !else - StrCpy $packageUrl "$packageUrl/${APP_32_NAME}" - !endif - !endif - - ${if} ${RunningX64} - StrCpy $packageArch "64" - ${else} - StrCpy $packageArch "32" - ${endif} - - download: - inetc::get /USERAGENT "electron-builder (Mozilla)" /header "X-Arch: $packageArch" /RESUME "" "$packageUrl" "$PLUGINSDIR\package.7z" /END - Pop $0 - ${if} $0 == "Cancelled" - quit - ${elseif} $0 != "OK" - Messagebox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Unable to download application package from $packageUrl (status: $0).$\r$\n$\r$\nPlease check you Internet connection and retry." IDRETRY download - Quit - ${endif} - - StrCpy $packageFile "$PLUGINSDIR\package.7z" -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/installSection.nsh b/node_modules/app-builder-lib/templates/nsis/installSection.nsh deleted file mode 100644 index 4e6cfa9..0000000 --- a/node_modules/app-builder-lib/templates/nsis/installSection.nsh +++ /dev/null @@ -1,104 +0,0 @@ -!include installer.nsh - -InitPluginsDir - -${IfNot} ${Silent} - SetDetailsPrint none -${endif} - -StrCpy $appExe "$INSTDIR\${APP_EXECUTABLE_FILENAME}" - -# must be called before uninstallOldVersion -!insertmacro setLinkVars - -!ifdef ONE_CLICK - !ifdef HEADER_ICO - File /oname=$PLUGINSDIR\installerHeaderico.ico "${HEADER_ICO}" - !endif - ${IfNot} ${Silent} - !ifdef HEADER_ICO - SpiderBanner::Show /MODERN /ICON "$PLUGINSDIR\installerHeaderico.ico" - !else - SpiderBanner::Show /MODERN - !endif - - FindWindow $0 "#32770" "" $hwndparent - FindWindow $0 "#32770" "" $hwndparent $0 - GetDlgItem $0 $0 1000 - SendMessage $0 ${WM_SETTEXT} 0 "STR:$(installing)" - ${endif} - !insertmacro CHECK_APP_RUNNING -!else - ${ifNot} ${UAC_IsInnerInstance} - !insertmacro CHECK_APP_RUNNING - ${endif} -!endif - -Var /GLOBAL keepShortcuts -StrCpy $keepShortcuts "false" -!insertMacro setIsTryToKeepShortcuts -${if} $isTryToKeepShortcuts == "true" - ReadRegStr $R1 SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" KeepShortcuts - - ${if} $R1 == "true" - ${andIf} ${FileExists} "$appExe" - StrCpy $keepShortcuts "true" - ${endIf} -${endif} - -!insertmacro uninstallOldVersion SHELL_CONTEXT -${if} $installMode == "all" - !insertmacro uninstallOldVersion HKEY_CURRENT_USER -${endIf} - -SetOutPath $INSTDIR - -!ifdef UNINSTALLER_ICON - File /oname=uninstallerIcon.ico "${UNINSTALLER_ICON}" -!endif - -!insertmacro installApplicationFiles -!insertmacro registryAddInstallInfo -!insertmacro addStartMenuLink $keepShortcuts -!insertmacro addDesktopLink $keepShortcuts - -${if} ${FileExists} "$newStartMenuLink" - StrCpy $launchLink "$newStartMenuLink" -${else} - StrCpy $launchLink "$INSTDIR\${APP_EXECUTABLE_FILENAME}" -${endIf} - -!ifmacrodef registerFileAssociations - !insertmacro registerFileAssociations -!endif - -!ifmacrodef customInstall - !insertmacro customInstall -!endif - -!macro doStartApp - # otherwise app window will be in background - HideWindow - !insertmacro StartApp -!macroend - -!ifdef ONE_CLICK - # https://github.com/electron-userland/electron-builder/pull/3093#issuecomment-403734568 - !ifdef RUN_AFTER_FINISH - ${ifNot} ${Silent} - ${orIf} ${isForceRun} - !insertmacro doStartApp - ${endIf} - !else - ${if} ${isForceRun} - !insertmacro doStartApp - ${endIf} - !endif - !insertmacro quitSuccess -!else - # for assisted installer run only if silent, because assisted installer has run after finish option - ${if} ${isForceRun} - ${andIf} ${Silent} - !insertmacro doStartApp - ${endIf} -!endif \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/installer.nsi b/node_modules/app-builder-lib/templates/nsis/installer.nsi deleted file mode 100644 index a228a29..0000000 --- a/node_modules/app-builder-lib/templates/nsis/installer.nsi +++ /dev/null @@ -1,90 +0,0 @@ -Var newStartMenuLink -Var oldStartMenuLink -Var newDesktopLink -Var oldDesktopLink -Var oldShortcutName -Var oldMenuDirectory - -!include "common.nsh" -!include "MUI2.nsh" -!include "multiUser.nsh" -!include "allowOnlyOneInstallerInstance.nsh" - -!ifdef INSTALL_MODE_PER_ALL_USERS - !ifdef BUILD_UNINSTALLER - RequestExecutionLevel user - !else - RequestExecutionLevel admin - !endif -!else - RequestExecutionLevel user -!endif - -!ifdef BUILD_UNINSTALLER - SilentInstall silent -!else - Var appExe - Var launchLink -!endif - -!ifdef ONE_CLICK - !include "oneClick.nsh" -!else - !include "assistedInstaller.nsh" -!endif - -!insertmacro addLangs - -!ifmacrodef customHeader - !insertmacro customHeader -!endif - -Function .onInit - !ifmacrodef preInit - !insertmacro preInit - !endif - - !ifdef DISPLAY_LANG_SELECTOR - !insertmacro MUI_LANGDLL_DISPLAY - !endif - - !ifdef BUILD_UNINSTALLER - WriteUninstaller "${UNINSTALLER_OUT_FILE}" - !insertmacro quitSuccess - !else - !insertmacro check64BitAndSetRegView - - !ifdef ONE_CLICK - !insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE - !else - ${IfNot} ${UAC_IsInnerInstance} - !insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE - ${EndIf} - !endif - - !insertmacro initMultiUser - - !ifmacrodef customInit - !insertmacro customInit - !endif - - !ifmacrodef addLicenseFiles - InitPluginsDir - !insertmacro addLicenseFiles - !endif - !endif -FunctionEnd - -!ifndef BUILD_UNINSTALLER - !include "installUtil.nsh" -!endif - -Section "install" - !ifndef BUILD_UNINSTALLER - !include "installSection.nsh" - !endif -SectionEnd - -!ifdef BUILD_UNINSTALLER - !include "uninstaller.nsh" -!endif \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/messages.yml b/node_modules/app-builder-lib/templates/nsis/messages.yml deleted file mode 100644 index 95688f1..0000000 --- a/node_modules/app-builder-lib/templates/nsis/messages.yml +++ /dev/null @@ -1,102 +0,0 @@ -# one-click installer messages, see assistedMessages.yml for assisted installer messages -# en must be first (https://github.com/electron-userland/electron-builder/issues/2517) -win7Required: - en: Windows 7 and above is required - de: Windows 7 oder höher wird vorausgesetzt - it: È necessario disporre del sistema operativo Windows 7 e successivi - fr: Windows 7 (ou une version ultérieure) est requis - ja: Windows 7 以降が必要です - ko: Windows 7 이상이 필요합니다 - ru: Требуется Windows 7 и выше - sk: Iba Windows 7 a vyššie je podporovaný - hu: Windows 7 vagy újabb szükséges - pl: Windows 7 lub nowszy jest wymagany - pt_BR: Requer Windows 7 ou superior - zh_CN: 需要 Windows 7 或以上系统 - tr_TR: Windows 7 ve üstü gereklidir - sv_SE: Windows 7 eller högre krävs - no: Windows 7 og over er nødvendig - nl_NL: Windows 7 en hoger is vereist - fi: Windows 7 tai uudempi vaaditaan - es: Se necesita Windows 7 o una versión superior. - da: Windows 7 og højere er nødvendig -x64WinRequired: - en: 64-bit Windows is required - de: 64-Bit-Windows wird vorausgesetzt - it: È necessario disporre di un sistema operativo Windows a 64 bit - fr: Windows 64 bits est requis - ja: 64 ビット バージョンの Windows が必要です - ko: 64 비트 버전의 Windows가 필요합니다 - ru: Требуется Windows 64-bit - sk: Potrebujete 64-bit Windows - hu: 64-bit Windows szükséges - pl: Windows 64-bitowy jest wymagany - pt_BR: Requer Windows 64 bits - zh_CN: 需要 64 位 Windows 系统 - tr_TR: 64 bit Windows gerekli - sv_SE: 64-bitars Windows krävs - no: 64-biters Windows er nødvendig - nl_NL: 64-bit Windows is vereist - fi: 64-bittinen Windows on pakollinen - es: Windows de 64 bits es requerido - da: 64-bit Windows er påkrævet -appRunning: - en: "${PRODUCT_NAME} is running.\nClick OK to close it." - de: "${PRODUCT_NAME} ist geöffnet. \nKlicken Sie zum Schliessen auf «OK»." - it: "${PRODUCT_NAME} è in esecuzione. \nPremi OK per chiudere." - fr: "${PRODUCT_NAME} est en cours d’utilisation. \nCliquez sur «OK» pour fermer ce programme." - ja: "${PRODUCT_NAME} が実行中です。\nOK をクリックすると終了します。" - ko: "${PRODUCT_NAME}이(가) 실행 중입니다. \nOK을 클릭하면 종료됩니다." - ru: "Приложение ${PRODUCT_NAME} уже запущено.\nНажмите OK для закрытия." - sk: "${PRODUCT_NAME} práve beží.\nUkončite ho kliknutím na OK." - hu: "${PRODUCT_NAME} éppen fut. \nKattiontson az «OK»-ra a bezárásához." - pl: "${PRODUCT_NAME} jest otwarty. Aby zamknąć kliknij na OK." - pt_BR: "${PRODUCT_NAME} está em execução.\nClique em OK para fechar." - zh_CN: "${PRODUCT_NAME} 正在运行.\n点击 OK 关闭." - tr_TR: "${PRODUCT_NAME} çalışıyor.\nKapatmak için Tamam'ı tıklayın." - sv_SE: "${PRODUCT_NAME} körs. \nKlicka på OK för att stänga det." - no: "${PRODUCT_NAME} kjører. \nKlikk OK for å lukke det." - nl_NL: "${PRODUCT_NAME} draait. \nKlik op 'OK' om het te sluiten." - fi: "${PRODUCT_NAME} on käynnissä. Napsauta OK sulkeaksesi sen." - es: "${PRODUCT_NAME} se está ejecutando. Haz clic en Aceptar para cerrarlo." - da: "${PRODUCT_NAME} er i gang. Klik OK for at lukke." -installing: - en: Installing, please wait... - de: Installation läuft, bitte warten... - it: Attendere prego. Installazione in corso... - fr: En cours d’installation... Veuillez patienter s'il vous plaît. - ja: インストールしています。しばらくお待ちください... - ko: 설치하고 있습니다. 잠시 기다려주십시오... - ru: Установка, пожалуйста, подождите... - sk: Inštalujem, prosím počkajte... - hu: Telepítés, kérem várjon... - pl: Zaczekaj na ukończenie instalacji... - pt_BR: Instalando, por favor aguarde... - zh_CN: 正在安装, 请稍候... - tr_TR: Yükleniyor, lütfen bekleyin... - sv_SE: Installerar, vänligen vänta... - no: Installerer, vennligst vent... - nl_NL: Installeren, even geduld... - fi: Asennetaan, odota... - es: Instalando, espera un momento... - da: Installerer, vent venligst... -areYouSureToUninstall: - en: Are you sure you want to uninstall ${PRODUCT_NAME}? - de: Sind Sie sicher, dass Sie ${PRODUCT_NAME} deinstallieren möchten? - it: Sicuro di voler procedere alla disinstallazione di ${PRODUCT_NAME}? - fr: Etes-vous sûr(e) de vouloir désinstaller ${PRODUCT_NAME}? - ja: ${PRODUCT_NAME} をアンインストールしてもよろしいですか? - ko: ${PRODUCT_NAME}을(를) 제거 하시겠습니까? - ru: Вы уверены, что хотите удалить ${PRODUCT_NAME}? - sk: Ste si istý že chcete odinštalovať ${PRODUCT_NAME}? - hu: Biztos benne, hogy szeretné eltávolítani a ${PRODUCT_NAME} alkalmazást? - pl: Czy na pewno chcesz odinstalować ${PRODUCT_NAME}? - pt_BR: Tem certeza que deseja desinstalar ${PRODUCT_NAME}? - zh_CN: 确定卸载 ${PRODUCT_NAME} 吗? - tr_TR: ${PRODUCT_NAME} kaldırmak istediğinize Eminmisiniz? - sv_SE: Är du säker på att du vill avinstallera ${PRODUCT_NAME}? - no: Er du sikker på at du vil avinstallere ${PRODUCT_NAME}? - nl_NL: Weet je zeker dat je ${PRODUCT_NAME} wilt verwijderen? - fi: Oletko varma, että haluat poistaa ${PRODUCT_NAME} asennuksen? - es: ¿Seguro que quieres desinstalar ${PRODUCT_NAME}? - da: Er du sikker på, at du vil afinstallere ${PRODUCT_NAME}? diff --git a/node_modules/app-builder-lib/templates/nsis/multiUser.nsh b/node_modules/app-builder-lib/templates/nsis/multiUser.nsh deleted file mode 100644 index 3de631b..0000000 --- a/node_modules/app-builder-lib/templates/nsis/multiUser.nsh +++ /dev/null @@ -1,93 +0,0 @@ -!include FileFunc.nsh -!include UAC.nsh - -!define FOLDERID_UserProgramFiles {5CD7AEE2-2219-4A67-B85D-6C9CE15660CB} -!define KF_FLAG_CREATE 0x00008000 - -# allow user to define own custom -!define /ifndef INSTALL_REGISTRY_KEY "Software\${APP_GUID}" -!define /ifndef UNINSTALL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${UNINSTALL_APP_KEY}" - -# current Install Mode ("all" or "CurrentUser") -Var installMode - -!ifndef INSTALL_MODE_PER_ALL_USERS - !ifndef ONE_CLICK - Var hasPerUserInstallation - Var hasPerMachineInstallation - !endif - Var PerUserInstallationFolder - - !macro setInstallModePerUser - StrCpy $installMode CurrentUser - SetShellVarContext current - - # сhecks registry for previous installation path - ReadRegStr $perUserInstallationFolder HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation - ${if} $perUserInstallationFolder != "" - StrCpy $INSTDIR $perUserInstallationFolder - ${else} - StrCpy $0 "$LocalAppData\Programs" - System::Store S - # Win7 has a per-user programfiles known folder and this can be a non-default location - System::Call 'SHELL32::SHGetKnownFolderPath(g "${FOLDERID_UserProgramFiles}", i ${KF_FLAG_CREATE}, p 0, *p .r2)i.r1' - ${If} $1 == 0 - System::Call '*$2(&w${NSIS_MAX_STRLEN} .s)' - StrCpy $0 $1 - System::Call 'OLE32::CoTaskMemFree(p r2)' - ${endif} - System::Store L - StrCpy $INSTDIR "$0\${APP_FILENAME}" - ${endif} - - # allow /D switch to override installation path https://github.com/electron-userland/electron-builder/issues/1551 - ${StdUtils.GetParameter} $R0 "D" "" - ${If} $R0 != "" - StrCpy $INSTDIR $R0 - ${endif} - - !macroend -!endif - -!ifdef INSTALL_MODE_PER_ALL_USERS_REQUIRED - Var perMachineInstallationFolder - - !macro setInstallModePerAllUsers - StrCpy $installMode all - SetShellVarContext all - - !ifdef BUILD_UNINSTALLER - ${IfNot} ${UAC_IsAdmin} - ShowWindow $HWNDPARENT ${SW_HIDE} - !insertmacro UAC_RunElevated - Quit - ${endif} - !endif - - # сheck registry for previous installation path - ReadRegStr $perMachineInstallationFolder HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation - ${if} $perMachineInstallationFolder != "" - StrCpy $INSTDIR $perMachineInstallationFolder - ${else} - StrCpy $0 "$PROGRAMFILES" - !ifdef APP_64 - ${if} ${RunningX64} - StrCpy $0 "$PROGRAMFILES64" - ${endif} - !endif - - !ifdef MENU_FILENAME - StrCpy $0 "$0\${MENU_FILENAME}" - !endif - - StrCpy $INSTDIR "$0\${APP_FILENAME}" - ${endif} - - # allow /D switch to override installation path https://github.com/electron-userland/electron-builder/issues/1551 - ${StdUtils.GetParameter} $R0 "D" "" - ${If} $R0 != "" - StrCpy $INSTDIR $R0 - ${endif} - - !macroend -!endif diff --git a/node_modules/app-builder-lib/templates/nsis/multiUserUi.nsh b/node_modules/app-builder-lib/templates/nsis/multiUserUi.nsh deleted file mode 100755 index 52a83df..0000000 --- a/node_modules/app-builder-lib/templates/nsis/multiUserUi.nsh +++ /dev/null @@ -1,230 +0,0 @@ -!include nsDialogs.nsh - -Var HasTwoAvailableOptions -Var RadioButtonLabel1 -Var isForceMachineInstall -Var isForceCurrentInstall - -!macro PAGE_INSTALL_MODE - !insertmacro MUI_PAGE_INIT - - !insertmacro MUI_SET MULTIUSER_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLMODEPAGE "" - Var MultiUser.InstallModePage - Var MultiUser.InstallModePage.Text - Var MultiUser.InstallModePage.AllUsers - Var MultiUser.InstallModePage.CurrentUser - Var MultiUser.InstallModePage.ReturnValue - - !ifndef BUILD_UNINSTALLER - !insertmacro FUNCTION_INSTALL_MODE_PAGE_FUNCTION MultiUser.InstallModePre_${MUI_UNIQUEID} MultiUser.InstallModeLeave_${MUI_UNIQUEID} "" - PageEx custom - PageCallbacks MultiUser.InstallModePre_${MUI_UNIQUEID} MultiUser.InstallModeLeave_${MUI_UNIQUEID} - Caption " " - PageExEnd - !else - !insertmacro FUNCTION_INSTALL_MODE_PAGE_FUNCTION MultiUser.InstallModePre_${MUI_UNIQUEID} MultiUser.InstallModeLeave_${MUI_UNIQUEID} un. - UninstPage custom un.multiUser.InstallModePre_${MUI_UNIQUEID} un.MultiUser.InstallModeLeave_${MUI_UNIQUEID} - !endif -!macroend - -!macro FUNCTION_INSTALL_MODE_PAGE_FUNCTION PRE LEAVE UNINSTALLER_FUNCPREFIX - Function "${UNINSTALLER_FUNCPREFIX}${PRE}" - ${if} ${UAC_IsInnerInstance} - ${andIf} ${UAC_IsAdmin} - # inner Process (and Admin) - skip selection, inner process is always used for elevation (machine-wide) - !insertmacro setInstallModePerAllUsers - Abort - ${endIf} - - StrCpy $isForceMachineInstall "0" - StrCpy $isForceCurrentInstall "0" - !ifmacrodef customInstallmode - !insertmacro customInstallMode - !endif - - ${if} $isForceMachineInstall == "1" - ${OrIf} ${isForAllUsers} - StrCpy $hasPerMachineInstallation "1" - StrCpy $hasPerUserInstallation "0" - ${ifNot} ${UAC_IsAdmin} - ShowWindow $HWNDPARENT ${SW_HIDE} - !insertmacro UAC_RunElevated - Quit - ${endIf} - - !insertmacro setInstallModePerAllUsers - Abort - ${endIf} - - ${if} $isForceCurrentInstall == "1" - ${OrIf} ${isForCurrentUser} - StrCpy $hasPerMachineInstallation "0" - StrCpy $hasPerUserInstallation "1" - !insertmacro setInstallModePerUser - Abort - ${endIf} - - # If uninstalling, will check if there is both a per-user and per-machine installation. If there is only one, will skip the form. - # If uninstallation was invoked from the "add/remove programs" Windows will automatically requests elevation (depending if uninstall keys are in HKLM or HKCU) - # so (for uninstallation) just checking UAC_IsAdmin would probably be enought to determine if it's a per-user or per-machine. However, user can run the uninstall.exe from the folder itself - !ifdef BUILD_UNINSTALLER - ${if} $hasPerUserInstallation == "1" - ${andif} $hasPerMachineInstallation == "0" - !insertmacro setInstallModePerUser - Abort - ${elseIf} $hasPerUserInstallation == "0" - ${andIf} $hasPerMachineInstallation == "1" - ${IfNot} ${UAC_IsAdmin} - ShowWindow $HWNDPARENT ${SW_HIDE} - !insertmacro UAC_RunElevated - Quit - ${endIf} - - !insertmacro setInstallModePerAllUsers - Abort - ${endIf} - - !insertmacro MUI_HEADER_TEXT "$(chooseUninstallationOptions)" "$(whichInstallationShouldBeRemoved)" - !else - !insertmacro MUI_HEADER_TEXT "$(chooseInstallationOptions)" "$(whoShouldThisApplicationBeInstalledFor)" - !endif - - !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE - nsDialogs::Create 1018 - Pop $MultiUser.InstallModePage - - !ifndef BUILD_UNINSTALLER - ${NSD_CreateLabel} 0u 0u 300u 20u "$(selectUserMode)" - StrCpy $8 "$(forAll)" - StrCpy $9 "$(onlyForMe)" - !else - ${NSD_CreateLabel} 0u 0u 300u 20u "$(whichInstallationRemove)" - StrCpy $8 "$(forAll)" - StrCpy $9 "$(onlyForMe)" - !endif - Pop $MultiUser.InstallModePage.Text - - ${NSD_CreateRadioButton} 10u 30u 280u 20u "$8" - Pop $MultiUser.InstallModePage.AllUsers - ${IfNot} ${UAC_IsAdmin} - !ifdef MULTIUSER_INSTALLMODE_ALLOW_ELEVATION - StrCpy $HasTwoAvailableOptions 1 - !else - # since radio button is disabled, we add that comment to the disabled control itself - SendMessage $MultiUser.InstallModePage.AllUsers ${WM_SETTEXT} 0 "STR:$8 (must run as admin)" - EnableWindow $MultiUser.InstallModePage.AllUsers 0 # start out disabled - StrCpy $HasTwoAvailableOptions 0 - !endif - ${else} - StrCpy $HasTwoAvailableOptions 1 - ${endif} - - System::Call "advapi32::GetUserName(t.r0,*i${NSIS_MAX_STRLEN})i" - ${NSD_CreateRadioButton} 10u 50u 280u 20u "$9 ($0)" - Pop $MultiUser.InstallModePage.CurrentUser - - nsDialogs::SetUserData $MultiUser.InstallModePage.AllUsers 1 ; Install for All Users (1, pra exibir o icone SHIELD de elevation) - nsDialogs::SetUserData $MultiUser.InstallModePage.CurrentUser 0 ; Install for Single User (0 pra não exibir) - - ${if} $HasTwoAvailableOptions == "1" ; if there are 2 available options, bind to radiobutton change - ${NSD_OnClick} $MultiUser.InstallModePage.CurrentUser ${UNINSTALLER_FUNCPREFIX}InstModeChange - ${NSD_OnClick} $MultiUser.InstallModePage.AllUsers ${UNINSTALLER_FUNCPREFIX}InstModeChange - ${endif} - - ${NSD_CreateLabel} 0u 110u 280u 50u "" - Pop $RadioButtonLabel1 - - ${if} $installMode == "all" - SendMessage $MultiUser.InstallModePage.AllUsers ${BM_SETCHECK} ${BST_CHECKED} 0 ; set as default - SendMessage $MultiUser.InstallModePage.AllUsers ${BM_CLICK} 0 0 ; trigger click event - ${else} - SendMessage $MultiUser.InstallModePage.CurrentUser ${BM_SETCHECK} ${BST_CHECKED} 0 ; set as default - SendMessage $MultiUser.InstallModePage.CurrentUser ${BM_CLICK} 0 0 ; trigger click event - ${endif} - - !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW - nsDialogs::Show - FunctionEnd - - Function "${UNINSTALLER_FUNCPREFIX}${LEAVE}" - SendMessage $MultiUser.InstallModePage.AllUsers ${BM_GETCHECK} 0 0 $MultiUser.InstallModePage.ReturnValue - - ${if} $MultiUser.InstallModePage.ReturnValue = ${BST_CHECKED} - ${IfNot} ${UAC_IsAdmin} - ShowWindow $HWNDPARENT ${SW_HIDE} - !insertmacro UAC_RunElevated - ${Switch} $0 - ${Case} 0 - ${If} $1 = 1 - Quit ;we are the outer process, the inner process has done its work (ExitCode is $2), we are done - ${EndIf} - ${If} $1 = 3 ;RunAs completed successfully, but with a non-admin user - ${OrIf} $2 = 0x666666 ;our special return, the new process was not admin after all - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "$(loginWithAdminAccount)" - ${EndIf} - ${Break} - ${Case} 1223 ;user aborted - ;MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "This option requires admin privileges, aborting!" - ;Quit ; instead of quit just abort going to the next page, and stay in the radiobuttons - ${Break} - ${Case} 1062 - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Logon service not running, aborting!" ; "Unable to elevate, Secondary Logon service not running!" - ;Quit ; instead of quit just abort going to the next page, and stay in the radiobuttons - ${Break} - ${Default} - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate, error $0" - ;Quit ; instead of quit just abort going to the next page, and stay in the radiobuttons - ${Break} - ${EndSwitch} - - ShowWindow $HWNDPARENT ${SW_SHOW} - BringToFront - Abort - ${else} - !insertmacro setInstallModePerAllUsers - ${endif} - ${else} - !insertmacro setInstallModePerUser - ${endif} - - !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE - FunctionEnd - - Function "${UNINSTALLER_FUNCPREFIX}InstModeChange" - pop $1 - nsDialogs::GetUserData $1 - pop $1 - GetDlgItem $0 $hwndParent 1 ; get item 1 (next button) at parent window, store in $0 - (0 is back, 1 is next .. what about CANCEL? http://nsis.sourceforge.net/Buttons_Header ) - - StrCpy $7 "" - ${if} "$1" == "0" ; current user - ${if} $hasPerUserInstallation == "1" - !ifndef BUILD_UNINSTALLER - StrCpy $7 "$(perUserInstallExists)($perUserInstallationFolder)$\r$\n$(reinstallUpgrade)" - !else - StrCpy $7 "$(perUserInstall)($perUserInstallationFolder)$\r$\n$(uninstall)" - !endif - ${else} - StrCpy $7 "$(freshInstallForCurrent)" - ${endif} - SendMessage $0 ${BCM_SETSHIELD} 0 0 ; hide SHIELD - ${else} ; all users - ${if} $hasPerMachineInstallation == "1" - !ifndef BUILD_UNINSTALLER - StrCpy $7 "$(perMachineInstallExists)($perMachineInstallationFolder)$\r$\n$(reinstallUpgrade)" - !else - StrCpy $7 "$(perMachineInstall)($perMachineInstallationFolder)$\r$\n$(uninstall)" - !endif - ${else} - StrCpy $7 "$(freshInstallForAll)" - ${endif} - ${ifNot} ${UAC_IsAdmin} - StrCpy $7 "$7" - SendMessage $0 ${BCM_SETSHIELD} 0 1 ; display SHIELD - ${else} - SendMessage $0 ${BCM_SETSHIELD} 0 0 ; hide SHIELD - ${endif} - ${endif} - SendMessage $RadioButtonLabel1 ${WM_SETTEXT} 0 "STR:$7" - FunctionEnd -!macroend diff --git a/node_modules/app-builder-lib/templates/nsis/oneClick.nsh b/node_modules/app-builder-lib/templates/nsis/oneClick.nsh deleted file mode 100644 index 01d007e..0000000 --- a/node_modules/app-builder-lib/templates/nsis/oneClick.nsh +++ /dev/null @@ -1,19 +0,0 @@ -!ifndef BUILD_UNINSTALLER - !ifmacrodef licensePage - !insertmacro skipPageIfUpdated - !insertmacro licensePage - !endif -!endif - -!insertmacro MUI_PAGE_INSTFILES -!ifdef BUILD_UNINSTALLER - !insertmacro MUI_UNPAGE_INSTFILES -!endif - -!macro initMultiUser - !ifdef INSTALL_MODE_PER_ALL_USERS - !insertmacro setInstallModePerAllUsers - !else - !insertmacro setInstallModePerUser - !endif -!macroend \ No newline at end of file diff --git a/node_modules/app-builder-lib/templates/nsis/portable.nsi b/node_modules/app-builder-lib/templates/nsis/portable.nsi deleted file mode 100644 index 1e1deaf..0000000 --- a/node_modules/app-builder-lib/templates/nsis/portable.nsi +++ /dev/null @@ -1,45 +0,0 @@ -!include "common.nsh" -!include "extractAppPackage.nsh" - -WindowIcon Off -AutoCloseWindow True -RequestExecutionLevel ${REQUEST_EXECUTION_LEVEL} - -SilentInstall silent - -Function .onInit - !insertmacro check64BitAndSetRegView -FunctionEnd - -Section - StrCpy $INSTDIR $PLUGINSDIR\app - SetOutPath $INSTDIR - - !ifdef APP_DIR_64 - !ifdef APP_DIR_32 - ${if} ${RunningX64} - File /r "${APP_DIR_64}\*.*" - ${else} - File /r "${APP_DIR_32}\*.*" - ${endIf} - !else - File /r "${APP_DIR_64}\*.*" - !endif - !else - !ifdef APP_DIR_32 - File /r "${APP_DIR_32}\*.*" - !else - !insertmacro extractEmbeddedAppPackage - !endif - !endif - - System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("PORTABLE_EXECUTABLE_DIR", "$EXEDIR").r0' - System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("PORTABLE_EXECUTABLE_FILE", "$EXEPATH").r0' - System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("PORTABLE_EXECUTABLE_APP_FILENAME", "${APP_FILENAME}").r0' - ${StdUtils.GetAllParameters} $R0 0 - ExecWait "$INSTDIR\${APP_EXECUTABLE_FILENAME} $R0" $0 - SetErrorlevel $0 - - SetOutPath $PLUGINSDIR - RMDir /r $INSTDIR -SectionEnd diff --git a/node_modules/app-builder-lib/templates/nsis/readme.md b/node_modules/app-builder-lib/templates/nsis/readme.md deleted file mode 100644 index d51e85d..0000000 --- a/node_modules/app-builder-lib/templates/nsis/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -It is developer documentation. See [user documentation](https://electron.build/configuration/nsis). - -http://www.mathiaswestin.net/2012/09/how-to-make-per-user-installation-with.html - -https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx#FOLDERID_UserProgramFiles - -https://github.com/Drizin/NsisMultiUser - -NSIS vs Inno Setup — it is not easy to choose because both are far from ideal, e.g. inno also doesn't have built-in per-user installation implementation — http://stackoverflow.com/questions/34330668/inno-setup-custom-dialog-with-per-user-or-per-machine-installation. - -http://stackoverflow.com/questions/2565215/checking-if-the-application-is-running-in-nsis-before-uninstalling - -One-click installer: http://forums.winamp.com/showthread.php?t=300479 - -# GUID -See [docs](https://electron.build/configuration/nsis). - -We use UUID v5 to generate sha-1 name-based UUID. - -http://stackoverflow.com/questions/3029994/convert-uri-to-guid -https://alexandrebrisebois.wordpress.com/2013/11/14/create-predictable-guids-for-your-windows-azure-table-storage-entities/ -https://github.com/Squirrel/Squirrel.Windows/pull/658 - -# Compression - -NSIS LZMA compression is slower and worse compared to external `7za` compression. Slower because `7za` is multi-threaded, worse because LZMA codec implementation is outdated and BCJ2 filter is not enabled. -Difference for test app — 4 MB (before: 36.3 after: 32.8). - -And compression time is also greatly reduced. - -Since NSIS is awesome, no disadvantages in our approach — [compression is disabled](http://nsis.sourceforge.net/Reference/SetCompress) before `File /oname=app.7z "${APP_ARCHIVE}"` and enabled after (it is the reasons why `SOLID` compression is not used). -So, opposite to Squirrel.Windows, archive is not twice compressed. - -So, in your custom NSIS scripts you should not use any compression instructions. Only `SetCompress` if you need to disable compression for already archived file. - - diff --git a/node_modules/app-builder-lib/templates/nsis/uninstaller.nsh b/node_modules/app-builder-lib/templates/nsis/uninstaller.nsh deleted file mode 100644 index 3885176..0000000 --- a/node_modules/app-builder-lib/templates/nsis/uninstaller.nsh +++ /dev/null @@ -1,106 +0,0 @@ -Function un.onInit - !insertmacro check64BitAndSetRegView - - ${IfNot} ${Silent} - !ifdef ONE_CLICK - MessageBox MB_OKCANCEL "$(areYouSureToUninstall)" IDOK +2 - Quit - - # one-click installer executes uninstall section in the silent mode, but we must show message dialog if silent mode was not explicitly set by user (using /S flag) - !insertmacro CHECK_APP_RUNNING - SetSilent silent - !endif - ${endIf} - - !insertmacro initMultiUser - - !ifmacrodef customUnInit - !insertmacro customUnInit - !endif -FunctionEnd - -Section "un.install" - !ifndef ONE_CLICK - # for assisted installer we check it here to show progress - !insertmacro CHECK_APP_RUNNING - !endif - - !insertmacro setLinkVars - - ${ifNot} ${isKeepShortcuts} - WinShell::UninstAppUserModelId "${APP_ID}" - - !ifndef DO_NOT_CREATE_DESKTOP_SHORTCUT - WinShell::UninstShortcut "$oldDesktopLink" - Delete "$oldDesktopLink" - !endif - - !ifndef DO_NOT_CREATE_START_MENU_SHORTCUT - WinShell::UninstShortcut "$oldStartMenuLink" - - Delete "$oldStartMenuLink" - ReadRegStr $R1 SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" MenuDirectory - ${ifNot} $R1 == "" - RMDir "$SMPROGRAMS\$R1" - ${endIf} - !endif - ${endIf} - - # refresh the desktop - System::Call 'shell32::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' - - !ifmacrodef unregisterFileAssociations - !insertmacro unregisterFileAssociations - !endif - - # delete the installed files - !ifmacrodef customRemoveFiles - !insertmacro customRemoveFiles - !else - RMDir /r $INSTDIR - !endif - - Var /GLOBAL isDeleteAppData - StrCpy $isDeleteAppData "0" - - ClearErrors - ${GetParameters} $R0 - ${GetOptions} $R0 "--delete-app-data" $R1 - ${if} ${Errors} - !ifdef DELETE_APP_DATA_ON_UNINSTALL - ${ifNot} ${isUpdated} - StrCpy $isDeleteAppData "1" - ${endif} - !endif - ${else} - StrCpy $isDeleteAppData "1" - ${endIf} - - ${if} $isDeleteAppData == "1" - # electron always uses per user app data - ${if} $installMode == "all" - SetShellVarContext current - ${endif} - RMDir /r "$APPDATA\${APP_FILENAME}" - !ifdef APP_PRODUCT_FILENAME - RMDir /r "$APPDATA\${APP_PRODUCT_FILENAME}" - !endif - ${if} $installMode == "all" - SetShellVarContext all - ${endif} - ${endif} - - DeleteRegKey SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY}" - !ifdef UNINSTALL_REGISTRY_KEY_2 - DeleteRegKey SHELL_CONTEXT "${UNINSTALL_REGISTRY_KEY_2}" - !endif - DeleteRegKey SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" - - !ifmacrodef customUnInstall - !insertmacro customUnInstall - !endif - - !ifdef ONE_CLICK - !insertmacro quitSuccess - !endif -SectionEnd diff --git a/node_modules/argparse/CHANGELOG.md b/node_modules/argparse/CHANGELOG.md deleted file mode 100644 index a43c628..0000000 --- a/node_modules/argparse/CHANGELOG.md +++ /dev/null @@ -1,185 +0,0 @@ -1.0.10 / 2018-02-15 ------------------- - -- Use .concat instead of + for arrays, #122. - - -1.0.9 / 2016-09-29 ------------------- - -- Rerelease after 1.0.8 - deps cleanup. - - -1.0.8 / 2016-09-29 ------------------- - -- Maintenance (deps bump, fix node 6.5+ tests, coverage report). - - -1.0.7 / 2016-03-17 ------------------- - -- Teach `addArgument` to accept string arg names. #97, @tomxtobin. - - -1.0.6 / 2016-02-06 ------------------- - -- Maintenance: moved to eslint & updated CS. - - -1.0.5 / 2016-02-05 ------------------- - -- Removed lodash dependency to significantly reduce install size. - Thanks to @mourner. - - -1.0.4 / 2016-01-17 ------------------- - -- Maintenance: lodash update to 4.0.0. - - -1.0.3 / 2015-10-27 ------------------- - -- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. - - -1.0.2 / 2015-03-22 ------------------- - -- Relaxed lodash version dependency. - - -1.0.1 / 2015-02-20 ------------------- - -- Changed dependencies to be compatible with ancient nodejs. - - -1.0.0 / 2015-02-19 ------------------- - -- Maintenance release. -- Replaced `underscore` with `lodash`. -- Bumped version to 1.0.0 to better reflect semver meaning. -- HISTORY.md -> CHANGELOG.md - - -0.1.16 / 2013-12-01 -------------------- - -- Maintenance release. Updated dependencies and docs. - - -0.1.15 / 2013-05-13 -------------------- - -- Fixed #55, @trebor89 - - -0.1.14 / 2013-05-12 -------------------- - -- Fixed #62, @maxtaco - - -0.1.13 / 2013-04-08 -------------------- - -- Added `.npmignore` to reduce package size - - -0.1.12 / 2013-02-10 -------------------- - -- Fixed conflictHandler (#46), @hpaulj - - -0.1.11 / 2013-02-07 -------------------- - -- Multiple bugfixes, @hpaulj -- Added 70+ tests (ported from python), @hpaulj -- Added conflictHandler, @applepicke -- Added fromfilePrefixChar, @hpaulj - - -0.1.10 / 2012-12-30 -------------------- - -- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) - support, thanks to @hpaulj -- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj - - -0.1.9 / 2012-12-27 ------------------- - -- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj -- Fixed default value behavior with `*` positionals, thanks to @hpaulj -- Improve `getDefault()` behavior, thanks to @hpaulj -- Imrove negative argument parsing, thanks to @hpaulj - - -0.1.8 / 2012-12-01 ------------------- - -- Fixed parser parents (issue #19), thanks to @hpaulj -- Fixed negative argument parse (issue #20), thanks to @hpaulj - - -0.1.7 / 2012-10-14 ------------------- - -- Fixed 'choices' argument parse (issue #16) -- Fixed stderr output (issue #15) - - -0.1.6 / 2012-09-09 ------------------- - -- Fixed check for conflict of options (thanks to @tomxtobin) - - -0.1.5 / 2012-09-03 ------------------- - -- Fix parser #setDefaults method (thanks to @tomxtobin) - - -0.1.4 / 2012-07-30 ------------------- - -- Fixed pseudo-argument support (thanks to @CGamesPlay) -- Fixed addHelp default (should be true), if not set (thanks to @benblank) - - -0.1.3 / 2012-06-27 ------------------- - -- Fixed formatter api name: Formatter -> HelpFormatter - - -0.1.2 / 2012-05-29 ------------------- - -- Added basic tests -- Removed excess whitespace in help -- Fixed error reporting, when parcer with subcommands - called with empty arguments - - -0.1.1 / 2012-05-23 ------------------- - -- Fixed line wrapping in help formatter -- Added better error reporting on invalid arguments - - -0.1.0 / 2012-05-16 ------------------- - -- First release. diff --git a/node_modules/argparse/LICENSE b/node_modules/argparse/LICENSE deleted file mode 100644 index 1afdae5..0000000 --- a/node_modules/argparse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2012 by Vitaly Puzrin - -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/argparse/README.md b/node_modules/argparse/README.md deleted file mode 100644 index 7fa6c40..0000000 --- a/node_modules/argparse/README.md +++ /dev/null @@ -1,257 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) -[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) - -CLI arguments parser for node.js. Javascript port of python's -[argparse](http://docs.python.org/dev/library/argparse.html) module -(original version 3.2). That's a full port, except some very rare options, -recorded in issue tracker. - -**NB. Difference with original.** - -- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). -- Use `defaultValue` instead of `default`. -- Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and - similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE` - (aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and - `SUPPRESS`. - - -Example -======= - -test.js file: - -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse example' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); -parser.addArgument( - '--baz', - { - help: 'baz bar' - } -); -var args = parser.parseArgs(); -console.dir(args); -``` - -Display help: - -``` -$ ./test.js -h -usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] - -Argparse example - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -f FOO, --foo FOO foo bar - -b BAR, --bar BAR bar foo - --baz BAZ baz bar -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 --baz 5 -{ foo: '3', bar: '4', baz: '5' } -``` - -More [examples](https://github.com/nodeca/argparse/tree/master/examples). - - -ArgumentParser objects -====================== - -``` -new ArgumentParser({parameters hash}); -``` - -Creates a new ArgumentParser object. - -**Supported params:** - -- ```description``` - Text to display before the argument help. -- ```epilog``` - Text to display after the argument help. -- ```addHelp``` - Add a -h/–help option to the parser. (default: true) -- ```argumentDefault``` - Set the global default value for arguments. (default: null) -- ```parents``` - A list of ArgumentParser objects whose arguments should also be included. -- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) -- ```formatterClass``` - A class for customizing the help output. -- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`) -- ```usage``` - The string describing the program usage (default: generated) -- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. - -**Not supported yet** - -- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. - - -Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) - - -addArgument() method -==================== - -``` -ArgumentParser.addArgument(name or flag or [name] or [flags...], {options}) -``` - -Defines how a single command-line argument should be parsed. - -- ```name or flag or [name] or [flags...]``` - Either a positional name - (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array - of a single positional name (e.g., `['foo']`), or an array of options - (e.g., `['-f', '--foo']`). - -Options: - -- ```action``` - The basic type of action to be taken when this argument is encountered at the command line. -- ```nargs```- The number of command-line arguments that should be consumed. -- ```constant``` - A constant value required by some action and nargs selections. -- ```defaultValue``` - The value produced if the argument is absent from the command line. -- ```type``` - The type to which the command-line argument should be converted. -- ```choices``` - A container of the allowable values for the argument. -- ```required``` - Whether or not the command-line option may be omitted (optionals only). -- ```help``` - A brief description of what the argument does. -- ```metavar``` - A name for the argument in usage messages. -- ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). - -Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) - - -Action (some details) -================ - -ArgumentParser objects associate command-line arguments with actions. -These actions can do just about anything with the command-line arguments associated -with them, though most actions simply add an attribute to the object returned by -parseArgs(). The action keyword argument specifies how the command-line arguments -should be handled. The supported actions are: - -- ```store``` - Just stores the argument’s value. This is the default action. -- ```storeConst``` - Stores value, specified by the const keyword argument. - (Note that the const keyword argument defaults to the rather unhelpful None.) - The 'storeConst' action is most commonly used with optional arguments, that - specify some sort of flag. -- ```storeTrue``` and ```storeFalse``` - Stores values True and False - respectively. These are special cases of 'storeConst'. -- ```append``` - Stores a list, and appends each argument value to the list. - This is useful to allow an option to be specified multiple times. -- ```appendConst``` - Stores a list, and appends value, specified by the - const keyword argument to the list. (Note, that the const keyword argument defaults - is None.) The 'appendConst' action is typically used when multiple arguments need - to store constants to the same list. -- ```count``` - Counts the number of times a keyword argument occurs. For example, - used for increasing verbosity levels. -- ```help``` - Prints a complete help message for all the options in the current - parser and then exits. By default a help action is automatically added to the parser. - See ArgumentParser for details of how the output is created. -- ```version``` - Prints version information and exit. Expects a `version=` - keyword argument in the addArgument() call. - -Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) - - -Sub-commands -============ - -ArgumentParser.addSubparsers() - -Many programs split their functionality into a number of sub-commands, for -example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, -and `svn commit`. Splitting up functionality this way can be a particularly good -idea when a program performs several different functions which require different -kinds of command-line arguments. `ArgumentParser` supports creation of such -sub-commands with `addSubparsers()` method. The `addSubparsers()` method is -normally called with no arguments and returns an special action object. -This object has a single method `addParser()`, which takes a command name and -any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object -that can be modified as usual. - -Example: - -sub_commands.js -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse examples: sub-commands', -}); - -var subparsers = parser.addSubparsers({ - title:'subcommands', - dest:"subcommand_name" -}); - -var bar = subparsers.addParser('c1', {addHelp:true}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases:['co'], addHelp:true} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); - -var args = parser.parseArgs(); -console.dir(args); - -``` - -Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) - - -Contributors -============ - -- [Eugene Shkuropat](https://github.com/shkuropat) -- [Paul Jacobson](https://github.com/hpaulj) - -[others](https://github.com/nodeca/argparse/graphs/contributors) - -License -======= - -Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). -Released under the MIT license. See -[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. - - diff --git a/node_modules/argparse/index.js b/node_modules/argparse/index.js deleted file mode 100644 index 3bbc143..0000000 --- a/node_modules/argparse/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/argparse'); diff --git a/node_modules/argparse/lib/action.js b/node_modules/argparse/lib/action.js deleted file mode 100644 index 1483c79..0000000 --- a/node_modules/argparse/lib/action.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * class Action - * - * Base class for all actions - * Do not call in your code, use this class only for inherits your own action - * - * Information about how to convert command line strings to Javascript objects. - * Action objects are used by an ArgumentParser to represent the information - * needed to parse a single argument from one or more strings from the command - * line. The keyword arguments to the Action constructor are also all attributes - * of Action instances. - * - * ##### Allowed keywords: - * - * - `store` - * - `storeConstant` - * - `storeTrue` - * - `storeFalse` - * - `append` - * - `appendConstant` - * - `count` - * - `help` - * - `version` - * - * Information about action options see [[Action.new]] - * - * See also [original guide](http://docs.python.org/dev/library/argparse.html#action) - * - **/ - -'use strict'; - - -// Constants -var c = require('./const'); - - -/** - * new Action(options) - * - * Base class for all actions. Used only for inherits - * - * - * ##### Options: - * - * - `optionStrings` A list of command-line option strings for the action. - * - `dest` Attribute to hold the created object(s) - * - `nargs` The number of command-line arguments that should be consumed. - * By default, one argument will be consumed and a single value will be - * produced. - * - `constant` Default value for an action with no value. - * - `defaultValue` The value to be produced if the option is not specified. - * - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If - * None, 'string'. - * - `choices` The choices available. - * - `required` True if the action must always be specified at the command - * line. - * - `help` The help describing the argument. - * - `metavar` The name to be used for the option's argument with the help - * string. If None, the 'dest' value will be used as the name. - * - * ##### nargs supported values: - * - * - `N` (an integer) consumes N arguments (and produces a list) - * - `?` consumes zero or one arguments - * - `*` consumes zero or more arguments (and produces a list) - * - `+` consumes one or more arguments (and produces a list) - * - * Note: that the difference between the default and nargs=1 is that with the - * default, a single value will be produced, while with nargs=1, a list - * containing a single value will be produced. - **/ -var Action = module.exports = function Action(options) { - options = options || {}; - this.optionStrings = options.optionStrings || []; - this.dest = options.dest; - this.nargs = typeof options.nargs !== 'undefined' ? options.nargs : null; - this.constant = typeof options.constant !== 'undefined' ? options.constant : null; - this.defaultValue = options.defaultValue; - this.type = typeof options.type !== 'undefined' ? options.type : null; - this.choices = typeof options.choices !== 'undefined' ? options.choices : null; - this.required = typeof options.required !== 'undefined' ? options.required : false; - this.help = typeof options.help !== 'undefined' ? options.help : null; - this.metavar = typeof options.metavar !== 'undefined' ? options.metavar : null; - - if (!(this.optionStrings instanceof Array)) { - throw new Error('optionStrings should be an array'); - } - if (typeof this.required !== 'undefined' && typeof this.required !== 'boolean') { - throw new Error('required should be a boolean'); - } -}; - -/** - * Action#getName -> String - * - * Tells action name - **/ -Action.prototype.getName = function () { - if (this.optionStrings.length > 0) { - return this.optionStrings.join('/'); - } else if (this.metavar !== null && this.metavar !== c.SUPPRESS) { - return this.metavar; - } else if (typeof this.dest !== 'undefined' && this.dest !== c.SUPPRESS) { - return this.dest; - } - return null; -}; - -/** - * Action#isOptional -> Boolean - * - * Return true if optional - **/ -Action.prototype.isOptional = function () { - return !this.isPositional(); -}; - -/** - * Action#isPositional -> Boolean - * - * Return true if positional - **/ -Action.prototype.isPositional = function () { - return (this.optionStrings.length === 0); -}; - -/** - * Action#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Should be implemented in inherited classes - * - * ##### Example - * - * ActionCount.prototype.call = function (parser, namespace, values, optionString) { - * namespace.set(this.dest, (namespace[this.dest] || 0) + 1); - * }; - * - **/ -Action.prototype.call = function () { - throw new Error('.call() not defined');// Not Implemented error -}; diff --git a/node_modules/argparse/lib/action/append.js b/node_modules/argparse/lib/action/append.js deleted file mode 100644 index b5da0de..0000000 --- a/node_modules/argparse/lib/action/append.js +++ /dev/null @@ -1,53 +0,0 @@ -/*:nodoc:* - * class ActionAppend - * - * This action stores a list, and appends each argument value to the list. - * This is useful to allow an option to be specified multiple times. - * This class inherided from [[Action]] - * - **/ - -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var c = require('../const'); - -/*:nodoc:* - * new ActionAppend(options) - * - options (object): options hash see [[Action.new]] - * - * Note: options.nargs should be optional for constants - * and more then zero for other - **/ -var ActionAppend = module.exports = function ActionAppend(options) { - options = options || {}; - if (this.nargs <= 0) { - throw new Error('nargs for append actions must be > 0; if arg ' + - 'strings are not supplying the value to append, ' + - 'the append const action may be more appropriate'); - } - if (!!this.constant && this.nargs !== c.OPTIONAL) { - throw new Error('nargs must be OPTIONAL to supply const'); - } - Action.call(this, options); -}; -util.inherits(ActionAppend, Action); - -/*:nodoc:* - * ActionAppend#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionAppend.prototype.call = function (parser, namespace, values) { - var items = (namespace[this.dest] || []).slice(); - items.push(values); - namespace.set(this.dest, items); -}; diff --git a/node_modules/argparse/lib/action/append/constant.js b/node_modules/argparse/lib/action/append/constant.js deleted file mode 100644 index 313f5d2..0000000 --- a/node_modules/argparse/lib/action/append/constant.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionAppendConstant - * - * This stores a list, and appends the value specified by - * the const keyword argument to the list. - * (Note that the const keyword argument defaults to null.) - * The 'appendConst' action is typically useful when multiple - * arguments need to store constants to the same list. - * - * This class inherited from [[Action]] - **/ - -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionAppendConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionAppendConstant = module.exports = function ActionAppendConstant(options) { - options = options || {}; - options.nargs = 0; - if (typeof options.constant === 'undefined') { - throw new Error('constant option is required for appendAction'); - } - Action.call(this, options); -}; -util.inherits(ActionAppendConstant, Action); - -/*:nodoc:* - * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionAppendConstant.prototype.call = function (parser, namespace) { - var items = [].concat(namespace[this.dest] || []); - items.push(this.constant); - namespace.set(this.dest, items); -}; diff --git a/node_modules/argparse/lib/action/count.js b/node_modules/argparse/lib/action/count.js deleted file mode 100644 index d6a5899..0000000 --- a/node_modules/argparse/lib/action/count.js +++ /dev/null @@ -1,40 +0,0 @@ -/*:nodoc:* - * class ActionCount - * - * This counts the number of times a keyword argument occurs. - * For example, this is useful for increasing verbosity levels - * - * This class inherided from [[Action]] - * - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -/*:nodoc:* - * new ActionCount(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionCount = module.exports = function ActionCount(options) { - options = options || {}; - options.nargs = 0; - - Action.call(this, options); -}; -util.inherits(ActionCount, Action); - -/*:nodoc:* - * ActionCount#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionCount.prototype.call = function (parser, namespace) { - namespace.set(this.dest, (namespace[this.dest] || 0) + 1); -}; diff --git a/node_modules/argparse/lib/action/help.js b/node_modules/argparse/lib/action/help.js deleted file mode 100644 index b40e05a..0000000 --- a/node_modules/argparse/lib/action/help.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionHelp - * - * Support action for printing help - * This class inherided from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var c = require('../const'); - -/*:nodoc:* - * new ActionHelp(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionHelp = module.exports = function ActionHelp(options) { - options = options || {}; - if (options.defaultValue !== null) { - options.defaultValue = options.defaultValue; - } else { - options.defaultValue = c.SUPPRESS; - } - options.dest = (options.dest !== null ? options.dest : c.SUPPRESS); - options.nargs = 0; - Action.call(this, options); - -}; -util.inherits(ActionHelp, Action); - -/*:nodoc:* - * ActionHelp#call(parser, namespace, values, optionString) - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Print help and exit - **/ -ActionHelp.prototype.call = function (parser) { - parser.printHelp(); - parser.exit(); -}; diff --git a/node_modules/argparse/lib/action/store.js b/node_modules/argparse/lib/action/store.js deleted file mode 100644 index 283b860..0000000 --- a/node_modules/argparse/lib/action/store.js +++ /dev/null @@ -1,50 +0,0 @@ -/*:nodoc:* - * class ActionStore - * - * This action just stores the argument’s value. This is the default action. - * - * This class inherited from [[Action]] - * - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var c = require('../const'); - - -/*:nodoc:* - * new ActionStore(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStore = module.exports = function ActionStore(options) { - options = options || {}; - if (this.nargs <= 0) { - throw new Error('nargs for store actions must be > 0; if you ' + - 'have nothing to store, actions such as store ' + - 'true or store const may be more appropriate'); - - } - if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) { - throw new Error('nargs must be OPTIONAL to supply const'); - } - Action.call(this, options); -}; -util.inherits(ActionStore, Action); - -/*:nodoc:* - * ActionStore#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionStore.prototype.call = function (parser, namespace, values) { - namespace.set(this.dest, values); -}; diff --git a/node_modules/argparse/lib/action/store/constant.js b/node_modules/argparse/lib/action/store/constant.js deleted file mode 100644 index 23caa89..0000000 --- a/node_modules/argparse/lib/action/store/constant.js +++ /dev/null @@ -1,43 +0,0 @@ -/*:nodoc:* - * class ActionStoreConstant - * - * This action stores the value specified by the const keyword argument. - * (Note that the const keyword argument defaults to the rather unhelpful null.) - * The 'store_const' action is most commonly used with optional - * arguments that specify some sort of flag. - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionStoreConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStoreConstant = module.exports = function ActionStoreConstant(options) { - options = options || {}; - options.nargs = 0; - if (typeof options.constant === 'undefined') { - throw new Error('constant option is required for storeAction'); - } - Action.call(this, options); -}; -util.inherits(ActionStoreConstant, Action); - -/*:nodoc:* - * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionStoreConstant.prototype.call = function (parser, namespace) { - namespace.set(this.dest, this.constant); -}; diff --git a/node_modules/argparse/lib/action/store/false.js b/node_modules/argparse/lib/action/store/false.js deleted file mode 100644 index 9924f46..0000000 --- a/node_modules/argparse/lib/action/store/false.js +++ /dev/null @@ -1,27 +0,0 @@ -/*:nodoc:* - * class ActionStoreFalse - * - * This action store the values False respectively. - * This is special cases of 'storeConst' - * - * This class inherited from [[Action]] - **/ - -'use strict'; - -var util = require('util'); - -var ActionStoreConstant = require('./constant'); - -/*:nodoc:* - * new ActionStoreFalse(options) - * - options (object): hash of options see [[Action.new]] - * - **/ -var ActionStoreFalse = module.exports = function ActionStoreFalse(options) { - options = options || {}; - options.constant = false; - options.defaultValue = options.defaultValue !== null ? options.defaultValue : true; - ActionStoreConstant.call(this, options); -}; -util.inherits(ActionStoreFalse, ActionStoreConstant); diff --git a/node_modules/argparse/lib/action/store/true.js b/node_modules/argparse/lib/action/store/true.js deleted file mode 100644 index 9e22f7d..0000000 --- a/node_modules/argparse/lib/action/store/true.js +++ /dev/null @@ -1,26 +0,0 @@ -/*:nodoc:* - * class ActionStoreTrue - * - * This action store the values True respectively. - * This isspecial cases of 'storeConst' - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var ActionStoreConstant = require('./constant'); - -/*:nodoc:* - * new ActionStoreTrue(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStoreTrue = module.exports = function ActionStoreTrue(options) { - options = options || {}; - options.constant = true; - options.defaultValue = options.defaultValue !== null ? options.defaultValue : false; - ActionStoreConstant.call(this, options); -}; -util.inherits(ActionStoreTrue, ActionStoreConstant); diff --git a/node_modules/argparse/lib/action/subparsers.js b/node_modules/argparse/lib/action/subparsers.js deleted file mode 100644 index 99dfedd..0000000 --- a/node_modules/argparse/lib/action/subparsers.js +++ /dev/null @@ -1,149 +0,0 @@ -/** internal - * class ActionSubparsers - * - * Support the creation of such sub-commands with the addSubparsers() - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); -var format = require('util').format; - - -var Action = require('../action'); - -// Constants -var c = require('../const'); - -// Errors -var argumentErrorHelper = require('../argument/error'); - - -/*:nodoc:* - * new ChoicesPseudoAction(name, help) - * - * Create pseudo action for correct help text - * - **/ -function ChoicesPseudoAction(name, help) { - var options = { - optionStrings: [], - dest: name, - help: help - }; - - Action.call(this, options); -} - -util.inherits(ChoicesPseudoAction, Action); - -/** - * new ActionSubparsers(options) - * - options (object): options hash see [[Action.new]] - * - **/ -function ActionSubparsers(options) { - options = options || {}; - options.dest = options.dest || c.SUPPRESS; - options.nargs = c.PARSER; - - this.debug = (options.debug === true); - - this._progPrefix = options.prog; - this._parserClass = options.parserClass; - this._nameParserMap = {}; - this._choicesActions = []; - - options.choices = this._nameParserMap; - Action.call(this, options); -} - -util.inherits(ActionSubparsers, Action); - -/*:nodoc:* - * ActionSubparsers#addParser(name, options) -> ArgumentParser - * - name (string): sub-command name - * - options (object): see [[ArgumentParser.new]] - * - * Note: - * addParser supports an additional aliases option, - * which allows multiple strings to refer to the same subparser. - * This example, like svn, aliases co as a shorthand for checkout - * - **/ -ActionSubparsers.prototype.addParser = function (name, options) { - var parser; - - var self = this; - - options = options || {}; - - options.debug = (this.debug === true); - - // set program from the existing prefix - if (!options.prog) { - options.prog = this._progPrefix + ' ' + name; - } - - var aliases = options.aliases || []; - - // create a pseudo-action to hold the choice help - if (!!options.help || typeof options.help === 'string') { - var help = options.help; - delete options.help; - - var choiceAction = new ChoicesPseudoAction(name, help); - this._choicesActions.push(choiceAction); - } - - // create the parser and add it to the map - parser = new this._parserClass(options); - this._nameParserMap[name] = parser; - - // make parser available under aliases also - aliases.forEach(function (alias) { - self._nameParserMap[alias] = parser; - }); - - return parser; -}; - -ActionSubparsers.prototype._getSubactions = function () { - return this._choicesActions; -}; - -/*:nodoc:* - * ActionSubparsers#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Parse input aguments - **/ -ActionSubparsers.prototype.call = function (parser, namespace, values) { - var parserName = values[0]; - var argStrings = values.slice(1); - - // set the parser name if requested - if (this.dest !== c.SUPPRESS) { - namespace[this.dest] = parserName; - } - - // select the parser - if (this._nameParserMap[parserName]) { - parser = this._nameParserMap[parserName]; - } else { - throw argumentErrorHelper(format( - 'Unknown parser "%s" (choices: [%s]).', - parserName, - Object.keys(this._nameParserMap).join(', ') - )); - } - - // parse all the remaining options into the namespace - parser.parseArgs(argStrings, namespace); -}; - -module.exports = ActionSubparsers; diff --git a/node_modules/argparse/lib/action/version.js b/node_modules/argparse/lib/action/version.js deleted file mode 100644 index 8053328..0000000 --- a/node_modules/argparse/lib/action/version.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionVersion - * - * Support action for printing program version - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// -// Constants -// -var c = require('../const'); - -/*:nodoc:* - * new ActionVersion(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionVersion = module.exports = function ActionVersion(options) { - options = options || {}; - options.defaultValue = (options.defaultValue ? options.defaultValue : c.SUPPRESS); - options.dest = (options.dest || c.SUPPRESS); - options.nargs = 0; - this.version = options.version; - Action.call(this, options); -}; -util.inherits(ActionVersion, Action); - -/*:nodoc:* - * ActionVersion#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Print version and exit - **/ -ActionVersion.prototype.call = function (parser) { - var version = this.version || parser.version; - var formatter = parser._getFormatter(); - formatter.addText(version); - parser.exit(0, formatter.formatHelp()); -}; diff --git a/node_modules/argparse/lib/action_container.js b/node_modules/argparse/lib/action_container.js deleted file mode 100644 index 6f1237b..0000000 --- a/node_modules/argparse/lib/action_container.js +++ /dev/null @@ -1,482 +0,0 @@ -/** internal - * class ActionContainer - * - * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] - **/ - -'use strict'; - -var format = require('util').format; - -// Constants -var c = require('./const'); - -var $$ = require('./utils'); - -//Actions -var ActionHelp = require('./action/help'); -var ActionAppend = require('./action/append'); -var ActionAppendConstant = require('./action/append/constant'); -var ActionCount = require('./action/count'); -var ActionStore = require('./action/store'); -var ActionStoreConstant = require('./action/store/constant'); -var ActionStoreTrue = require('./action/store/true'); -var ActionStoreFalse = require('./action/store/false'); -var ActionVersion = require('./action/version'); -var ActionSubparsers = require('./action/subparsers'); - -// Errors -var argumentErrorHelper = require('./argument/error'); - -/** - * new ActionContainer(options) - * - * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] - * - * ##### Options: - * - * - `description` -- A description of what the program does - * - `prefixChars` -- Characters that prefix optional arguments - * - `argumentDefault` -- The default value for all arguments - * - `conflictHandler` -- The conflict handler to use for duplicate arguments - **/ -var ActionContainer = module.exports = function ActionContainer(options) { - options = options || {}; - - this.description = options.description; - this.argumentDefault = options.argumentDefault; - this.prefixChars = options.prefixChars || ''; - this.conflictHandler = options.conflictHandler; - - // set up registries - this._registries = {}; - - // register actions - this.register('action', null, ActionStore); - this.register('action', 'store', ActionStore); - this.register('action', 'storeConst', ActionStoreConstant); - this.register('action', 'storeTrue', ActionStoreTrue); - this.register('action', 'storeFalse', ActionStoreFalse); - this.register('action', 'append', ActionAppend); - this.register('action', 'appendConst', ActionAppendConstant); - this.register('action', 'count', ActionCount); - this.register('action', 'help', ActionHelp); - this.register('action', 'version', ActionVersion); - this.register('action', 'parsers', ActionSubparsers); - - // raise an exception if the conflict handler is invalid - this._getHandler(); - - // action storage - this._actions = []; - this._optionStringActions = {}; - - // groups - this._actionGroups = []; - this._mutuallyExclusiveGroups = []; - - // defaults storage - this._defaults = {}; - - // determines whether an "option" looks like a negative number - // -1, -1.5 -5e+4 - this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$'); - - // whether or not there are any optionals that look like negative - // numbers -- uses a list so it can be shared and edited - this._hasNegativeNumberOptionals = []; -}; - -// Groups must be required, then ActionContainer already defined -var ArgumentGroup = require('./argument/group'); -var MutuallyExclusiveGroup = require('./argument/exclusive'); - -// -// Registration methods -// - -/** - * ActionContainer#register(registryName, value, object) -> Void - * - registryName (String) : object type action|type - * - value (string) : keyword - * - object (Object|Function) : handler - * - * Register handlers - **/ -ActionContainer.prototype.register = function (registryName, value, object) { - this._registries[registryName] = this._registries[registryName] || {}; - this._registries[registryName][value] = object; -}; - -ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) { - if (arguments.length < 3) { - defaultValue = null; - } - return this._registries[registryName][value] || defaultValue; -}; - -// -// Namespace default accessor methods -// - -/** - * ActionContainer#setDefaults(options) -> Void - * - options (object):hash of options see [[Action.new]] - * - * Set defaults - **/ -ActionContainer.prototype.setDefaults = function (options) { - options = options || {}; - for (var property in options) { - if ($$.has(options, property)) { - this._defaults[property] = options[property]; - } - } - - // if these defaults match any existing arguments, replace the previous - // default on the object with the new one - this._actions.forEach(function (action) { - if ($$.has(options, action.dest)) { - action.defaultValue = options[action.dest]; - } - }); -}; - -/** - * ActionContainer#getDefault(dest) -> Mixed - * - dest (string): action destination - * - * Return action default value - **/ -ActionContainer.prototype.getDefault = function (dest) { - var result = $$.has(this._defaults, dest) ? this._defaults[dest] : null; - - this._actions.forEach(function (action) { - if (action.dest === dest && $$.has(action, 'defaultValue')) { - result = action.defaultValue; - } - }); - - return result; -}; -// -// Adding argument actions -// - -/** - * ActionContainer#addArgument(args, options) -> Object - * - args (String|Array): argument key, or array of argument keys - * - options (Object): action objects see [[Action.new]] - * - * #### Examples - * - addArgument([ '-f', '--foo' ], { action: 'store', defaultValue: 1, ... }) - * - addArgument([ 'bar' ], { action: 'store', nargs: 1, ... }) - * - addArgument('--baz', { action: 'store', nargs: 1, ... }) - **/ -ActionContainer.prototype.addArgument = function (args, options) { - args = args; - options = options || {}; - - if (typeof args === 'string') { - args = [ args ]; - } - if (!Array.isArray(args)) { - throw new TypeError('addArgument first argument should be a string or an array'); - } - if (typeof options !== 'object' || Array.isArray(options)) { - throw new TypeError('addArgument second argument should be a hash'); - } - - // if no positional args are supplied or only one is supplied and - // it doesn't look like an option string, parse a positional argument - if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) { - if (args && !!options.dest) { - throw new Error('dest supplied twice for positional argument'); - } - options = this._getPositional(args, options); - - // otherwise, we're adding an optional argument - } else { - options = this._getOptional(args, options); - } - - // if no default was supplied, use the parser-level default - if (typeof options.defaultValue === 'undefined') { - var dest = options.dest; - if ($$.has(this._defaults, dest)) { - options.defaultValue = this._defaults[dest]; - } else if (typeof this.argumentDefault !== 'undefined') { - options.defaultValue = this.argumentDefault; - } - } - - // create the action object, and add it to the parser - var ActionClass = this._popActionClass(options); - if (typeof ActionClass !== 'function') { - throw new Error(format('Unknown action "%s".', ActionClass)); - } - var action = new ActionClass(options); - - // throw an error if the action type is not callable - var typeFunction = this._registryGet('type', action.type, action.type); - if (typeof typeFunction !== 'function') { - throw new Error(format('"%s" is not callable', typeFunction)); - } - - return this._addAction(action); -}; - -/** - * ActionContainer#addArgumentGroup(options) -> ArgumentGroup - * - options (Object): hash of options see [[ArgumentGroup.new]] - * - * Create new arguments groups - **/ -ActionContainer.prototype.addArgumentGroup = function (options) { - var group = new ArgumentGroup(this, options); - this._actionGroups.push(group); - return group; -}; - -/** - * ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup - * - options (Object): {required: false} - * - * Create new mutual exclusive groups - **/ -ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) { - var group = new MutuallyExclusiveGroup(this, options); - this._mutuallyExclusiveGroups.push(group); - return group; -}; - -ActionContainer.prototype._addAction = function (action) { - var self = this; - - // resolve any conflicts - this._checkConflict(action); - - // add to actions list - this._actions.push(action); - action.container = this; - - // index the action by any option strings it has - action.optionStrings.forEach(function (optionString) { - self._optionStringActions[optionString] = action; - }); - - // set the flag if any option strings look like negative numbers - action.optionStrings.forEach(function (optionString) { - if (optionString.match(self._regexpNegativeNumber)) { - if (!self._hasNegativeNumberOptionals.some(Boolean)) { - self._hasNegativeNumberOptionals.push(true); - } - } - }); - - // return the created action - return action; -}; - -ActionContainer.prototype._removeAction = function (action) { - var actionIndex = this._actions.indexOf(action); - if (actionIndex >= 0) { - this._actions.splice(actionIndex, 1); - } -}; - -ActionContainer.prototype._addContainerActions = function (container) { - // collect groups by titles - var titleGroupMap = {}; - this._actionGroups.forEach(function (group) { - if (titleGroupMap[group.title]) { - throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title)); - } - titleGroupMap[group.title] = group; - }); - - // map each action to its group - var groupMap = {}; - function actionHash(action) { - // unique (hopefully?) string suitable as dictionary key - return action.getName(); - } - container._actionGroups.forEach(function (group) { - // if a group with the title exists, use that, otherwise - // create a new group matching the container's group - if (!titleGroupMap[group.title]) { - titleGroupMap[group.title] = this.addArgumentGroup({ - title: group.title, - description: group.description - }); - } - - // map the actions to their new group - group._groupActions.forEach(function (action) { - groupMap[actionHash(action)] = titleGroupMap[group.title]; - }); - }, this); - - // add container's mutually exclusive groups - // NOTE: if add_mutually_exclusive_group ever gains title= and - // description= then this code will need to be expanded as above - var mutexGroup; - container._mutuallyExclusiveGroups.forEach(function (group) { - mutexGroup = this.addMutuallyExclusiveGroup({ - required: group.required - }); - // map the actions to their new mutex group - group._groupActions.forEach(function (action) { - groupMap[actionHash(action)] = mutexGroup; - }); - }, this); // forEach takes a 'this' argument - - // add all actions to this container or their group - container._actions.forEach(function (action) { - var key = actionHash(action); - if (groupMap[key]) { - groupMap[key]._addAction(action); - } else { - this._addAction(action); - } - }); -}; - -ActionContainer.prototype._getPositional = function (dest, options) { - if (Array.isArray(dest)) { - dest = dest[0]; - } - // make sure required is not specified - if (options.required) { - throw new Error('"required" is an invalid argument for positionals.'); - } - - // mark positional arguments as required if at least one is - // always required - if (options.nargs !== c.OPTIONAL && options.nargs !== c.ZERO_OR_MORE) { - options.required = true; - } - if (options.nargs === c.ZERO_OR_MORE && typeof options.defaultValue === 'undefined') { - options.required = true; - } - - // return the keyword arguments with no option strings - options.dest = dest; - options.optionStrings = []; - return options; -}; - -ActionContainer.prototype._getOptional = function (args, options) { - var prefixChars = this.prefixChars; - var optionStrings = []; - var optionStringsLong = []; - - // determine short and long option strings - args.forEach(function (optionString) { - // error on strings that don't start with an appropriate prefix - if (prefixChars.indexOf(optionString[0]) < 0) { - throw new Error(format('Invalid option string "%s": must start with a "%s".', - optionString, - prefixChars - )); - } - - // strings starting with two prefix characters are long options - optionStrings.push(optionString); - if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) { - optionStringsLong.push(optionString); - } - }); - - // infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' - var dest = options.dest || null; - delete options.dest; - - if (!dest) { - var optionStringDest = optionStringsLong.length ? optionStringsLong[0] : optionStrings[0]; - dest = $$.trimChars(optionStringDest, this.prefixChars); - - if (dest.length === 0) { - throw new Error( - format('dest= is required for options like "%s"', optionStrings.join(', ')) - ); - } - dest = dest.replace(/-/g, '_'); - } - - // return the updated keyword arguments - options.dest = dest; - options.optionStrings = optionStrings; - - return options; -}; - -ActionContainer.prototype._popActionClass = function (options, defaultValue) { - defaultValue = defaultValue || null; - - var action = (options.action || defaultValue); - delete options.action; - - var actionClass = this._registryGet('action', action, action); - return actionClass; -}; - -ActionContainer.prototype._getHandler = function () { - var handlerString = this.conflictHandler; - var handlerFuncName = '_handleConflict' + $$.capitalize(handlerString); - var func = this[handlerFuncName]; - if (typeof func === 'undefined') { - var msg = 'invalid conflict resolution value: ' + handlerString; - throw new Error(msg); - } else { - return func; - } -}; - -ActionContainer.prototype._checkConflict = function (action) { - var optionStringActions = this._optionStringActions; - var conflictOptionals = []; - - // find all options that conflict with this option - // collect pairs, the string, and an existing action that it conflicts with - action.optionStrings.forEach(function (optionString) { - var conflOptional = optionStringActions[optionString]; - if (typeof conflOptional !== 'undefined') { - conflictOptionals.push([ optionString, conflOptional ]); - } - }); - - if (conflictOptionals.length > 0) { - var conflictHandler = this._getHandler(); - conflictHandler.call(this, action, conflictOptionals); - } -}; - -ActionContainer.prototype._handleConflictError = function (action, conflOptionals) { - var conflicts = conflOptionals.map(function (pair) { return pair[0]; }); - conflicts = conflicts.join(', '); - throw argumentErrorHelper( - action, - format('Conflicting option string(s): %s', conflicts) - ); -}; - -ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) { - // remove all conflicting options - var self = this; - conflOptionals.forEach(function (pair) { - var optionString = pair[0]; - var conflictingAction = pair[1]; - // remove the conflicting option string - var i = conflictingAction.optionStrings.indexOf(optionString); - if (i >= 0) { - conflictingAction.optionStrings.splice(i, 1); - } - delete self._optionStringActions[optionString]; - // if the option now has no option string, remove it from the - // container holding it - if (conflictingAction.optionStrings.length === 0) { - conflictingAction.container._removeAction(conflictingAction); - } - }); -}; diff --git a/node_modules/argparse/lib/argparse.js b/node_modules/argparse/lib/argparse.js deleted file mode 100644 index f2a2c51..0000000 --- a/node_modules/argparse/lib/argparse.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports.ArgumentParser = require('./argument_parser.js'); -module.exports.Namespace = require('./namespace'); -module.exports.Action = require('./action'); -module.exports.HelpFormatter = require('./help/formatter.js'); -module.exports.Const = require('./const.js'); - -module.exports.ArgumentDefaultsHelpFormatter = - require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter; -module.exports.RawDescriptionHelpFormatter = - require('./help/added_formatters.js').RawDescriptionHelpFormatter; -module.exports.RawTextHelpFormatter = - require('./help/added_formatters.js').RawTextHelpFormatter; diff --git a/node_modules/argparse/lib/argument/error.js b/node_modules/argparse/lib/argument/error.js deleted file mode 100644 index c8a02a0..0000000 --- a/node_modules/argparse/lib/argument/error.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - - -var format = require('util').format; - - -var ERR_CODE = 'ARGError'; - -/*:nodoc:* - * argumentError(argument, message) -> TypeError - * - argument (Object): action with broken argument - * - message (String): error message - * - * Error format helper. An error from creating or using an argument - * (optional or positional). The string value of this exception - * is the message, augmented with information - * about the argument that caused it. - * - * #####Example - * - * var argumentErrorHelper = require('./argument/error'); - * if (conflictOptionals.length > 0) { - * throw argumentErrorHelper( - * action, - * format('Conflicting option string(s): %s', conflictOptionals.join(', ')) - * ); - * } - * - **/ -module.exports = function (argument, message) { - var argumentName = null; - var errMessage; - var err; - - if (argument.getName) { - argumentName = argument.getName(); - } else { - argumentName = '' + argument; - } - - if (!argumentName) { - errMessage = message; - } else { - errMessage = format('argument "%s": %s', argumentName, message); - } - - err = new TypeError(errMessage); - err.code = ERR_CODE; - return err; -}; diff --git a/node_modules/argparse/lib/argument/exclusive.js b/node_modules/argparse/lib/argument/exclusive.js deleted file mode 100644 index 8287e00..0000000 --- a/node_modules/argparse/lib/argument/exclusive.js +++ /dev/null @@ -1,54 +0,0 @@ -/** internal - * class MutuallyExclusiveGroup - * - * Group arguments. - * By default, ArgumentParser groups command-line arguments - * into “positional arguments” and “optional arguments” - * when displaying help messages. When there is a better - * conceptual grouping of arguments than this default one, - * appropriate groups can be created using the addArgumentGroup() method - * - * This class inherited from [[ArgumentContainer]] - **/ -'use strict'; - -var util = require('util'); - -var ArgumentGroup = require('./group'); - -/** - * new MutuallyExclusiveGroup(container, options) - * - container (object): main container - * - options (object): options.required -> true/false - * - * `required` could be an argument itself, but making it a property of - * the options argument is more consistent with the JS adaptation of the Python) - **/ -var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) { - var required; - options = options || {}; - required = options.required || false; - ArgumentGroup.call(this, container); - this.required = required; - -}; -util.inherits(MutuallyExclusiveGroup, ArgumentGroup); - - -MutuallyExclusiveGroup.prototype._addAction = function (action) { - var msg; - if (action.required) { - msg = 'mutually exclusive arguments must be optional'; - throw new Error(msg); - } - action = this._container._addAction(action); - this._groupActions.push(action); - return action; -}; - - -MutuallyExclusiveGroup.prototype._removeAction = function (action) { - this._container._removeAction(action); - this._groupActions.remove(action); -}; - diff --git a/node_modules/argparse/lib/argument/group.js b/node_modules/argparse/lib/argument/group.js deleted file mode 100644 index 58b271f..0000000 --- a/node_modules/argparse/lib/argument/group.js +++ /dev/null @@ -1,75 +0,0 @@ -/** internal - * class ArgumentGroup - * - * Group arguments. - * By default, ArgumentParser groups command-line arguments - * into “positional arguments” and “optional arguments” - * when displaying help messages. When there is a better - * conceptual grouping of arguments than this default one, - * appropriate groups can be created using the addArgumentGroup() method - * - * This class inherited from [[ArgumentContainer]] - **/ -'use strict'; - -var util = require('util'); - -var ActionContainer = require('../action_container'); - - -/** - * new ArgumentGroup(container, options) - * - container (object): main container - * - options (object): hash of group options - * - * #### options - * - **prefixChars** group name prefix - * - **argumentDefault** default argument value - * - **title** group title - * - **description** group description - * - **/ -var ArgumentGroup = module.exports = function ArgumentGroup(container, options) { - - options = options || {}; - - // add any missing keyword arguments by checking the container - options.conflictHandler = (options.conflictHandler || container.conflictHandler); - options.prefixChars = (options.prefixChars || container.prefixChars); - options.argumentDefault = (options.argumentDefault || container.argumentDefault); - - ActionContainer.call(this, options); - - // group attributes - this.title = options.title; - this._groupActions = []; - - // share most attributes with the container - this._container = container; - this._registries = container._registries; - this._actions = container._actions; - this._optionStringActions = container._optionStringActions; - this._defaults = container._defaults; - this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals; - this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups; -}; -util.inherits(ArgumentGroup, ActionContainer); - - -ArgumentGroup.prototype._addAction = function (action) { - // Parent add action - action = ActionContainer.prototype._addAction.call(this, action); - this._groupActions.push(action); - return action; -}; - - -ArgumentGroup.prototype._removeAction = function (action) { - // Parent remove action - ActionContainer.prototype._removeAction.call(this, action); - var actionIndex = this._groupActions.indexOf(action); - if (actionIndex >= 0) { - this._groupActions.splice(actionIndex, 1); - } -}; - diff --git a/node_modules/argparse/lib/argument_parser.js b/node_modules/argparse/lib/argument_parser.js deleted file mode 100644 index bd9a59a..0000000 --- a/node_modules/argparse/lib/argument_parser.js +++ /dev/null @@ -1,1161 +0,0 @@ -/** - * class ArgumentParser - * - * Object for parsing command line strings into js objects. - * - * Inherited from [[ActionContainer]] - **/ -'use strict'; - -var util = require('util'); -var format = require('util').format; -var Path = require('path'); -var sprintf = require('sprintf-js').sprintf; - -// Constants -var c = require('./const'); - -var $$ = require('./utils'); - -var ActionContainer = require('./action_container'); - -// Errors -var argumentErrorHelper = require('./argument/error'); - -var HelpFormatter = require('./help/formatter'); - -var Namespace = require('./namespace'); - - -/** - * new ArgumentParser(options) - * - * Create a new ArgumentParser object. - * - * ##### Options: - * - `prog` The name of the program (default: Path.basename(process.argv[1])) - * - `usage` A usage message (default: auto-generated from arguments) - * - `description` A description of what the program does - * - `epilog` Text following the argument descriptions - * - `parents` Parsers whose arguments should be copied into this one - * - `formatterClass` HelpFormatter class for printing help messages - * - `prefixChars` Characters that prefix optional arguments - * - `fromfilePrefixChars` Characters that prefix files containing additional arguments - * - `argumentDefault` The default value for all arguments - * - `addHelp` Add a -h/-help option - * - `conflictHandler` Specifies how to handle conflicting argument names - * - `debug` Enable debug mode. Argument errors throw exception in - * debug mode and process.exit in normal. Used for development and - * testing (default: false) - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#argumentparser-objects - **/ -function ArgumentParser(options) { - if (!(this instanceof ArgumentParser)) { - return new ArgumentParser(options); - } - var self = this; - options = options || {}; - - options.description = (options.description || null); - options.argumentDefault = (options.argumentDefault || null); - options.prefixChars = (options.prefixChars || '-'); - options.conflictHandler = (options.conflictHandler || 'error'); - ActionContainer.call(this, options); - - options.addHelp = typeof options.addHelp === 'undefined' || !!options.addHelp; - options.parents = options.parents || []; - // default program name - options.prog = (options.prog || Path.basename(process.argv[1])); - this.prog = options.prog; - this.usage = options.usage; - this.epilog = options.epilog; - this.version = options.version; - - this.debug = (options.debug === true); - - this.formatterClass = (options.formatterClass || HelpFormatter); - this.fromfilePrefixChars = options.fromfilePrefixChars || null; - this._positionals = this.addArgumentGroup({ title: 'Positional arguments' }); - this._optionals = this.addArgumentGroup({ title: 'Optional arguments' }); - this._subparsers = null; - - // register types - function FUNCTION_IDENTITY(o) { - return o; - } - this.register('type', 'auto', FUNCTION_IDENTITY); - this.register('type', null, FUNCTION_IDENTITY); - this.register('type', 'int', function (x) { - var result = parseInt(x, 10); - if (isNaN(result)) { - throw new Error(x + ' is not a valid integer.'); - } - return result; - }); - this.register('type', 'float', function (x) { - var result = parseFloat(x); - if (isNaN(result)) { - throw new Error(x + ' is not a valid float.'); - } - return result; - }); - this.register('type', 'string', function (x) { - return '' + x; - }); - - // add help and version arguments if necessary - var defaultPrefix = (this.prefixChars.indexOf('-') > -1) ? '-' : this.prefixChars[0]; - if (options.addHelp) { - this.addArgument( - [ defaultPrefix + 'h', defaultPrefix + defaultPrefix + 'help' ], - { - action: 'help', - defaultValue: c.SUPPRESS, - help: 'Show this help message and exit.' - } - ); - } - if (typeof this.version !== 'undefined') { - this.addArgument( - [ defaultPrefix + 'v', defaultPrefix + defaultPrefix + 'version' ], - { - action: 'version', - version: this.version, - defaultValue: c.SUPPRESS, - help: "Show program's version number and exit." - } - ); - } - - // add parent arguments and defaults - options.parents.forEach(function (parent) { - self._addContainerActions(parent); - if (typeof parent._defaults !== 'undefined') { - for (var defaultKey in parent._defaults) { - if (parent._defaults.hasOwnProperty(defaultKey)) { - self._defaults[defaultKey] = parent._defaults[defaultKey]; - } - } - } - }); -} - -util.inherits(ArgumentParser, ActionContainer); - -/** - * ArgumentParser#addSubparsers(options) -> [[ActionSubparsers]] - * - options (object): hash of options see [[ActionSubparsers.new]] - * - * See also [subcommands][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#sub-commands - **/ -ArgumentParser.prototype.addSubparsers = function (options) { - if (this._subparsers) { - this.error('Cannot have multiple subparser arguments.'); - } - - options = options || {}; - options.debug = (this.debug === true); - options.optionStrings = []; - options.parserClass = (options.parserClass || ArgumentParser); - - - if (!!options.title || !!options.description) { - - this._subparsers = this.addArgumentGroup({ - title: (options.title || 'subcommands'), - description: options.description - }); - delete options.title; - delete options.description; - - } else { - this._subparsers = this._positionals; - } - - // prog defaults to the usage message of this parser, skipping - // optional arguments and with no "usage:" prefix - if (!options.prog) { - var formatter = this._getFormatter(); - var positionals = this._getPositionalActions(); - var groups = this._mutuallyExclusiveGroups; - formatter.addUsage(this.usage, positionals, groups, ''); - options.prog = formatter.formatHelp().trim(); - } - - // create the parsers action and add it to the positionals list - var ParsersClass = this._popActionClass(options, 'parsers'); - var action = new ParsersClass(options); - this._subparsers._addAction(action); - - // return the created parsers action - return action; -}; - -ArgumentParser.prototype._addAction = function (action) { - if (action.isOptional()) { - this._optionals._addAction(action); - } else { - this._positionals._addAction(action); - } - return action; -}; - -ArgumentParser.prototype._getOptionalActions = function () { - return this._actions.filter(function (action) { - return action.isOptional(); - }); -}; - -ArgumentParser.prototype._getPositionalActions = function () { - return this._actions.filter(function (action) { - return action.isPositional(); - }); -}; - - -/** - * ArgumentParser#parseArgs(args, namespace) -> Namespace|Object - * - args (array): input elements - * - namespace (Namespace|Object): result object - * - * Parsed args and throws error if some arguments are not recognized - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#the-parse-args-method - **/ -ArgumentParser.prototype.parseArgs = function (args, namespace) { - var argv; - var result = this.parseKnownArgs(args, namespace); - - args = result[0]; - argv = result[1]; - if (argv && argv.length > 0) { - this.error( - format('Unrecognized arguments: %s.', argv.join(' ')) - ); - } - return args; -}; - -/** - * ArgumentParser#parseKnownArgs(args, namespace) -> array - * - args (array): input options - * - namespace (Namespace|Object): result object - * - * Parse known arguments and return tuple of result object - * and unknown args - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#partial-parsing - **/ -ArgumentParser.prototype.parseKnownArgs = function (args, namespace) { - var self = this; - - // args default to the system args - args = args || process.argv.slice(2); - - // default Namespace built from parser defaults - namespace = namespace || new Namespace(); - - self._actions.forEach(function (action) { - if (action.dest !== c.SUPPRESS) { - if (!$$.has(namespace, action.dest)) { - if (action.defaultValue !== c.SUPPRESS) { - var defaultValue = action.defaultValue; - if (typeof action.defaultValue === 'string') { - defaultValue = self._getValue(action, defaultValue); - } - namespace[action.dest] = defaultValue; - } - } - } - }); - - Object.keys(self._defaults).forEach(function (dest) { - namespace[dest] = self._defaults[dest]; - }); - - // parse the arguments and exit if there are any errors - try { - var res = this._parseKnownArgs(args, namespace); - - namespace = res[0]; - args = res[1]; - if ($$.has(namespace, c._UNRECOGNIZED_ARGS_ATTR)) { - args = $$.arrayUnion(args, namespace[c._UNRECOGNIZED_ARGS_ATTR]); - delete namespace[c._UNRECOGNIZED_ARGS_ATTR]; - } - return [ namespace, args ]; - } catch (e) { - this.error(e); - } -}; - -ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { - var self = this; - - var extras = []; - - // replace arg strings that are file references - if (this.fromfilePrefixChars !== null) { - argStrings = this._readArgsFromFiles(argStrings); - } - // map all mutually exclusive arguments to the other arguments - // they can't occur with - // Python has 'conflicts = action_conflicts.setdefault(mutex_action, [])' - // though I can't conceive of a way in which an action could be a member - // of two different mutually exclusive groups. - - function actionHash(action) { - // some sort of hashable key for this action - // action itself cannot be a key in actionConflicts - // I think getName() (join of optionStrings) is unique enough - return action.getName(); - } - - var conflicts, key; - var actionConflicts = {}; - - this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { - mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { - key = actionHash(mutexAction); - if (!$$.has(actionConflicts, key)) { - actionConflicts[key] = []; - } - conflicts = actionConflicts[key]; - conflicts.push.apply(conflicts, groupActions.slice(0, i)); - conflicts.push.apply(conflicts, groupActions.slice(i + 1)); - }); - }); - - // find all option indices, and determine the arg_string_pattern - // which has an 'O' if there is an option at an index, - // an 'A' if there is an argument, or a '-' if there is a '--' - var optionStringIndices = {}; - - var argStringPatternParts = []; - - argStrings.forEach(function (argString, argStringIndex) { - if (argString === '--') { - argStringPatternParts.push('-'); - while (argStringIndex < argStrings.length) { - argStringPatternParts.push('A'); - argStringIndex++; - } - } else { - // otherwise, add the arg to the arg strings - // and note the index if it was an option - var pattern; - var optionTuple = self._parseOptional(argString); - if (!optionTuple) { - pattern = 'A'; - } else { - optionStringIndices[argStringIndex] = optionTuple; - pattern = 'O'; - } - argStringPatternParts.push(pattern); - } - }); - var argStringsPattern = argStringPatternParts.join(''); - - var seenActions = []; - var seenNonDefaultActions = []; - - - function takeAction(action, argumentStrings, optionString) { - seenActions.push(action); - var argumentValues = self._getValues(action, argumentStrings); - - // error if this argument is not allowed with other previously - // seen arguments, assuming that actions that use the default - // value don't really count as "present" - if (argumentValues !== action.defaultValue) { - seenNonDefaultActions.push(action); - if (actionConflicts[actionHash(action)]) { - actionConflicts[actionHash(action)].forEach(function (actionConflict) { - if (seenNonDefaultActions.indexOf(actionConflict) >= 0) { - throw argumentErrorHelper( - action, - format('Not allowed with argument "%s".', actionConflict.getName()) - ); - } - }); - } - } - - if (argumentValues !== c.SUPPRESS) { - action.call(self, namespace, argumentValues, optionString); - } - } - - function consumeOptional(startIndex) { - // get the optional identified at this index - var optionTuple = optionStringIndices[startIndex]; - var action = optionTuple[0]; - var optionString = optionTuple[1]; - var explicitArg = optionTuple[2]; - - // identify additional optionals in the same arg string - // (e.g. -xyz is the same as -x -y -z if no args are required) - var actionTuples = []; - - var args, argCount, start, stop; - - for (;;) { - if (!action) { - extras.push(argStrings[startIndex]); - return startIndex + 1; - } - if (explicitArg) { - argCount = self._matchArgument(action, 'A'); - - // if the action is a single-dash option and takes no - // arguments, try to parse more single-dash options out - // of the tail of the option string - var chars = self.prefixChars; - if (argCount === 0 && chars.indexOf(optionString[1]) < 0) { - actionTuples.push([ action, [], optionString ]); - optionString = optionString[0] + explicitArg[0]; - var newExplicitArg = explicitArg.slice(1) || null; - var optionalsMap = self._optionStringActions; - - if (Object.keys(optionalsMap).indexOf(optionString) >= 0) { - action = optionalsMap[optionString]; - explicitArg = newExplicitArg; - } else { - throw argumentErrorHelper(action, sprintf('ignored explicit argument %r', explicitArg)); - } - } else if (argCount === 1) { - // if the action expect exactly one argument, we've - // successfully matched the option; exit the loop - stop = startIndex + 1; - args = [ explicitArg ]; - actionTuples.push([ action, args, optionString ]); - break; - } else { - // error if a double-dash option did not use the - // explicit argument - throw argumentErrorHelper(action, sprintf('ignored explicit argument %r', explicitArg)); - } - } else { - // if there is no explicit argument, try to match the - // optional's string arguments with the following strings - // if successful, exit the loop - - start = startIndex + 1; - var selectedPatterns = argStringsPattern.substr(start); - - argCount = self._matchArgument(action, selectedPatterns); - stop = start + argCount; - - - args = argStrings.slice(start, stop); - - actionTuples.push([ action, args, optionString ]); - break; - } - - } - - // add the Optional to the list and return the index at which - // the Optional's string args stopped - if (actionTuples.length < 1) { - throw new Error('length should be > 0'); - } - for (var i = 0; i < actionTuples.length; i++) { - takeAction.apply(self, actionTuples[i]); - } - return stop; - } - - // the list of Positionals left to be parsed; this is modified - // by consume_positionals() - var positionals = self._getPositionalActions(); - - function consumePositionals(startIndex) { - // match as many Positionals as possible - var selectedPattern = argStringsPattern.substr(startIndex); - var argCounts = self._matchArgumentsPartial(positionals, selectedPattern); - - // slice off the appropriate arg strings for each Positional - // and add the Positional and its args to the list - for (var i = 0; i < positionals.length; i++) { - var action = positionals[i]; - var argCount = argCounts[i]; - if (typeof argCount === 'undefined') { - continue; - } - var args = argStrings.slice(startIndex, startIndex + argCount); - - startIndex += argCount; - takeAction(action, args); - } - - // slice off the Positionals that we just parsed and return the - // index at which the Positionals' string args stopped - positionals = positionals.slice(argCounts.length); - return startIndex; - } - - // consume Positionals and Optionals alternately, until we have - // passed the last option string - var startIndex = 0; - var position; - - var maxOptionStringIndex = -1; - - Object.keys(optionStringIndices).forEach(function (position) { - maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); - }); - - var positionalsEndIndex, nextOptionStringIndex; - - while (startIndex <= maxOptionStringIndex) { - // consume any Positionals preceding the next option - nextOptionStringIndex = null; - for (position in optionStringIndices) { - if (!optionStringIndices.hasOwnProperty(position)) { continue; } - - position = parseInt(position, 10); - if (position >= startIndex) { - if (nextOptionStringIndex !== null) { - nextOptionStringIndex = Math.min(nextOptionStringIndex, position); - } else { - nextOptionStringIndex = position; - } - } - } - - if (startIndex !== nextOptionStringIndex) { - positionalsEndIndex = consumePositionals(startIndex); - // only try to parse the next optional if we didn't consume - // the option string during the positionals parsing - if (positionalsEndIndex > startIndex) { - startIndex = positionalsEndIndex; - continue; - } else { - startIndex = positionalsEndIndex; - } - } - - // if we consumed all the positionals we could and we're not - // at the index of an option string, there were extra arguments - if (!optionStringIndices[startIndex]) { - var strings = argStrings.slice(startIndex, nextOptionStringIndex); - extras = extras.concat(strings); - startIndex = nextOptionStringIndex; - } - // consume the next optional and any arguments for it - startIndex = consumeOptional(startIndex); - } - - // consume any positionals following the last Optional - var stopIndex = consumePositionals(startIndex); - - // if we didn't consume all the argument strings, there were extras - extras = extras.concat(argStrings.slice(stopIndex)); - - // if we didn't use all the Positional objects, there were too few - // arg strings supplied. - if (positionals.length > 0) { - self.error('too few arguments'); - } - - // make sure all required actions were present - self._actions.forEach(function (action) { - if (action.required) { - if (seenActions.indexOf(action) < 0) { - self.error(format('Argument "%s" is required', action.getName())); - } - } - }); - - // make sure all required groups have one option present - var actionUsed = false; - self._mutuallyExclusiveGroups.forEach(function (group) { - if (group.required) { - actionUsed = group._groupActions.some(function (action) { - return seenNonDefaultActions.indexOf(action) !== -1; - }); - - // if no actions were used, report the error - if (!actionUsed) { - var names = []; - group._groupActions.forEach(function (action) { - if (action.help !== c.SUPPRESS) { - names.push(action.getName()); - } - }); - names = names.join(' '); - var msg = 'one of the arguments ' + names + ' is required'; - self.error(msg); - } - } - }); - - // return the updated namespace and the extra arguments - return [ namespace, extras ]; -}; - -ArgumentParser.prototype._readArgsFromFiles = function (argStrings) { - // expand arguments referencing files - var self = this; - var fs = require('fs'); - var newArgStrings = []; - argStrings.forEach(function (argString) { - if (self.fromfilePrefixChars.indexOf(argString[0]) < 0) { - // for regular arguments, just add them back into the list - newArgStrings.push(argString); - } else { - // replace arguments referencing files with the file content - try { - var argstrs = []; - var filename = argString.slice(1); - var content = fs.readFileSync(filename, 'utf8'); - content = content.trim().split('\n'); - content.forEach(function (argLine) { - self.convertArgLineToArgs(argLine).forEach(function (arg) { - argstrs.push(arg); - }); - argstrs = self._readArgsFromFiles(argstrs); - }); - newArgStrings.push.apply(newArgStrings, argstrs); - } catch (error) { - return self.error(error.message); - } - } - }); - return newArgStrings; -}; - -ArgumentParser.prototype.convertArgLineToArgs = function (argLine) { - return [ argLine ]; -}; - -ArgumentParser.prototype._matchArgument = function (action, regexpArgStrings) { - - // match the pattern for this action to the arg strings - var regexpNargs = new RegExp('^' + this._getNargsPattern(action)); - var matches = regexpArgStrings.match(regexpNargs); - var message; - - // throw an exception if we weren't able to find a match - if (!matches) { - switch (action.nargs) { - /*eslint-disable no-undefined*/ - case undefined: - case null: - message = 'Expected one argument.'; - break; - case c.OPTIONAL: - message = 'Expected at most one argument.'; - break; - case c.ONE_OR_MORE: - message = 'Expected at least one argument.'; - break; - default: - message = 'Expected %s argument(s)'; - } - - throw argumentErrorHelper( - action, - format(message, action.nargs) - ); - } - // return the number of arguments matched - return matches[1].length; -}; - -ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgStrings) { - // progressively shorten the actions list by slicing off the - // final actions until we find a match - var self = this; - var result = []; - var actionSlice, pattern, matches; - var i, j; - - function getLength(string) { - return string.length; - } - - for (i = actions.length; i > 0; i--) { - pattern = ''; - actionSlice = actions.slice(0, i); - for (j = 0; j < actionSlice.length; j++) { - pattern += self._getNargsPattern(actionSlice[j]); - } - - pattern = new RegExp('^' + pattern); - matches = regexpArgStrings.match(pattern); - - if (matches && matches.length > 0) { - // need only groups - matches = matches.splice(1); - result = result.concat(matches.map(getLength)); - break; - } - } - - // return the list of arg string counts - return result; -}; - -ArgumentParser.prototype._parseOptional = function (argString) { - var action, optionString, argExplicit, optionTuples; - - // if it's an empty string, it was meant to be a positional - if (!argString) { - return null; - } - - // if it doesn't start with a prefix, it was meant to be positional - if (this.prefixChars.indexOf(argString[0]) < 0) { - return null; - } - - // if the option string is present in the parser, return the action - if (this._optionStringActions[argString]) { - return [ this._optionStringActions[argString], argString, null ]; - } - - // if it's just a single character, it was meant to be positional - if (argString.length === 1) { - return null; - } - - // if the option string before the "=" is present, return the action - if (argString.indexOf('=') >= 0) { - optionString = argString.split('=', 1)[0]; - argExplicit = argString.slice(optionString.length + 1); - - if (this._optionStringActions[optionString]) { - action = this._optionStringActions[optionString]; - return [ action, optionString, argExplicit ]; - } - } - - // search through all possible prefixes of the option string - // and all actions in the parser for possible interpretations - optionTuples = this._getOptionTuples(argString); - - // if multiple actions match, the option string was ambiguous - if (optionTuples.length > 1) { - var optionStrings = optionTuples.map(function (optionTuple) { - return optionTuple[1]; - }); - this.error(format( - 'Ambiguous option: "%s" could match %s.', - argString, optionStrings.join(', ') - )); - // if exactly one action matched, this segmentation is good, - // so return the parsed action - } else if (optionTuples.length === 1) { - return optionTuples[0]; - } - - // if it was not found as an option, but it looks like a negative - // number, it was meant to be positional - // unless there are negative-number-like options - if (argString.match(this._regexpNegativeNumber)) { - if (!this._hasNegativeNumberOptionals.some(Boolean)) { - return null; - } - } - // if it contains a space, it was meant to be a positional - if (argString.search(' ') >= 0) { - return null; - } - - // it was meant to be an optional but there is no such option - // in this parser (though it might be a valid option in a subparser) - return [ null, argString, null ]; -}; - -ArgumentParser.prototype._getOptionTuples = function (optionString) { - var result = []; - var chars = this.prefixChars; - var optionPrefix; - var argExplicit; - var action; - var actionOptionString; - - // option strings starting with two prefix characters are only split at - // the '=' - if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) >= 0) { - if (optionString.indexOf('=') >= 0) { - var optionStringSplit = optionString.split('=', 1); - - optionPrefix = optionStringSplit[0]; - argExplicit = optionStringSplit[1]; - } else { - optionPrefix = optionString; - argExplicit = null; - } - - for (actionOptionString in this._optionStringActions) { - if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - action = this._optionStringActions[actionOptionString]; - result.push([ action, actionOptionString, argExplicit ]); - } - } - - // single character options can be concatenated with their arguments - // but multiple character options always have to have their argument - // separate - } else if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) < 0) { - optionPrefix = optionString; - argExplicit = null; - var optionPrefixShort = optionString.substr(0, 2); - var argExplicitShort = optionString.substr(2); - - for (actionOptionString in this._optionStringActions) { - if (!$$.has(this._optionStringActions, actionOptionString)) continue; - - action = this._optionStringActions[actionOptionString]; - if (actionOptionString === optionPrefixShort) { - result.push([ action, actionOptionString, argExplicitShort ]); - } else if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - result.push([ action, actionOptionString, argExplicit ]); - } - } - - // shouldn't ever get here - } else { - throw new Error(format('Unexpected option string: %s.', optionString)); - } - // return the collected option tuples - return result; -}; - -ArgumentParser.prototype._getNargsPattern = function (action) { - // in all examples below, we have to allow for '--' args - // which are represented as '-' in the pattern - var regexpNargs; - - switch (action.nargs) { - // the default (null) is assumed to be a single argument - case undefined: - case null: - regexpNargs = '(-*A-*)'; - break; - // allow zero or more arguments - case c.OPTIONAL: - regexpNargs = '(-*A?-*)'; - break; - // allow zero or more arguments - case c.ZERO_OR_MORE: - regexpNargs = '(-*[A-]*)'; - break; - // allow one or more arguments - case c.ONE_OR_MORE: - regexpNargs = '(-*A[A-]*)'; - break; - // allow any number of options or arguments - case c.REMAINDER: - regexpNargs = '([-AO]*)'; - break; - // allow one argument followed by any number of options or arguments - case c.PARSER: - regexpNargs = '(-*A[-AO]*)'; - break; - // all others should be integers - default: - regexpNargs = '(-*' + $$.repeat('-*A', action.nargs) + '-*)'; - } - - // if this is an optional action, -- is not allowed - if (action.isOptional()) { - regexpNargs = regexpNargs.replace(/-\*/g, ''); - regexpNargs = regexpNargs.replace(/-/g, ''); - } - - // return the pattern - return regexpNargs; -}; - -// -// Value conversion methods -// - -ArgumentParser.prototype._getValues = function (action, argStrings) { - var self = this; - - // for everything but PARSER args, strip out '--' - if (action.nargs !== c.PARSER && action.nargs !== c.REMAINDER) { - argStrings = argStrings.filter(function (arrayElement) { - return arrayElement !== '--'; - }); - } - - var value, argString; - - // optional argument produces a default when not present - if (argStrings.length === 0 && action.nargs === c.OPTIONAL) { - - value = (action.isOptional()) ? action.constant : action.defaultValue; - - if (typeof (value) === 'string') { - value = this._getValue(action, value); - this._checkValue(action, value); - } - - // when nargs='*' on a positional, if there were no command-line - // args, use the default if it is anything other than None - } else if (argStrings.length === 0 && action.nargs === c.ZERO_OR_MORE && - action.optionStrings.length === 0) { - - value = (action.defaultValue || argStrings); - this._checkValue(action, value); - - // single argument or optional argument produces a single value - } else if (argStrings.length === 1 && - (!action.nargs || action.nargs === c.OPTIONAL)) { - - argString = argStrings[0]; - value = this._getValue(action, argString); - this._checkValue(action, value); - - // REMAINDER arguments convert all values, checking none - } else if (action.nargs === c.REMAINDER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - - // PARSER arguments convert all values, but check only the first - } else if (action.nargs === c.PARSER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - this._checkValue(action, value[0]); - - // all other types of nargs produce a list - } else { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - value.forEach(function (v) { - self._checkValue(action, v); - }); - } - - // return the converted value - return value; -}; - -ArgumentParser.prototype._getValue = function (action, argString) { - var result; - - var typeFunction = this._registryGet('type', action.type, action.type); - if (typeof typeFunction !== 'function') { - var message = format('%s is not callable', typeFunction); - throw argumentErrorHelper(action, message); - } - - // convert the value to the appropriate type - try { - result = typeFunction(argString); - - // ArgumentTypeErrors indicate errors - // If action.type is not a registered string, it is a function - // Try to deduce its name for inclusion in the error message - // Failing that, include the error message it raised. - } catch (e) { - var name = null; - if (typeof action.type === 'string') { - name = action.type; - } else { - name = action.type.name || action.type.displayName || ''; - } - var msg = format('Invalid %s value: %s', name, argString); - if (name === '') { msg += '\n' + e.message; } - throw argumentErrorHelper(action, msg); - } - // return the converted value - return result; -}; - -ArgumentParser.prototype._checkValue = function (action, value) { - // converted value must be one of the choices (if specified) - var choices = action.choices; - if (choices) { - // choise for argument can by array or string - if ((typeof choices === 'string' || Array.isArray(choices)) && - choices.indexOf(value) !== -1) { - return; - } - // choise for subparsers can by only hash - if (typeof choices === 'object' && !Array.isArray(choices) && choices[value]) { - return; - } - - if (typeof choices === 'string') { - choices = choices.split('').join(', '); - } else if (Array.isArray(choices)) { - choices = choices.join(', '); - } else { - choices = Object.keys(choices).join(', '); - } - var message = format('Invalid choice: %s (choose from [%s])', value, choices); - throw argumentErrorHelper(action, message); - } -}; - -// -// Help formatting methods -// - -/** - * ArgumentParser#formatUsage -> string - * - * Return usage string - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatUsage = function () { - var formatter = this._getFormatter(); - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - return formatter.formatHelp(); -}; - -/** - * ArgumentParser#formatHelp -> string - * - * Return help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatHelp = function () { - var formatter = this._getFormatter(); - - // usage - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - - // description - formatter.addText(this.description); - - // positionals, optionals and user-defined groups - this._actionGroups.forEach(function (actionGroup) { - formatter.startSection(actionGroup.title); - formatter.addText(actionGroup.description); - formatter.addArguments(actionGroup._groupActions); - formatter.endSection(); - }); - - // epilog - formatter.addText(this.epilog); - - // determine help from format above - return formatter.formatHelp(); -}; - -ArgumentParser.prototype._getFormatter = function () { - var FormatterClass = this.formatterClass; - var formatter = new FormatterClass({ prog: this.prog }); - return formatter; -}; - -// -// Print functions -// - -/** - * ArgumentParser#printUsage() -> Void - * - * Print usage - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printUsage = function () { - this._printMessage(this.formatUsage()); -}; - -/** - * ArgumentParser#printHelp() -> Void - * - * Print help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printHelp = function () { - this._printMessage(this.formatHelp()); -}; - -ArgumentParser.prototype._printMessage = function (message, stream) { - if (!stream) { - stream = process.stdout; - } - if (message) { - stream.write('' + message); - } -}; - -// -// Exit functions -// - -/** - * ArgumentParser#exit(status=0, message) -> Void - * - status (int): exit status - * - message (string): message - * - * Print message in stderr/stdout and exit program - **/ -ArgumentParser.prototype.exit = function (status, message) { - if (message) { - if (status === 0) { - this._printMessage(message); - } else { - this._printMessage(message, process.stderr); - } - } - - process.exit(status); -}; - -/** - * ArgumentParser#error(message) -> Void - * - err (Error|string): message - * - * Error method Prints a usage message incorporating the message to stderr and - * exits. If you override this in a subclass, - * it should not return -- it should - * either exit or throw an exception. - * - **/ -ArgumentParser.prototype.error = function (err) { - var message; - if (err instanceof Error) { - if (this.debug === true) { - throw err; - } - message = err.message; - } else { - message = err; - } - var msg = format('%s: error: %s', this.prog, message) + c.EOL; - - if (this.debug === true) { - throw new Error(msg); - } - - this.printUsage(process.stderr); - - return this.exit(2, msg); -}; - -module.exports = ArgumentParser; diff --git a/node_modules/argparse/lib/const.js b/node_modules/argparse/lib/const.js deleted file mode 100644 index b1fd4ce..0000000 --- a/node_modules/argparse/lib/const.js +++ /dev/null @@ -1,21 +0,0 @@ -// -// Constants -// - -'use strict'; - -module.exports.EOL = '\n'; - -module.exports.SUPPRESS = '==SUPPRESS=='; - -module.exports.OPTIONAL = '?'; - -module.exports.ZERO_OR_MORE = '*'; - -module.exports.ONE_OR_MORE = '+'; - -module.exports.PARSER = 'A...'; - -module.exports.REMAINDER = '...'; - -module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'; diff --git a/node_modules/argparse/lib/help/added_formatters.js b/node_modules/argparse/lib/help/added_formatters.js deleted file mode 100644 index f8e4299..0000000 --- a/node_modules/argparse/lib/help/added_formatters.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var util = require('util'); - -// Constants -var c = require('../const'); - -var $$ = require('../utils'); -var HelpFormatter = require('./formatter.js'); - -/** - * new RawDescriptionHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) - * - * Help message formatter which adds default values to argument help. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -function ArgumentDefaultsHelpFormatter(options) { - HelpFormatter.call(this, options); -} - -util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter); - -ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) { - var help = action.help; - if (action.help.indexOf('%(defaultValue)s') === -1) { - if (action.defaultValue !== c.SUPPRESS) { - var defaulting_nargs = [ c.OPTIONAL, c.ZERO_OR_MORE ]; - if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) { - help += ' (default: %(defaultValue)s)'; - } - } - } - return help; -}; - -module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter; - -/** - * new RawDescriptionHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) - * - * Help message formatter which retains any formatting in descriptions. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -function RawDescriptionHelpFormatter(options) { - HelpFormatter.call(this, options); -} - -util.inherits(RawDescriptionHelpFormatter, HelpFormatter); - -RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) { - var lines = text.split('\n'); - lines = lines.map(function (line) { - return $$.trimEnd(indent + line); - }); - return lines.join('\n'); -}; -module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter; - -/** - * new RawTextHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...}) - * - * Help message formatter which retains formatting of all help text. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -function RawTextHelpFormatter(options) { - RawDescriptionHelpFormatter.call(this, options); -} - -util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter); - -RawTextHelpFormatter.prototype._splitLines = function (text) { - return text.split('\n'); -}; - -module.exports.RawTextHelpFormatter = RawTextHelpFormatter; diff --git a/node_modules/argparse/lib/help/formatter.js b/node_modules/argparse/lib/help/formatter.js deleted file mode 100644 index 29036c1..0000000 --- a/node_modules/argparse/lib/help/formatter.js +++ /dev/null @@ -1,795 +0,0 @@ -/** - * class HelpFormatter - * - * Formatter for generating usage messages and argument help strings. Only the - * name of this class is considered a public API. All the methods provided by - * the class are considered an implementation detail. - * - * Do not call in your code, use this class only for inherits your own forvatter - * - * ToDo add [additonal formatters][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#formatter-class - **/ -'use strict'; - -var sprintf = require('sprintf-js').sprintf; - -// Constants -var c = require('../const'); - -var $$ = require('../utils'); - - -/*:nodoc:* internal - * new Support(parent, heding) - * - parent (object): parent section - * - heading (string): header string - * - **/ -function Section(parent, heading) { - this._parent = parent; - this._heading = heading; - this._items = []; -} - -/*:nodoc:* internal - * Section#addItem(callback) -> Void - * - callback (array): tuple with function and args - * - * Add function for single element - **/ -Section.prototype.addItem = function (callback) { - this._items.push(callback); -}; - -/*:nodoc:* internal - * Section#formatHelp(formatter) -> string - * - formatter (HelpFormatter): current formatter - * - * Form help section string - * - **/ -Section.prototype.formatHelp = function (formatter) { - var itemHelp, heading; - - // format the indented section - if (this._parent) { - formatter._indent(); - } - - itemHelp = this._items.map(function (item) { - var obj, func, args; - - obj = formatter; - func = item[0]; - args = item[1]; - return func.apply(obj, args); - }); - itemHelp = formatter._joinParts(itemHelp); - - if (this._parent) { - formatter._dedent(); - } - - // return nothing if the section was empty - if (!itemHelp) { - return ''; - } - - // add the heading if the section was non-empty - heading = ''; - if (this._heading && this._heading !== c.SUPPRESS) { - var currentIndent = formatter.currentIndent; - heading = $$.repeat(' ', currentIndent) + this._heading + ':' + c.EOL; - } - - // join the section-initialize newline, the heading and the help - return formatter._joinParts([ c.EOL, heading, itemHelp, c.EOL ]); -}; - -/** - * new HelpFormatter(options) - * - * #### Options: - * - `prog`: program name - * - `indentIncriment`: indent step, default value 2 - * - `maxHelpPosition`: max help position, default value = 24 - * - `width`: line width - * - **/ -var HelpFormatter = module.exports = function HelpFormatter(options) { - options = options || {}; - - this._prog = options.prog; - - this._maxHelpPosition = options.maxHelpPosition || 24; - this._width = (options.width || ((process.env.COLUMNS || 80) - 2)); - - this._currentIndent = 0; - this._indentIncriment = options.indentIncriment || 2; - this._level = 0; - this._actionMaxLength = 0; - - this._rootSection = new Section(null); - this._currentSection = this._rootSection; - - this._whitespaceMatcher = new RegExp('\\s+', 'g'); - this._longBreakMatcher = new RegExp(c.EOL + c.EOL + c.EOL + '+', 'g'); -}; - -HelpFormatter.prototype._indent = function () { - this._currentIndent += this._indentIncriment; - this._level += 1; -}; - -HelpFormatter.prototype._dedent = function () { - this._currentIndent -= this._indentIncriment; - this._level -= 1; - if (this._currentIndent < 0) { - throw new Error('Indent decreased below 0.'); - } -}; - -HelpFormatter.prototype._addItem = function (func, args) { - this._currentSection.addItem([ func, args ]); -}; - -// -// Message building methods -// - -/** - * HelpFormatter#startSection(heading) -> Void - * - heading (string): header string - * - * Start new help section - * - * See alse [code example][1] - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.startSection = function (heading) { - this._indent(); - var section = new Section(this._currentSection, heading); - var func = section.formatHelp.bind(section); - this._addItem(func, [ this ]); - this._currentSection = section; -}; - -/** - * HelpFormatter#endSection -> Void - * - * End help section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - **/ -HelpFormatter.prototype.endSection = function () { - this._currentSection = this._currentSection._parent; - this._dedent(); -}; - -/** - * HelpFormatter#addText(text) -> Void - * - text (string): plain text - * - * Add plain text into current section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.addText = function (text) { - if (text && text !== c.SUPPRESS) { - this._addItem(this._formatText, [ text ]); - } -}; - -/** - * HelpFormatter#addUsage(usage, actions, groups, prefix) -> Void - * - usage (string): usage text - * - actions (array): actions list - * - groups (array): groups list - * - prefix (string): usage prefix - * - * Add usage data into current section - * - * ##### Example - * - * formatter.addUsage(this.usage, this._actions, []); - * return formatter.formatHelp(); - * - **/ -HelpFormatter.prototype.addUsage = function (usage, actions, groups, prefix) { - if (usage !== c.SUPPRESS) { - this._addItem(this._formatUsage, [ usage, actions, groups, prefix ]); - } -}; - -/** - * HelpFormatter#addArgument(action) -> Void - * - action (object): action - * - * Add argument into current section - * - * Single variant of [[HelpFormatter#addArguments]] - **/ -HelpFormatter.prototype.addArgument = function (action) { - if (action.help !== c.SUPPRESS) { - var self = this; - - // find all invocations - var invocations = [ this._formatActionInvocation(action) ]; - var invocationLength = invocations[0].length; - - var actionLength; - - if (action._getSubactions) { - this._indent(); - action._getSubactions().forEach(function (subaction) { - - var invocationNew = self._formatActionInvocation(subaction); - invocations.push(invocationNew); - invocationLength = Math.max(invocationLength, invocationNew.length); - - }); - this._dedent(); - } - - // update the maximum item length - actionLength = invocationLength + this._currentIndent; - this._actionMaxLength = Math.max(this._actionMaxLength, actionLength); - - // add the item to the list - this._addItem(this._formatAction, [ action ]); - } -}; - -/** - * HelpFormatter#addArguments(actions) -> Void - * - actions (array): actions list - * - * Mass add arguments into current section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.addArguments = function (actions) { - var self = this; - actions.forEach(function (action) { - self.addArgument(action); - }); -}; - -// -// Help-formatting methods -// - -/** - * HelpFormatter#formatHelp -> string - * - * Format help - * - * ##### Example - * - * formatter.addText(this.epilog); - * return formatter.formatHelp(); - * - **/ -HelpFormatter.prototype.formatHelp = function () { - var help = this._rootSection.formatHelp(this); - if (help) { - help = help.replace(this._longBreakMatcher, c.EOL + c.EOL); - help = $$.trimChars(help, c.EOL) + c.EOL; - } - return help; -}; - -HelpFormatter.prototype._joinParts = function (partStrings) { - return partStrings.filter(function (part) { - return (part && part !== c.SUPPRESS); - }).join(''); -}; - -HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) { - if (!prefix && typeof prefix !== 'string') { - prefix = 'usage: '; - } - - actions = actions || []; - groups = groups || []; - - - // if usage is specified, use that - if (usage) { - usage = sprintf(usage, { prog: this._prog }); - - // if no optionals or positionals are available, usage is just prog - } else if (!usage && actions.length === 0) { - usage = this._prog; - - // if optionals and positionals are available, calculate usage - } else if (!usage) { - var prog = this._prog; - var optionals = []; - var positionals = []; - var actionUsage; - var textWidth; - - // split optionals from positionals - actions.forEach(function (action) { - if (action.isOptional()) { - optionals.push(action); - } else { - positionals.push(action); - } - }); - - // build full usage string - actionUsage = this._formatActionsUsage([].concat(optionals, positionals), groups); - usage = [ prog, actionUsage ].join(' '); - - // wrap the usage parts if it's too long - textWidth = this._width - this._currentIndent; - if ((prefix.length + usage.length) > textWidth) { - - // break usage into wrappable parts - var regexpPart = new RegExp('\\(.*?\\)+|\\[.*?\\]+|\\S+', 'g'); - var optionalUsage = this._formatActionsUsage(optionals, groups); - var positionalUsage = this._formatActionsUsage(positionals, groups); - - - var optionalParts = optionalUsage.match(regexpPart); - var positionalParts = positionalUsage.match(regexpPart) || []; - - if (optionalParts.join(' ') !== optionalUsage) { - throw new Error('assert "optionalParts.join(\' \') === optionalUsage"'); - } - if (positionalParts.join(' ') !== positionalUsage) { - throw new Error('assert "positionalParts.join(\' \') === positionalUsage"'); - } - - // helper for wrapping lines - /*eslint-disable func-style*/ // node 0.10 compat - var _getLines = function (parts, indent, prefix) { - var lines = []; - var line = []; - - var lineLength = prefix ? prefix.length - 1 : indent.length - 1; - - parts.forEach(function (part) { - if (lineLength + 1 + part.length > textWidth) { - lines.push(indent + line.join(' ')); - line = []; - lineLength = indent.length - 1; - } - line.push(part); - lineLength += part.length + 1; - }); - - if (line) { - lines.push(indent + line.join(' ')); - } - if (prefix) { - lines[0] = lines[0].substr(indent.length); - } - return lines; - }; - - var lines, indent, parts; - // if prog is short, follow it with optionals or positionals - if (prefix.length + prog.length <= 0.75 * textWidth) { - indent = $$.repeat(' ', (prefix.length + prog.length + 1)); - if (optionalParts) { - lines = [].concat( - _getLines([ prog ].concat(optionalParts), indent, prefix), - _getLines(positionalParts, indent) - ); - } else if (positionalParts) { - lines = _getLines([ prog ].concat(positionalParts), indent, prefix); - } else { - lines = [ prog ]; - } - - // if prog is long, put it on its own line - } else { - indent = $$.repeat(' ', prefix.length); - parts = optionalParts.concat(positionalParts); - lines = _getLines(parts, indent); - if (lines.length > 1) { - lines = [].concat( - _getLines(optionalParts, indent), - _getLines(positionalParts, indent) - ); - } - lines = [ prog ].concat(lines); - } - // join lines into usage - usage = lines.join(c.EOL); - } - } - - // prefix with 'usage:' - return prefix + usage + c.EOL + c.EOL; -}; - -HelpFormatter.prototype._formatActionsUsage = function (actions, groups) { - // find group indices and identify actions in groups - var groupActions = []; - var inserts = []; - var self = this; - - groups.forEach(function (group) { - var end; - var i; - - var start = actions.indexOf(group._groupActions[0]); - if (start >= 0) { - end = start + group._groupActions.length; - - //if (actions.slice(start, end) === group._groupActions) { - if ($$.arrayEqual(actions.slice(start, end), group._groupActions)) { - group._groupActions.forEach(function (action) { - groupActions.push(action); - }); - - if (!group.required) { - if (inserts[start]) { - inserts[start] += ' ['; - } else { - inserts[start] = '['; - } - inserts[end] = ']'; - } else { - if (inserts[start]) { - inserts[start] += ' ('; - } else { - inserts[start] = '('; - } - inserts[end] = ')'; - } - for (i = start + 1; i < end; i += 1) { - inserts[i] = '|'; - } - } - } - }); - - // collect all actions format strings - var parts = []; - - actions.forEach(function (action, actionIndex) { - var part; - var optionString; - var argsDefault; - var argsString; - - // suppressed arguments are marked with None - // remove | separators for suppressed arguments - if (action.help === c.SUPPRESS) { - parts.push(null); - if (inserts[actionIndex] === '|') { - inserts.splice(actionIndex, actionIndex); - } else if (inserts[actionIndex + 1] === '|') { - inserts.splice(actionIndex + 1, actionIndex + 1); - } - - // produce all arg strings - } else if (!action.isOptional()) { - part = self._formatArgs(action, action.dest); - - // if it's in a group, strip the outer [] - if (groupActions.indexOf(action) >= 0) { - if (part[0] === '[' && part[part.length - 1] === ']') { - part = part.slice(1, -1); - } - } - // add the action string to the list - parts.push(part); - - // produce the first way to invoke the option in brackets - } else { - optionString = action.optionStrings[0]; - - // if the Optional doesn't take a value, format is: -s or --long - if (action.nargs === 0) { - part = '' + optionString; - - // if the Optional takes a value, format is: -s ARGS or --long ARGS - } else { - argsDefault = action.dest.toUpperCase(); - argsString = self._formatArgs(action, argsDefault); - part = optionString + ' ' + argsString; - } - // make it look optional if it's not required or in a group - if (!action.required && groupActions.indexOf(action) < 0) { - part = '[' + part + ']'; - } - // add the action string to the list - parts.push(part); - } - }); - - // insert things at the necessary indices - for (var i = inserts.length - 1; i >= 0; --i) { - if (inserts[i] !== null) { - parts.splice(i, 0, inserts[i]); - } - } - - // join all the action items with spaces - var text = parts.filter(function (part) { - return !!part; - }).join(' '); - - // clean up separators for mutually exclusive groups - text = text.replace(/([\[(]) /g, '$1'); // remove spaces - text = text.replace(/ ([\])])/g, '$1'); - text = text.replace(/\[ *\]/g, ''); // remove empty groups - text = text.replace(/\( *\)/g, ''); - text = text.replace(/\(([^|]*)\)/g, '$1'); // remove () from single action groups - - text = text.trim(); - - // return the text - return text; -}; - -HelpFormatter.prototype._formatText = function (text) { - text = sprintf(text, { prog: this._prog }); - var textWidth = this._width - this._currentIndent; - var indentIncriment = $$.repeat(' ', this._currentIndent); - return this._fillText(text, textWidth, indentIncriment) + c.EOL + c.EOL; -}; - -HelpFormatter.prototype._formatAction = function (action) { - var self = this; - - var helpText; - var helpLines; - var parts; - var indentFirst; - - // determine the required width and the entry label - var helpPosition = Math.min(this._actionMaxLength + 2, this._maxHelpPosition); - var helpWidth = this._width - helpPosition; - var actionWidth = helpPosition - this._currentIndent - 2; - var actionHeader = this._formatActionInvocation(action); - - // no help; start on same line and add a final newline - if (!action.help) { - actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL; - - // short action name; start on the same line and pad two spaces - } else if (actionHeader.length <= actionWidth) { - actionHeader = $$.repeat(' ', this._currentIndent) + - actionHeader + - ' ' + - $$.repeat(' ', actionWidth - actionHeader.length); - indentFirst = 0; - - // long action name; start on the next line - } else { - actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL; - indentFirst = helpPosition; - } - - // collect the pieces of the action help - parts = [ actionHeader ]; - - // if there was help for the action, add lines of help text - if (action.help) { - helpText = this._expandHelp(action); - helpLines = this._splitLines(helpText, helpWidth); - parts.push($$.repeat(' ', indentFirst) + helpLines[0] + c.EOL); - helpLines.slice(1).forEach(function (line) { - parts.push($$.repeat(' ', helpPosition) + line + c.EOL); - }); - - // or add a newline if the description doesn't end with one - } else if (actionHeader.charAt(actionHeader.length - 1) !== c.EOL) { - parts.push(c.EOL); - } - // if there are any sub-actions, add their help as well - if (action._getSubactions) { - this._indent(); - action._getSubactions().forEach(function (subaction) { - parts.push(self._formatAction(subaction)); - }); - this._dedent(); - } - // return a single string - return this._joinParts(parts); -}; - -HelpFormatter.prototype._formatActionInvocation = function (action) { - if (!action.isOptional()) { - var format_func = this._metavarFormatter(action, action.dest); - var metavars = format_func(1); - return metavars[0]; - } - - var parts = []; - var argsDefault; - var argsString; - - // if the Optional doesn't take a value, format is: -s, --long - if (action.nargs === 0) { - parts = parts.concat(action.optionStrings); - - // if the Optional takes a value, format is: -s ARGS, --long ARGS - } else { - argsDefault = action.dest.toUpperCase(); - argsString = this._formatArgs(action, argsDefault); - action.optionStrings.forEach(function (optionString) { - parts.push(optionString + ' ' + argsString); - }); - } - return parts.join(', '); -}; - -HelpFormatter.prototype._metavarFormatter = function (action, metavarDefault) { - var result; - - if (action.metavar || action.metavar === '') { - result = action.metavar; - } else if (action.choices) { - var choices = action.choices; - - if (typeof choices === 'string') { - choices = choices.split('').join(', '); - } else if (Array.isArray(choices)) { - choices = choices.join(','); - } else { - choices = Object.keys(choices).join(','); - } - result = '{' + choices + '}'; - } else { - result = metavarDefault; - } - - return function (size) { - if (Array.isArray(result)) { - return result; - } - - var metavars = []; - for (var i = 0; i < size; i += 1) { - metavars.push(result); - } - return metavars; - }; -}; - -HelpFormatter.prototype._formatArgs = function (action, metavarDefault) { - var result; - var metavars; - - var buildMetavar = this._metavarFormatter(action, metavarDefault); - - switch (action.nargs) { - /*eslint-disable no-undefined*/ - case undefined: - case null: - metavars = buildMetavar(1); - result = '' + metavars[0]; - break; - case c.OPTIONAL: - metavars = buildMetavar(1); - result = '[' + metavars[0] + ']'; - break; - case c.ZERO_OR_MORE: - metavars = buildMetavar(2); - result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]'; - break; - case c.ONE_OR_MORE: - metavars = buildMetavar(2); - result = '' + metavars[0] + ' [' + metavars[1] + ' ...]'; - break; - case c.REMAINDER: - result = '...'; - break; - case c.PARSER: - metavars = buildMetavar(1); - result = metavars[0] + ' ...'; - break; - default: - metavars = buildMetavar(action.nargs); - result = metavars.join(' '); - } - return result; -}; - -HelpFormatter.prototype._expandHelp = function (action) { - var params = { prog: this._prog }; - - Object.keys(action).forEach(function (actionProperty) { - var actionValue = action[actionProperty]; - - if (actionValue !== c.SUPPRESS) { - params[actionProperty] = actionValue; - } - }); - - if (params.choices) { - if (typeof params.choices === 'string') { - params.choices = params.choices.split('').join(', '); - } else if (Array.isArray(params.choices)) { - params.choices = params.choices.join(', '); - } else { - params.choices = Object.keys(params.choices).join(', '); - } - } - - return sprintf(this._getHelpString(action), params); -}; - -HelpFormatter.prototype._splitLines = function (text, width) { - var lines = []; - var delimiters = [ ' ', '.', ',', '!', '?' ]; - var re = new RegExp('[' + delimiters.join('') + '][^' + delimiters.join('') + ']*$'); - - text = text.replace(/[\n\|\t]/g, ' '); - - text = text.trim(); - text = text.replace(this._whitespaceMatcher, ' '); - - // Wraps the single paragraph in text (a string) so every line - // is at most width characters long. - text.split(c.EOL).forEach(function (line) { - if (width >= line.length) { - lines.push(line); - return; - } - - var wrapStart = 0; - var wrapEnd = width; - var delimiterIndex = 0; - while (wrapEnd <= line.length) { - if (wrapEnd !== line.length && delimiters.indexOf(line[wrapEnd] < -1)) { - delimiterIndex = (re.exec(line.substring(wrapStart, wrapEnd)) || {}).index; - wrapEnd = wrapStart + delimiterIndex + 1; - } - lines.push(line.substring(wrapStart, wrapEnd)); - wrapStart = wrapEnd; - wrapEnd += width; - } - if (wrapStart < line.length) { - lines.push(line.substring(wrapStart, wrapEnd)); - } - }); - - return lines; -}; - -HelpFormatter.prototype._fillText = function (text, width, indent) { - var lines = this._splitLines(text, width); - lines = lines.map(function (line) { - return indent + line; - }); - return lines.join(c.EOL); -}; - -HelpFormatter.prototype._getHelpString = function (action) { - return action.help; -}; diff --git a/node_modules/argparse/lib/namespace.js b/node_modules/argparse/lib/namespace.js deleted file mode 100644 index a860de9..0000000 --- a/node_modules/argparse/lib/namespace.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * class Namespace - * - * Simple object for storing attributes. Implements equality by attribute names - * and values, and provides a simple string representation. - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object - **/ -'use strict'; - -var $$ = require('./utils'); - -/** - * new Namespace(options) - * - options(object): predefined propertis for result object - * - **/ -var Namespace = module.exports = function Namespace(options) { - $$.extend(this, options); -}; - -/** - * Namespace#isset(key) -> Boolean - * - key (string|number): property name - * - * Tells whenever `namespace` contains given `key` or not. - **/ -Namespace.prototype.isset = function (key) { - return $$.has(this, key); -}; - -/** - * Namespace#set(key, value) -> self - * -key (string|number|object): propery name - * -value (mixed): new property value - * - * Set the property named key with value. - * If key object then set all key properties to namespace object - **/ -Namespace.prototype.set = function (key, value) { - if (typeof (key) === 'object') { - $$.extend(this, key); - } else { - this[key] = value; - } - return this; -}; - -/** - * Namespace#get(key, defaultValue) -> mixed - * - key (string|number): property name - * - defaultValue (mixed): default value - * - * Return the property key or defaulValue if not set - **/ -Namespace.prototype.get = function (key, defaultValue) { - return !this[key] ? defaultValue : this[key]; -}; - -/** - * Namespace#unset(key, defaultValue) -> mixed - * - key (string|number): property name - * - defaultValue (mixed): default value - * - * Return data[key](and delete it) or defaultValue - **/ -Namespace.prototype.unset = function (key, defaultValue) { - var value = this[key]; - if (value !== null) { - delete this[key]; - return value; - } - return defaultValue; -}; diff --git a/node_modules/argparse/lib/utils.js b/node_modules/argparse/lib/utils.js deleted file mode 100644 index 4a9cf3e..0000000 --- a/node_modules/argparse/lib/utils.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -exports.repeat = function (str, num) { - var result = ''; - for (var i = 0; i < num; i++) { result += str; } - return result; -}; - -exports.arrayEqual = function (a, b) { - if (a.length !== b.length) { return false; } - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) { return false; } - } - return true; -}; - -exports.trimChars = function (str, chars) { - var start = 0; - var end = str.length - 1; - while (chars.indexOf(str.charAt(start)) >= 0) { start++; } - while (chars.indexOf(str.charAt(end)) >= 0) { end--; } - return str.slice(start, end + 1); -}; - -exports.capitalize = function (str) { - return str.charAt(0).toUpperCase() + str.slice(1); -}; - -exports.arrayUnion = function () { - var result = []; - for (var i = 0, values = {}; i < arguments.length; i++) { - var arr = arguments[i]; - for (var j = 0; j < arr.length; j++) { - if (!values[arr[j]]) { - values[arr[j]] = true; - result.push(arr[j]); - } - } - } - return result; -}; - -function has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} - -exports.has = has; - -exports.extend = function (dest, src) { - for (var i in src) { - if (has(src, i)) { dest[i] = src[i]; } - } -}; - -exports.trimEnd = function (str) { - return str.replace(/\s+$/g, ''); -}; diff --git a/node_modules/argparse/package.json b/node_modules/argparse/package.json deleted file mode 100644 index 68c84d1..0000000 --- a/node_modules/argparse/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "argparse@^1.0.7", - "_id": "argparse@1.0.10", - "_inBundle": false, - "_integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "_location": "/argparse", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "argparse@^1.0.7", - "name": "argparse", - "escapedName": "argparse", - "rawSpec": "^1.0.7", - "saveSpec": null, - "fetchSpec": "^1.0.7" - }, - "_requiredBy": [ - "/js-yaml" - ], - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "_shasum": "bcd6791ea5ae09725e17e5ad988134cd40b3d911", - "_spec": "argparse@^1.0.7", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/js-yaml", - "bugs": { - "url": "https://github.com/nodeca/argparse/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Eugene Shkuropat" - }, - { - "name": "Paul Jacobson" - } - ], - "dependencies": { - "sprintf-js": "~1.0.2" - }, - "deprecated": false, - "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "devDependencies": { - "eslint": "^2.13.1", - "istanbul": "^0.4.5", - "mocha": "^3.1.0", - "ndoc": "^5.0.1" - }, - "files": [ - "index.js", - "lib/" - ], - "homepage": "https://github.com/nodeca/argparse#readme", - "keywords": [ - "cli", - "parser", - "argparse", - "option", - "args" - ], - "license": "MIT", - "name": "argparse", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/argparse.git" - }, - "scripts": { - "test": "make test" - }, - "version": "1.0.10" -} diff --git a/node_modules/array-find-index/package.json b/node_modules/array-find-index/package.json index c61fc93..ef213fa 100644 --- a/node_modules/array-find-index/package.json +++ b/node_modules/array-find-index/package.json @@ -1,27 +1,33 @@ { - "_from": "array-find-index@^1.0.1", + "_args": [ + [ + "array-find-index@1.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "array-find-index@1.0.2", "_id": "array-find-index@1.0.2", "_inBundle": false, "_integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "_location": "/array-find-index", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "array-find-index@^1.0.1", + "raw": "array-find-index@1.0.2", "name": "array-find-index", "escapedName": "array-find-index", - "rawSpec": "^1.0.1", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "1.0.2" }, "_requiredBy": [ "/currently-unhandled" ], "_resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "_shasum": "df010aa1287e164bbda6f9723b0a96a1ec4187a1", - "_spec": "array-find-index@^1.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/currently-unhandled", + "_spec": "1.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/array-find-index/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "ES2015 `Array#findIndex()` ponyfill", "devDependencies": { "ava": "*", diff --git a/node_modules/asn1/package.json b/node_modules/asn1/package.json index 3ba018b..2ac6f3e 100644 --- a/node_modules/asn1/package.json +++ b/node_modules/asn1/package.json @@ -1,27 +1,32 @@ { - "_from": "asn1@~0.2.3", + "_args": [ + [ + "asn1@0.2.4", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "asn1@0.2.4", "_id": "asn1@0.2.4", "_inBundle": false, "_integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "_location": "/asn1", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "asn1@~0.2.3", + "raw": "asn1@0.2.4", "name": "asn1", "escapedName": "asn1", - "rawSpec": "~0.2.3", + "rawSpec": "0.2.4", "saveSpec": null, - "fetchSpec": "~0.2.3" + "fetchSpec": "0.2.4" }, "_requiredBy": [ "/sshpk" ], "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "_shasum": "8d2475dfab553bb33e77b54e59e880bb8ce23136", - "_spec": "asn1@~0.2.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sshpk", + "_spec": "0.2.4", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Joyent", "url": "joyent.com" @@ -29,7 +34,6 @@ "bugs": { "url": "https://github.com/joyent/node-asn1/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Mark Cavage", @@ -51,7 +55,6 @@ "dependencies": { "safer-buffer": "~2.1.0" }, - "deprecated": false, "description": "Contains parsers and serializers for ASN.1 (currently BER only)", "devDependencies": { "eslint": "2.13.1", diff --git a/node_modules/assert-plus/package.json b/node_modules/assert-plus/package.json index 890bcb2..449f624 100644 --- a/node_modules/assert-plus/package.json +++ b/node_modules/assert-plus/package.json @@ -1,19 +1,25 @@ { - "_from": "assert-plus@^1.0.0", + "_args": [ + [ + "assert-plus@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "assert-plus@1.0.0", "_id": "assert-plus@1.0.0", "_inBundle": false, "_integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "_location": "/assert-plus", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "assert-plus@^1.0.0", + "raw": "assert-plus@1.0.0", "name": "assert-plus", "escapedName": "assert-plus", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/dashdash", @@ -24,9 +30,8 @@ "/verror" ], "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "_spec": "assert-plus@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/http-signature", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mark Cavage", "email": "mcavage@gmail.com" @@ -34,7 +39,6 @@ "bugs": { "url": "https://github.com/mcavage/node-assert-plus/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Dave Eddy", @@ -62,7 +66,6 @@ } ], "dependencies": {}, - "deprecated": false, "description": "Extra assertions on top of node's assert module", "devDependencies": { "faucet": "0.0.1", diff --git a/node_modules/async-exit-hook/CHANGELOG.md b/node_modules/async-exit-hook/CHANGELOG.md deleted file mode 100644 index 743fa77..0000000 --- a/node_modules/async-exit-hook/CHANGELOG.md +++ /dev/null @@ -1,62 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -## [2.0.1](https://github.com/tapppi/async-exit-hook/compare/v2.0.0...v2.0.1) (2017-08-03) - - - - -# [2.0.0](https://github.com/tapppi/async-exit-hook/compare/v1.1.2...v2.0.0) (2017-08-03) - - -### Features - -* add unhandledRejectionHandler ([#3](https://github.com/tapppi/async-exit-hook/issues/3)) ([96a194f](https://github.com/tapppi/async-exit-hook/commit/96a194f)) - - -### BREAKING CHANGES - -* unhandledExceptionHandler no longer -catches rejections. - - - - -## [1.1.2](https://github.com/tapppi/async-exit-hook/compare/v1.1.1...v1.1.2) (2017-03-29) - - -### Bug Fixes - -* filters are used individually for events [#1](https://github.com/tapppi/async-exit-hook/issues/1) ([03235c8](https://github.com/tapppi/async-exit-hook/commit/03235c8)) - - - - -## [1.1.1](https://github.com/tapppi/async-exit-hook/compare/v1.1.0...v1.1.1) (2016-11-04) - - -### Bug Fixes - -* unhandled rejections now handled ([4302b9e](https://github.com/tapppi/async-exit-hook/commit/4302b9e)) - - -### Chores - -* drop support for node 0.12 ([2830391](https://github.com/tapppi/async-exit-hook/commit/2830391)) - - -### BREAKING CHANGES - -* node 0.12 not tested anymore - - - - -# [1.1.0](https://github.com/tapppi/async-exit-hook/compare/v1.0.0...v1.1.0) (2016-10-13) - - -### Features - -* support uncaughtRejectionHandler ([9098e3c](https://github.com/tapppi/async-exit-hook/commit/9098e3c)) diff --git a/node_modules/async-exit-hook/index.js b/node_modules/async-exit-hook/index.js deleted file mode 100644 index 2bb54a2..0000000 --- a/node_modules/async-exit-hook/index.js +++ /dev/null @@ -1,171 +0,0 @@ -'use strict'; - -const hooks = []; -const errHooks = []; -let called = false; -let waitingFor = 0; -let asyncTimeoutMs = 10000; - -const events = {}; -const filters = {}; - -function exit(exit, code, err) { - // Helper functions - let doExitDone = false; - - function doExit() { - if (doExitDone) { - return; - } - doExitDone = true; - - if (exit === true) { - // All handlers should be called even if the exit-hook handler was registered first - process.nextTick(process.exit.bind(null, code)); - } - } - - // Async hook callback, decrements waiting counter - function stepTowardExit() { - process.nextTick(() => { - if (--waitingFor === 0) { - doExit(); - } - }); - } - - // Runs a single hook - function runHook(syncArgCount, err, hook) { - // Cannot perform async hooks in `exit` event - if (exit && hook.length > syncArgCount) { - // Hook is async, expects a finish callback - waitingFor++; - - if (err) { - // Pass error, calling uncaught exception handlers - return hook(err, stepTowardExit); - } - return hook(stepTowardExit); - } - - // Hook is synchronous - if (err) { - // Pass error, calling uncaught exception handlers - return hook(err); - } - return hook(); - } - - // Only execute hooks once - if (called) { - return; - } - - called = true; - - // Run hooks - if (err) { - // Uncaught exception, run error hooks - errHooks.map(runHook.bind(null, 1, err)); - } - hooks.map(runHook.bind(null, 0, null)); - - if (waitingFor) { - // Force exit after x ms (10000 by default), even if async hooks in progress - setTimeout(() => { - doExit(); - }, asyncTimeoutMs); - } else { - // No asynchronous hooks, exit immediately - doExit(); - } -} - -// Add a hook -function add(hook) { - hooks.push(hook); - - if (hooks.length === 1) { - add.hookEvent('exit'); - add.hookEvent('beforeExit', 0); - add.hookEvent('SIGHUP', 128 + 1); - add.hookEvent('SIGINT', 128 + 2); - add.hookEvent('SIGTERM', 128 + 15); - add.hookEvent('SIGBREAK', 128 + 21); - - // PM2 Cluster shutdown message. Caught to support async handlers with pm2, needed because - // explicitly calling process.exit() doesn't trigger the beforeExit event, and the exit - // event cannot support async handlers, since the event loop is never called after it. - add.hookEvent('message', 0, function (msg) { // eslint-disable-line prefer-arrow-callback - if (msg !== 'shutdown') { - return true; - } - }); - } -} - -// New signal / event to hook -add.hookEvent = function (event, code, filter) { - events[event] = function () { - const eventFilters = filters[event]; - for (let i = 0; i < eventFilters.length; i++) { - if (eventFilters[i].apply(this, arguments)) { - return; - } - } - exit(code !== undefined && code !== null, code); - }; - - if (!filters[event]) { - filters[event] = []; - } - - if (filter) { - filters[event].push(filter); - } - process.on(event, events[event]); -}; - -// Unhook signal / event -add.unhookEvent = function (event) { - process.removeListener(event, events[event]); - delete events[event]; - delete filters[event]; -}; - -// List hooked events -add.hookedEvents = function () { - const ret = []; - for (const name in events) { - if ({}.hasOwnProperty.call(events, name)) { - ret.push(name); - } - } - return ret; -}; - -// Add an uncaught exception handler -add.uncaughtExceptionHandler = function (hook) { - errHooks.push(hook); - - if (errHooks.length === 1) { - process.once('uncaughtException', exit.bind(null, true, 1)); - } -}; - -// Add an unhandled rejection handler -add.unhandledRejectionHandler = function (hook) { - errHooks.push(hook); - - if (errHooks.length === 1) { - process.once('unhandledRejection', exit.bind(null, true, 1)); - } -}; - -// Configure async force exit timeout -add.forceExitTimeout = function (ms) { - asyncTimeoutMs = ms; -}; - -// Export -module.exports = add; diff --git a/node_modules/async-exit-hook/license b/node_modules/async-exit-hook/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/async-exit-hook/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/async-exit-hook/package.json b/node_modules/async-exit-hook/package.json deleted file mode 100644 index c90cf69..0000000 --- a/node_modules/async-exit-hook/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_from": "async-exit-hook@^2.0.1", - "_id": "async-exit-hook@2.0.1", - "_inBundle": false, - "_integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", - "_location": "/async-exit-hook", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "async-exit-hook@^2.0.1", - "name": "async-exit-hook", - "escapedName": "async-exit-hook", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/app-builder-lib", - "/temp-file" - ], - "_resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz", - "_shasum": "8bd8b024b0ec9b1c01cccb9af9db29bd717dfaf3", - "_spec": "async-exit-hook@^2.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "author": { - "name": "Tapani Moilanen", - "email": "moilanen.tapani@gmail.com", - "url": "https://github.com/tapppi" - }, - "ava": { - "files": [ - "test/*.js", - "!tests/cases/*" - ] - }, - "bugs": { - "url": "https://github.com/tapppi/async-exit-hook/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - } - ], - "deprecated": false, - "description": "Run some code when the process exits (supports async hooks and pm2 clustering)", - "devDependencies": { - "ava": "^0.21.0", - "coveralls": "^2.11.14", - "nyc": "^10.3.2", - "standard-version": "^4.2.0", - "xo": "^0.18.2" - }, - "engines": { - "node": ">=0.12.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/tapppi/async-exit-hook#readme", - "keywords": [ - "exit", - "quit", - "process", - "hook", - "graceful", - "handler", - "shutdown", - "sigterm", - "sigint", - "sighup", - "pm2", - "cluster", - "child", - "reload", - "async", - "terminate", - "kill", - "stop", - "event" - ], - "license": "MIT", - "name": "async-exit-hook", - "repository": { - "type": "git", - "url": "git+https://github.com/tapppi/async-exit-hook.git" - }, - "scripts": { - "release": "standard-version", - "test": "xo && nyc ava" - }, - "version": "2.0.1" -} diff --git a/node_modules/async-exit-hook/readme.md b/node_modules/async-exit-hook/readme.md deleted file mode 100644 index 65ed130..0000000 --- a/node_modules/async-exit-hook/readme.md +++ /dev/null @@ -1,118 +0,0 @@ -# async-exit-hook -[![Build Status](https://api.travis-ci.org/Tapppi/async-exit-hook.svg)](https://travis-ci.org/Tapppi/async-exit-hook) -[![Coverage Status](https://coveralls.io/repos/github/Tapppi/async-exit-hook/badge.svg?branch=master)](https://coveralls.io/github/Tapppi/async-exit-hook?branch=master) - -> Run some code when the process exits - -The `process.on('exit')` event doesn't catch all the ways a process can exit. This module catches: - -* process SIGINT, SIGTERM and SIGHUP, SIGBREAK signals -* process beforeExit and exit events -* PM2 clustering process shutdown message ([PM2 graceful reload](http://pm2.keymetrics.io/docs/usage/cluster-mode/#graceful-reload)) - -Useful for cleaning up. You can also include async handlers, and add custom events to hook and exit on. - -Forked and pretty much rewritten from [exit-hook](https://npmjs.com/package/exit-hook). - - -## Install - -``` -$ npm install --save async-exit-hook -``` - -## Usage - -### Considerations and warning -#### On `process.exit()` and asynchronous code -**If you use asynchronous exit hooks, DO NOT use `process.exit()` to exit. -The `exit` event DOES NOT support asynchronous code.** ->['beforeExit' is not emitted for conditions causing explicit termination, such as process.exit()] -(https://nodejs.org/api/process.html#process_event_beforeexit) - -#### Windows and `process.kill(signal)` -On windows `process.kill(signal)` immediately kills the process, and does not fire signal events, -and as such, cannot be used to gracefully exit. See *Clustering and child processes* for a -workaround when killing child processes. I'm planning to support gracefully exiting -with async support on windows soon. - -### Clustering and child processes -If you use custom clustering / child processes, you can gracefully shutdown your child process -by sending a shutdown message (`childProc.send('shutdown')`). - -### Example -```js -const exitHook = require('async-exit-hook'); - -exitHook(() => { - console.log('exiting'); -}); - -// you can add multiple hooks, even across files -exitHook(() => { - console.log('exiting 2'); -}); - -// you can add async hooks by accepting a callback -exitHook(callback => { - setTimeout(() => { - console.log('exiting 3'); - callback(); - }, 1000); -}); - -// You can hook uncaught errors with uncaughtExceptionHandler(), consequently adding -// async support to uncaught errors (normally uncaught errors result in a synchronous exit). -exitHook.uncaughtExceptionHandler(err => { - console.error(err); -}); - -// You can hook unhandled rejections with unhandledRejectionHandler() -exitHook.unhandledRejectionHandler(err => { - console.error(err); -}); - -// You can add multiple uncaught error handlers -// Add the second parameter (callback) to indicate async hooks -exitHook.uncaughtExceptionHandler((err, callback) => { - sendErrorToCloudOrWhatever(err) // Returns promise - .then(() => { - console.log('Sent err to cloud'); - }); - .catch(sendError => { - console.error('Error sending to cloud: ', err.stack)); - }) - .then(() => callback); - }); -}); - -// Add exit hooks for a signal or custom message: - -// Custom signal -// Arguments are `signal, exitCode` (SIGBREAK is already handled, this is an example) -exitHook.hookEvent('SIGBREAK', 21); - -// process event: `message` with a filter -// filter gets all arguments passed to *handler*: `process.on(message, *handler*)` -// Exits on process event `message` with msg `customShutdownMessage` only -exitHook.hookEvent('message', 0, msg => msg !== 'customShutdownMessage'); - -// All async hooks will work with uncaught errors when you have specified an uncaughtExceptionHandler -throw new Error('awesome'); - -//=> // Sync uncaughtExcpetion hooks called and retun -//=> '[Error: awesome]' -//=> // Sync hooks called and retun -//=> 'exiting' -//=> 'exiting 2' -//=> // Async uncaughtException hooks return -//=> 'Sent error to cloud' -//=> // Sync uncaughtException hooks return -//=> 'exiting 3' -``` - - -## License - -MIT © Tapani Moilanen -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/asynckit/package.json b/node_modules/asynckit/package.json index 97bf15b..5c3bd89 100644 --- a/node_modules/asynckit/package.json +++ b/node_modules/asynckit/package.json @@ -1,27 +1,32 @@ { - "_from": "asynckit@^0.4.0", + "_args": [ + [ + "asynckit@0.4.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "asynckit@0.4.0", "_id": "asynckit@0.4.0", "_inBundle": false, "_integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "_location": "/asynckit", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "asynckit@^0.4.0", + "raw": "asynckit@0.4.0", "name": "asynckit", "escapedName": "asynckit", - "rawSpec": "^0.4.0", + "rawSpec": "0.4.0", "saveSpec": null, - "fetchSpec": "^0.4.0" + "fetchSpec": "0.4.0" }, "_requiredBy": [ "/form-data" ], "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", - "_spec": "asynckit@^0.4.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/form-data", + "_spec": "0.4.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Alex Indigo", "email": "iam@alexindigo.com" @@ -29,9 +34,7 @@ "bugs": { "url": "https://github.com/alexindigo/asynckit/issues" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, "description": "Minimal async jobs utility library, with streams support", "devDependencies": { "browserify": "^13.0.0", diff --git a/node_modules/aws-sign2/package.json b/node_modules/aws-sign2/package.json index b9b8b5d..996384a 100644 --- a/node_modules/aws-sign2/package.json +++ b/node_modules/aws-sign2/package.json @@ -1,27 +1,32 @@ { - "_from": "aws-sign2@~0.7.0", + "_args": [ + [ + "aws-sign2@0.7.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "aws-sign2@0.7.0", "_id": "aws-sign2@0.7.0", "_inBundle": false, "_integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", "_location": "/aws-sign2", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "aws-sign2@~0.7.0", + "raw": "aws-sign2@0.7.0", "name": "aws-sign2", "escapedName": "aws-sign2", - "rawSpec": "~0.7.0", + "rawSpec": "0.7.0", "saveSpec": null, - "fetchSpec": "~0.7.0" + "fetchSpec": "0.7.0" }, "_requiredBy": [ "/request" ], "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "_shasum": "b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8", - "_spec": "aws-sign2@~0.7.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "0.7.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", @@ -30,9 +35,7 @@ "bugs": { "url": "https://github.com/mikeal/aws-sign/issues" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", "devDependencies": {}, "engines": { diff --git a/node_modules/aws4/package.json b/node_modules/aws4/package.json index 7a26d41..2175099 100644 --- a/node_modules/aws4/package.json +++ b/node_modules/aws4/package.json @@ -1,27 +1,32 @@ { - "_from": "aws4@^1.8.0", + "_args": [ + [ + "aws4@1.8.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "aws4@1.8.0", "_id": "aws4@1.8.0", "_inBundle": false, "_integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "_location": "/aws4", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "aws4@^1.8.0", + "raw": "aws4@1.8.0", "name": "aws4", "escapedName": "aws4", - "rawSpec": "^1.8.0", + "rawSpec": "1.8.0", "saveSpec": null, - "fetchSpec": "^1.8.0" + "fetchSpec": "1.8.0" }, "_requiredBy": [ "/request" ], "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "_shasum": "f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f", - "_spec": "aws4@^1.8.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "1.8.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Michael Hart", "email": "michael.hart.au@gmail.com", @@ -30,8 +35,6 @@ "bugs": { "url": "https://github.com/mhart/aws4/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Signs and prepares requests using AWS Signature Version 4", "devDependencies": { "mocha": "^2.4.5", diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json index 16a76a8..cb3150b 100644 --- a/node_modules/balanced-match/package.json +++ b/node_modules/balanced-match/package.json @@ -1,27 +1,33 @@ { - "_from": "balanced-match@^1.0.0", + "_args": [ + [ + "balanced-match@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "balanced-match@1.0.0", "_id": "balanced-match@1.0.0", "_inBundle": false, "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "_location": "/balanced-match", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "balanced-match@^1.0.0", + "raw": "balanced-match@1.0.0", "name": "balanced-match", "escapedName": "balanced-match", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/brace-expansion" ], "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", - "_spec": "balanced-match@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/brace-expansion", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", @@ -30,9 +36,7 @@ "bugs": { "url": "https://github.com/juliangruber/balanced-match/issues" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { "matcha": "^0.7.0", diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json index dc4fe62..882933c 100644 --- a/node_modules/base64-js/package.json +++ b/node_modules/base64-js/package.json @@ -1,27 +1,33 @@ { - "_from": "base64-js@^1.2.3", + "_args": [ + [ + "base64-js@1.3.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "base64-js@1.3.0", "_id": "base64-js@1.3.0", "_inBundle": false, "_integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", "_location": "/base64-js", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "base64-js@^1.2.3", + "raw": "base64-js@1.3.0", "name": "base64-js", "escapedName": "base64-js", - "rawSpec": "^1.2.3", + "rawSpec": "1.3.0", "saveSpec": null, - "fetchSpec": "^1.2.3" + "fetchSpec": "1.3.0" }, "_requiredBy": [ "/plist" ], "_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "_shasum": "cab1e6118f051095e58b5281aea8c1cd22bfc0e3", - "_spec": "base64-js@^1.2.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/plist", + "_spec": "1.3.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "T. Jameson Little", "email": "t.jameson.little@gmail.com" @@ -29,8 +35,6 @@ "bugs": { "url": "https://github.com/beatgammit/base64-js/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Base64 encoding/decoding in pure JS", "devDependencies": { "benchmark": "^2.1.4", diff --git a/node_modules/bcrypt-pbkdf/package.json b/node_modules/bcrypt-pbkdf/package.json index e7bb3cc..d2468fa 100644 --- a/node_modules/bcrypt-pbkdf/package.json +++ b/node_modules/bcrypt-pbkdf/package.json @@ -1,35 +1,38 @@ { - "_from": "bcrypt-pbkdf@^1.0.0", + "_args": [ + [ + "bcrypt-pbkdf@1.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "bcrypt-pbkdf@1.0.2", "_id": "bcrypt-pbkdf@1.0.2", "_inBundle": false, "_integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "_location": "/bcrypt-pbkdf", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "bcrypt-pbkdf@^1.0.0", + "raw": "bcrypt-pbkdf@1.0.2", "name": "bcrypt-pbkdf", "escapedName": "bcrypt-pbkdf", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.2" }, "_requiredBy": [ "/sshpk" ], "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "_shasum": "a4301d389b6a43f9b67ff3ca11a3f6637e360e9e", - "_spec": "bcrypt-pbkdf@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sshpk", + "_spec": "1.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/joyent/node-bcrypt-pbkdf/issues" }, - "bundleDependencies": false, "dependencies": { "tweetnacl": "^0.14.3" }, - "deprecated": false, "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", "devDependencies": {}, "homepage": "https://github.com/joyent/node-bcrypt-pbkdf#readme", diff --git a/node_modules/bluebird-lst/index.d.ts b/node_modules/bluebird-lst/index.d.ts deleted file mode 100644 index beed318..0000000 --- a/node_modules/bluebird-lst/index.d.ts +++ /dev/null @@ -1,1146 +0,0 @@ -// Type definitions for bluebird 3.5 -// Project: https://github.com/petkaantonov/bluebird -// Definitions by: Leonard Hecker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/*! - * The code following this comment originates from: - * https://github.com/types/npm-bluebird - * - * Note for browser users: use bluebird-global typings instead of this one - * if you want to use Bluebird via the global Promise symbol. - * - * Licensed under: - * The MIT License (MIT) - * - * Copyright (c) 2016 unional - * - * 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. - */ - -declare class Bluebird implements PromiseLike, Bluebird.Inspection { - [Symbol.toStringTag]: any - - /** - * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. - * If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback. - */ - constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); - - /** - * Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. - */ - // Based on PromiseLike.then, but returns a Bluebird instance. - then(onFulfill?: (value: R) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike): Bluebird; // For simpler signature help. - then(onfulfilled?: ((value: R) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Bluebird; - - /** - * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. - * - * Alias `.caught();` for compatibility with earlier ECMAScript version. - */ - catch(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; - caught(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; - catch(onReject?: (error: any) => U | PromiseLike): Bluebird; - caught(onReject?: (error: any) => U | PromiseLike): Bluebird; - - /** - * This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called. - * - * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called. - * - * Alias `.caught();` for compatibility with earlier ECMAScript version. - * - * TODO: disallow non-objects - */ - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, - ): Bluebird; - - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - - catch( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - - /** - * Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections. - */ - error(onReject: (reason: any) => U | PromiseLike): Bluebird; - - /** - * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler. - * - * Alias `.lastly();` for compatibility with earlier ECMAScript version. - */ - finally(handler: () => U | PromiseLike): Bluebird; - - lastly(handler: () => U | PromiseLike): Bluebird; - - /** - * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. - */ - bind(thisArg: any): Bluebird; - - /** - * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. - */ - done(onFulfilled?: (value: R) => U | PromiseLike, onRejected?: (error: any) => U | PromiseLike): void; - - /** - * Like `.finally()`, but not called for rejections. - */ - tap(onFulFill: (value: R) => PromiseLike | U): Bluebird; - - /** - * Like `.catch()` but rethrows the error - * TODO: disallow non-objects - */ - tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; - - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, - ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - - /** - * Same as calling `Promise.delay(ms, this)`. - */ - delay(ms: number): Bluebird; - - /** - * Returns a promise that will be fulfilled with this promise's fulfillment value or rejection reason. - * However, if this promise is not fulfilled or rejected within ms milliseconds, the returned promise - * is rejected with a TimeoutError or the error as the reason. - * - * You may specify a custom error message with the `message` parameter. - */ - timeout(ms: number, message?: string | Error): Bluebird; - - /** - * Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success. - * If the `callback` argument is not a function, this method does not do anything. - */ - nodeify(callback: (err: any, value?: R) => void, options?: Bluebird.SpreadOption): this; - nodeify(...sink: any[]): this; - asCallback(callback: (err: any, value?: R) => void, options?: Bluebird.SpreadOption): this; - asCallback(...sink: any[]): this; - - /** - * See if this `promise` has been fulfilled. - */ - isFulfilled(): boolean; - - /** - * See if this `promise` has been rejected. - */ - isRejected(): boolean; - - /** - * See if this `promise` is still defer. - */ - isPending(): boolean; - - /** - * See if this `promise` has been cancelled. - */ - isCancelled(): boolean; - - /** - * See if this `promise` is resolved -> either fulfilled or rejected. - */ - isResolved(): boolean; - - /** - * Get the fulfillment value of the underlying promise. Throws if the promise isn't fulfilled yet. - * - * throws `TypeError` - */ - value(): R; - - /** - * Get the rejection reason for the underlying promise. Throws if the promise isn't rejected yet. - * - * throws `TypeError` - */ - reason(): any; - - /** - * Synchronously inspect the state of this `promise`. The `PromiseInspection` will represent the state of - * the promise as snapshotted at the time of calling `.reflect()`. - */ - reflect(): Bluebird>; - reflect(): Bluebird>; - - /** - * This is a convenience method for doing: - * - * - * promise.then(function(obj){ - * return obj[propertyName].call(obj, arg...); - * }); - * - */ - call(propertyName: string, ...args: any[]): Bluebird; - - /** - * This is a convenience method for doing: - * - * - * promise.then(function(obj){ - * return obj[propertyName]; - * }); - * - */ - // TODO: Use "type property type" once it's there - // @see https://github.com/Microsoft/TypeScript/issues/1295 - get(key: string | number): Bluebird; - - /** - * Convenience method for: - * - * - * .then(function() { - * return value; - * }); - * - * - * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.return()` - * - * Alias `.thenReturn();` for compatibility with earlier ECMAScript version. - */ - return(): Bluebird; - thenReturn(): Bluebird; - return(value: U): Bluebird; - thenReturn(value: U): Bluebird; - - /** - * Convenience method for: - * - * - * .then(function() { - * throw reason; - * }); - * - * Same limitations apply as with `.return()`. - * - * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. - */ - throw(reason: Error): Bluebird; - thenThrow(reason: Error): Bluebird; - - /** - * Convenience method for: - * - * - * .catch(function() { - * return value; - * }); - * - * - * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.catchReturn()` - * TODO: disallow non-objects - */ - catchReturn(value: U): Bluebird; - - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, - value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - value: U, - ): Bluebird; - - /** - * Convenience method for: - * - * - * .catch(function() { - * throw reason; - * }); - * - * Same limitations apply as with `.catchReturn()`. - * TODO: disallow non-objects - */ - catchThrow(reason: Error): Bluebird; - - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, - reason: Error, - ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - reason: Error, - ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - reason: Error, - ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - reason: Error, - ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - reason: Error, - ): Bluebird; - - /** - * Convert to String. - */ - toString(): string; - - /** - * This is implicitly called by `JSON.stringify` when serializing the object. Returns a serialized representation of the `Promise`. - */ - toJSON(): object; - - /** - * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. - */ - spread(fulfilledHandler: (...values: W[]) => U | PromiseLike): Bluebird; - spread(fulfilledHandler: (...args: any[]) => U | PromiseLike): Bluebird; - - /** - * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - all(): Bluebird; - - /** - * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - props(this: PromiseLike | V>>): Bluebird>; - props(this: PromiseLike>): Bluebird; - - /** - * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - any(): Bluebird; - - /** - * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - some(count: number): Bluebird; - - /** - * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - race(): Bluebird; - - /** - * Same as calling `Bluebird.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - map(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - /** - * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - filter(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * Same as calling ``Bluebird.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - each(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - - /** - * Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - mapSeries(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - - /** - * Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled - */ - cancel(): void; - - /** - * Basically sugar for doing: somePromise.catch(function(){}); - * - * Which is needed in case error handlers are attached asynchronously to the promise later, which would otherwise result in premature unhandled rejection reporting. - */ - suppressUnhandledRejections(): void; - - /** - * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. - * - * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call. - * - * Alias for `attempt();` for compatibility with earlier ECMAScript version. - */ - static try(fn: () => R | PromiseLike): Bluebird; - static attempt(fn: () => R | PromiseLike): Bluebird; - - /** - * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. - * This method is convenient when a function can sometimes return synchronously or throw synchronously. - */ - static method(fn: (arg1: A1) => R | PromiseLike): (arg1: A1) => Bluebird; - static method(fn: (arg1: A1, arg2: A2) => R | PromiseLike): (arg1: A1, arg2: A2) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; - static method(fn: (...args: any[]) => R | PromiseLike): (...args: any[]) => Bluebird; - - /** - * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. - */ - static resolve(): Bluebird; - static resolve(value: R | PromiseLike): Bluebird; - - /** - * Create a promise that is rejected with the given `reason`. - */ - static reject(reason: any): Bluebird; - static reject(reason: any): Bluebird; - - /** - * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). - */ - static defer(): Bluebird.Resolver; - - /** - * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. - */ - static cast(value: R | PromiseLike): Bluebird; - - /** - * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. - */ - static bind(thisArg: any): Bluebird; - - /** - * See if `value` is a trusted Promise. - */ - static is(value: any): boolean; - - /** - * Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. - */ - static longStackTraces(): void; - - /** - * Returns a promise that will be resolved with value (or undefined) after given ms milliseconds. - * If value is a promise, the delay will start counting down when it is fulfilled and the returned - * promise will be fulfilled with the fulfillment value of the value promise. - */ - static delay(ms: number, value: R | PromiseLike): Bluebird; - static delay(ms: number): Bluebird; - - /** - * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. - * - * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. - * - * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. - */ - static promisify(func: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): () => Bluebird; - static promisify(func: (arg1: A1, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; - static promisify(nodeFunction: (...args: any[]) => void, options?: Bluebird.PromisifyOptions): (...args: any[]) => Bluebird; - - /** - * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object. - * - * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. - */ - // TODO how to model promisifyAll? - static promisifyAll(target: object, options?: Bluebird.PromisifyAllOptions): object; - - /** - * Returns a promise that is resolved by a node style callback function. - */ - static fromNode(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromNode(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromCallback(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromCallback(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - - /** - * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. - */ - // TODO: After https://github.com/Microsoft/TypeScript/issues/2983 is implemented, we can use - // the return type propagation of generators to automatically infer the return type T. - static coroutine(generatorFunction: () => IterableIterator, options?: Bluebird.CoroutineOptions): () => Bluebird; - static coroutine(generatorFunction: (a1: A1) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird; - /** - * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. - * - * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. - */ - static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; - - /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason. - */ - // TODO enable more overloads - // array with promises of different types - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4, PromiseLike | T5]): Bluebird<[T1, T2, T3, T4, T5]>; - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4]): Bluebird<[T1, T2, T3, T4]>; - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3]): Bluebird<[T1, T2, T3]>; - static all(values: [PromiseLike | T1, PromiseLike | T2]): Bluebird<[T1, T2]>; - static all(values: [PromiseLike | T1]): Bluebird<[T1]>; - // array with values - static all(values: PromiseLike | R>> | Array | R>): Bluebird; - - /** - * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. - * - * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. - * - * *The original object is not modified.* - */ - // trusted promise for map - static props(map: PromiseLike | V>>): Bluebird>; - // trusted promise for object - static props(object: PromiseLike>): Bluebird; // tslint:disable-line:unified-signatures - // map - static props(map: Map | V>): Bluebird>; // tslint:disable-line:unified-signatures - // object - static props(object: Bluebird.ResolvableProps): Bluebird; // tslint:disable-line:unified-signatures - - /** - * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. - */ - static any(values: PromiseLike | R>> | Array | R>): Bluebird; - - /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. - * - * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. - */ - static race(values: PromiseLike | R>> | Array | R>): Bluebird; - - /** - * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. - * - * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. - * - * *The original array is not modified.* - */ - static some(values: PromiseLike | R>> | Array | R>, count: number): Bluebird; - - /** - * Promise.join( - * Promise|any values..., - * function handler - * ) -> Promise - * For coordinating multiple concurrent discrete promises. - * - * Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply - */ - static join(arg1: A1 | PromiseLike, handler: (arg1: A1) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, handler: (arg1: A1, arg2: A2) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, arg5: A5 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): Bluebird; - - // variadic array - /** @deprecated use .all instead */ - static join(...values: Array>): Bluebird; - - /** - * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. - * - * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. - * - * *The original array is not modified.* - */ - static map(values: PromiseLike | R> | Iterable | R>> | Array | R> | Iterable | R>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. - * - * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. - * - * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* - */ - static reduce(values: PromiseLike | R>> | Array | R>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - /** - * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. - * - * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. - * - * *The original array is not modified. - */ - static filter(values: PromiseLike | R>> | Array | R>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. - * - * Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. - */ - static each(values: PromiseLike | R>> | Array | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - - /** - * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. - * - * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach. - * - * If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well. - */ - static mapSeries(values: PromiseLike | R> | Iterable | R>> | Array | R> | Iterable | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - - /** - * A meta method used to specify the disposer method that cleans up a resource when using `Promise.using`. - * - * Returns a Disposer object which encapsulates both the resource as well as the method to clean it up. - * The user can pass this object to `Promise.using` to get access to the resource when it becomes available, - * as well as to ensure its automatically cleaned up. - * - * The second argument passed to a disposer is the result promise of the using block, which you can - * inspect synchronously. - */ - disposer(disposeFn: (arg: R, promise: Bluebird) => void | PromiseLike): Bluebird.Disposer; - - /** - * In conjunction with `.disposer`, using will make sure that no matter what, the specified disposer - * will be called when the promise returned by the callback passed to using has settled. The disposer is - * necessary because there is no standard interface in node for disposing resources. - */ - static using(disposer: Bluebird.Disposer, executor: (transaction: R) => PromiseLike): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2) => PromiseLike): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, disposer3: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike): Bluebird; - - /** - * Add handler as the handler to call when there is a possibly unhandled rejection. - * The default handler logs the error stack to stderr or console.error in browsers. - * - * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. - * - * Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events. - */ - static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird) => void): void; - - /** - * Configure long stack traces, warnings, monitoring and cancellation. - * Note that even though false is the default here, a development environment might be detected which automatically - * enables long stack traces and warnings. - */ - static config(options: { - /** Enable warnings */ - warnings?: boolean | { - /** Enables all warnings except forgotten return statements. */ - wForgottenReturn: boolean; - }; - /** Enable long stack traces */ - longStackTraces?: boolean; - /** Enable cancellation */ - cancellation?: boolean; - /** Enable monitoring */ - monitoring?: boolean; - }): void; - - /** - * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. - * If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback. - */ - static Promise: typeof Bluebird; - - /** - * The version number of the library - */ - static version: string; -} - -declare namespace Bluebird { - interface ConcurrencyOption { - concurrency: number; - } - interface SpreadOption { - spread: boolean; - } - interface FromNodeOptions { - multiArgs?: boolean; - } - interface PromisifyOptions { - context?: any; - multiArgs?: boolean; - } - interface PromisifyAllOptions extends PromisifyOptions { - suffix?: string; - filter?(name: string, func: (...args: any[]) => any, target?: any, passesDefaultFilter?: boolean): boolean; - // The promisifier gets a reference to the original method and should return a function which returns a promise - promisifier?(originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird): () => PromiseLike; - } - interface CoroutineOptions { - yieldHandler(value: any): any; - } - - /** - * Represents an error is an explicit promise rejection as opposed to a thrown error. - * For example, if an error is errbacked by a callback API promisified through undefined or undefined - * and is not a typed error, it will be converted to a `OperationalError` which has the original error in - * the `.cause` property. - * - * `OperationalError`s are caught in `.error` handlers. - */ - class OperationalError extends Error { } - - /** - * Signals that an operation has timed out. Used as a custom cancellation reason in `.timeout`. - */ - class TimeoutError extends Error { } - - /** - * Signals that an operation has been aborted or cancelled. The default reason used by `.cancel`. - */ - class CancellationError extends Error {} - - /** - * A collection of errors. `AggregateError` is an array-like object, with numeric indices and a `.length` property. - * It supports all generic array methods such as `.forEach` directly. - * - * `AggregateError`s are caught in `.error` handlers, even if the contained errors are not operational. - * - * `Promise.some` and `Promise.any` use `AggregateError` as rejection reason when they fail. - */ - class AggregateError extends Error implements ArrayLike { - length: number; - [index: number]: Error; - join(separator?: string): string; - pop(): Error; - push(...errors: Error[]): number; - shift(): Error; - unshift(...errors: Error[]): number; - slice(begin?: number, end?: number): AggregateError; - filter(callback: (element: Error, index: number, array: AggregateError) => boolean, thisArg?: any): AggregateError; - forEach(callback: (element: Error, index: number, array: AggregateError) => void, thisArg?: any): undefined; - some(callback: (element: Error, index: number, array: AggregateError) => boolean, thisArg?: any): boolean; - every(callback: (element: Error, index: number, array: AggregateError) => boolean, thisArg?: any): boolean; - map(callback: (element: Error, index: number, array: AggregateError) => boolean, thisArg?: any): AggregateError; - indexOf(searchElement: Error, fromIndex?: number): number; - lastIndexOf(searchElement: Error, fromIndex?: number): number; - reduce(callback: (accumulator: any, element: Error, index: number, array: AggregateError) => any, initialValue?: any): any; - reduceRight(callback: (previousValue: any, element: Error, index: number, array: AggregateError) => any, initialValue?: any): any; - sort(compareFunction?: (errLeft: Error, errRight: Error) => number): AggregateError; - reverse(): AggregateError; - } - - /** - * returned by `Bluebird.disposer()`. - */ - class Disposer {} - - /** @deprecated Use PromiseLike directly. */ - type Thenable = PromiseLike; - - type ResolvableProps = object & { [K in keyof T]: PromiseLike | T[K] }; - - interface Resolver { - /** - * Returns a reference to the controlled promise that can be passed to clients. - */ - promise: Bluebird; - - /** - * Resolve the underlying promise with `value` as the resolution value. If `value` is a thenable or a promise, the underlying promise will assume its state. - */ - resolve(value: R): void; - resolve(): void; - - /** - * Reject the underlying promise with `reason` as the rejection reason. - */ - reject(reason: any): void; - - /** - * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. - * - * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. - */ - // TODO specify resolver callback - callback(err: any, value: R, ...values: R[]): void; - } - - interface Inspection { - /** - * See if the underlying promise was fulfilled at the creation time of this inspection object. - */ - isFulfilled(): boolean; - - /** - * See if the underlying promise was rejected at the creation time of this inspection object. - */ - isRejected(): boolean; - - /** - * See if the underlying promise was cancelled at the creation time of this inspection object. - */ - isCancelled(): boolean; - - /** - * See if the underlying promise was defer at the creation time of this inspection object. - */ - isPending(): boolean; - - /** - * Get the fulfillment value of the underlying promise. Throws if the promise wasn't fulfilled at the creation time of this inspection object. - * - * throws `TypeError` - */ - value(): R; - - /** - * Get the rejection reason for the underlying promise. Throws if the promise wasn't rejected at the creation time of this inspection object. - * - * throws `TypeError` - */ - reason(): any; - } - - /** - * Returns a new independent copy of the Bluebird library. - * - * This method should be used before you use any of the methods which would otherwise alter the global Bluebird object - to avoid polluting global state. - */ - function getNewLibraryCopy(): typeof Bluebird; - - /** - * This is relevant to browser environments with no module loader. - * - * Release control of the Promise namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. - */ - function noConflict(): typeof Bluebird; - - /** - * Changes how bluebird schedules calls a-synchronously. - * - * @param scheduler Should be a function that asynchronously schedules - * the calling of the passed in function - */ - function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; -} - -export = Bluebird; diff --git a/node_modules/bluebird-lst/index.js b/node_modules/bluebird-lst/index.js deleted file mode 100644 index 1b7755f..0000000 --- a/node_modules/bluebird-lst/index.js +++ /dev/null @@ -1,6 +0,0 @@ -const BluebirdPromise = require("bluebird/js/release/promise")() -BluebirdPromise.config({ - longStackTraces: true, -}) -BluebirdPromise.default = BluebirdPromise -module.exports = BluebirdPromise \ No newline at end of file diff --git a/node_modules/bluebird-lst/package.json b/node_modules/bluebird-lst/package.json deleted file mode 100644 index a1197c5..0000000 --- a/node_modules/bluebird-lst/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "bluebird-lst@^1.0.6", - "_id": "bluebird-lst@1.0.6", - "_inBundle": false, - "_integrity": "sha512-CBWFoPuUPpcvMUxfyr8DKdI5d4kjxFl1h39+VbKxP3KJWJHEsLtuT4pPLkjpxCGU6Ask21tvbnftWXdqIxYldQ==", - "_location": "/bluebird-lst", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "bluebird-lst@^1.0.6", - "name": "bluebird-lst", - "escapedName": "bluebird-lst", - "rawSpec": "^1.0.6", - "saveSpec": null, - "fetchSpec": "^1.0.6" - }, - "_requiredBy": [ - "/app-builder-lib", - "/builder-util", - "/builder-util-runtime", - "/dmg-builder", - "/electron-builder", - "/electron-publish", - "/fs-extra-p", - "/read-config-file", - "/temp-file" - ], - "_resolved": "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.6.tgz", - "_shasum": "89bc4de0a357373605c8781f293f7b06d454f869", - "_spec": "bluebird-lst@^1.0.6", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", - "author": { - "name": "Vladimir Krivosheev" - }, - "bugs": { - "url": "https://github.com/develar/fs-extra-p/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bluebird": "^3.5.2" - }, - "deprecated": false, - "description": "Bluebird — longStackTraces: true, cancellation: true", - "files": [ - "index.*" - ], - "homepage": "https://github.com/develar/fs-extra-p", - "license": "MIT", - "name": "bluebird-lst", - "repository": { - "type": "git", - "url": "git+https://github.com/develar/fs-extra-p.git" - }, - "typings": "./index.d.ts", - "version": "1.0.6" -} diff --git a/node_modules/bluebird/package.json b/node_modules/bluebird/package.json index f30f7e1..1bf969e 100644 --- a/node_modules/bluebird/package.json +++ b/node_modules/bluebird/package.json @@ -1,28 +1,34 @@ { - "_from": "bluebird@^3.5.2", + "_args": [ + [ + "bluebird@3.5.3", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "bluebird@3.5.3", "_id": "bluebird@3.5.3", "_inBundle": false, "_integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==", "_location": "/bluebird", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "bluebird@^3.5.2", + "raw": "bluebird@3.5.3", "name": "bluebird", "escapedName": "bluebird", - "rawSpec": "^3.5.2", + "rawSpec": "3.5.3", "saveSpec": null, - "fetchSpec": "^3.5.2" + "fetchSpec": "3.5.3" }, "_requiredBy": [ - "/bluebird-lst", - "/electron-osx-sign" + "/electron-osx-sign", + "/get-package-info" ], "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", - "_shasum": "7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7", - "_spec": "bluebird@^3.5.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/bluebird-lst", + "_spec": "3.5.3", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Petka Antonov", "email": "petka_antonov@hotmail.com", @@ -32,8 +38,6 @@ "bugs": { "url": "http://github.com/petkaantonov/bluebird/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Full featured Promises/A+ implementation with exceptionally good performance", "devDependencies": { "acorn": "^6.0.2", diff --git a/node_modules/boxen/index.js b/node_modules/boxen/index.js deleted file mode 100644 index b54b92d..0000000 --- a/node_modules/boxen/index.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; -const stringWidth = require('string-width'); -const chalk = require('chalk'); -const widestLine = require('widest-line'); -const cliBoxes = require('cli-boxes'); -const camelCase = require('camelcase'); -const ansiAlign = require('ansi-align'); -const termSize = require('term-size'); - -const getObject = detail => { - let obj; - - if (typeof detail === 'number') { - obj = { - top: detail, - right: detail * 3, - bottom: detail, - left: detail * 3 - }; - } else { - obj = Object.assign({ - top: 0, - right: 0, - bottom: 0, - left: 0 - }, detail); - } - - return obj; -}; - -const getBorderChars = borderStyle => { - const sides = [ - 'topLeft', - 'topRight', - 'bottomRight', - 'bottomLeft', - 'vertical', - 'horizontal' - ]; - - let chars; - - if (typeof borderStyle === 'string') { - chars = cliBoxes[borderStyle]; - - if (!chars) { - throw new TypeError(`Invalid border style: ${borderStyle}`); - } - } else { - sides.forEach(key => { - if (!borderStyle[key] || typeof borderStyle[key] !== 'string') { - throw new TypeError(`Invalid border style: ${key}`); - } - }); - - chars = borderStyle; - } - - return chars; -}; - -const getBackgroundColorName = x => camelCase('bg', x); - -module.exports = (text, opts) => { - opts = Object.assign({ - padding: 0, - borderStyle: 'single', - dimBorder: false, - align: 'left', - float: 'left' - }, opts); - - if (opts.backgroundColor) { - opts.backgroundColor = getBackgroundColorName(opts.backgroundColor); - } - - if (opts.borderColor && !chalk[opts.borderColor]) { - throw new Error(`${opts.borderColor} is not a valid borderColor`); - } - - if (opts.backgroundColor && !chalk[opts.backgroundColor]) { - throw new Error(`${opts.backgroundColor} is not a valid backgroundColor`); - } - - const chars = getBorderChars(opts.borderStyle); - const padding = getObject(opts.padding); - const margin = getObject(opts.margin); - - const colorizeBorder = x => { - const ret = opts.borderColor ? chalk[opts.borderColor](x) : x; - return opts.dimBorder ? chalk.dim(ret) : ret; - }; - - const colorizeContent = x => opts.backgroundColor ? chalk[opts.backgroundColor](x) : x; - - text = ansiAlign(text, {align: opts.align}); - - const NL = '\n'; - const PAD = ' '; - - let lines = text.split(NL); - - if (padding.top > 0) { - lines = Array(padding.top).fill('').concat(lines); - } - - if (padding.bottom > 0) { - lines = lines.concat(Array(padding.bottom).fill('')); - } - - const contentWidth = widestLine(text) + padding.left + padding.right; - const paddingLeft = PAD.repeat(padding.left); - const columns = termSize().columns; - let marginLeft = PAD.repeat(margin.left); - - if (opts.float === 'center') { - const padWidth = Math.max((columns - contentWidth) / 2, 0); - marginLeft = PAD.repeat(padWidth); - } else if (opts.float === 'right') { - const padWidth = Math.max(columns - contentWidth - margin.right - 2, 0); - marginLeft = PAD.repeat(padWidth); - } - - const horizontal = chars.horizontal.repeat(contentWidth); - const top = colorizeBorder(NL.repeat(margin.top) + marginLeft + chars.topLeft + horizontal + chars.topRight); - const bottom = colorizeBorder(marginLeft + chars.bottomLeft + horizontal + chars.bottomRight + NL.repeat(margin.bottom)); - const side = colorizeBorder(chars.vertical); - - const middle = lines.map(line => { - const paddingRight = PAD.repeat(contentWidth - stringWidth(line) - padding.left); - return marginLeft + side + colorizeContent(paddingLeft + line + paddingRight) + side; - }).join(NL); - - return top + NL + middle + NL + bottom; -}; - -module.exports._borderStyles = cliBoxes; diff --git a/node_modules/boxen/license b/node_modules/boxen/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/boxen/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/boxen/node_modules/ansi-regex/index.js b/node_modules/boxen/node_modules/ansi-regex/index.js deleted file mode 100644 index c4aaecf..0000000 --- a/node_modules/boxen/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = () => { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, 'g'); -}; diff --git a/node_modules/boxen/node_modules/ansi-regex/license b/node_modules/boxen/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/boxen/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/boxen/node_modules/ansi-regex/package.json b/node_modules/boxen/node_modules/ansi-regex/package.json deleted file mode 100644 index 42392f2..0000000 --- a/node_modules/boxen/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "ansi-regex@^3.0.0", - "_id": "ansi-regex@3.0.0", - "_inBundle": false, - "_integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "_location": "/boxen/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-regex@^3.0.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/boxen/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "_shasum": "ed0317c322064f79466c02966bddb605ab37d998", - "_spec": "ansi-regex@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen/node_modules/strip-ansi", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/ansi-regex#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "3.0.0" -} diff --git a/node_modules/boxen/node_modules/ansi-regex/readme.md b/node_modules/boxen/node_modules/ansi-regex/readme.md deleted file mode 100644 index 22db1c3..0000000 --- a/node_modules/boxen/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] -``` - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/boxen/node_modules/camelcase/index.js b/node_modules/boxen/node_modules/camelcase/index.js deleted file mode 100644 index c8492a2..0000000 --- a/node_modules/boxen/node_modules/camelcase/index.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -function preserveCamelCase(str) { - let isLastCharLower = false; - let isLastCharUpper = false; - let isLastLastCharUpper = false; - - for (let i = 0; i < str.length; i++) { - const c = str[i]; - - if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) { - str = str.substr(0, i) + '-' + str.substr(i); - isLastCharLower = false; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = true; - i++; - } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) { - str = str.substr(0, i - 1) + '-' + str.substr(i - 1); - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = false; - isLastCharLower = true; - } else { - isLastCharLower = c.toLowerCase() === c; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = c.toUpperCase() === c; - } - } - - return str; -} - -module.exports = function (str) { - if (arguments.length > 1) { - str = Array.from(arguments) - .map(x => x.trim()) - .filter(x => x.length) - .join('-'); - } else { - str = str.trim(); - } - - if (str.length === 0) { - return ''; - } - - if (str.length === 1) { - return str.toLowerCase(); - } - - if (/^[a-z0-9]+$/.test(str)) { - return str; - } - - const hasUpperCase = str !== str.toLowerCase(); - - if (hasUpperCase) { - str = preserveCamelCase(str); - } - - return str - .replace(/^[_.\- ]+/, '') - .toLowerCase() - .replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase()); -}; diff --git a/node_modules/boxen/node_modules/camelcase/license b/node_modules/boxen/node_modules/camelcase/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/boxen/node_modules/camelcase/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/boxen/node_modules/camelcase/package.json b/node_modules/boxen/node_modules/camelcase/package.json deleted file mode 100644 index 023633b..0000000 --- a/node_modules/boxen/node_modules/camelcase/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "camelcase@^4.0.0", - "_id": "camelcase@4.1.0", - "_inBundle": false, - "_integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "_location": "/boxen/camelcase", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "camelcase@^4.0.0", - "name": "camelcase", - "escapedName": "camelcase", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "_shasum": "d545635be1e33c542649c69173e5de6acfae34dd", - "_spec": "camelcase@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/camelcase/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/camelcase#readme", - "keywords": [ - "camelcase", - "camel-case", - "camel", - "case", - "dash", - "hyphen", - "dot", - "underscore", - "separator", - "string", - "text", - "convert" - ], - "license": "MIT", - "name": "camelcase", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/camelcase.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.1.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/boxen/node_modules/camelcase/readme.md b/node_modules/boxen/node_modules/camelcase/readme.md deleted file mode 100644 index 0610dc6..0000000 --- a/node_modules/boxen/node_modules/camelcase/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) - -> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar` - - -## Install - -``` -$ npm install --save camelcase -``` - - -## Usage - -```js -const camelCase = require('camelcase'); - -camelCase('foo-bar'); -//=> 'fooBar' - -camelCase('foo_bar'); -//=> 'fooBar' - -camelCase('Foo-Bar'); -//=> 'fooBar' - -camelCase('--foo.bar'); -//=> 'fooBar' - -camelCase('__foo__bar__'); -//=> 'fooBar' - -camelCase('foo bar'); -//=> 'fooBar' - -console.log(process.argv[3]); -//=> '--foo-bar' -camelCase(process.argv[3]); -//=> 'fooBar' - -camelCase('foo', 'bar'); -//=> 'fooBar' - -camelCase('__foo__', '--bar'); -//=> 'fooBar' -``` - - -## Related - -- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module -- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/boxen/node_modules/is-fullwidth-code-point/index.js b/node_modules/boxen/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index d506327..0000000 --- a/node_modules/boxen/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -/* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { - return false; - } - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || - // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || - // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || - // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || - // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || - // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || - // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || - // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || - // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || - // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) - ) - ) { - return true; - } - - return false; -}; diff --git a/node_modules/boxen/node_modules/is-fullwidth-code-point/license b/node_modules/boxen/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/boxen/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/boxen/node_modules/is-fullwidth-code-point/package.json b/node_modules/boxen/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index cf35636..0000000 --- a/node_modules/boxen/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-fullwidth-code-point@^2.0.0", - "_id": "is-fullwidth-code-point@2.0.0", - "_inBundle": false, - "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "_location": "/boxen/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-fullwidth-code-point@^2.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/boxen/string-width" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", - "_spec": "is-fullwidth-code-point@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen/node_modules/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "license": "MIT", - "name": "is-fullwidth-code-point", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/boxen/node_modules/is-fullwidth-code-point/readme.md b/node_modules/boxen/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 093b028..0000000 --- a/node_modules/boxen/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/boxen/node_modules/string-width/index.js b/node_modules/boxen/node_modules/string-width/index.js deleted file mode 100644 index bbc49d2..0000000 --- a/node_modules/boxen/node_modules/string-width/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -module.exports = str => { - if (typeof str !== 'string' || str.length === 0) { - return 0; - } - - str = stripAnsi(str); - - let width = 0; - - for (let i = 0; i < str.length; i++) { - const code = str.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; diff --git a/node_modules/boxen/node_modules/string-width/license b/node_modules/boxen/node_modules/string-width/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/boxen/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/boxen/node_modules/string-width/package.json b/node_modules/boxen/node_modules/string-width/package.json deleted file mode 100644 index b6121b0..0000000 --- a/node_modules/boxen/node_modules/string-width/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "string-width@^2.0.0", - "_id": "string-width@2.1.1", - "_inBundle": false, - "_integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "_location": "/boxen/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^2.0.0", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "_shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e", - "_spec": "string-width@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "license": "MIT", - "name": "string-width", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/string-width.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.1.1" -} diff --git a/node_modules/boxen/node_modules/string-width/readme.md b/node_modules/boxen/node_modules/string-width/readme.md deleted file mode 100644 index df5b719..0000000 --- a/node_modules/boxen/node_modules/string-width/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/boxen/node_modules/strip-ansi/index.js b/node_modules/boxen/node_modules/strip-ansi/index.js deleted file mode 100644 index 96e0292..0000000 --- a/node_modules/boxen/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; diff --git a/node_modules/boxen/node_modules/strip-ansi/license b/node_modules/boxen/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/boxen/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/boxen/node_modules/strip-ansi/package.json b/node_modules/boxen/node_modules/strip-ansi/package.json deleted file mode 100644 index ff02791..0000000 --- a/node_modules/boxen/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "strip-ansi@^4.0.0", - "_id": "strip-ansi@4.0.0", - "_inBundle": false, - "_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "_location": "/boxen/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^4.0.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/boxen/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "_shasum": "a8479022eb1ac368a871389b635262c505ee368f", - "_spec": "strip-ansi@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen/node_modules/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/strip-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/strip-ansi#readme", - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} diff --git a/node_modules/boxen/node_modules/strip-ansi/readme.md b/node_modules/boxen/node_modules/strip-ansi/readme.md deleted file mode 100644 index dc76f0c..0000000 --- a/node_modules/boxen/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/boxen/package.json b/node_modules/boxen/package.json deleted file mode 100644 index 98c3283..0000000 --- a/node_modules/boxen/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "boxen@^1.2.1", - "_id": "boxen@1.3.0", - "_inBundle": false, - "_integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "_location": "/boxen", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "boxen@^1.2.1", - "name": "boxen", - "escapedName": "boxen", - "rawSpec": "^1.2.1", - "saveSpec": null, - "fetchSpec": "^1.2.1" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "_shasum": "55c6c39a8ba58d9c61ad22cd877532deb665a20b", - "_spec": "boxen@^1.2.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/boxen/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - }, - "deprecated": false, - "description": "Create boxes in the terminal", - "devDependencies": { - "ava": "*", - "nyc": "^11.0.3", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/boxen#readme", - "keywords": [ - "cli", - "box", - "boxes", - "terminal", - "term", - "console", - "ascii", - "unicode", - "border", - "text" - ], - "license": "MIT", - "name": "boxen", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/boxen.git" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "version": "1.3.0" -} diff --git a/node_modules/boxen/readme.md b/node_modules/boxen/readme.md deleted file mode 100644 index d8db8e9..0000000 --- a/node_modules/boxen/readme.md +++ /dev/null @@ -1,175 +0,0 @@ -# boxen - -> Create boxes in the terminal - -[![Build Status](https://travis-ci.org/sindresorhus/boxen.svg?branch=master)](https://travis-ci.org/sindresorhus/boxen) - - -## Install - -``` -$ npm install boxen -``` - - -## Usage - -```js -const boxen = require('boxen'); - -console.log(boxen('unicorn', {padding: 1})); -/* -┌─────────────┐ -│ │ -│ unicorn │ -│ │ -└─────────────┘ -*/ - -console.log(boxen('unicorn', {padding: 1, margin: 1, borderStyle: 'double'})); -/* - - ╔═════════════╗ - ║ ║ - ║ unicorn ║ - ║ ║ - ╚═════════════╝ - -*/ -``` - - -## API - -### boxen(input, [options]) - -#### input - -Type: `string` - -Text inside the box. - -#### options - -##### borderColor - -Type: `string`
-Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray` - -Color of the box border. - -##### borderStyle - -Type: `string` `object`
-Default: `single`
-Values: -- `single` -``` -┌───┐ -│foo│ -└───┘ -``` -- `double` -``` -╔═══╗ -║foo║ -╚═══╝ -``` -- `round` (`single` sides with round corners) -``` -╭───╮ -│foo│ -╰───╯ -``` -- `single-double` (`single` on top and bottom, `double` on right and left) -``` -╓───╖ -║foo║ -╙───╜ -``` -- `double-single` (`double` on top and bottom, `single` on right and left) -``` -╒═══╕ -│foo│ -╘═══╛ -``` -- `classic` -``` -+---+ -|foo| -+---+ -``` - -Style of the box border. - -Can be any of the above predefined styles or an object with the following keys: - -```js -{ - topLeft: '+', - topRight: '+', - bottomLeft: '+', - bottomRight: '+', - horizontal: '-', - vertical: '|' -} -``` - -##### dimBorder - -Type: `boolean`
-Default: `false` - -Reduce opacity of the border. - -##### padding - -Type: `number` `Object`
-Default: `0` - -Space between the text and box border. - -Accepts a number or an object with any of the `top`, `right`, `bottom`, `left` properties. When a number is specified, the left/right padding is 3 times the top/bottom to make it look nice. - -##### margin - -Type: `number` `Object`
-Default: `0` - -Space around the box. - -Accepts a number or an object with any of the `top`, `right`, `bottom`, `left` properties. When a number is specified, the left/right margin is 3 times the top/bottom to make it look nice. - -##### float - -Type: `string`
-Values: `right` `center` `left`
-Default: `left` - -Float the box on the available terminal screen space. - -##### backgroundColor - -Type: `string`
-Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` - -Color of the background. - -##### align - -Type: `string`
-Default: `left`
-Values: `left` `center` `right` - -Align the text in the box based on the widest line. - - -## Related - -- [boxen-cli](https://github.com/sindresorhus/boxen-cli) - CLI for this module -- [cli-boxes](https://github.com/sindresorhus/cli-boxes) - Boxes for use in the terminal - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json index 4cf25ec..037e9bb 100644 --- a/node_modules/brace-expansion/package.json +++ b/node_modules/brace-expansion/package.json @@ -1,27 +1,33 @@ { - "_from": "brace-expansion@^1.1.7", + "_args": [ + [ + "brace-expansion@1.1.11", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "brace-expansion@1.1.11", "_id": "brace-expansion@1.1.11", "_inBundle": false, "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "_location": "/brace-expansion", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "brace-expansion@^1.1.7", + "raw": "brace-expansion@1.1.11", "name": "brace-expansion", "escapedName": "brace-expansion", - "rawSpec": "^1.1.7", + "rawSpec": "1.1.11", "saveSpec": null, - "fetchSpec": "^1.1.7" + "fetchSpec": "1.1.11" }, "_requiredBy": [ "/minimatch" ], "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", - "_spec": "brace-expansion@^1.1.7", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/minimatch", + "_spec": "1.1.11", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", @@ -30,12 +36,10 @@ "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, - "bundleDependencies": false, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" }, - "deprecated": false, "description": "Brace expansion as known from sh/bash", "devDependencies": { "matcha": "^0.7.0", diff --git a/node_modules/buffer-alloc-unsafe/package.json b/node_modules/buffer-alloc-unsafe/package.json index 8e1130b..761e3f7 100644 --- a/node_modules/buffer-alloc-unsafe/package.json +++ b/node_modules/buffer-alloc-unsafe/package.json @@ -1,32 +1,35 @@ { - "_from": "buffer-alloc-unsafe@^1.1.0", + "_args": [ + [ + "buffer-alloc-unsafe@1.1.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "buffer-alloc-unsafe@1.1.0", "_id": "buffer-alloc-unsafe@1.1.0", "_inBundle": false, "_integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", "_location": "/buffer-alloc-unsafe", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "buffer-alloc-unsafe@^1.1.0", + "raw": "buffer-alloc-unsafe@1.1.0", "name": "buffer-alloc-unsafe", "escapedName": "buffer-alloc-unsafe", - "rawSpec": "^1.1.0", + "rawSpec": "1.1.0", "saveSpec": null, - "fetchSpec": "^1.1.0" + "fetchSpec": "1.1.0" }, "_requiredBy": [ "/buffer-alloc" ], "_resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "_shasum": "bd7dc26ae2972d0eda253be061dba992349c19f0", - "_spec": "buffer-alloc-unsafe@^1.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/buffer-alloc", + "_spec": "1.1.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/LinusU/buffer-alloc-unsafe/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "A [ponyfill](https://ponyfill.com) for `Buffer.allocUnsafe`.", "devDependencies": { "standard": "^7.1.2" diff --git a/node_modules/buffer-alloc/package.json b/node_modules/buffer-alloc/package.json index f9d83bb..90b3624 100644 --- a/node_modules/buffer-alloc/package.json +++ b/node_modules/buffer-alloc/package.json @@ -1,36 +1,40 @@ { - "_from": "buffer-alloc@^1.2.0", + "_args": [ + [ + "buffer-alloc@1.2.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "buffer-alloc@1.2.0", "_id": "buffer-alloc@1.2.0", "_inBundle": false, "_integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "_location": "/buffer-alloc", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "buffer-alloc@^1.2.0", + "raw": "buffer-alloc@1.2.0", "name": "buffer-alloc", "escapedName": "buffer-alloc", - "rawSpec": "^1.2.0", + "rawSpec": "1.2.0", "saveSpec": null, - "fetchSpec": "^1.2.0" + "fetchSpec": "1.2.0" }, "_requiredBy": [ - "/isbinaryfile" + "/isbinaryfile", + "/tar-stream" ], "_resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "_shasum": "890dd90d923a873e08e10e5fd51a57e5b7cce0ec", - "_spec": "buffer-alloc@^1.2.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/isbinaryfile", + "_spec": "1.2.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/LinusU/buffer-alloc/issues" }, - "bundleDependencies": false, "dependencies": { "buffer-alloc-unsafe": "^1.1.0", "buffer-fill": "^1.0.0" }, - "deprecated": false, "description": "A [ponyfill](https://ponyfill.com) for `Buffer.alloc`.", "devDependencies": { "standard": "^7.1.2" diff --git a/node_modules/buffer-fill/package.json b/node_modules/buffer-fill/package.json index 9852645..965e0b6 100644 --- a/node_modules/buffer-fill/package.json +++ b/node_modules/buffer-fill/package.json @@ -1,32 +1,35 @@ { - "_from": "buffer-fill@^1.0.0", + "_args": [ + [ + "buffer-fill@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "buffer-fill@1.0.0", "_id": "buffer-fill@1.0.0", "_inBundle": false, "_integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "_location": "/buffer-fill", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "buffer-fill@^1.0.0", + "raw": "buffer-fill@1.0.0", "name": "buffer-fill", "escapedName": "buffer-fill", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/buffer-alloc" ], "_resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "_shasum": "f8f78b76789888ef39f205cd637f68e702122b2c", - "_spec": "buffer-fill@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/buffer-alloc", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/LinusU/buffer-fill/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "A [ponyfill](https://ponyfill.com) for `Buffer.fill`.", "devDependencies": { "buffer-alloc-unsafe": "^1.1.0", diff --git a/node_modules/buffer-from/package.json b/node_modules/buffer-from/package.json index 9a2baf0..73d44a0 100644 --- a/node_modules/buffer-from/package.json +++ b/node_modules/buffer-from/package.json @@ -1,32 +1,36 @@ { - "_from": "buffer-from@^1.0.0", + "_args": [ + [ + "buffer-from@1.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "buffer-from@1.1.1", "_id": "buffer-from@1.1.1", "_inBundle": false, "_integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "_location": "/buffer-from", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "buffer-from@^1.0.0", + "raw": "buffer-from@1.1.1", "name": "buffer-from", "escapedName": "buffer-from", - "rawSpec": "^1.0.0", + "rawSpec": "1.1.1", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.1.1" }, "_requiredBy": [ "/concat-stream" ], "_resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "_shasum": "32713bc028f75c02fdb710d7c7bcec1f2c6070ef", - "_spec": "buffer-from@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/concat-stream", + "_spec": "1.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/LinusU/buffer-from/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.", "devDependencies": { "standard": "^7.1.2" diff --git a/node_modules/builder-util-runtime/node_modules/debug/CHANGELOG.md b/node_modules/builder-util-runtime/node_modules/debug/CHANGELOG.md deleted file mode 100644 index 820d21e..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,395 +0,0 @@ - -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/builder-util-runtime/node_modules/debug/LICENSE b/node_modules/builder-util-runtime/node_modules/debug/LICENSE deleted file mode 100644 index 658c933..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(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/builder-util-runtime/node_modules/debug/README.md b/node_modules/builder-util-runtime/node_modules/debug/README.md deleted file mode 100644 index 88dae35..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/README.md +++ /dev/null @@ -1,455 +0,0 @@ -# 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 -``` - -`disable()` - -Will disable all namespaces. The functions returns the namespaces currently -enabled (and skipped). This can be useful if you want to disable debugging -temporarily without knowing what was enabled to begin with. - -For example: - -```js -let debug = require('debug'); -debug.enable('foo:*,-foo:bar'); -let namespaces = debug.disable(); -debug.enable(namespaces); -``` - -Note: There is no guarantee that the string will be identical to the initial -enable string, but semantically they will be identical. - -## 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/builder-util-runtime/node_modules/debug/dist/debug.js b/node_modules/builder-util-runtime/node_modules/debug/dist/debug.js deleted file mode 100644 index 89ad0c2..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/dist/debug.js +++ /dev/null @@ -1,912 +0,0 @@ -"use strict"; - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - -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); } - -(function (f) { - if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { - module.exports = f(); - } else if (typeof define === "function" && define.amd) { - define([], f); - } else { - var g; - - if (typeof window !== "undefined") { - g = window; - } else if (typeof global !== "undefined") { - g = global; - } else if (typeof self !== "undefined") { - g = self; - } else { - g = this; - } - - g.debug = f(); - } -})(function () { - var define, module, exports; - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = "function" == typeof require && require; - if (!f && c) return c(i, !0); - if (u) return u(i, !0); - var a = new Error("Cannot find module '" + i + "'"); - throw a.code = "MODULE_NOT_FOUND", a; - } - - var p = n[i] = { - exports: {} - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - - return n[i].exports; - } - - for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { - o(t[i]); - } - - return o; - } - - return r; - }()({ - 1: [function (require, module, exports) { - /** - * Helpers. - */ - var s = 1000; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - - module.exports = function (val, options) { - options = options || {}; - - var type = _typeof(val); - - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); - }; - /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - - - function parse(str) { - str = String(str); - - if (str.length > 100) { - return; - } - - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - - if (!match) { - return; - } - - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - - case 'weeks': - case 'week': - case 'w': - return n * w; - - case 'days': - case 'day': - case 'd': - return n * d; - - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - - default: - return undefined; - } - } - /** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtShort(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - - return ms + 'ms'; - } - /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtLong(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - - return ms + ' ms'; - } - /** - * Pluralization helper. - */ - - - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); - } - }, {}], - 2: [function (require, module, exports) { - // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - })(); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; // v8 likes predictible objects - - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - - process.listeners = function (name) { - return []; - }; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { - return '/'; - }; - - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - - process.umask = function () { - return 0; - }; - }, {}], - 3: [function (require, module, exports) { - /** - * 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() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - // Disabled? - if (!debug.enabled) { - return; - } - - 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) { - var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - /** - * 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. - * - * @return {String} namespaces - * @api public - */ - - - function disable() { - var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { - return '-' + namespace; - }))).join(','); - createDebug.enable(''); - return namespaces; - } - /** - * 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; - } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - - - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); - } - /** - * 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; - }, { - "ms": 1 - }], - 4: [function (require, module, exports) { - (function (process) { - /* 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; - } - }; - }).call(this, require('_process')); - }, { - "./common": 3, - "_process": 2 - }] - }, {}, [4])(4); -}); diff --git a/node_modules/builder-util-runtime/node_modules/debug/package.json b/node_modules/builder-util-runtime/node_modules/debug/package.json deleted file mode 100644 index bc1bf96..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_from": "debug@^4.1.0", - "_id": "debug@4.1.1", - "_inBundle": false, - "_integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "_location": "/builder-util-runtime/debug", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "debug@^4.1.0", - "name": "debug", - "escapedName": "debug", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/builder-util-runtime" - ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "_shasum": "3b72260255109c6b589cee050f1d516139664791", - "_spec": "debug@^4.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/builder-util-runtime", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - } - ], - "dependencies": { - "ms": "^2.1.1" - }, - "deprecated": false, - "description": "small debugging utility", - "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" - }, - "files": [ - "src", - "dist/debug.js", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/visionmedia/debug#readme", - "keywords": [ - "debug", - "log", - "debugger" - ], - "license": "MIT", - "main": "./src/index.js", - "name": "debug", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "scripts": { - "build": "npm run build:debug && npm run build:test", - "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", - "build:test": "babel -d dist test.js", - "clean": "rimraf dist coverage", - "lint": "xo", - "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", - "pretest:browser": "npm run build", - "test": "npm run test:node && npm run test:browser", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls", - "test:node": "istanbul cover _mocha -- test.js" - }, - "unpkg": "./dist/debug.js", - "version": "4.1.1" -} diff --git a/node_modules/builder-util-runtime/node_modules/debug/src/browser.js b/node_modules/builder-util-runtime/node_modules/debug/src/browser.js deleted file mode 100644 index 5f34c0d..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/src/browser.js +++ /dev/null @@ -1,264 +0,0 @@ -/* 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; - } - - const 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 - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, 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(...args) { - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return typeof console === 'object' && - console.log && - console.log(...args); -} - -/** - * 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() { - let 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); - -const {formatters} = module.exports; - -/** - * 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/builder-util-runtime/node_modules/debug/src/common.js b/node_modules/builder-util-runtime/node_modules/debug/src/common.js deleted file mode 100644 index 2f82b8d..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/src/common.js +++ /dev/null @@ -1,266 +0,0 @@ - -/** - * 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(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) { - let hash = 0; - - for (let 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) { - let prevTime; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const 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 - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const 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); - - const 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() { - const index = createDebug.instances.indexOf(this); - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - return false; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * 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 = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const 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++) { - const instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * 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; - } - - let i; - let 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; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * 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/builder-util-runtime/node_modules/debug/src/index.js b/node_modules/builder-util-runtime/node_modules/debug/src/index.js deleted file mode 100644 index bf4c57f..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/builder-util-runtime/node_modules/debug/src/node.js b/node_modules/builder-util-runtime/node_modules/debug/src/node.js deleted file mode 100644 index 5e1f154..0000000 --- a/node_modules/builder-util-runtime/node_modules/debug/src/node.js +++ /dev/null @@ -1,257 +0,0 @@ -/** - * Module dependencies. - */ - -const tty = require('tty'); -const 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 - const 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(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let 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) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[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(...args) { - return process.stderr.write(util.format(...args) + '\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 = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * 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) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * 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/builder-util-runtime/out/CancellationToken.d.ts b/node_modules/builder-util-runtime/out/CancellationToken.d.ts deleted file mode 100755 index de3a040..0000000 --- a/node_modules/builder-util-runtime/out/CancellationToken.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// -import { EventEmitter } from "events"; -export declare class CancellationToken extends EventEmitter { - private parentCancelHandler; - private _cancelled; - readonly cancelled: boolean; - private _parent; - parent: CancellationToken; - constructor(parent?: CancellationToken); - cancel(): void; - private onCancel; - createPromise(callback: (resolve: (thenableOrResult?: R) => void, reject: (error: Error) => void, onCancel: (callback: () => void) => void) => void): Promise; - private removeParentCancelHandler; - dispose(): void; -} -export declare class CancellationError extends Error { - constructor(); -} diff --git a/node_modules/builder-util-runtime/out/CancellationToken.js b/node_modules/builder-util-runtime/out/CancellationToken.js deleted file mode 100755 index f67d62f..0000000 --- a/node_modules/builder-util-runtime/out/CancellationToken.js +++ /dev/null @@ -1,134 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CancellationError = exports.CancellationToken = void 0; - -function _events() { - const data = require("events"); - - _events = function () { - return data; - }; - - return data; -} - -class CancellationToken extends _events().EventEmitter { - // babel cannot compile ... correctly for super calls - constructor(parent) { - super(); - this.parentCancelHandler = null; - this._parent = null; - this._cancelled = false; - - if (parent != null) { - this.parent = parent; - } - } - - get cancelled() { - return this._cancelled || this._parent != null && this._parent.cancelled; - } - - set parent(value) { - this.removeParentCancelHandler(); - this._parent = value; - - this.parentCancelHandler = () => this.cancel(); - - this._parent.onCancel(this.parentCancelHandler); - } - - cancel() { - this._cancelled = true; - this.emit("cancel"); - } - - onCancel(handler) { - if (this.cancelled) { - handler(); - } else { - this.once("cancel", handler); - } - } - - createPromise(callback) { - if (this.cancelled) { - return Promise.reject(new CancellationError()); - } - - const finallyHandler = () => { - if (cancelHandler != null) { - try { - this.removeListener("cancel", cancelHandler); - cancelHandler = null; - } catch (ignore) {// ignore - } - } - }; - - let cancelHandler = null; - return new Promise((resolve, reject) => { - let addedCancelHandler = null; - - cancelHandler = () => { - try { - if (addedCancelHandler != null) { - addedCancelHandler(); - addedCancelHandler = null; - } - } finally { - reject(new CancellationError()); - } - }; - - if (this.cancelled) { - cancelHandler(); - return; - } - - this.onCancel(cancelHandler); - callback(resolve, reject, callback => { - addedCancelHandler = callback; - }); - }).then(it => { - finallyHandler(); - return it; - }).catch(e => { - finallyHandler(); - throw e; - }); - } - - removeParentCancelHandler() { - const parent = this._parent; - - if (parent != null && this.parentCancelHandler != null) { - parent.removeListener("cancel", this.parentCancelHandler); - this.parentCancelHandler = null; - } - } - - dispose() { - try { - this.removeParentCancelHandler(); - } finally { - this.removeAllListeners(); - this._parent = null; - } - } - -} - -exports.CancellationToken = CancellationToken; - -class CancellationError extends Error { - constructor() { - super("Cancelled"); - } - -} exports.CancellationError = CancellationError; -// __ts-babel@6.0.4 -//# sourceMappingURL=CancellationToken.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/CancellationToken.js.map b/node_modules/builder-util-runtime/out/CancellationToken.js.map deleted file mode 100755 index 650fc26..0000000 --- a/node_modules/builder-util-runtime/out/CancellationToken.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/CancellationToken.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,iBAAP,SAAiC,sBAAjC,CAA6C;AAiBjD;AACA,EAAA,WAAA,CAAY,MAAZ,EAAsC;AACpC;AAlBM,SAAA,mBAAA,GAA0C,IAA1C;AAOA,SAAA,OAAA,GAAoC,IAApC;AAaN,SAAK,UAAL,GAAkB,KAAlB;;AACA,QAAI,MAAM,IAAI,IAAd,EAAoB;AAClB,WAAK,MAAL,GAAc,MAAd;AACD;AACF;;AArBD,MAAI,SAAJ,GAAa;AACX,WAAO,KAAK,UAAL,IAAoB,KAAK,OAAL,IAAgB,IAAhB,IAAwB,KAAK,OAAL,CAAa,SAAhE;AACD;;AAGD,MAAI,MAAJ,CAAW,KAAX,EAAmC;AACjC,SAAK,yBAAL;AAEA,SAAK,OAAL,GAAe,KAAf;;AACA,SAAK,mBAAL,GAA2B,MAA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O,CAAR;AAGD,KAzBM,EA0BJ,IA1BI,CA0BC,EAAE,IAAG;AACT,MAAA,cAAc;AACd,aAAO,EAAP;AACD,KA7BI,EA8BJ,KA9BI,CA8BE,CAAC,IAAG;AACT,MAAA,cAAc;AACd,YAAM,CAAN;AACD,KAjCI,CAAP;AAkCD;;AAEO,EAAA,yBAAyB,GAAA;AAC/B,UAAM,MAAM,GAAG,KAAK,OAApB;;AACA,QAAI,MAAM,IAAI,IAAV,IAAkB,KAAK,mBAAL,IAA4B,IAAlD,EAAwD;AACtD,MAAA,MAAM,CAAC,cAAP,CAAsB,QAAtB,EAAgC,KAAK,mBAArC;AACA,WAAK,mBAAL,GAA2B,IAA3B;AACD;AACF;;AAED,EAAA,OAAO,GAAA;AACL,QAAI;AACF,WAAK,yBAAL;AACD,KAFD,SAGQ;AACN,WAAK,kBAAL;AACA,WAAK,OAAL,GAAe,IAAf;AACD;AACF;;AA/GgD;;;;AAkH7C,MAAO,iBAAP,SAAiC,KAAjC,CAAsC;AAC1C,EAAA,WAAA,GAAA;AACE,UAAM,WAAN;AACD;;AAHyC,C","sourcesContent":["import { EventEmitter } from \"events\"\n\nexport class CancellationToken extends EventEmitter {\n private parentCancelHandler: (() => any) | null = null\n\n private _cancelled: boolean\n get cancelled(): boolean {\n return this._cancelled || (this._parent != null && this._parent.cancelled)\n }\n\n private _parent: CancellationToken | null = null\n set parent(value: CancellationToken) {\n this.removeParentCancelHandler()\n\n this._parent = value\n this.parentCancelHandler = () => this.cancel()\n this._parent.onCancel(this.parentCancelHandler)\n }\n\n // babel cannot compile ... correctly for super calls\n constructor(parent?: CancellationToken) {\n super()\n\n this._cancelled = false\n if (parent != null) {\n this.parent = parent\n }\n }\n\n cancel() {\n this._cancelled = true\n this.emit(\"cancel\")\n }\n\n private onCancel(handler: () => any) {\n if (this.cancelled) {\n handler()\n }\n else {\n this.once(\"cancel\", handler)\n }\n }\n\n createPromise(callback: (resolve: (thenableOrResult?: R) => void, reject: (error: Error) => void, onCancel: (callback: () => void) => void) => void): Promise {\n if (this.cancelled) {\n return Promise.reject(new CancellationError())\n }\n\n const finallyHandler = () => {\n if (cancelHandler != null) {\n try {\n this.removeListener(\"cancel\", cancelHandler)\n cancelHandler = null\n }\n catch (ignore) {\n // ignore\n }\n }\n }\n\n let cancelHandler: (() => void) | null = null\n return new Promise((resolve, reject) => {\n let addedCancelHandler: (() => void) | null = null\n\n cancelHandler = () => {\n try {\n if (addedCancelHandler != null) {\n addedCancelHandler()\n addedCancelHandler = null\n }\n }\n finally {\n reject(new CancellationError())\n }\n }\n\n if (this.cancelled) {\n cancelHandler()\n return\n }\n\n this.onCancel(cancelHandler)\n\n callback(resolve, reject, (callback: () => void) => {\n addedCancelHandler = callback\n })\n })\n .then(it => {\n finallyHandler()\n return it\n })\n .catch(e => {\n finallyHandler()\n throw e\n })\n }\n\n private removeParentCancelHandler() {\n const parent = this._parent\n if (parent != null && this.parentCancelHandler != null) {\n parent.removeListener(\"cancel\", this.parentCancelHandler)\n this.parentCancelHandler = null\n }\n }\n\n dispose() {\n try {\n this.removeParentCancelHandler()\n }\n finally {\n this.removeAllListeners()\n this._parent = null\n }\n }\n}\n\nexport class CancellationError extends Error {\n constructor() {\n super(\"Cancelled\")\n }\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/ProgressCallbackTransform.d.ts b/node_modules/builder-util-runtime/out/ProgressCallbackTransform.d.ts deleted file mode 100755 index 61a857b..0000000 --- a/node_modules/builder-util-runtime/out/ProgressCallbackTransform.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// -import { Transform } from "stream"; -import { CancellationToken } from "./CancellationToken"; -export interface ProgressInfo { - total: number; - delta: number; - transferred: number; - percent: number; - bytesPerSecond: number; -} -export declare class ProgressCallbackTransform extends Transform { - private readonly total; - private readonly cancellationToken; - private readonly onProgress; - private start; - private transferred; - private delta; - private nextUpdate; - constructor(total: number, cancellationToken: CancellationToken, onProgress: (info: ProgressInfo) => any); - _transform(chunk: any, encoding: string, callback: any): void; - _flush(callback: any): void; -} diff --git a/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js b/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js deleted file mode 100755 index ce29fc4..0000000 --- a/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ProgressCallbackTransform = void 0; - -function _stream() { - const data = require("stream"); - - _stream = function () { - return data; - }; - - return data; -} - -class ProgressCallbackTransform extends _stream().Transform { - constructor(total, cancellationToken, onProgress) { - super(); - this.total = total; - this.cancellationToken = cancellationToken; - this.onProgress = onProgress; - this.start = Date.now(); - this.transferred = 0; - this.delta = 0; - this.nextUpdate = this.start + 1000; - } - - _transform(chunk, encoding, callback) { - if (this.cancellationToken.cancelled) { - callback(new Error("Cancelled"), null); - return; - } - - this.transferred += chunk.length; - this.delta += chunk.length; - const now = Date.now(); - - if (now >= this.nextUpdate && this.transferred !== this.total - /* will be emitted on _flush */ - ) { - this.nextUpdate = now + 1000; - this.onProgress({ - total: this.total, - delta: this.delta, - transferred: this.transferred, - percent: this.transferred / this.total * 100, - bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000)) - }); - this.delta = 0; - } - - callback(null, chunk); - } - - _flush(callback) { - if (this.cancellationToken.cancelled) { - callback(new Error("Cancelled")); - return; - } - - this.onProgress({ - total: this.total, - delta: this.delta, - transferred: this.total, - percent: 100, - bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000)) - }); - this.delta = 0; - callback(null); - } - -} exports.ProgressCallbackTransform = ProgressCallbackTransform; -// __ts-babel@6.0.4 -//# sourceMappingURL=ProgressCallbackTransform.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js.map b/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js.map deleted file mode 100755 index f44cb9d..0000000 --- a/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js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KAAK,WAAL,IAAoB,CAAC,GAAG,GAAG,KAAK,KAAZ,IAAqB,IAAzC,CAAX;AALF,SAAhB;AAOA,aAAK,KAAL,GAAa,CAAb;AACD;;AAED,IAAA,QAAQ,CAAC,IAAD,EAAO,KAAP,CAAR;AACD;;AAED,EAAA,MAAM,CAAC,QAAD,EAAc;AAClB,QAAI,KAAK,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,MAAA,QAAQ,CAAC,IAAI,KAAJ,CAAU,WAAV,CAAD,CAAR;AACA;AACD;;AAED,SAAK,UAAL,CAAgB;AACd,MAAA,KAAK,EAAE,KAAK,KADE;AAEd,MAAA,KAAK,EAAE,KAAK,KAFE;AAGd,MAAA,WAAW,EAAE,KAAK,KAHJ;AAId,MAAA,OAAO,EAAE,GAJK;AAKd,MAAA,cAAc,EAAE,IAAI,CAAC,KAAL,CAAW,KAAK,WAAL,IAAoB,CAAC,IAAI,CAAC,GAAL,KAAa,KAAK,KAAnB,IAA4B,IAAhD,CAAX;AALF,KAAhB;AAOA,SAAK,KAAL,GAAa,CAAb;AAEA,IAAA,QAAQ,CAAC,IAAD,CAAR;AACD;;AArDqD,C","sourcesContent":["import { Transform } from \"stream\"\nimport { CancellationToken } from \"./CancellationToken\"\n\nexport interface ProgressInfo {\n total: number\n delta: number\n transferred: number\n percent: number\n bytesPerSecond: number\n}\n\nexport class ProgressCallbackTransform extends Transform {\n private start = Date.now()\n private transferred = 0\n private delta = 0\n\n private nextUpdate = this.start + 1000\n\n constructor(private readonly total: number, private readonly cancellationToken: CancellationToken, private readonly onProgress: (info: ProgressInfo) => any) {\n super()\n }\n\n _transform(chunk: any, encoding: string, callback: any) {\n if (this.cancellationToken.cancelled) {\n callback(new Error(\"Cancelled\"), null)\n return\n }\n\n this.transferred += chunk.length\n this.delta += chunk.length\n\n const now = Date.now()\n if (now >= this.nextUpdate && this.transferred !== this.total /* will be emitted on _flush */) {\n this.nextUpdate = now + 1000\n\n this.onProgress({\n total: this.total,\n delta: this.delta,\n transferred: this.transferred,\n percent: (this.transferred / this.total) * 100,\n bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000))\n })\n this.delta = 0\n }\n\n callback(null, chunk)\n }\n\n _flush(callback: any): void {\n if (this.cancellationToken.cancelled) {\n callback(new Error(\"Cancelled\"))\n return\n }\n\n this.onProgress({\n total: this.total,\n delta: this.delta,\n transferred: this.total,\n percent: 100,\n bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000))\n })\n this.delta = 0\n\n callback(null)\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/bintray.d.ts b/node_modules/builder-util-runtime/out/bintray.d.ts deleted file mode 100755 index 607de5a..0000000 --- a/node_modules/builder-util-runtime/out/bintray.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { CancellationToken } from "./CancellationToken"; -import { HttpExecutor, RequestHeaders } from "./httpExecutor"; -import { BintrayOptions } from "./publishOptions"; -export interface Version { - readonly name: string; - readonly package: string; -} -export interface File { - name: string; - path: string; - sha1: string; - sha256: string; -} -export declare class BintrayClient { - private readonly httpExecutor; - private readonly cancellationToken; - private readonly basePath; - readonly auth: string | null; - readonly repo: string; - readonly owner: string; - readonly user: string; - readonly component: string | null; - readonly distribution: string | null; - readonly packageName: string; - private requestHeaders; - setRequestHeaders(value: RequestHeaders | null): void; - constructor(options: BintrayOptions, httpExecutor: HttpExecutor, cancellationToken: CancellationToken, apiKey?: string | null); - private bintrayRequest; - getVersion(version: string): Promise; - getVersionFiles(version: string): Promise>; - createVersion(version: string): Promise; - deleteVersion(version: string): Promise; -} diff --git a/node_modules/builder-util-runtime/out/bintray.js b/node_modules/builder-util-runtime/out/bintray.js deleted file mode 100755 index e09d0f6..0000000 --- a/node_modules/builder-util-runtime/out/bintray.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BintrayClient = void 0; - -function _httpExecutor() { - const data = require("./httpExecutor"); - - _httpExecutor = function () { - return data; - }; - - return data; -} - -class BintrayClient { - constructor(options, httpExecutor, cancellationToken, apiKey) { - this.httpExecutor = httpExecutor; - this.cancellationToken = cancellationToken; - this.requestHeaders = null; - - if (options.owner == null) { - throw new Error("owner is not specified"); - } - - if (options.package == null) { - throw new Error("package is not specified"); - } - - this.repo = options.repo || "generic"; - this.packageName = options.package; - this.owner = options.owner; - this.user = options.user || options.owner; - this.component = options.component || null; - this.distribution = options.distribution || "stable"; - this.auth = apiKey == null ? null : `Basic ${Buffer.from(`${this.user}:${apiKey}`).toString("base64")}`; - this.basePath = `/packages/${this.owner}/${this.repo}/${this.packageName}`; - } - - setRequestHeaders(value) { - this.requestHeaders = value; - } - - bintrayRequest(path, auth, data = null, cancellationToken, method) { - return (0, _httpExecutor().parseJson)(this.httpExecutor.request((0, _httpExecutor().configureRequestOptions)({ - hostname: "api.bintray.com", - path, - headers: this.requestHeaders || undefined - }, auth, method), cancellationToken, data)); - } - - getVersion(version) { - return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken); - } - - getVersionFiles(version) { - return this.bintrayRequest(`${this.basePath}/versions/${version}/files`, this.auth, null, this.cancellationToken); - } - - createVersion(version) { - return this.bintrayRequest(`${this.basePath}/versions`, this.auth, { - name: version - }, this.cancellationToken); - } - - deleteVersion(version) { - return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken, "DELETE"); - } - -} exports.BintrayClient = BintrayClient; -// __ts-babel@6.0.4 -//# sourceMappingURL=bintray.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/bintray.js.map b/node_modules/builder-util-runtime/out/bintray.js.map deleted file mode 100755 index 9c04956..0000000 --- a/node_modules/builder-util-runtime/out/bintray.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/bintray.ts"],"names":[],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAiBM,MAAO,aAAP,CAAoB;AAi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AQ,EAAE,iBAAX;AAA8B,MAAA,IAA9B;AAAoC,MAAA,OAAO,EAAE,KAAK,cAAL,IAAuB;AAApE,KAAxB,EAAwG,IAAxG,EAA8G,MAA9G,CAA1B,EAAiJ,iBAAjJ,EAAoK,IAApK,CAAV,CAAP;AACD;;AAED,EAAA,UAAU,CAAC,OAAD,EAAgB;AACxB,WAAO,KAAK,cAAL,CAAoB,GAAG,KAAK,QAAQ,aAAa,OAAO,EAAxD,EAA4D,KAAK,IAAjE,EAAuE,IAAvE,EAA6E,KAAK,iBAAlF,CAAP;AACD;;AAED,EAAA,eAAe,CAAC,OAAD,EAAgB;AAC7B,WAAO,KAAK,cAAL,CAAiC,GAAG,KAAK,QAAQ,aAAa,OAAO,QAArE,EAA+E,KAAK,IAApF,EAA0F,IAA1F,EAAgG,KAAK,iBAArG,CAAP;AACD;;AAED,EAAA,aAAa,CAAC,OAAD,EAAgB;AAC3B,WAAO,KAAK,cAAL,CAA6B,GAAG,KAAK,QAAQ,WAA7C,EAA0D,KAAK,IAA/D,EAAqE;AAC1E,MAAA,IAAI,EAAE;AADoE,KAArE,EAEJ,KAAK,iBAFD,CAAP;AAGD;;AAED,EAAA,aAAa,CAAC,OAAD,EAAgB;AAC3B,WAAO,KAAK,cAAL,CAAoB,GAAG,KAAK,QAAQ,aAAa,OAAO,EAAxD,EAA4D,KAAK,IAAjE,EAAuE,IAAvE,EAA6E,KAAK,iBAAlF,EAAqG,QAArG,CAAP;AACD;;AAvDuB,C","sourcesContent":["import { CancellationToken } from \"./CancellationToken\"\nimport { configureRequestOptions, HttpExecutor, parseJson, RequestHeaders } from \"./httpExecutor\"\nimport { BintrayOptions } from \"./publishOptions\"\n\nexport interface Version {\n readonly name: string\n //noinspection ReservedWordAsName\n readonly package: string\n}\n\nexport interface File {\n name: string\n path: string\n\n sha1: string\n sha256: string\n}\n\nexport class BintrayClient {\n private readonly basePath: string\n readonly auth: string | null\n readonly repo: string\n\n readonly owner: string\n readonly user: string\n readonly component: string | null\n readonly distribution: string | null\n readonly packageName: string\n\n private requestHeaders: RequestHeaders | null = null\n\n setRequestHeaders(value: RequestHeaders | null) {\n this.requestHeaders = value\n }\n\n constructor(options: BintrayOptions, private readonly httpExecutor: HttpExecutor, private readonly cancellationToken: CancellationToken, apiKey?: string | null) {\n if (options.owner == null) {\n throw new Error(\"owner is not specified\")\n }\n if (options.package == null) {\n throw new Error(\"package is not specified\")\n }\n\n this.repo = options.repo || \"generic\"\n this.packageName = options.package\n this.owner = options.owner\n this.user = options.user || options.owner\n this.component = options.component || null\n this.distribution = options.distribution || \"stable\"\n this.auth = apiKey == null ? null : `Basic ${Buffer.from(`${this.user}:${apiKey}`).toString(\"base64\")}`\n this.basePath = `/packages/${this.owner}/${this.repo}/${this.packageName}`\n }\n\n private bintrayRequest(path: string, auth: string | null, data: {[name: string]: any; } | null = null, cancellationToken: CancellationToken, method?: \"GET\" | \"DELETE\" | \"PUT\"): Promise {\n return parseJson(this.httpExecutor.request(configureRequestOptions({hostname: \"api.bintray.com\", path, headers: this.requestHeaders || undefined}, auth, method), cancellationToken, data))\n }\n\n getVersion(version: string): Promise {\n return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken)\n }\n\n getVersionFiles(version: string): Promise> {\n return this.bintrayRequest>(`${this.basePath}/versions/${version}/files`, this.auth, null, this.cancellationToken)\n }\n\n createVersion(version: string): Promise {\n return this.bintrayRequest(`${this.basePath}/versions`, this.auth, {\n name: version,\n }, this.cancellationToken)\n }\n\n deleteVersion(version: string): Promise {\n return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken, \"DELETE\")\n }\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/blockMapApi.d.ts b/node_modules/builder-util-runtime/out/blockMapApi.d.ts deleted file mode 100755 index cd72174..0000000 --- a/node_modules/builder-util-runtime/out/blockMapApi.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface FileChunks { - checksums: Array; - sizes: Array; -} -export interface BlockMap { - version: "1" | "2"; - files: Array; -} -export interface BlockMapFile extends FileChunks { - name: string; - offset: number; -} diff --git a/node_modules/builder-util-runtime/out/blockMapApi.js b/node_modules/builder-util-runtime/out/blockMapApi.js deleted file mode 100755 index a9e980b..0000000 --- a/node_modules/builder-util-runtime/out/blockMapApi.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=blockMapApi.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/blockMapApi.js.map b/node_modules/builder-util-runtime/out/blockMapApi.js.map deleted file mode 100755 index 4917f66..0000000 --- a/node_modules/builder-util-runtime/out/blockMapApi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/httpExecutor.d.ts b/node_modules/builder-util-runtime/out/httpExecutor.d.ts deleted file mode 100755 index ebd4924..0000000 --- a/node_modules/builder-util-runtime/out/httpExecutor.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/// -import { IncomingMessage, OutgoingHttpHeaders, RequestOptions } from "http"; -import { Transform } from "stream"; -import { URL } from "url"; -import { CancellationToken } from "./CancellationToken"; -import { ProgressInfo } from "./ProgressCallbackTransform"; -export interface RequestHeaders extends OutgoingHttpHeaders { - [key: string]: string; -} -export interface DownloadOptions { - readonly headers?: OutgoingHttpHeaders | null; - readonly sha2?: string | null; - readonly sha512?: string | null; - readonly cancellationToken: CancellationToken; - onProgress?(progress: ProgressInfo): void; -} -export declare function createHttpError(response: IncomingMessage, description?: any | null): HttpError; -export declare class HttpError extends Error { - readonly statusCode: number; - readonly description: any | null; - constructor(statusCode: number, message?: string, description?: any | null); -} -export declare function parseJson(result: Promise): Promise; -export declare abstract class HttpExecutor { - protected readonly maxRedirects = 10; - request(options: RequestOptions, cancellationToken?: CancellationToken, data?: { - [name: string]: any; - } | null): Promise; - doApiRequest(options: RequestOptions, cancellationToken: CancellationToken, requestProcessor: (request: REQUEST, reject: (error: Error) => void) => void, redirectCount?: number): Promise; - protected addRedirectHandlers(request: any, options: RequestOptions, reject: (error: Error) => void, redirectCount: number, handler: (options: RequestOptions) => void): void; - addErrorAndTimeoutHandlers(request: any, reject: (error: Error) => void): void; - private handleResponse; - abstract createRequest(options: any, callback: (response: any) => void): any; - downloadToBuffer(url: URL, options: DownloadOptions): Promise; - protected doDownload(requestOptions: any, options: DownloadCallOptions, redirectCount: number): void; - protected createMaxRedirectError(): Error; - private addTimeOutHandler; - static prepareRedirectUrlOptions(redirectUrl: string, options: RequestOptions): RequestOptions; -} -export interface DownloadCallOptions { - responseHandler: ((response: IncomingMessage, callback: (error: Error | null) => void) => void) | null; - onCancel: (callback: () => void) => void; - callback: (error: Error | null) => void; - options: DownloadOptions; - destination: string | null; -} -export declare function configureRequestOptionsFromUrl(url: string, options: RequestOptions): RequestOptions; -export declare function configureRequestUrl(url: URL, options: RequestOptions): void; -export declare class DigestTransform extends Transform { - readonly expected: string; - private readonly algorithm; - private readonly encoding; - private readonly digester; - private _actual; - readonly actual: string | null; - isValidateOnEnd: boolean; - constructor(expected: string, algorithm?: string, encoding?: "hex" | "base64" | "latin1"); - _transform(chunk: Buffer, encoding: string, callback: any): void; - _flush(callback: any): void; - validate(): null; -} -export declare function safeGetHeader(response: any, headerKey: string): any; -export declare function configureRequestOptions(options: RequestOptions, token?: string | null, method?: "GET" | "DELETE" | "PUT"): RequestOptions; -export declare function safeStringifyJson(data: any, skippedNames?: Set): string; diff --git a/node_modules/builder-util-runtime/out/httpExecutor.js b/node_modules/builder-util-runtime/out/httpExecutor.js deleted file mode 100755 index b1fca05..0000000 --- a/node_modules/builder-util-runtime/out/httpExecutor.js +++ /dev/null @@ -1,540 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createHttpError = createHttpError; -exports.parseJson = parseJson; -exports.configureRequestOptionsFromUrl = configureRequestOptionsFromUrl; -exports.configureRequestUrl = configureRequestUrl; -exports.safeGetHeader = safeGetHeader; -exports.configureRequestOptions = configureRequestOptions; -exports.safeStringifyJson = safeStringifyJson; -exports.DigestTransform = exports.HttpExecutor = exports.HttpError = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -var _debug2 = _interopRequireDefault(require("debug")); - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _stream() { - const data = require("stream"); - - _stream = function () { - return data; - }; - - return data; -} - -function _url() { - const data = require("url"); - - _url = function () { - return data; - }; - - return data; -} - -function _CancellationToken() { - const data = require("./CancellationToken"); - - _CancellationToken = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("./index"); - - _index = function () { - return data; - }; - - return data; -} - -function _ProgressCallbackTransform() { - const data = require("./ProgressCallbackTransform"); - - _ProgressCallbackTransform = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const debug = (0, _debug2.default)("electron-builder"); - -function createHttpError(response, description = null) { - return new HttpError(response.statusCode || -1, `${response.statusCode} ${response.statusMessage}` + (description == null ? "" : "\n" + JSON.stringify(description, null, " ")) + "\nHeaders: " + safeStringifyJson(response.headers), description); -} - -const HTTP_STATUS_CODES = new Map([[429, "Too many requests"], [400, "Bad request"], [403, "Forbidden"], [404, "Not found"], [405, "Method not allowed"], [406, "Not acceptable"], [408, "Request timeout"], [413, "Request entity too large"], [500, "Internal server error"], [502, "Bad gateway"], [503, "Service unavailable"], [504, "Gateway timeout"], [505, "HTTP version not supported"]]); - -class HttpError extends Error { - constructor(statusCode, message = `HTTP error: ${HTTP_STATUS_CODES.get(statusCode) || statusCode}`, description = null) { - super(message); - this.statusCode = statusCode; - this.description = description; - this.name = "HttpError"; - } - -} - -exports.HttpError = HttpError; - -function parseJson(result) { - return result.then(it => it == null || it.length === 0 ? null : JSON.parse(it)); -} - -class HttpExecutor { - constructor() { - this.maxRedirects = 10; - } - - request(options, cancellationToken = new (_CancellationToken().CancellationToken)(), data) { - configureRequestOptions(options); - const encodedData = data == null ? undefined : Buffer.from(JSON.stringify(data)); - - if (encodedData != null) { - options.method = "post"; - options.headers["Content-Type"] = "application/json"; - options.headers["Content-Length"] = encodedData.length; - } - - return this.doApiRequest(options, cancellationToken, it => { - it.end(encodedData); - }); - } - - doApiRequest(options, cancellationToken, requestProcessor, redirectCount = 0) { - if (debug.enabled) { - debug(`Request: ${safeStringifyJson(options)}`); - } - - return cancellationToken.createPromise((resolve, reject, onCancel) => { - const request = this.createRequest(options, response => { - try { - this.handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor); - } catch (e) { - reject(e); - } - }); - this.addErrorAndTimeoutHandlers(request, reject); - this.addRedirectHandlers(request, options, reject, redirectCount, options => { - this.doApiRequest(options, cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject); - }); - requestProcessor(request, reject); - onCancel(() => request.abort()); - }); - } // noinspection JSUnusedLocalSymbols - - - addRedirectHandlers(request, options, reject, redirectCount, handler) {// not required for NodeJS - } - - addErrorAndTimeoutHandlers(request, reject) { - this.addTimeOutHandler(request, reject); - request.on("error", reject); - request.on("aborted", () => { - reject(new Error("Request has been aborted by the server")); - }); - } - - handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor) { - if (debug.enabled) { - debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(options)}`); - } // we handle any other >= 400 error on request end (read detailed message in the response body) - - - if (response.statusCode === 404) { - // error is clear, we don't need to read detailed error description - reject(createHttpError(response, `method: ${options.method} url: ${options.protocol || "https:"}//${options.hostname}${options.path} - -Please double check that your authentication token is correct. Due to security reasons actual status maybe not reported, but 404. -`)); - return; - } else if (response.statusCode === 204) { - // on DELETE request - resolve(); - return; - } - - const redirectUrl = safeGetHeader(response, "location"); - - if (redirectUrl != null) { - if (redirectCount > this.maxRedirects) { - reject(this.createMaxRedirectError()); - return; - } - - this.doApiRequest(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject); - return; - } - - response.setEncoding("utf8"); - let data = ""; - response.on("data", chunk => data += chunk); - response.on("end", () => { - try { - if (response.statusCode != null && response.statusCode >= 400) { - const contentType = safeGetHeader(response, "content-type"); - const isJson = contentType != null && (Array.isArray(contentType) ? contentType.find(it => it.includes("json")) != null : contentType.includes("json")); - reject(createHttpError(response, isJson ? JSON.parse(data) : data)); - } else { - resolve(data.length === 0 ? null : data); - } - } catch (e) { - reject(e); - } - }); - } - - downloadToBuffer(url, options) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - return yield options.cancellationToken.createPromise((resolve, reject, onCancel) => { - let result = null; - const requestOptions = { - headers: options.headers || undefined, - // because PrivateGitHubProvider requires HttpExecutor.prepareRedirectUrlOptions logic, so, we need to redirect manually - redirect: "manual" - }; - configureRequestUrl(url, requestOptions); - configureRequestOptions(requestOptions); - - _this.doDownload(requestOptions, { - destination: null, - options, - onCancel, - callback: error => { - if (error == null) { - resolve(result); - } else { - reject(error); - } - }, - responseHandler: (response, callback) => { - const contentLength = safeGetHeader(response, "content-length"); - let position = -1; - - if (contentLength != null) { - const size = parseInt(contentLength, 10); - - if (size > 0) { - if (size > 5242880) { - callback(new Error("Maximum allowed size is 5 MB")); - return; - } - - result = Buffer.alloc(size); - position = 0; - } - } - - response.on("data", chunk => { - if (position !== -1) { - chunk.copy(result, position); - position += chunk.length; - } else if (result == null) { - result = chunk; - } else { - if (result.length > 5242880) { - callback(new Error("Maximum allowed size is 5 MB")); - return; - } - - result = Buffer.concat([result, chunk]); - } - }); - response.on("end", () => { - if (result != null && position !== -1 && position !== result.length) { - callback(new Error(`Received data length ${position} is not equal to expected ${result.length}`)); - } else { - callback(null); - } - }); - } - }, 0); - }); - })(); - } - - doDownload(requestOptions, options, redirectCount) { - const request = this.createRequest(requestOptions, response => { - if (response.statusCode >= 400) { - options.callback(new Error(`Cannot download "${requestOptions.protocol || "https:"}//${requestOptions.hostname}${requestOptions.path}", status ${response.statusCode}: ${response.statusMessage}`)); - return; - } // this code not relevant for Electron (redirect event instead handled) - - - const redirectUrl = safeGetHeader(response, "location"); - - if (redirectUrl != null) { - if (redirectCount < this.maxRedirects) { - this.doDownload(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, requestOptions), options, redirectCount++); - } else { - options.callback(this.createMaxRedirectError()); - } - - return; - } - - if (options.responseHandler == null) { - configurePipes(options, response); - } else { - options.responseHandler(response, options.callback); - } - }); - this.addErrorAndTimeoutHandlers(request, options.callback); - this.addRedirectHandlers(request, requestOptions, options.callback, redirectCount, requestOptions => { - this.doDownload(requestOptions, options, redirectCount++); - }); - request.end(); - } - - createMaxRedirectError() { - return new Error(`Too many redirects (> ${this.maxRedirects})`); - } - - addTimeOutHandler(request, callback) { - request.on("socket", socket => { - socket.setTimeout(60 * 1000, () => { - request.abort(); - callback(new Error("Request timed out")); - }); - }); - } - - static prepareRedirectUrlOptions(redirectUrl, options) { - const newOptions = configureRequestOptionsFromUrl(redirectUrl, Object.assign({}, options)); - const headers = newOptions.headers; - - if (headers != null && headers.authorization != null && headers.authorization.startsWith("token")) { - const parsedNewUrl = new (_url().URL)(redirectUrl); - - if (parsedNewUrl.hostname.endsWith(".amazonaws.com")) { - delete headers.authorization; - } - } - - return newOptions; - } - -} - -exports.HttpExecutor = HttpExecutor; - -function configureRequestOptionsFromUrl(url, options) { - const result = configureRequestOptions(options); - configureRequestUrl(new (_url().URL)(url), result); - return result; -} - -function configureRequestUrl(url, options) { - options.protocol = url.protocol; - options.hostname = url.hostname; - - if (url.port) { - options.port = url.port; - } else if (options.port) { - delete options.port; - } - - options.path = url.pathname + url.search; -} - -class DigestTransform extends _stream().Transform { - constructor(expected, algorithm = "sha512", encoding = "base64") { - super(); - this.expected = expected; - this.algorithm = algorithm; - this.encoding = encoding; - this._actual = null; - this.isValidateOnEnd = true; - this.digester = (0, _crypto().createHash)(algorithm); - } // noinspection JSUnusedGlobalSymbols - - - get actual() { - return this._actual; - } // noinspection JSUnusedGlobalSymbols - - - _transform(chunk, encoding, callback) { - this.digester.update(chunk); - callback(null, chunk); - } // noinspection JSUnusedGlobalSymbols - - - _flush(callback) { - this._actual = this.digester.digest(this.encoding); - - if (this.isValidateOnEnd) { - try { - this.validate(); - } catch (e) { - callback(e); - return; - } - } - - callback(null); - } - - validate() { - if (this._actual == null) { - throw (0, _index().newError)("Not finished yet", "ERR_STREAM_NOT_FINISHED"); - } - - if (this._actual !== this.expected) { - throw (0, _index().newError)(`${this.algorithm} checksum mismatch, expected ${this.expected}, got ${this._actual}`, "ERR_CHECKSUM_MISMATCH"); - } - - return null; - } - -} - -exports.DigestTransform = DigestTransform; - -function checkSha2(sha2Header, sha2, callback) { - if (sha2Header != null && sha2 != null && sha2Header !== sha2) { - callback(new Error(`checksum mismatch: expected ${sha2} but got ${sha2Header} (X-Checksum-Sha2 header)`)); - return false; - } - - return true; -} - -function safeGetHeader(response, headerKey) { - const value = response.headers[headerKey]; - - if (value == null) { - return null; - } else if (Array.isArray(value)) { - // electron API - return value.length === 0 ? null : value[value.length - 1]; - } else { - return value; - } -} - -function configurePipes(options, response) { - if (!checkSha2(safeGetHeader(response, "X-Checksum-Sha2"), options.options.sha2, options.callback)) { - return; - } - - const streams = []; - - if (options.options.onProgress != null) { - const contentLength = safeGetHeader(response, "content-length"); - - if (contentLength != null) { - streams.push(new (_ProgressCallbackTransform().ProgressCallbackTransform)(parseInt(contentLength, 10), options.options.cancellationToken, options.options.onProgress)); - } - } - - const sha512 = options.options.sha512; - - if (sha512 != null) { - streams.push(new DigestTransform(sha512, "sha512", sha512.length === 128 && !sha512.includes("+") && !sha512.includes("Z") && !sha512.includes("=") ? "hex" : "base64")); - } else if (options.options.sha2 != null) { - streams.push(new DigestTransform(options.options.sha2, "sha256", "hex")); - } - - const fileOut = (0, _fsExtraP().createWriteStream)(options.destination); - streams.push(fileOut); - let lastStream = response; - - for (const stream of streams) { - stream.on("error", error => { - if (!options.options.cancellationToken.cancelled) { - options.callback(error); - } - }); - lastStream = lastStream.pipe(stream); - } - - fileOut.on("finish", () => { - fileOut.close(options.callback); - }); -} - -function configureRequestOptions(options, token, method) { - if (method != null) { - options.method = method; - } - - let headers = options.headers; - - if (headers == null) { - headers = {}; - options.headers = headers; - } - - if (token != null) { - headers.authorization = token.startsWith("Basic") ? token : `token ${token}`; - } - - if (headers["User-Agent"] == null) { - headers["User-Agent"] = "electron-builder"; - } - - if (method == null || method === "GET" || headers["Cache-Control"] == null) { - headers["Cache-Control"] = "no-cache"; - } // do not specify for node (in any case we use https module) - - - if (options.protocol == null && process.versions.electron != null) { - options.protocol = "https:"; - } - - return options; -} - -function safeStringifyJson(data, skippedNames) { - return JSON.stringify(data, (name, value) => { - if (name.endsWith("authorization") || name.endsWith("Password") || name.endsWith("PASSWORD") || name.endsWith("Token") || name.includes("password") || name.includes("token") || skippedNames != null && skippedNames.has(name)) { - return ""; - } - - return value; - }, 2); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=httpExecutor.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/httpExecutor.js.map b/node_modules/builder-util-runtime/out/httpExecutor.js.map deleted file mode 100755 index a60e345..0000000 --- a/node_modules/builder-util-runtime/out/httpExecutor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/httpExecutor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;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ug\"\nimport { createWriteStream } from \"fs-extra-p\"\nimport { IncomingMessage, OutgoingHttpHeaders, RequestOptions } from \"http\"\nimport { Socket } from \"net\"\nimport { Transform } from \"stream\"\nimport { URL } from \"url\"\nimport { CancellationToken } from \"./CancellationToken\"\nimport { newError } from \"./index\"\nimport { ProgressCallbackTransform, ProgressInfo } from \"./ProgressCallbackTransform\"\n\nconst debug = _debug(\"electron-builder\")\n\nexport interface RequestHeaders extends OutgoingHttpHeaders {\n [key: string]: string\n}\n\nexport interface DownloadOptions {\n readonly headers?: OutgoingHttpHeaders | null\n readonly sha2?: string | null\n readonly sha512?: string | null\n\n readonly cancellationToken: CancellationToken\n\n // noinspection JSUnusedLocalSymbols\n onProgress?(progress: ProgressInfo): void\n}\n\nexport function createHttpError(response: IncomingMessage, description: any | null = null) {\n return new HttpError(response.statusCode || -1, `${response.statusCode} ${response.statusMessage}` + (description == null ? \"\" : (\"\\n\" + JSON.stringify(description, null, \" \"))) + \"\\nHeaders: \" + safeStringifyJson(response.headers), description)\n}\n\nconst HTTP_STATUS_CODES = new Map([\n [429, \"Too many requests\"],\n [400, \"Bad request\"],\n [403, \"Forbidden\"],\n [404, \"Not found\"],\n [405, \"Method not allowed\"],\n [406, \"Not acceptable\"],\n [408, \"Request timeout\"],\n [413, \"Request entity too large\"],\n [500, \"Internal server error\"],\n [502, \"Bad gateway\"],\n [503, \"Service unavailable\"],\n [504, \"Gateway timeout\"],\n [505, \"HTTP version not supported\"],\n])\n\nexport class HttpError extends Error {\n constructor(readonly statusCode: number, message: string = `HTTP error: ${HTTP_STATUS_CODES.get(statusCode) || statusCode}`, readonly description: any | null = null) {\n super(message)\n\n this.name = \"HttpError\"\n }\n}\n\nexport function parseJson(result: Promise) {\n return result.then(it => it == null || it.length === 0 ? null : JSON.parse(it))\n}\n\nexport abstract class HttpExecutor {\n protected readonly maxRedirects = 10\n\n request(options: RequestOptions, cancellationToken: CancellationToken = new CancellationToken(), data?: { [name: string]: any; } | null): Promise {\n configureRequestOptions(options)\n const encodedData = data == null ? undefined : Buffer.from(JSON.stringify(data))\n if (encodedData != null) {\n options.method = \"post\"\n options.headers![\"Content-Type\"] = \"application/json\"\n options.headers![\"Content-Length\"] = encodedData.length\n }\n return this.doApiRequest(options, cancellationToken, it => {\n (it as any).end(encodedData)\n })\n }\n\n doApiRequest(options: RequestOptions, cancellationToken: CancellationToken, requestProcessor: (request: REQUEST, reject: (error: Error) => void) => void, redirectCount: number = 0): Promise {\n if (debug.enabled) {\n debug(`Request: ${safeStringifyJson(options)}`)\n }\n\n return cancellationToken.createPromise((resolve, reject, onCancel) => {\n const request = this.createRequest(options, (response: any) => {\n try {\n this.handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor)\n }\n catch (e) {\n reject(e)\n }\n })\n this.addErrorAndTimeoutHandlers(request, reject)\n this.addRedirectHandlers(request, options, reject, redirectCount, options => {\n this.doApiRequest(options, cancellationToken, requestProcessor, redirectCount)\n .then(resolve)\n .catch(reject)\n })\n requestProcessor(request, reject)\n onCancel(() => request.abort())\n })\n }\n\n // noinspection JSUnusedLocalSymbols\n protected addRedirectHandlers(request: any, options: RequestOptions, reject: (error: Error) => void, redirectCount: number, handler: (options: RequestOptions) => void) {\n // not required for NodeJS\n }\n\n addErrorAndTimeoutHandlers(request: any, reject: (error: Error) => void) {\n this.addTimeOutHandler(request, reject)\n request.on(\"error\", reject)\n request.on(\"aborted\", () => {\n reject(new Error(\"Request has been aborted by the server\"))\n })\n }\n\n private handleResponse(response: IncomingMessage,\n options: RequestOptions,\n cancellationToken: CancellationToken,\n resolve: (data?: any) => void,\n reject: (error: Error) => void,\n redirectCount: number,\n requestProcessor: (request: REQUEST, reject: (error: Error) => void) => void) {\n if (debug.enabled) {\n debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(options)}`)\n }\n\n // we handle any other >= 400 error on request end (read detailed message in the response body)\n if (response.statusCode === 404) {\n // error is clear, we don't need to read detailed error description\n reject(createHttpError(response, `method: ${options.method} url: ${options.protocol || \"https:\"}//${options.hostname}${options.path}\n\nPlease double check that your authentication token is correct. Due to security reasons actual status maybe not reported, but 404.\n`))\n return\n }\n else if (response.statusCode === 204) {\n // on DELETE request\n resolve()\n return\n }\n\n const redirectUrl = safeGetHeader(response, \"location\")\n if (redirectUrl != null) {\n if (redirectCount > this.maxRedirects) {\n reject(this.createMaxRedirectError())\n return\n }\n\n this.doApiRequest(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options), cancellationToken, requestProcessor, redirectCount)\n .then(resolve)\n .catch(reject)\n return\n }\n\n response.setEncoding(\"utf8\")\n\n let data = \"\"\n response.on(\"data\", (chunk: string) => data += chunk)\n response.on(\"end\", () => {\n try {\n if (response.statusCode != null && response.statusCode >= 400) {\n const contentType = safeGetHeader(response, \"content-type\")\n const isJson = contentType != null && (Array.isArray(contentType) ? contentType.find(it => it.includes(\"json\")) != null : contentType.includes(\"json\"))\n reject(createHttpError(response, isJson ? JSON.parse(data) : data))\n }\n else {\n resolve(data.length === 0 ? null : data)\n }\n }\n catch (e) {\n reject(e)\n }\n })\n }\n\n // noinspection JSUnusedLocalSymbols\n abstract createRequest(options: any, callback: (response: any) => void): any\n\n async downloadToBuffer(url: URL, options: DownloadOptions): Promise {\n return await options.cancellationToken.createPromise((resolve, reject, onCancel) => {\n let result: Buffer | null = null\n const requestOptions = {\n headers: options.headers || undefined,\n // because PrivateGitHubProvider requires HttpExecutor.prepareRedirectUrlOptions logic, so, we need to redirect manually\n redirect: \"manual\",\n }\n configureRequestUrl(url, requestOptions)\n configureRequestOptions(requestOptions)\n this.doDownload(requestOptions, {\n destination: null,\n options,\n onCancel,\n callback: error => {\n if (error == null) {\n resolve(result!!)\n }\n else {\n reject(error)\n }\n },\n responseHandler: (response, callback) => {\n const contentLength = safeGetHeader(response, \"content-length\")\n let position = -1\n if (contentLength != null) {\n const size = parseInt(contentLength, 10)\n if (size > 0) {\n if (size > 5242880) {\n callback(new Error(\"Maximum allowed size is 5 MB\"))\n return\n }\n\n result = Buffer.alloc(size)\n position = 0\n }\n }\n response.on(\"data\", (chunk: Buffer) => {\n if (position !== -1) {\n chunk.copy(result!!, position)\n position += chunk.length\n }\n else if (result == null) {\n result = chunk\n }\n else {\n if (result.length > 5242880) {\n callback(new Error(\"Maximum allowed size is 5 MB\"))\n return\n }\n result = Buffer.concat([result, chunk])\n }\n })\n response.on(\"end\", () => {\n if (result != null && position !== -1 && position !== result.length) {\n callback(new Error(`Received data length ${position} is not equal to expected ${result.length}`))\n }\n else {\n callback(null)\n }\n })\n },\n }, 0)\n })\n }\n\n protected doDownload(requestOptions: any, options: DownloadCallOptions, redirectCount: number) {\n const request = this.createRequest(requestOptions, (response: IncomingMessage) => {\n if (response.statusCode! >= 400) {\n options.callback(new Error(`Cannot download \"${requestOptions.protocol || \"https:\"}//${requestOptions.hostname}${requestOptions.path}\", status ${response.statusCode}: ${response.statusMessage}`))\n return\n }\n\n // this code not relevant for Electron (redirect event instead handled)\n const redirectUrl = safeGetHeader(response, \"location\")\n if (redirectUrl != null) {\n if (redirectCount < this.maxRedirects) {\n this.doDownload(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, requestOptions), options, redirectCount++)\n }\n else {\n options.callback(this.createMaxRedirectError())\n }\n return\n }\n\n if (options.responseHandler == null) {\n configurePipes(options, response)\n }\n else {\n options.responseHandler(response, options.callback)\n }\n })\n this.addErrorAndTimeoutHandlers(request, options.callback)\n this.addRedirectHandlers(request, requestOptions, options.callback, redirectCount, requestOptions => {\n this.doDownload(requestOptions, options, redirectCount++)\n })\n request.end()\n }\n\n protected createMaxRedirectError() {\n return new Error(`Too many redirects (> ${this.maxRedirects})`)\n }\n\n private addTimeOutHandler(request: any, callback: (error: Error) => void) {\n request.on(\"socket\", (socket: Socket) => {\n socket.setTimeout(60 * 1000, () => {\n request.abort()\n callback(new Error(\"Request timed out\"))\n })\n })\n }\n\n static prepareRedirectUrlOptions(redirectUrl: string, options: RequestOptions): RequestOptions {\n const newOptions = configureRequestOptionsFromUrl(redirectUrl, {...options})\n const headers = newOptions.headers\n if (headers != null && headers.authorization != null && (headers.authorization as string).startsWith(\"token\")) {\n const parsedNewUrl = new URL(redirectUrl)\n if (parsedNewUrl.hostname.endsWith(\".amazonaws.com\")) {\n delete headers.authorization\n }\n }\n return newOptions\n }\n}\n\nexport interface DownloadCallOptions {\n responseHandler: ((response: IncomingMessage, callback: (error: Error | null) => void) => void) | null\n onCancel: (callback: () => void) => void\n callback: (error: Error | null) => void\n\n options: DownloadOptions\n\n destination: string | null\n}\n\nexport function configureRequestOptionsFromUrl(url: string, options: RequestOptions) {\n const result = configureRequestOptions(options)\n configureRequestUrl(new URL(url), result)\n return result\n}\n\nexport function configureRequestUrl(url: URL, options: RequestOptions): void {\n options.protocol = url.protocol\n options.hostname = url.hostname\n if (url.port) {\n options.port = url.port\n }\n else if (options.port) {\n delete options.port\n }\n options.path = url.pathname + url.search\n}\n\nexport class DigestTransform extends Transform {\n private readonly digester: Hash\n\n private _actual: string | null = null\n\n // noinspection JSUnusedGlobalSymbols\n get actual() {\n return this._actual\n }\n\n isValidateOnEnd: boolean = true\n\n constructor(readonly expected: string, private readonly algorithm: string = \"sha512\", private readonly encoding: \"hex\" | \"base64\" | \"latin1\" = \"base64\") {\n super()\n\n this.digester = createHash(algorithm)\n }\n\n // noinspection JSUnusedGlobalSymbols\n _transform(chunk: Buffer, encoding: string, callback: any) {\n this.digester.update(chunk)\n callback(null, chunk)\n }\n\n // noinspection JSUnusedGlobalSymbols\n _flush(callback: any): void {\n this._actual = this.digester.digest(this.encoding)\n\n if (this.isValidateOnEnd) {\n try {\n this.validate()\n }\n catch (e) {\n callback(e)\n return\n }\n }\n\n callback(null)\n }\n\n validate() {\n if (this._actual == null) {\n throw newError(\"Not finished yet\", \"ERR_STREAM_NOT_FINISHED\")\n }\n\n if (this._actual !== this.expected) {\n throw newError(`${this.algorithm} checksum mismatch, expected ${this.expected}, got ${this._actual}`, \"ERR_CHECKSUM_MISMATCH\")\n }\n\n return null\n }\n}\n\nfunction checkSha2(sha2Header: string | null | undefined, sha2: string | null | undefined, callback: (error: Error | null) => void): boolean {\n if (sha2Header != null && sha2 != null && sha2Header !== sha2) {\n callback(new Error(`checksum mismatch: expected ${sha2} but got ${sha2Header} (X-Checksum-Sha2 header)`))\n return false\n }\n return true\n}\n\nexport function safeGetHeader(response: any, headerKey: string) {\n const value = response.headers[headerKey]\n if (value == null) {\n return null\n }\n else if (Array.isArray(value)) {\n // electron API\n return value.length === 0 ? null : value[value.length - 1]\n }\n else {\n return value\n }\n}\n\nfunction configurePipes(options: DownloadCallOptions, response: IncomingMessage) {\n if (!checkSha2(safeGetHeader(response, \"X-Checksum-Sha2\"), options.options.sha2, options.callback)) {\n return\n }\n\n const streams: Array = []\n if (options.options.onProgress != null) {\n const contentLength = safeGetHeader(response, \"content-length\")\n if (contentLength != null) {\n streams.push(new ProgressCallbackTransform(parseInt(contentLength, 10), options.options.cancellationToken, options.options.onProgress))\n }\n }\n\n const sha512 = options.options.sha512\n if (sha512 != null) {\n streams.push(new DigestTransform(sha512, \"sha512\", sha512.length === 128 && !sha512.includes(\"+\") && !sha512.includes(\"Z\") && !sha512.includes(\"=\") ? \"hex\" : \"base64\"))\n }\n else if (options.options.sha2 != null) {\n streams.push(new DigestTransform(options.options.sha2, \"sha256\", \"hex\"))\n }\n\n const fileOut = createWriteStream(options.destination!!)\n streams.push(fileOut)\n\n let lastStream = response\n for (const stream of streams) {\n stream.on(\"error\", (error: Error) => {\n if (!options.options.cancellationToken.cancelled) {\n options.callback(error)\n }\n })\n lastStream = lastStream.pipe(stream)\n }\n\n fileOut.on(\"finish\", () => {\n (fileOut.close as any)(options.callback)\n })\n}\n\nexport function configureRequestOptions(options: RequestOptions, token?: string | null, method?: \"GET\" | \"DELETE\" | \"PUT\"): RequestOptions {\n if (method != null) {\n options.method = method\n }\n\n let headers = options.headers\n if (headers == null) {\n headers = {}\n options.headers = headers\n }\n if (token != null) {\n (headers as any).authorization = token.startsWith(\"Basic\") ? token : `token ${token}`\n }\n if (headers[\"User-Agent\"] == null) {\n headers[\"User-Agent\"] = \"electron-builder\"\n }\n\n if ((method == null || method === \"GET\") || headers[\"Cache-Control\"] == null) {\n headers[\"Cache-Control\"] = \"no-cache\"\n }\n\n // do not specify for node (in any case we use https module)\n if (options.protocol == null && (process.versions as any).electron != null) {\n options.protocol = \"https:\"\n }\n return options\n}\n\nexport function safeStringifyJson(data: any, skippedNames?: Set) {\n return JSON.stringify(data, (name, value) => {\n if (name.endsWith(\"authorization\") || name.endsWith(\"Password\") || name.endsWith(\"PASSWORD\") || name.endsWith(\"Token\") || name.includes(\"password\") || name.includes(\"token\") || (skippedNames != null && skippedNames.has(name))) {\n return \"\"\n }\n return value\n }, 2)\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/index.d.ts b/node_modules/builder-util-runtime/out/index.d.ts deleted file mode 100755 index 8a3dcb0..0000000 --- a/node_modules/builder-util-runtime/out/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { CancellationToken, CancellationError } from "./CancellationToken"; -export { HttpError, createHttpError, HttpExecutor, DownloadOptions, DigestTransform, RequestHeaders, safeGetHeader, configureRequestOptions, configureRequestOptionsFromUrl, safeStringifyJson, parseJson, configureRequestUrl } from "./httpExecutor"; -export { BintrayOptions, GenericServerOptions, GithubOptions, PublishConfiguration, S3Options, SpacesOptions, BaseS3Options, getS3LikeProviderBaseUrl, Publish, githubUrl, PublishProvider, AllPublishOptions } from "./publishOptions"; -export { UpdateInfo, UpdateFileInfo, WindowsUpdateInfo, BlockMapDataHolder, PackageFileInfo, ReleaseNoteInfo } from "./updateInfo"; -export { parseDn } from "./rfc2253Parser"; -export { UUID } from "./uuid"; -export { ProgressCallbackTransform, ProgressInfo } from "./ProgressCallbackTransform"; -export { parseXml, XElement } from "./xml"; -export { BlockMap } from "./blockMapApi"; -export declare const CURRENT_APP_INSTALLER_FILE_NAME = "installer.exe"; -export declare const CURRENT_APP_PACKAGE_FILE_NAME = "package.7z"; -export declare function asArray(v: null | undefined | T | Array): Array; -export declare function newError(message: string, code: string): Error; diff --git a/node_modules/builder-util-runtime/out/index.js b/node_modules/builder-util-runtime/out/index.js deleted file mode 100755 index ea9b3f1..0000000 --- a/node_modules/builder-util-runtime/out/index.js +++ /dev/null @@ -1,217 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.asArray = asArray; -exports.newError = newError; -Object.defineProperty(exports, "CancellationToken", { - enumerable: true, - get: function () { - return _CancellationToken().CancellationToken; - } -}); -Object.defineProperty(exports, "CancellationError", { - enumerable: true, - get: function () { - return _CancellationToken().CancellationError; - } -}); -Object.defineProperty(exports, "HttpError", { - enumerable: true, - get: function () { - return _httpExecutor().HttpError; - } -}); -Object.defineProperty(exports, "createHttpError", { - enumerable: true, - get: function () { - return _httpExecutor().createHttpError; - } -}); -Object.defineProperty(exports, "HttpExecutor", { - enumerable: true, - get: function () { - return _httpExecutor().HttpExecutor; - } -}); -Object.defineProperty(exports, "DigestTransform", { - enumerable: true, - get: function () { - return _httpExecutor().DigestTransform; - } -}); -Object.defineProperty(exports, "safeGetHeader", { - enumerable: true, - get: function () { - return _httpExecutor().safeGetHeader; - } -}); -Object.defineProperty(exports, "configureRequestOptions", { - enumerable: true, - get: function () { - return _httpExecutor().configureRequestOptions; - } -}); -Object.defineProperty(exports, "configureRequestOptionsFromUrl", { - enumerable: true, - get: function () { - return _httpExecutor().configureRequestOptionsFromUrl; - } -}); -Object.defineProperty(exports, "safeStringifyJson", { - enumerable: true, - get: function () { - return _httpExecutor().safeStringifyJson; - } -}); -Object.defineProperty(exports, "parseJson", { - enumerable: true, - get: function () { - return _httpExecutor().parseJson; - } -}); -Object.defineProperty(exports, "configureRequestUrl", { - enumerable: true, - get: function () { - return _httpExecutor().configureRequestUrl; - } -}); -Object.defineProperty(exports, "getS3LikeProviderBaseUrl", { - enumerable: true, - get: function () { - return _publishOptions().getS3LikeProviderBaseUrl; - } -}); -Object.defineProperty(exports, "githubUrl", { - enumerable: true, - get: function () { - return _publishOptions().githubUrl; - } -}); -Object.defineProperty(exports, "parseDn", { - enumerable: true, - get: function () { - return _rfc2253Parser().parseDn; - } -}); -Object.defineProperty(exports, "UUID", { - enumerable: true, - get: function () { - return _uuid().UUID; - } -}); -Object.defineProperty(exports, "ProgressCallbackTransform", { - enumerable: true, - get: function () { - return _ProgressCallbackTransform().ProgressCallbackTransform; - } -}); -Object.defineProperty(exports, "parseXml", { - enumerable: true, - get: function () { - return _xml().parseXml; - } -}); -Object.defineProperty(exports, "XElement", { - enumerable: true, - get: function () { - return _xml().XElement; - } -}); -exports.CURRENT_APP_PACKAGE_FILE_NAME = exports.CURRENT_APP_INSTALLER_FILE_NAME = void 0; - -function _CancellationToken() { - const data = require("./CancellationToken"); - - _CancellationToken = function () { - return data; - }; - - return data; -} - -function _httpExecutor() { - const data = require("./httpExecutor"); - - _httpExecutor = function () { - return data; - }; - - return data; -} - -function _publishOptions() { - const data = require("./publishOptions"); - - _publishOptions = function () { - return data; - }; - - return data; -} - -function _rfc2253Parser() { - const data = require("./rfc2253Parser"); - - _rfc2253Parser = function () { - return data; - }; - - return data; -} - -function _uuid() { - const data = require("./uuid"); - - _uuid = function () { - return data; - }; - - return data; -} - -function _ProgressCallbackTransform() { - const data = require("./ProgressCallbackTransform"); - - _ProgressCallbackTransform = function () { - return data; - }; - - return data; -} - -function _xml() { - const data = require("./xml"); - - _xml = function () { - return data; - }; - - return data; -} - -// nsis -const CURRENT_APP_INSTALLER_FILE_NAME = "installer.exe"; // nsis-web - -exports.CURRENT_APP_INSTALLER_FILE_NAME = CURRENT_APP_INSTALLER_FILE_NAME; -const CURRENT_APP_PACKAGE_FILE_NAME = "package.7z"; -exports.CURRENT_APP_PACKAGE_FILE_NAME = CURRENT_APP_PACKAGE_FILE_NAME; - -function asArray(v) { - if (v == null) { - return []; - } else if (Array.isArray(v)) { - return v; - } else { - return [v]; - } -} - -function newError(message, code) { - const error = new Error(message); - error.code = code; - return error; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/index.js.map b/node_modules/builder-util-runtime/out/index.js.map deleted file mode 100755 index 207f76f..0000000 --- a/node_modules/builder-util-runtime/out/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AACO,MAAM,+BAA+B,GAAG,eAAxC,C,CACP;;;AACO,MAAM,6BAA6B,GAAG,YAAtC;;;AAED,SAAU,OAAV,CAAqB,CAArB,EAAuD;AAC3D,MAAI,CAAC,IAAI,IAAT,EAAe;AACb,WAAO,EAAP;AACD,GAFD,MAGK,IAAI,KAAK,CAAC,OAAN,CAAc,CAAd,CAAJ,EAAsB;AACzB,WAAO,CAAP;AACD,GAFI,MAGA;AACH,WAAO,CAAC,CAAD,CAAP;AACD;AACF;;AAEK,SAAU,QAAV,CAAmB,OAAnB,EAAoC,IAApC,EAAgD;AACpD,QAAM,KAAK,GAAG,IAAI,KAAJ,CAAU,OAAV,CAAd;AACC,EAAA,KAA+B,CAAC,IAAhC,GAAuC,IAAvC;AACD,SAAO,KAAP;AACD,C","sourcesContent":["export { CancellationToken, CancellationError } from \"./CancellationToken\"\nexport { HttpError, createHttpError, HttpExecutor, DownloadOptions, DigestTransform, RequestHeaders, safeGetHeader, configureRequestOptions, configureRequestOptionsFromUrl, safeStringifyJson, parseJson, configureRequestUrl } from \"./httpExecutor\"\nexport { BintrayOptions, GenericServerOptions, GithubOptions, PublishConfiguration, S3Options, SpacesOptions, BaseS3Options, getS3LikeProviderBaseUrl, Publish, githubUrl, PublishProvider, AllPublishOptions } from \"./publishOptions\"\nexport { UpdateInfo, UpdateFileInfo, WindowsUpdateInfo, BlockMapDataHolder, PackageFileInfo, ReleaseNoteInfo } from \"./updateInfo\"\nexport { parseDn } from \"./rfc2253Parser\"\nexport { UUID } from \"./uuid\"\nexport { ProgressCallbackTransform, ProgressInfo } from \"./ProgressCallbackTransform\"\nexport { parseXml, XElement } from \"./xml\"\nexport { BlockMap } from \"./blockMapApi\"\n\n// nsis\nexport const CURRENT_APP_INSTALLER_FILE_NAME = \"installer.exe\"\n// nsis-web\nexport const CURRENT_APP_PACKAGE_FILE_NAME = \"package.7z\"\n\nexport function asArray(v: null | undefined | T | Array): Array {\n if (v == null) {\n return []\n }\n else if (Array.isArray(v)) {\n return v\n }\n else {\n return [v]\n }\n}\n\nexport function newError(message: string, code: string) {\n const error = new Error(message);\n (error as NodeJS.ErrnoException).code = code\n return error\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/publishOptions.d.ts b/node_modules/builder-util-runtime/out/publishOptions.d.ts deleted file mode 100755 index 07beedd..0000000 --- a/node_modules/builder-util-runtime/out/publishOptions.d.ts +++ /dev/null @@ -1,216 +0,0 @@ -export declare type PublishProvider = "github" | "bintray" | "s3" | "spaces" | "generic" | "custom"; -export declare type AllPublishOptions = string | GithubOptions | S3Options | SpacesOptions | GenericServerOptions | BintrayOptions | CustomPublishOptions; -export declare type Publish = AllPublishOptions | Array | null; -export interface PublishConfiguration { - /** - * The provider. - */ - readonly provider: PublishProvider; - /** - * @private - * win-only - */ - publisherName?: Array | null; - /** - * @private - * win-only - */ - readonly updaterCacheDirName?: string | null; - /** - * Whether to publish auto update info files. - * - * Auto update relies only on the first provider in the list (you can specify several publishers). - * Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded. - * - * @default true - */ - readonly publishAutoUpdate?: boolean; -} -export interface CustomPublishOptions extends PublishConfiguration { - [index: string]: any; -} -/** - * [GitHub](https://help.github.com/articles/about-releases/) options. - * - * GitHub [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) is required. You can generate by going to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). The access token should have the repo scope/permission. - * Define `GH_TOKEN` environment variable. - */ -export interface GithubOptions extends PublishConfiguration { - /** - * The provider. Must be `github`. - */ - readonly provider: "github"; - /** - * The repository name. [Detected automatically](#github-repository-and-bintray-package). - */ - readonly repo?: string | null; - /** - * The owner. - */ - readonly owner?: string | null; - /** - * Whether to use `v`-prefixed tag name. - * @default true - */ - readonly vPrefixedTagName?: boolean; - /** - * The host (including the port if need). - * @default github.com - */ - readonly host?: string | null; - /** - * The protocol. GitHub Publisher supports only `https`. - * @default https - */ - readonly protocol?: "https" | "http" | null; - /** - * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](/auto-update#appupdatersetfeedurloptions). - */ - readonly token?: string | null; - /** - * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](/auto-update#private-github-update-repo). - */ - readonly private?: boolean | null; - /** - * The type of release. By default `draft` release will be created. - * - * Also you can set release type using environment variable. If `EP_DRAFT`is set to `true` — `draft`, if `EP_PRE_RELEASE`is set to `true` — `prerelease`. - * @default draft - */ - releaseType?: "draft" | "prerelease" | "release" | null; -} -/** @private */ -export declare function githubUrl(options: GithubOptions, defaultHost?: string): string; -/** - * Generic (any HTTP(S) server) options. - * In all publish options [File Macros](/file-patterns#file-macros) are supported. - */ -export interface GenericServerOptions extends PublishConfiguration { - /** - * The provider. Must be `generic`. - */ - readonly provider: "generic"; - /** - * The base url. e.g. `https://bucket_name.s3.amazonaws.com`. - */ - readonly url: string; - /** - * The channel. - * @default latest - */ - readonly channel?: string | null; - /** - * Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`. - */ - readonly useMultipleRangeRequest?: boolean; -} -export interface BaseS3Options extends PublishConfiguration { - /** - * The update channel. - * @default latest - */ - channel?: string | null; - /** - * The directory path. - * @default / - */ - readonly path?: string | null; - /** - * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822). - * - * @default public-read - */ - readonly acl?: "private" | "public-read" | null; -} -export interface S3Options extends BaseS3Options { - /** - * The provider. Must be `s3`. - */ - readonly provider: "s3"; - /** - * The bucket name. - */ - readonly bucket: string; - /** - * The region. Is determined and set automatically when publishing. - */ - region?: string | null; - /** - * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822). - * - * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128). - * - * @default public-read - */ - readonly acl?: "private" | "public-read" | null; - /** - * The type of storage to use for the object. - * @default STANDARD - */ - readonly storageClass?: "STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | null; - /** - * Server-side encryption algorithm to use for the object. - */ - readonly encryption?: "AES256" | "aws:kms" | null; - /** - * The endpoint URI to send requests to. The default endpoint is built from the configured region. - * The endpoint should be a string like `https://{service}.{region}.amazonaws.com`. - */ - readonly endpoint?: string | null; -} -/** - * [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options. - * Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables. - */ -export interface SpacesOptions extends BaseS3Options { - /** - * The provider. Must be `spaces`. - */ - readonly provider: "spaces"; - /** - * The space name. - */ - readonly name: string; - /** - * The region (e.g. `nyc3`). - */ - readonly region: string; -} -export declare function getS3LikeProviderBaseUrl(configuration: PublishConfiguration): string; -/** - * [Bintray](https://bintray.com/) options. Requires an API key. An API key can be obtained from the user [profile](https://bintray.com/profile/edit) page ("Edit Your Profile" -> API Key). - * Define `BT_TOKEN` environment variable. - */ -export interface BintrayOptions extends PublishConfiguration { - /** - * The provider. Must be `bintray`. - */ - readonly provider: "bintray"; - /** - * The Bintray package name. - */ - readonly package?: string | null; - /** - * The Bintray repository name. - * @default generic - */ - readonly repo?: string | null; - /** - * The owner. - */ - readonly owner?: string | null; - /** - * The Bintray component (Debian only). - */ - readonly component?: string | null; - /** - * The Bintray distribution (Debian only). - * @default stable - */ - readonly distribution?: string | null; - /** - * The Bintray user account. Used in cases where the owner is an organization. - */ - readonly user?: string | null; - readonly token?: string | null; -} diff --git a/node_modules/builder-util-runtime/out/publishOptions.js b/node_modules/builder-util-runtime/out/publishOptions.js deleted file mode 100755 index 81d213c..0000000 --- a/node_modules/builder-util-runtime/out/publishOptions.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.githubUrl = githubUrl; -exports.getS3LikeProviderBaseUrl = getS3LikeProviderBaseUrl; - -/** @private */ -function githubUrl(options, defaultHost = "github.com") { - return `${options.protocol || "https"}://${options.host || defaultHost}`; -} - -function getS3LikeProviderBaseUrl(configuration) { - const provider = configuration.provider; - - if (provider === "s3") { - return s3Url(configuration); - } - - if (provider === "spaces") { - return spacesUrl(configuration); - } - - throw new Error(`Not supported provider: ${provider}`); -} - -function s3Url(options) { - let url; - - if (options.endpoint != null) { - url = `${options.endpoint}/${options.bucket}`; - } else if (options.bucket.includes(".")) { - if (options.region == null) { - throw new Error(`Bucket name "${options.bucket}" includes a dot, but S3 region is missing`); - } // special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro - - - if (options.region === "us-east-1") { - url = `https://s3.amazonaws.com/${options.bucket}`; - } else { - url = `https://s3-${options.region}.amazonaws.com/${options.bucket}`; - } - } else if (options.region === "cn-north-1") { - url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`; - } else { - url = `https://${options.bucket}.s3.amazonaws.com`; - } - - return appendPath(url, options.path); -} - -function appendPath(url, p) { - if (p != null && p.length > 0) { - if (!p.startsWith("/")) { - url += "/"; - } - - url += p; - } - - return url; -} - -function spacesUrl(options) { - if (options.name == null) { - throw new Error(`name is missing`); - } - - if (options.region == null) { - throw new Error(`region is missing`); - } - - return appendPath(`https://${options.name}.${options.region}.digitaloceanspaces.com`, options.path); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=publishOptions.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/publishOptions.js.map b/node_modules/builder-util-runtime/out/publishOptions.js.map deleted file mode 100755 index 1b6fa6b..0000000 --- a/node_modules/builder-util-runtime/out/publishOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/publishOptions.ts"],"names":[],"mappings":";;;;;;;;AAoGA;AACM,SAAU,SAAV,CAAoB,OAApB,EAA4C,WAAA,GAAsB,YAAlE,EAA8E;AAClF,SAAO,GAAG,OAAO,CAAC,QAAR,IAAoB,OAAO,MAAM,OAAO,CAAC,IAAR,IAAgB,WAAW,EAAtE;AACD;;AAkHK,SAAU,wBAAV,CAAmC,aAAnC,EAAsE;AAC1E,QAAM,QAAQ,GAAG,aAAa,CAAC,QAA/B;;AACA,MAAI,QAAQ,KAAK,IAAjB,EAAuB;AACrB,WAAO,KAAK,CAAE,aAAF,CAAZ;AACD;;AACD,MAAI,QAAQ,KAAK,QAAjB,EAA2B;AACzB,WAAO,SAAS,CAAE,aAAF,CAAhB;AACD;;AACD,QAAM,IAAI,KAAJ,CAAU,2BAA2B,QAAQ,EAA7C,CAAN;AACD;;AAED,SAAS,KAAT,CAAe,OAAf,EAAiC;AAC/B,MAAI,GAAJ;;AACA,MAAI,OAAO,CAAC,QAAR,IAAoB,IAAxB,EAA8B;AAC5B,IAAA,GAAG,GAAG,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAA3C;AACD,GAFD,MAGK,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;;AACD,SAAO,UAAU,CAAC,WAAW,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,yBAA1C,EAAqE,OAAO,CAAC,IAA7E,CAAjB;AACD,C","sourcesContent":["export type PublishProvider = \"github\" | \"bintray\" | \"s3\" | \"spaces\" | \"generic\" | \"custom\"\n\n// typescript-json-schema generates only PublishConfiguration if it is specified in the list, so, it is not added here\nexport type AllPublishOptions = string | GithubOptions | S3Options | SpacesOptions | GenericServerOptions | BintrayOptions | CustomPublishOptions\n// https://github.com/YousefED/typescript-json-schema/issues/80\nexport type Publish = AllPublishOptions | Array | null\n\nexport interface PublishConfiguration {\n /**\n * The provider.\n */\n readonly provider: PublishProvider\n\n /**\n * @private\n * win-only\n */\n publisherName?: Array | null\n\n /**\n * @private\n * win-only\n */\n readonly updaterCacheDirName?: string | null\n\n /**\n * Whether to publish auto update info files.\n *\n * Auto update relies only on the first provider in the list (you can specify several publishers).\n * Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.\n *\n * @default true\n */\n readonly publishAutoUpdate?: boolean\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3261\nexport interface CustomPublishOptions extends PublishConfiguration {\n [index: string]: any\n}\n\n/**\n * [GitHub](https://help.github.com/articles/about-releases/) options.\n *\n * GitHub [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) is required. You can generate by going to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). The access token should have the repo scope/permission.\n * Define `GH_TOKEN` environment variable.\n */\nexport interface GithubOptions extends PublishConfiguration {\n /**\n * The provider. Must be `github`.\n */\n readonly provider: \"github\"\n\n /**\n * The repository name. [Detected automatically](#github-repository-and-bintray-package).\n */\n readonly repo?: string | null\n\n /**\n * The owner.\n */\n readonly owner?: string | null\n\n /**\n * Whether to use `v`-prefixed tag name.\n * @default true\n */\n readonly vPrefixedTagName?: boolean\n\n /**\n * The host (including the port if need).\n * @default github.com\n */\n readonly host?: string | null\n\n /**\n * The protocol. GitHub Publisher supports only `https`.\n * @default https\n */\n readonly protocol?: \"https\" | \"http\" | null\n\n /**\n * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](/auto-update#appupdatersetfeedurloptions).\n */\n readonly token?: string | null\n\n /**\n * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](/auto-update#private-github-update-repo).\n */\n readonly private?: boolean | null\n\n /**\n * The type of release. By default `draft` release will be created.\n *\n * Also you can set release type using environment variable. If `EP_DRAFT`is set to `true` — `draft`, if `EP_PRE_RELEASE`is set to `true` — `prerelease`.\n * @default draft\n */\n releaseType?: \"draft\" | \"prerelease\" | \"release\" | null\n}\n\n/** @private */\nexport function githubUrl(options: GithubOptions, defaultHost: string = \"github.com\") {\n return `${options.protocol || \"https\"}://${options.host || defaultHost}`\n}\n\n/**\n * Generic (any HTTP(S) server) options.\n * In all publish options [File Macros](/file-patterns#file-macros) are supported.\n */\nexport interface GenericServerOptions extends PublishConfiguration {\n /**\n * The provider. Must be `generic`.\n */\n readonly provider: \"generic\"\n\n /**\n * The base url. e.g. `https://bucket_name.s3.amazonaws.com`.\n */\n readonly url: string\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n\n /**\n * Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.\n */\n readonly useMultipleRangeRequest?: boolean\n}\n\nexport interface BaseS3Options extends PublishConfiguration {\n /**\n * The update channel.\n * @default latest\n */\n channel?: string | null\n\n /**\n * The directory path.\n * @default /\n */\n readonly path?: string | null\n\n /**\n * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n *\n * @default public-read\n */\n readonly acl?: \"private\" | \"public-read\" | null\n}\n\nexport interface S3Options extends BaseS3Options {\n /**\n * The provider. Must be `s3`.\n */\n readonly provider: \"s3\"\n\n /**\n * The bucket name.\n */\n readonly bucket: string\n\n /**\n * The region. Is determined and set automatically when publishing.\n */\n region?: string | null\n\n /**\n * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n *\n * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128).\n *\n * @default public-read\n */\n readonly acl?: \"private\" | \"public-read\" | null\n\n /**\n * The type of storage to use for the object.\n * @default STANDARD\n */\n readonly storageClass?: \"STANDARD\" | \"REDUCED_REDUNDANCY\" | \"STANDARD_IA\" | null\n\n /**\n * Server-side encryption algorithm to use for the object.\n */\n readonly encryption?: \"AES256\" | \"aws:kms\" | null\n\n /**\n * The endpoint URI to send requests to. The default endpoint is built from the configured region.\n * The endpoint should be a string like `https://{service}.{region}.amazonaws.com`.\n */\n readonly endpoint?: string | null\n}\n\n/**\n * [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.\n * Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.\n */\nexport interface SpacesOptions extends BaseS3Options {\n /**\n * The provider. Must be `spaces`.\n */\n readonly provider: \"spaces\"\n\n /**\n * The space name.\n */\n readonly name: string\n\n /**\n * The region (e.g. `nyc3`).\n */\n readonly region: string\n}\n\nexport function getS3LikeProviderBaseUrl(configuration: PublishConfiguration) {\n const provider = configuration.provider\n if (provider === \"s3\") {\n return s3Url((configuration as S3Options))\n }\n if (provider === \"spaces\") {\n return spacesUrl((configuration as SpacesOptions))\n }\n throw new Error(`Not supported provider: ${provider}`)\n}\n\nfunction s3Url(options: S3Options) {\n let url: string\n if (options.endpoint != null) {\n url = `${options.endpoint}/${options.bucket}`\n }\n else if (options.bucket.includes(\".\")) {\n if (options.region == null) {\n throw new Error(`Bucket name \"${options.bucket}\" includes a dot, but S3 region is missing`)\n }\n\n // special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro\n if (options.region === \"us-east-1\") {\n url = `https://s3.amazonaws.com/${options.bucket}`\n }\n else {\n url = `https://s3-${options.region}.amazonaws.com/${options.bucket}`\n }\n }\n else if (options.region === \"cn-north-1\") {\n url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`\n }\n else {\n url = `https://${options.bucket}.s3.amazonaws.com`\n }\n return appendPath(url, options.path)\n}\n\nfunction appendPath(url: string, p: string | null | undefined): string {\n if (p != null && p.length > 0) {\n if (!p.startsWith(\"/\")) {\n url += \"/\"\n }\n url += p\n }\n return url\n}\n\nfunction spacesUrl(options: SpacesOptions) {\n if (options.name == null) {\n throw new Error(`name is missing`)\n }\n if (options.region == null) {\n throw new Error(`region is missing`)\n }\n return appendPath(`https://${options.name}.${options.region}.digitaloceanspaces.com`, options.path)\n}\n\n/**\n * [Bintray](https://bintray.com/) options. Requires an API key. An API key can be obtained from the user [profile](https://bintray.com/profile/edit) page (\"Edit Your Profile\" -> API Key).\n * Define `BT_TOKEN` environment variable.\n */\nexport interface BintrayOptions extends PublishConfiguration {\n /**\n * The provider. Must be `bintray`.\n */\n readonly provider: \"bintray\"\n\n /**\n * The Bintray package name.\n */\n readonly package?: string | null\n\n /**\n * The Bintray repository name.\n * @default generic\n */\n readonly repo?: string | null\n\n /**\n * The owner.\n */\n readonly owner?: string | null\n\n /**\n * The Bintray component (Debian only).\n */\n readonly component?: string | null\n\n /**\n * The Bintray distribution (Debian only).\n * @default stable\n */\n readonly distribution?: string | null\n\n /**\n * The Bintray user account. Used in cases where the owner is an organization.\n */\n readonly user?: string | null\n\n readonly token?: string | null\n}\n"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/rfc2253Parser.d.ts b/node_modules/builder-util-runtime/out/rfc2253Parser.d.ts deleted file mode 100755 index 48c26bc..0000000 --- a/node_modules/builder-util-runtime/out/rfc2253Parser.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function parseDn(seq: string): Map; diff --git a/node_modules/builder-util-runtime/out/rfc2253Parser.js b/node_modules/builder-util-runtime/out/rfc2253Parser.js deleted file mode 100755 index 797fa0e..0000000 --- a/node_modules/builder-util-runtime/out/rfc2253Parser.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parseDn = parseDn; - -function parseDn(seq) { - let quoted = false; - let key = null; - let token = ""; - let nextNonSpace = 0; - seq = seq.trim(); - const result = new Map(); - - for (let i = 0; i <= seq.length; i++) { - if (i === seq.length) { - if (key !== null) { - result.set(key, token); - } - - break; - } - - const ch = seq[i]; - - if (quoted) { - if (ch === '"') { - quoted = false; - continue; - } - } else { - if (ch === '"') { - quoted = true; - continue; - } - - if (ch === "\\") { - i++; - const ord = parseInt(seq.slice(i, i + 2), 16); - - if (Number.isNaN(ord)) { - token += seq[i]; - } else { - i++; - token += String.fromCharCode(ord); - } - - continue; - } - - if (key === null && ch === "=") { - key = token; - token = ""; - continue; - } - - if (ch === "," || ch === ";" || ch === "+") { - if (key !== null) { - result.set(key, token); - } - - key = null; - token = ""; - continue; - } - } - - if (ch === " " && !quoted) { - if (token.length === 0) { - continue; - } - - if (i > nextNonSpace) { - let j = i; - - while (seq[j] === " ") { - j++; - } - - nextNonSpace = j; - } - - if (nextNonSpace >= seq.length || seq[nextNonSpace] === "," || seq[nextNonSpace] === ";" || key === null && seq[nextNonSpace] === "=" || key !== null && seq[nextNonSpace] === "+") { - i = nextNonSpace - 1; - continue; - } - } - - token += ch; - } - - return result; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=rfc2253Parser.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/rfc2253Parser.js.map b/node_modules/builder-util-runtime/out/rfc2253Parser.js.map deleted file mode 100755 index c38bb36..0000000 --- a/node_modules/builder-util-runtime/out/rfc2253Parser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/rfc2253Parser.ts"],"names":[],"mappings":";;;;;;;AAAM,SAAU,OAAV,CAAkB,GAAlB,EAA6B;AACjC,MAAI,MAAM,GAAG,KAAb;AACA,MAAI,GAAG,GAAkB,IAAzB;AACA,MAAI,KAAK,GAAG,EAAZ;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AAC1C,YAAI,GAAG,KAAK,IAAZ,EAAkB;AAChB,UAAA,MAAM,CAAC,GAAP,CAAW,GAAX,EAAgB,KAAhB;AACD;;AACD,QAAA,GAAG,GAAG,IAAN;AACA,QAAA,KAAK,GAAG,EAAR;AACA;AACD;AACF;;AAED,QAAI,EAAE,KAAK,GAAP,IAAc,CAAC,MAAnB,EAA2B;AACzB,UAAI,KAAK,CAAC,MAAN,KAAiB,CAArB,EAAwB;AACtB;AACD;;AAED,UAAI,CAAC,GAAG,YAAR,EAAsB;AACpB,YAAI,CAAC,GAAG,CAAR;;AACA,eAAO,GAAG,CAAC,CAAD,CAAH,KAAW,GAAlB,EAAuB;AACrB,UAAA,CAAC;AACF;;AACD,QAAA,YAAY,GAAG,CAAf;AACD;;AAED,UAAI,YAAY,IAAI,GAAG,CAAC,MAApB,IACC,GAAG,CAAC,YAAD,CAAH,KAAsB,GADvB,IAEC,GAAG,CAAC,YAAD,CAAH,KAAsB,GAFvB,IAGE,GAAG,KAAK,IAAR,IAAgB,GAAG,CAAC,YAAD,CAAH,KAAsB,GAHxC,IAIE,GAAG,KAAK,IAAR,IAAgB,GAAG,CAAC,YAAD,CAAH,KAAsB,GAJ5C,EAKE;AACA,QAAA,CAAC,GAAG,YAAY,GAAG,CAAnB;AACA;AACD;AACF;;AAED,IAAA,KAAK,IAAI,EAAT;AACD;;AAED,SAAO,MAAP;AACD,C","sourcesContent":["export function parseDn(seq: string): Map {\n let quoted = false\n let key: string | null = null\n let token = \"\"\n let nextNonSpace = 0\n\n seq = seq.trim()\n const result = new Map()\n for (let i = 0; i <= seq.length; i++) {\n if (i === seq.length) {\n if (key !== null) {\n result.set(key, token)\n }\n break\n }\n\n const ch = seq[i]\n if (quoted) {\n if (ch === '\"') {\n quoted = false\n continue\n }\n }\n else {\n if (ch === '\"') {\n quoted = true\n continue\n }\n\n if (ch === \"\\\\\") {\n i++\n const ord = parseInt(seq.slice(i, i + 2), 16)\n if (Number.isNaN(ord)) {\n token += seq[i]\n }\n else {\n i++\n token += String.fromCharCode(ord)\n }\n continue\n }\n\n if (key === null && ch === \"=\") {\n key = token\n token = \"\"\n continue\n }\n\n if (ch === \",\" || ch === \";\" || ch === \"+\") {\n if (key !== null) {\n result.set(key, token)\n }\n key = null\n token = \"\"\n continue\n }\n }\n\n if (ch === \" \" && !quoted) {\n if (token.length === 0) {\n continue\n }\n\n if (i > nextNonSpace) {\n let j = i\n while (seq[j] === \" \") {\n j++\n }\n nextNonSpace = j\n }\n\n if (nextNonSpace >= seq.length\n || seq[nextNonSpace] === \",\"\n || seq[nextNonSpace] === \";\"\n || (key === null && seq[nextNonSpace] === \"=\")\n || (key !== null && seq[nextNonSpace] === \"+\")\n ) {\n i = nextNonSpace - 1\n continue\n }\n }\n\n token += ch\n }\n\n return result\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/updateInfo.d.ts b/node_modules/builder-util-runtime/out/updateInfo.d.ts deleted file mode 100755 index 79d85f9..0000000 --- a/node_modules/builder-util-runtime/out/updateInfo.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -export interface ReleaseNoteInfo { - /** - * The version. - */ - readonly version: string; - /** - * The note. - */ - readonly note: string | null; -} -export interface BlockMapDataHolder { - /** - * The file size. Used to verify downloaded size (save one HTTP request to get length). - * Also used when block map data is embedded into the file (appimage, windows web installer package). - */ - size?: number; - /** - * The block map file size. Used when block map data is embedded into the file (appimage, windows web installer package). - * This information can be obtained from the file itself, but it requires additional HTTP request, - * so, to reduce request count, block map size is specified in the update metadata too. - */ - blockMapSize?: number; - /** - * The file checksum. - */ - readonly sha512: string; - readonly isAdminRightsRequired?: boolean; -} -export interface PackageFileInfo extends BlockMapDataHolder { - readonly path: string; -} -export interface UpdateFileInfo extends BlockMapDataHolder { - url: string; -} -export interface UpdateInfo { - /** - * The version. - */ - readonly version: string; - readonly files: Array; - /** @deprecated */ - readonly path: string; - /** @deprecated */ - readonly sha512: string; - /** - * The release name. - */ - releaseName?: string | null; - /** - * The release notes. List if `updater.fullChangelog` is set to `true`, `string` otherwise. - */ - releaseNotes?: string | Array | null; - /** - * The release date. - */ - releaseDate: string; - /** - * The [staged rollout](/auto-update#staged-rollouts) percentage, 0-100. - */ - readonly stagingPercentage?: number; -} -export interface WindowsUpdateInfo extends UpdateInfo { - packages?: { - [arch: string]: PackageFileInfo; - } | null; - /** - * @deprecated - * @private - */ - sha2?: string; -} diff --git a/node_modules/builder-util-runtime/out/updateInfo.js b/node_modules/builder-util-runtime/out/updateInfo.js deleted file mode 100755 index 56f494e..0000000 --- a/node_modules/builder-util-runtime/out/updateInfo.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -// __ts-babel@6.0.4 -//# sourceMappingURL=updateInfo.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/updateInfo.js.map b/node_modules/builder-util-runtime/out/updateInfo.js.map deleted file mode 100755 index 4917f66..0000000 --- a/node_modules/builder-util-runtime/out/updateInfo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/uuid.d.ts b/node_modules/builder-util-runtime/out/uuid.d.ts deleted file mode 100755 index 13e814a..0000000 --- a/node_modules/builder-util-runtime/out/uuid.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// -export declare class UUID { - private ascii; - private readonly binary; - private readonly version; - static readonly OID: Buffer; - constructor(uuid: Buffer | string); - static v5(name: string | Buffer, namespace: Buffer): any; - toString(): string; - inspect(): string; - static check(uuid: Buffer | string, offset?: number): false | { - version: undefined; - variant: string; - format: string; - } | { - version: number; - variant: string; - format: string; - }; - static parse(input: string): Buffer; -} -export declare const nil: UUID; diff --git a/node_modules/builder-util-runtime/out/uuid.js b/node_modules/builder-util-runtime/out/uuid.js deleted file mode 100755 index 7d1643c..0000000 --- a/node_modules/builder-util-runtime/out/uuid.js +++ /dev/null @@ -1,229 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.nil = exports.UUID = void 0; - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("./index"); - - _index = function () { - return data; - }; - - return data; -} - -const invalidName = "options.name must be either a string or a Buffer"; // Node ID according to rfc4122#section-4.5 - -const randomHost = (0, _crypto().randomBytes)(16); -randomHost[0] = randomHost[0] | 0x01; // lookup table hex to byte - -const hex2byte = {}; // lookup table byte to hex - -const byte2hex = []; // populate lookup tables - -for (let i = 0; i < 256; i++) { - const hex = (i + 0x100).toString(16).substr(1); - hex2byte[hex] = i; - byte2hex[i] = hex; -} // UUID class - - -class UUID { - constructor(uuid) { - this.ascii = null; - this.binary = null; - const check = UUID.check(uuid); - - if (!check) { - throw new Error("not a UUID"); - } - - this.version = check.version; - - if (check.format === "ascii") { - this.ascii = uuid; - } else { - this.binary = uuid; - } - } - - static v5(name, namespace) { - return uuidNamed(name, "sha1", 0x50, namespace); - } - - toString() { - if (this.ascii == null) { - this.ascii = stringify(this.binary); - } - - return this.ascii; - } - - inspect() { - return `UUID v${this.version} ${this.toString()}`; - } - - static check(uuid, offset = 0) { - if (typeof uuid === "string") { - uuid = uuid.toLowerCase(); - - if (!/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-([a-f0-9]{12})$/.test(uuid)) { - return false; - } - - if (uuid === "00000000-0000-0000-0000-000000000000") { - return { - version: undefined, - variant: "nil", - format: "ascii" - }; - } - - return { - version: (hex2byte[uuid[14] + uuid[15]] & 0xf0) >> 4, - variant: getVariant((hex2byte[uuid[19] + uuid[20]] & 0xe0) >> 5), - format: "ascii" - }; - } - - if (Buffer.isBuffer(uuid)) { - if (uuid.length < offset + 16) { - return false; - } - - let i = 0; - - for (; i < 16; i++) { - if (uuid[offset + i] !== 0) { - break; - } - } - - if (i === 16) { - return { - version: undefined, - variant: "nil", - format: "binary" - }; - } - - return { - version: (uuid[offset + 6] & 0xf0) >> 4, - variant: getVariant((uuid[offset + 8] & 0xe0) >> 5), - format: "binary" - }; - } - - throw (0, _index().newError)("Unknown type of uuid", "ERR_UNKNOWN_UUID_TYPE"); - } // read stringified uuid into a Buffer - - - static parse(input) { - const buffer = Buffer.allocUnsafe(16); - let j = 0; - - for (let i = 0; i < 16; i++) { - buffer[i] = hex2byte[input[j++] + input[j++]]; - - if (i === 3 || i === 5 || i === 7 || i === 9) { - j += 1; - } - } - - return buffer; - } - -} // from rfc4122#appendix-C - - -exports.UUID = UUID; -UUID.OID = UUID.parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"); // according to rfc4122#section-4.1.1 - -function getVariant(bits) { - switch (bits) { - case 0: - case 1: - case 3: - return "ncs"; - - case 4: - case 5: - return "rfc4122"; - - case 6: - return "microsoft"; - - default: - return "future"; - } -} - -var UuidEncoding; - -(function (UuidEncoding) { - UuidEncoding[UuidEncoding["ASCII"] = 0] = "ASCII"; - UuidEncoding[UuidEncoding["BINARY"] = 1] = "BINARY"; - UuidEncoding[UuidEncoding["OBJECT"] = 2] = "OBJECT"; -})(UuidEncoding || (UuidEncoding = {})); // v3 + v5 - - -function uuidNamed(name, hashMethod, version, namespace, encoding = UuidEncoding.ASCII) { - const hash = (0, _crypto().createHash)(hashMethod); - const nameIsNotAString = typeof name !== "string"; - - if (nameIsNotAString && !Buffer.isBuffer(name)) { - throw (0, _index().newError)(invalidName, "ERR_INVALID_UUID_NAME"); - } - - hash.update(namespace); - hash.update(name); - const buffer = hash.digest(); - let result; - - switch (encoding) { - case UuidEncoding.BINARY: - buffer[6] = buffer[6] & 0x0f | version; - buffer[8] = buffer[8] & 0x3f | 0x80; - result = buffer; - break; - - case UuidEncoding.OBJECT: - buffer[6] = buffer[6] & 0x0f | version; - buffer[8] = buffer[8] & 0x3f | 0x80; - result = new UUID(buffer); - break; - - default: - result = byte2hex[buffer[0]] + byte2hex[buffer[1]] + byte2hex[buffer[2]] + byte2hex[buffer[3]] + "-" + byte2hex[buffer[4]] + byte2hex[buffer[5]] + "-" + byte2hex[buffer[6] & 0x0f | version] + byte2hex[buffer[7]] + "-" + byte2hex[buffer[8] & 0x3f | 0x80] + byte2hex[buffer[9]] + "-" + byte2hex[buffer[10]] + byte2hex[buffer[11]] + byte2hex[buffer[12]] + byte2hex[buffer[13]] + byte2hex[buffer[14]] + byte2hex[buffer[15]]; - break; - } - - return result; -} - -function stringify(buffer) { - return byte2hex[buffer[0]] + byte2hex[buffer[1]] + byte2hex[buffer[2]] + byte2hex[buffer[3]] + "-" + byte2hex[buffer[4]] + byte2hex[buffer[5]] + "-" + byte2hex[buffer[6]] + byte2hex[buffer[7]] + "-" + byte2hex[buffer[8]] + byte2hex[buffer[9]] + "-" + byte2hex[buffer[10]] + byte2hex[buffer[11]] + byte2hex[buffer[12]] + byte2hex[buffer[13]] + byte2hex[buffer[14]] + byte2hex[buffer[15]]; -} // according to rfc4122#section-4.1.7 - - -const nil = new UUID("00000000-0000-0000-0000-000000000000"); // UUID.v4 = uuidRandom -// UUID.v4fast = uuidRandomFast -// UUID.v3 = function(options, callback) { -// return uuidNamed("md5", 0x30, options, callback) -// } -exports.nil = nil; -// __ts-babel@6.0.4 -//# sourceMappingURL=uuid.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/uuid.js.map b/node_modules/builder-util-runtime/out/uuid.js.map deleted file mode 100755 index 06541db..0000000 --- a/node_modules/builder-util-runtime/out/uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/uuid.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA,MAAM,WAAW,GAAG,kDAApB,C,CAEA;;AACA,MAAM,UAAU,GAAG,2BAAY,EAAZ,CAAnB;AACA,UAAU,CAAC,CAAD,CAAV,GAAgB,UAAU,CAAC,CAAD,CAAV,GAAgB,IAAhC,C,CAEA;;AACA,MAAM,QAAQ,GAAQ,EAAtB,C,CAEA;;AACA,MAAM,QAAQ,GA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AD,CAAP,CADzB,GACuC,GADvC,GAEL,QAAQ,CAAC,MAAM,CAAC,CAAD,CAAP,CAFH,GAEiB,QAAQ,CAAC,MAAM,CAAC,CAAD,CAAP,CAFzB,GAEuC,GAFvC,GAGL,QAAQ,CAAC,MAAM,CAAC,CAAD,CAAP,CAHH,GAGiB,QAAQ,CAAC,MAAM,CAAC,CAAD,CAAP,CAHzB,GAGuC,GAHvC,GAIL,QAAQ,CAAC,MAAM,CAAC,CAAD,CAAP,CAJH,GAIiB,QAAQ,CAAC,MAAM,CAAC,CAAD,CAAP,CAJzB,GAIuC,GAJvC,GAKL,QAAQ,CAAC,MAAM,CAAC,EAAD,CAAP,CALH,GAKkB,QAAQ,CAAC,MAAM,CAAC,EAAD,CAAP,CAL1B,GAML,QAAQ,CAAC,MAAM,CAAC,EAAD,CAAP,CANH,GAMkB,QAAQ,CAAC,MAAM,CAAC,EAAD,CAAP,CAN1B,GAOL,QAAQ,CAAC,MAAM,CAAC,EAAD,CAAP,CAPH,GAOkB,QAAQ,CAAC,MAAM,CAAC,EAAD,CAAP,CAPjC;AAQD,C,CAED;;;AACO,MAAM,GAAG,GAAG,IAAI,IAAJ,CAAS,sCAAT,CAAZ,C,CAEP;AAEA;AAEA;AACA;AACA","sourcesContent":["import { createHash, randomBytes } from \"crypto\"\nimport { newError } from \"./index\"\n\nconst invalidName = \"options.name must be either a string or a Buffer\"\n\n// Node ID according to rfc4122#section-4.5\nconst randomHost = randomBytes(16)\nrandomHost[0] = randomHost[0] | 0x01\n\n// lookup table hex to byte\nconst hex2byte: any = {}\n\n// lookup table byte to hex\nconst byte2hex: Array = []\n// populate lookup tables\nfor (let i = 0; i < 256; i++) {\n const hex = (i + 0x100).toString(16).substr(1)\n hex2byte[hex] = i\n byte2hex[i] = hex\n}\n\n// UUID class\nexport class UUID {\n private ascii: string | null = null\n private readonly binary: Buffer | null = null\n private readonly version: number\n\n // from rfc4122#appendix-C\n static readonly OID = UUID.parse(\"6ba7b812-9dad-11d1-80b4-00c04fd430c8\")\n\n constructor(uuid: Buffer | string) {\n const check = UUID.check(uuid)\n if (!check) {\n throw new Error(\"not a UUID\")\n }\n\n this.version = check.version!!\n\n if (check.format === \"ascii\") {\n this.ascii = uuid as string\n }\n else {\n this.binary = uuid as Buffer\n }\n }\n\n static v5(name: string | Buffer, namespace: Buffer) {\n return uuidNamed(name, \"sha1\", 0x50, namespace)\n }\n\n toString() {\n if (this.ascii == null) {\n this.ascii = stringify(this.binary!!)\n }\n return this.ascii\n }\n\n inspect() {\n return `UUID v${this.version} ${this.toString()}`\n }\n\n static check(uuid: Buffer | string, offset: number = 0) {\n if (typeof uuid === \"string\") {\n uuid = uuid.toLowerCase()\n\n if (!/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-([a-f0-9]{12})$/.test(uuid)) {\n return false\n }\n\n if (uuid === \"00000000-0000-0000-0000-000000000000\") {\n return {version: undefined, variant: \"nil\", format: \"ascii\"}\n }\n\n return {\n version: (hex2byte[uuid[14] + uuid[15]] & 0xf0) >> 4,\n variant: getVariant((hex2byte[uuid[19] + uuid[20]] & 0xe0) >> 5),\n format: \"ascii\"\n }\n }\n\n if (Buffer.isBuffer(uuid)) {\n if (uuid.length < offset + 16) {\n return false\n }\n\n let i = 0\n for (; i < 16; i++) {\n if (uuid[offset + i] !== 0) {\n break\n }\n }\n if (i === 16) {\n return {version: undefined, variant: \"nil\", format: \"binary\"}\n }\n\n return {\n version: (uuid[offset + 6] & 0xf0) >> 4,\n variant: getVariant((uuid[offset + 8] & 0xe0) >> 5),\n format: \"binary\"\n }\n }\n\n throw newError(\"Unknown type of uuid\", \"ERR_UNKNOWN_UUID_TYPE\")\n }\n\n // read stringified uuid into a Buffer\n static parse(input: string) {\n const buffer = Buffer.allocUnsafe(16)\n let j = 0\n for (let i = 0; i < 16; i++) {\n buffer[i] = hex2byte[input[j++] + input[j++]]\n if (i === 3 || i === 5 || i === 7 || i === 9) {\n j += 1\n }\n }\n return buffer\n }\n}\n\n// according to rfc4122#section-4.1.1\nfunction getVariant(bits: number) {\n switch (bits) {\n case 0: case 1: case 3:\n return \"ncs\"\n case 4: case 5:\n return \"rfc4122\"\n case 6:\n return \"microsoft\"\n default:\n return \"future\"\n }\n}\n\nenum UuidEncoding {\n ASCII, BINARY, OBJECT\n}\n\n// v3 + v5\nfunction uuidNamed(name: string | Buffer, hashMethod: string, version: number, namespace: Buffer, encoding: UuidEncoding = UuidEncoding.ASCII) {\n const hash = createHash(hashMethod)\n\n const nameIsNotAString = typeof name !== \"string\"\n if (nameIsNotAString && !Buffer.isBuffer(name)) {\n throw newError(invalidName, \"ERR_INVALID_UUID_NAME\")\n }\n\n hash.update(namespace)\n hash.update(name)\n\n const buffer = hash.digest()\n let result: any\n switch (encoding) {\n case UuidEncoding.BINARY:\n buffer[6] = (buffer[6] & 0x0f) | version\n buffer[8] = (buffer[8] & 0x3f) | 0x80\n result = buffer\n break\n case UuidEncoding.OBJECT:\n buffer[6] = (buffer[6] & 0x0f) | version\n buffer[8] = (buffer[8] & 0x3f) | 0x80\n result = new UUID(buffer)\n break\n default:\n result = byte2hex[buffer[0]] + byte2hex[buffer[1]] +\n byte2hex[buffer[2]] + byte2hex[buffer[3]] + \"-\" +\n byte2hex[buffer[4]] + byte2hex[buffer[5]] + \"-\" +\n byte2hex[(buffer[6] & 0x0f) | version] +\n byte2hex[buffer[7]] + \"-\" +\n byte2hex[(buffer[8] & 0x3f) | 0x80] +\n byte2hex[buffer[9]] + \"-\" +\n byte2hex[buffer[10]] + byte2hex[buffer[11]] +\n byte2hex[buffer[12]] + byte2hex[buffer[13]] +\n byte2hex[buffer[14]] + byte2hex[buffer[15]]\n break\n }\n return result\n}\n\nfunction stringify(buffer: Buffer) {\n return byte2hex[buffer[0]] + byte2hex[buffer[1]] +\n byte2hex[buffer[2]] + byte2hex[buffer[3]] + \"-\" +\n byte2hex[buffer[4]] + byte2hex[buffer[5]] + \"-\" +\n byte2hex[buffer[6]] + byte2hex[buffer[7]] + \"-\" +\n byte2hex[buffer[8]] + byte2hex[buffer[9]] + \"-\" +\n byte2hex[buffer[10]] + byte2hex[buffer[11]] +\n byte2hex[buffer[12]] + byte2hex[buffer[13]] +\n byte2hex[buffer[14]] + byte2hex[buffer[15]]\n}\n\n// according to rfc4122#section-4.1.7\nexport const nil = new UUID(\"00000000-0000-0000-0000-000000000000\")\n\n// UUID.v4 = uuidRandom\n\n// UUID.v4fast = uuidRandomFast\n\n// UUID.v3 = function(options, callback) {\n// return uuidNamed(\"md5\", 0x30, options, callback)\n// }"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/out/xml.d.ts b/node_modules/builder-util-runtime/out/xml.d.ts deleted file mode 100755 index 4aa9213..0000000 --- a/node_modules/builder-util-runtime/out/xml.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export declare class XElement { - readonly name: string; - value: string; - attributes: { - [key: string]: string; - } | null; - isCData: boolean; - elements: Array | null; - constructor(name: string); - attribute(name: string): string; - removeAttribute(name: string): void; - element(name: string, ignoreCase?: boolean, errorIfMissed?: string | null): XElement; - elementOrNull(name: string, ignoreCase?: boolean): XElement | null; - getElements(name: string, ignoreCase?: boolean): XElement[]; - elementValueOrEmpty(name: string, ignoreCase?: boolean): string; -} -export declare function parseXml(data: string): XElement; diff --git a/node_modules/builder-util-runtime/out/xml.js b/node_modules/builder-util-runtime/out/xml.js deleted file mode 100755 index 44176bd..0000000 --- a/node_modules/builder-util-runtime/out/xml.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parseXml = parseXml; -exports.XElement = void 0; - -function sax() { - const data = _interopRequireWildcard(require("sax")); - - sax = function () { - return data; - }; - - return data; -} - -function _index() { - const data = require("./index"); - - _index = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class XElement { - constructor(name) { - this.name = name; - this.value = ""; - this.attributes = null; - this.isCData = false; - this.elements = null; - - if (!name) { - throw (0, _index().newError)("Element name cannot be empty", "ERR_XML_ELEMENT_NAME_EMPTY"); - } - - if (!isValidName(name)) { - throw (0, _index().newError)(`Invalid element name: ${name}`, "ERR_XML_ELEMENT_INVALID_NAME"); - } - } - - attribute(name) { - const result = this.attributes === null ? null : this.attributes[name]; - - if (result == null) { - throw (0, _index().newError)(`No attribute "${name}"`, "ERR_XML_MISSED_ATTRIBUTE"); - } - - return result; - } - - removeAttribute(name) { - if (this.attributes !== null) { - delete this.attributes[name]; - } - } - - element(name, ignoreCase = false, errorIfMissed = null) { - const result = this.elementOrNull(name, ignoreCase); - - if (result === null) { - throw (0, _index().newError)(errorIfMissed || `No element "${name}"`, "ERR_XML_MISSED_ELEMENT"); - } - - return result; - } - - elementOrNull(name, ignoreCase = false) { - if (this.elements === null) { - return null; - } - - for (const element of this.elements) { - if (isNameEquals(element, name, ignoreCase)) { - return element; - } - } - - return null; - } - - getElements(name, ignoreCase = false) { - if (this.elements === null) { - return []; - } - - return this.elements.filter(it => isNameEquals(it, name, ignoreCase)); - } - - elementValueOrEmpty(name, ignoreCase = false) { - const element = this.elementOrNull(name, ignoreCase); - return element === null ? "" : element.value; - } - -} - -exports.XElement = XElement; -const NAME_REG_EXP = new RegExp(/^[A-Za-z_][:A-Za-z0-9_-]*$/i); - -function isValidName(name) { - return NAME_REG_EXP.test(name); -} - -function isNameEquals(element, name, ignoreCase) { - const elementName = element.name; - return elementName === name || ignoreCase === true && elementName.length === name.length && elementName.toLowerCase() === name.toLowerCase(); -} - -function parseXml(data) { - let rootElement = null; - const parser = sax().parser(true, {}); - const elements = []; - - parser.onopentag = saxElement => { - const element = new XElement(saxElement.name); - element.attributes = saxElement.attributes; - - if (rootElement === null) { - rootElement = element; - } else { - const parent = elements[elements.length - 1]; - - if (parent.elements == null) { - parent.elements = []; - } - - parent.elements.push(element); - } - - elements.push(element); - }; - - parser.onclosetag = () => { - elements.pop(); - }; - - parser.ontext = text => { - if (elements.length > 0) { - elements[elements.length - 1].value = text; - } - }; - - parser.oncdata = cdata => { - const element = elements[elements.length - 1]; - element.value = cdata; - element.isCData = true; - }; - - parser.onerror = err => { - throw err; - }; - - parser.write(data); - return rootElement; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=xml.js.map \ No newline at end of file diff --git a/node_modules/builder-util-runtime/out/xml.js.map b/node_modules/builder-util-runtime/out/xml.js.map deleted file mode 100755 index ebfb270..0000000 --- a/node_modules/builder-util-runtime/out/xml.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/xml.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,MAAO,QAAP,CAAe;AAMnB,EAAA,WAAA,CAAqB,IAArB,EAAiC;AAAZ,SAAA,IAAA,GAAA,IAAA;AALrB,SAAA,KAAA,GAAQ,EAAR;AACA,SAAA,UAAA,GAA+C,IAA/C;AACA,SAAA,OAAA,GAAU,KAAV;AACA,SAAA,QAAA,GAAmC,IAAnC;;AAGE,QAAI,CAAC,IAAL,EAAW;AACT,YAAM,uBAAS,8BAAT,EAAyC,4BAAzC,CAAN;AACD;;AACD,QAAI,CAAC,WAAW,CAAC,IAAD,CAAhB,EAAwB;AACtB,YAAM,uBAAS,yBAAyB,IAAI,EAAtC,EAA0C,8BAA1C,CAAN;AACD;AACF;;AAED,EAAA,SAAS,CAAC,IAAD,EAAa;AACpB,UAAM,MAAM,GAAG,KAAK,UAAL,KAAoB,IAApB,GAA2B,IAA3B,GAAkC,KAAK,UAAL,CAAgB,IAAhB,CAAjD;;AACA,QAAI,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,IAAA,QAAQ,CAAC,IAAT,CAAc,OAAd;AACD,GAfD;;AAiBA,EAAA,MAAM,CAAC,UAAP,GAAoB,MAAK;AACvB,IAAA,QAAQ,CAAC,GAAT;AACD,GAFD;;AAIA,EAAA,MAAM,CAAC,MAAP,GAAgB,IAAI,IAAG;AACrB,QAAI,QAAQ,CAAC,MAAT,GAAkB,CAAtB,EAAyB;AACvB,MAAA,QAAQ,CAAC,QAAQ,CAAC,MAAT,GAAkB,CAAnB,CAAR,CAA8B,KAA9B,GAAsC,IAAtC;AACD;AACF,GAJD;;AAMA,EAAA,MAAM,CAAC,OAAP,GAAiB,KAAK,IAAG;AACvB,UAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAT,GAAkB,CAAnB,CAAxB;AACA,IAAA,OAAO,CAAC,KAAR,GAAgB,KAAhB;AACA,IAAA,OAAO,CAAC,OAAR,GAAkB,IAAlB;AACD,GAJD;;AAMA,EAAA,MAAM,CAAC,OAAP,GAAiB,GAAG,IAAG;AACrB,UAAM,GAAN;AACD,GAFD;;AAIA,EAAA,MAAM,CAAC,KAAP,CAAa,IAAb;AACA,SAAO,WAAP;AACD,C","sourcesContent":["import * as sax from \"sax\"\nimport { newError } from \"./index\"\n\nexport class XElement {\n value = \"\"\n attributes: { [key: string]: string } | null = null\n isCData = false\n elements: Array | null = null\n\n constructor(readonly name: string) {\n if (!name) {\n throw newError(\"Element name cannot be empty\", \"ERR_XML_ELEMENT_NAME_EMPTY\")\n }\n if (!isValidName(name)) {\n throw newError(`Invalid element name: ${name}`, \"ERR_XML_ELEMENT_INVALID_NAME\")\n }\n }\n\n attribute(name: string): string {\n const result = this.attributes === null ? null : this.attributes[name]\n if (result == null) {\n throw newError(`No attribute \"${name}\"`, \"ERR_XML_MISSED_ATTRIBUTE\")\n }\n return result\n }\n\n removeAttribute(name: string): void {\n if (this.attributes !== null) {\n delete this.attributes[name]\n }\n }\n\n element(name: string, ignoreCase = false, errorIfMissed: string | null = null): XElement {\n const result = this.elementOrNull(name, ignoreCase)\n if (result === null) {\n throw newError(errorIfMissed || `No element \"${name}\"`, \"ERR_XML_MISSED_ELEMENT\")\n }\n return result\n }\n\n elementOrNull(name: string, ignoreCase = false): XElement | null {\n if (this.elements === null) {\n return null\n }\n\n for (const element of this.elements) {\n if (isNameEquals(element, name, ignoreCase)) {\n return element\n }\n }\n\n return null\n }\n\n getElements(name: string, ignoreCase = false) {\n if (this.elements === null) {\n return []\n }\n return this.elements.filter(it => isNameEquals(it, name, ignoreCase))\n }\n\n elementValueOrEmpty(name: string, ignoreCase = false): string {\n const element = this.elementOrNull(name, ignoreCase)\n return element === null ? \"\" : element.value\n }\n}\n\nconst NAME_REG_EXP = new RegExp(/^[A-Za-z_][:A-Za-z0-9_-]*$/i)\n\nfunction isValidName(name: string) {\n return (NAME_REG_EXP.test(name))\n}\n\nfunction isNameEquals(element: XElement, name: string, ignoreCase: boolean) {\n const elementName = element.name\n return elementName === name || (ignoreCase === true && elementName.length === name.length && elementName.toLowerCase() === name.toLowerCase())\n}\n\nexport function parseXml(data: string): XElement {\n let rootElement: XElement | null = null\n const parser = sax.parser(true, {})\n const elements: Array = []\n\n parser.onopentag = saxElement => {\n const element = new XElement(saxElement.name)\n element.attributes = saxElement.attributes as { [key: string]: string }\n\n if (rootElement === null) {\n rootElement = element\n }\n else {\n const parent = elements[elements.length - 1]\n if (parent.elements == null) {\n parent.elements = []\n }\n parent.elements.push(element)\n }\n elements.push(element)\n }\n\n parser.onclosetag = () => {\n elements.pop()\n }\n\n parser.ontext = text => {\n if (elements.length > 0) {\n elements[elements.length - 1].value = text\n }\n }\n\n parser.oncdata = cdata => {\n const element = elements[elements.length - 1]\n element.value = cdata\n element.isCData = true\n }\n\n parser.onerror = err => {\n throw err\n }\n\n parser.write(data)\n return rootElement!!\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util-runtime/package.json b/node_modules/builder-util-runtime/package.json deleted file mode 100644 index a178f33..0000000 --- a/node_modules/builder-util-runtime/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "builder-util-runtime@8.1.0", - "_id": "builder-util-runtime@8.1.0", - "_inBundle": false, - "_integrity": "sha512-s1mlJ28mv+56Iebh6c9aXjVe11O3Z0cDTwAGeB0PCcUzHA37fDxGgS8ZGoYNMZP+rBHj21d/od1wuYofTVLaQg==", - "_location": "/builder-util-runtime", - "_phantomChildren": { - "ms": "2.1.1" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "builder-util-runtime@8.1.0", - "name": "builder-util-runtime", - "escapedName": "builder-util-runtime", - "rawSpec": "8.1.0", - "saveSpec": null, - "fetchSpec": "8.1.0" - }, - "_requiredBy": [ - "/app-builder-lib", - "/builder-util", - "/electron-builder", - "/electron-publish" - ], - "_resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.1.0.tgz", - "_shasum": "dd7fca995d48ceee7580b4851ca057566c94601e", - "_spec": "builder-util-runtime@8.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", - "author": { - "name": "Vladimir Krivosheev" - }, - "bugs": { - "url": "https://github.com/electron-userland/electron-builder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bluebird-lst": "^1.0.6", - "debug": "^4.1.0", - "fs-extra-p": "^7.0.0", - "sax": "^1.2.4" - }, - "deprecated": false, - "description": "HTTP utilities. Used by [electron-builder](https://github.com/electron-userland/electron-builder).", - "engines": { - "node": ">=6.0.0" - }, - "files": [ - "out" - ], - "homepage": "https://github.com/electron-userland/electron-builder", - "license": "MIT", - "main": "out/index.js", - "name": "builder-util-runtime", - "repository": { - "type": "git", - "url": "git+https://github.com/electron-userland/electron-builder.git" - }, - "types": "./out/index.d.ts", - "version": "8.1.0" -} diff --git a/node_modules/builder-util-runtime/readme.md b/node_modules/builder-util-runtime/readme.md deleted file mode 100644 index c0312a2..0000000 --- a/node_modules/builder-util-runtime/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# builder-util-runtime - -HTTP utilities. Used by [electron-builder](https://github.com/electron-userland/electron-builder). \ No newline at end of file diff --git a/node_modules/builder-util/node_modules/debug/CHANGELOG.md b/node_modules/builder-util/node_modules/debug/CHANGELOG.md deleted file mode 100644 index 820d21e..0000000 --- a/node_modules/builder-util/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,395 +0,0 @@ - -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/builder-util/node_modules/debug/LICENSE b/node_modules/builder-util/node_modules/debug/LICENSE deleted file mode 100644 index 658c933..0000000 --- a/node_modules/builder-util/node_modules/debug/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(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/builder-util/node_modules/debug/README.md b/node_modules/builder-util/node_modules/debug/README.md deleted file mode 100644 index 88dae35..0000000 --- a/node_modules/builder-util/node_modules/debug/README.md +++ /dev/null @@ -1,455 +0,0 @@ -# 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 -``` - -`disable()` - -Will disable all namespaces. The functions returns the namespaces currently -enabled (and skipped). This can be useful if you want to disable debugging -temporarily without knowing what was enabled to begin with. - -For example: - -```js -let debug = require('debug'); -debug.enable('foo:*,-foo:bar'); -let namespaces = debug.disable(); -debug.enable(namespaces); -``` - -Note: There is no guarantee that the string will be identical to the initial -enable string, but semantically they will be identical. - -## 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/builder-util/node_modules/debug/dist/debug.js b/node_modules/builder-util/node_modules/debug/dist/debug.js deleted file mode 100644 index 89ad0c2..0000000 --- a/node_modules/builder-util/node_modules/debug/dist/debug.js +++ /dev/null @@ -1,912 +0,0 @@ -"use strict"; - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - -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); } - -(function (f) { - if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { - module.exports = f(); - } else if (typeof define === "function" && define.amd) { - define([], f); - } else { - var g; - - if (typeof window !== "undefined") { - g = window; - } else if (typeof global !== "undefined") { - g = global; - } else if (typeof self !== "undefined") { - g = self; - } else { - g = this; - } - - g.debug = f(); - } -})(function () { - var define, module, exports; - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = "function" == typeof require && require; - if (!f && c) return c(i, !0); - if (u) return u(i, !0); - var a = new Error("Cannot find module '" + i + "'"); - throw a.code = "MODULE_NOT_FOUND", a; - } - - var p = n[i] = { - exports: {} - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - - return n[i].exports; - } - - for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { - o(t[i]); - } - - return o; - } - - return r; - }()({ - 1: [function (require, module, exports) { - /** - * Helpers. - */ - var s = 1000; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - - module.exports = function (val, options) { - options = options || {}; - - var type = _typeof(val); - - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); - }; - /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - - - function parse(str) { - str = String(str); - - if (str.length > 100) { - return; - } - - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - - if (!match) { - return; - } - - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - - case 'weeks': - case 'week': - case 'w': - return n * w; - - case 'days': - case 'day': - case 'd': - return n * d; - - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - - default: - return undefined; - } - } - /** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtShort(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - - return ms + 'ms'; - } - /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtLong(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - - return ms + ' ms'; - } - /** - * Pluralization helper. - */ - - - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); - } - }, {}], - 2: [function (require, module, exports) { - // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - })(); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; // v8 likes predictible objects - - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - - process.listeners = function (name) { - return []; - }; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { - return '/'; - }; - - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - - process.umask = function () { - return 0; - }; - }, {}], - 3: [function (require, module, exports) { - /** - * 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() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - // Disabled? - if (!debug.enabled) { - return; - } - - 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) { - var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - /** - * 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. - * - * @return {String} namespaces - * @api public - */ - - - function disable() { - var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { - return '-' + namespace; - }))).join(','); - createDebug.enable(''); - return namespaces; - } - /** - * 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; - } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - - - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); - } - /** - * 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; - }, { - "ms": 1 - }], - 4: [function (require, module, exports) { - (function (process) { - /* 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; - } - }; - }).call(this, require('_process')); - }, { - "./common": 3, - "_process": 2 - }] - }, {}, [4])(4); -}); diff --git a/node_modules/builder-util/node_modules/debug/package.json b/node_modules/builder-util/node_modules/debug/package.json deleted file mode 100644 index ac1b059..0000000 --- a/node_modules/builder-util/node_modules/debug/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_from": "debug@^4.1.0", - "_id": "debug@4.1.1", - "_inBundle": false, - "_integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "_location": "/builder-util/debug", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "debug@^4.1.0", - "name": "debug", - "escapedName": "debug", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/builder-util" - ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "_shasum": "3b72260255109c6b589cee050f1d516139664791", - "_spec": "debug@^4.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/builder-util", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - } - ], - "dependencies": { - "ms": "^2.1.1" - }, - "deprecated": false, - "description": "small debugging utility", - "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" - }, - "files": [ - "src", - "dist/debug.js", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/visionmedia/debug#readme", - "keywords": [ - "debug", - "log", - "debugger" - ], - "license": "MIT", - "main": "./src/index.js", - "name": "debug", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "scripts": { - "build": "npm run build:debug && npm run build:test", - "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", - "build:test": "babel -d dist test.js", - "clean": "rimraf dist coverage", - "lint": "xo", - "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", - "pretest:browser": "npm run build", - "test": "npm run test:node && npm run test:browser", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls", - "test:node": "istanbul cover _mocha -- test.js" - }, - "unpkg": "./dist/debug.js", - "version": "4.1.1" -} diff --git a/node_modules/builder-util/node_modules/debug/src/browser.js b/node_modules/builder-util/node_modules/debug/src/browser.js deleted file mode 100644 index 5f34c0d..0000000 --- a/node_modules/builder-util/node_modules/debug/src/browser.js +++ /dev/null @@ -1,264 +0,0 @@ -/* 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; - } - - const 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 - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, 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(...args) { - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return typeof console === 'object' && - console.log && - console.log(...args); -} - -/** - * 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() { - let 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); - -const {formatters} = module.exports; - -/** - * 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/builder-util/node_modules/debug/src/common.js b/node_modules/builder-util/node_modules/debug/src/common.js deleted file mode 100644 index 2f82b8d..0000000 --- a/node_modules/builder-util/node_modules/debug/src/common.js +++ /dev/null @@ -1,266 +0,0 @@ - -/** - * 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(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) { - let hash = 0; - - for (let 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) { - let prevTime; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const 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 - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const 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); - - const 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() { - const index = createDebug.instances.indexOf(this); - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - return false; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * 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 = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const 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++) { - const instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * 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; - } - - let i; - let 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; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * 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/builder-util/node_modules/debug/src/index.js b/node_modules/builder-util/node_modules/debug/src/index.js deleted file mode 100644 index bf4c57f..0000000 --- a/node_modules/builder-util/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/builder-util/node_modules/debug/src/node.js b/node_modules/builder-util/node_modules/debug/src/node.js deleted file mode 100644 index 5e1f154..0000000 --- a/node_modules/builder-util/node_modules/debug/src/node.js +++ /dev/null @@ -1,257 +0,0 @@ -/** - * Module dependencies. - */ - -const tty = require('tty'); -const 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 - const 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(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let 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) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[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(...args) { - return process.stderr.write(util.format(...args) + '\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 = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * 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) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * 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/builder-util/out/DebugLogger.d.ts b/node_modules/builder-util/out/DebugLogger.d.ts deleted file mode 100644 index fffac87..0000000 --- a/node_modules/builder-util/out/DebugLogger.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare class DebugLogger { - readonly isEnabled: boolean; - readonly data: any; - constructor(isEnabled?: boolean); - add(key: string, value: any): void; - save(file: string): Promise; -} diff --git a/node_modules/builder-util/out/DebugLogger.js b/node_modules/builder-util/out/DebugLogger.js deleted file mode 100644 index 464a3ee..0000000 --- a/node_modules/builder-util/out/DebugLogger.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.DebugLogger = void 0; - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _util() { - const data = require("./util"); - - _util = function () { - return data; - }; - - return data; -} - -class DebugLogger { - constructor(isEnabled = true) { - this.isEnabled = isEnabled; - this.data = {}; - } - - add(key, value) { - if (!this.isEnabled) { - return; - } - - const dataPath = key.split("."); - let o = this.data; - let lastName = null; - - for (const p of dataPath) { - if (p === dataPath[dataPath.length - 1]) { - lastName = p; - break; - } else { - if (o[p] == null) { - o[p] = Object.create(null); - } else if (typeof o[p] === "string") { - o[p] = [o[p]]; - } - - o = o[p]; - } - } - - if (Array.isArray(o[lastName])) { - o[lastName].push(value); - } else { - o[lastName] = value; - } - } - - save(file) { - // toml and json doesn't correctly output multiline string as multiline - if (this.isEnabled && Object.keys(this.data).length > 0) { - return (0, _fsExtraP().outputFile)(file, (0, _util().serializeToYaml)(this.data)); - } else { - return Promise.resolve(); - } - } - -} exports.DebugLogger = DebugLogger; -// __ts-babel@6.0.4 -//# sourceMappingURL=DebugLogger.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/DebugLogger.js.map b/node_modules/builder-util/out/DebugLogger.js.map deleted file mode 100644 index 71570de..0000000 --- a/node_modules/builder-util/out/DebugLogger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/DebugLogger.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,WAAP,CAAkB;AAGtB,EAAA,WAAA,CAAqB,SAAA,GAAY,IAAjC,EAAqC;AAAhB,SAAA,SAAA,GAAA,SAAA;AAFZ,SAAA,IAAA,GAAY,EAAZ;AAGR;;AAED,EAAA,GAAG,CAAC,GAAD,EAAc,KAAd,EAAwB;AACzB,QAAI,CAAC,KAAK,SAAV,EAAqB;AACnB;AACD;;AAED,UAAM,QAAQ,GAAG,GAAG,CAAC,KAAJ,CAAU,GAAV,CAAjB;AACA,QAAI,CAAC,GAAG,KAAK,IAAb;AACA,QAAI,QAAQ,GAAkB,IAA9B;;AACA,SAAK,MAAM,CAAX,IAAgB,QAAhB,EAA0B;AACxB,UAAI,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,MAAT,GAAkB,CAAnB,CAAlB,EAAyC;AACvC,QAAA,QAAQ,GAAG,CAAX;AACA;AACD,OAHD,MAIK;AACH,YAAI,CAAC,CAAC,CAAD,CAAD,IAAQ,IAAZ,EAAkB;AAChB,UAAA,CAAC,CAAC,CAAD,CAAD,GAAO,MAAM,CAAC,MAAP,CAAc,IAAd,CAAP;AACD,SAFD,MAGK,IAAI,OAAO,CAAC,CAAC,CAAD,CAAR,KAAgB,QAApB,EAA8B;AACjC,UAAA,CAAC,CAAC,CAAD,CAAD,GAAO,CAAC,CAAC,CAAC,CAAD,CAAF,CAAP;AACD;;AACD,QAAA,CAAC,GAAG,CAAC,CAAC,CAAD,CAAL;AACD;AACF;;AAED,QAAI,KAAK,CAAC,OAAN,CAAc,CAAC,CAAC,QAAD,CAAf,CAAJ,EAAkC;AAChC,MAAA,CAAC,CAAC,QAAD,CAAD,CAAc,IAAd,CAAmB,KAAnB;AACD,KAFD,MAGK;AACH,MAAA,CAAC,CAAC,QAAD,CAAD,GAAgB,KAAhB;AACD;AACF;;AAED,EAAA,IAAI,CAAC,IAAD,EAAa;AACf;AACA,QAAI,KAAK,SAAL,IAAkB,MAAM,CAAC,IAAP,CAAY,KAAK,IAAjB,EAAuB,MAAvB,GAAgC,CAAtD,EAAyD;AACvD,aAAO,4BAAW,IAAX,EAAiB,6BAAgB,KAAK,IAArB,CAAjB,CAAP;AACD,KAFD,MAGK;AACH,aAAO,OAAO,CAAC,OAAR,EAAP;AACD;AACF;;AA9CqB,C","sourcesContent":["import { outputFile } from \"fs-extra-p\"\nimport { serializeToYaml } from \"./util\"\n\nexport class DebugLogger {\n readonly data: any = {}\n\n constructor(readonly isEnabled = true) {\n }\n\n add(key: string, value: any) {\n if (!this.isEnabled) {\n return\n }\n\n const dataPath = key.split(\".\")\n let o = this.data\n let lastName: string | null = null\n for (const p of dataPath) {\n if (p === dataPath[dataPath.length - 1]) {\n lastName = p\n break\n }\n else {\n if (o[p] == null) {\n o[p] = Object.create(null)\n }\n else if (typeof o[p] === \"string\") {\n o[p] = [o[p]]\n }\n o = o[p]\n }\n }\n\n if (Array.isArray(o[lastName!!])) {\n o[lastName!!].push(value)\n }\n else {\n o[lastName!!] = value\n }\n }\n\n save(file: string) {\n // toml and json doesn't correctly output multiline string as multiline\n if (this.isEnabled && Object.keys(this.data).length > 0) {\n return outputFile(file, serializeToYaml(this.data))\n }\n else {\n return Promise.resolve()\n }\n }\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/arch.d.ts b/node_modules/builder-util/out/arch.d.ts deleted file mode 100644 index 7e92c6d..0000000 --- a/node_modules/builder-util/out/arch.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare enum Arch { - ia32 = 0, - x64 = 1, - armv7l = 2, - arm64 = 3 -} -export declare type ArchType = "x64" | "ia32" | "armv7l" | "arm64"; -export declare function toLinuxArchString(arch: Arch): string; -export declare function getArchCliNames(): Array; -export declare function getArchSuffix(arch: Arch): string; -export declare function archFromString(name: string): Arch; diff --git a/node_modules/builder-util/out/arch.js b/node_modules/builder-util/out/arch.js deleted file mode 100644 index 80b3623..0000000 --- a/node_modules/builder-util/out/arch.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.toLinuxArchString = toLinuxArchString; -exports.getArchCliNames = getArchCliNames; -exports.getArchSuffix = getArchSuffix; -exports.archFromString = archFromString; -exports.Arch = void 0; -var Arch; -exports.Arch = Arch; - -(function (Arch) { - Arch[Arch["ia32"] = 0] = "ia32"; - Arch[Arch["x64"] = 1] = "x64"; - Arch[Arch["armv7l"] = 2] = "armv7l"; - Arch[Arch["arm64"] = 3] = "arm64"; -})(Arch || (exports.Arch = Arch = {})); - -function toLinuxArchString(arch) { - switch (arch) { - case Arch.x64: - return "amd64"; - - case Arch.ia32: - return "i386"; - - case Arch.armv7l: - return "armv7l"; - - case Arch.arm64: - return "arm64"; - - default: - throw new Error(`Unsupported arch ${arch}`); - } -} - -function getArchCliNames() { - return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]]; -} - -function getArchSuffix(arch) { - return arch === Arch.x64 ? "" : `-${Arch[arch]}`; -} - -function archFromString(name) { - switch (name) { - case "x64": - return Arch.x64; - - case "ia32": - return Arch.ia32; - - case "arm64": - return Arch.arm64; - - case "armv7l": - return Arch.armv7l; - - default: - throw new Error(`Unsupported arch ${name}`); - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=arch.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/arch.js.map b/node_modules/builder-util/out/arch.js.map deleted file mode 100644 index e3c0b6e..0000000 --- a/node_modules/builder-util/out/arch.js.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zB,EAAqC;AACzC,UAAQ,IAAR;AACE,SAAK,KAAL;AACE,aAAO,IAAI,CAAC,GAAZ;;AACF,SAAK,MAAL;AACE,aAAO,IAAI,CAAC,IAAZ;;AACF,SAAK,OAAL;AACE,aAAO,IAAI,CAAC,KAAZ;;AACF,SAAK,QAAL;AACE,aAAO,IAAI,CAAC,MAAZ;;AAEF;AACE,YAAM,IAAI,KAAJ,CAAU,oBAAoB,IAAI,EAAlC,CAAN;AAXJ;AAaD,C","sourcesContent":["export enum Arch {\n ia32, x64, armv7l, arm64\n}\n\nexport type ArchType = \"x64\" | \"ia32\" | \"armv7l\" | \"arm64\"\n\nexport function toLinuxArchString(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"amd64\"\n case Arch.ia32:\n return \"i386\"\n case Arch.armv7l:\n return \"armv7l\"\n case Arch.arm64:\n return \"arm64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n\nexport function getArchCliNames(): Array {\n return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]]\n}\n\nexport function getArchSuffix(arch: Arch): string {\n return arch === Arch.x64 ? \"\" : `-${Arch[arch]}`\n}\n\nexport function archFromString(name: string): Arch {\n switch (name) {\n case \"x64\":\n return Arch.x64\n case \"ia32\":\n return Arch.ia32\n case \"arm64\":\n return Arch.arm64\n case \"armv7l\":\n return Arch.armv7l\n\n default:\n throw new Error(`Unsupported arch ${name}`)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/asyncTaskManager.d.ts b/node_modules/builder-util/out/asyncTaskManager.d.ts deleted file mode 100644 index becc1fe..0000000 --- a/node_modules/builder-util/out/asyncTaskManager.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CancellationToken } from "builder-util-runtime"; -export declare class AsyncTaskManager { - private readonly cancellationToken; - readonly tasks: Array>; - private readonly errors; - constructor(cancellationToken: CancellationToken); - add(task: () => Promise): void; - addTask(promise: Promise): void; - cancelTasks(): void; - awaitTasks(): Promise>; -} diff --git a/node_modules/builder-util/out/asyncTaskManager.js b/node_modules/builder-util/out/asyncTaskManager.js deleted file mode 100644 index e28b761..0000000 --- a/node_modules/builder-util/out/asyncTaskManager.js +++ /dev/null @@ -1,145 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AsyncTaskManager = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _log() { - const data = require("./log"); - - _log = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("./promise"); - - _promise = function () { - return data; - }; - - return data; -} - -class AsyncTaskManager { - constructor(cancellationToken) { - this.cancellationToken = cancellationToken; - this.tasks = []; - this.errors = []; - } - - add(task) { - if (this.cancellationToken == null || !this.cancellationToken.cancelled) { - this.addTask(task()); - } - } - - addTask(promise) { - if (this.cancellationToken.cancelled) { - _log().log.debug({ - reason: "cancelled", - stack: new Error().stack - }, "async task not added"); - - if ("cancel" in promise) { - promise.cancel(); - } - - return; - } - - this.tasks.push(promise.catch(it => { - _log().log.debug({ - error: it.message || it.toString() - }, "async task error"); - - this.errors.push(it); - return Promise.resolve(null); - })); - } - - cancelTasks() { - for (const task of this.tasks) { - if ("cancel" in task) { - task.cancel(); - } - } - - this.tasks.length = 0; - } - - awaitTasks() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (_this.cancellationToken.cancelled) { - _this.cancelTasks(); - - return []; - } - - const checkErrors = () => { - if (_this.errors.length > 0) { - _this.cancelTasks(); - - throwError(_this.errors); - return; - } - }; - - checkErrors(); - let result = null; - const tasks = _this.tasks; - let list = tasks.slice(); - tasks.length = 0; - - while (list.length > 0) { - const subResult = yield Promise.all(list); - result = result == null ? subResult : result.concat(subResult); - checkErrors(); - - if (tasks.length === 0) { - break; - } else { - if (_this.cancellationToken.cancelled) { - _this.cancelTasks(); - - return []; - } - - list = tasks.slice(); - tasks.length = 0; - } - } - - return result || []; - })(); - } - -} - -exports.AsyncTaskManager = AsyncTaskManager; - -function throwError(errors) { - if (errors.length === 1) { - throw errors[0]; - } else if (errors.length > 1) { - throw new (_promise().NestedError)(errors, "Cannot cleanup: "); - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=asyncTaskManager.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/asyncTaskManager.js.map b/node_modules/builder-util/out/asyncTaskManager.js.map deleted file mode 100644 index d68d1ef..0000000 --- a/node_modules/builder-util/out/asyncTaskManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/asyncTaskManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,gBAAP,CAAuB;AAI3B,EAAA,WAAA,CAA6B,iBAA7B,EAAiE;AAApC,SAAA,iBAAA,GAAA,iBAAA;AAHpB,SAAA,KAAA,GAA6B,EAA7B;AACQ,SAAA,MAAA,GAAuB,EAAvB;AAGhB;;AAED,EAAA,GAAG,CAAC,IAAD,EAAyB;AAC1B,QAAI,KAAK,iBAAL,IAA0B,IAA1B,IAAkC,CAAC,KAAK,iBAAL,CAAuB,SAA9D,EAAyE;AACvE,WAAK,OAAL,CAAa,IAAI,EAAjB;AACD;AACF;;AAED,EAAA,OAAO,CAAC,OAAD,EAAsB;AAC3B,QAAI,KAAK,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,iBAAI,KAAJ,CAAU;AAAC,QAAA,MAAM,EAAE,WAAT;AAAsB,QAAA,KAAK,EAAE,IAAI,KAAJ,GAAY;AAAzC,OAAV,EAA2D,sBAA3D;;AACA,UAAI,YAAY,OAAhB,EAAyB;AACtB,QAAA,OAAe,CAAC,MAAhB;AACF;;AACD;AACD;;AAED,SAAK,KAAL,CAAW,IAAX,CAAgB,OAAO,CACpB,KADa,CACP,EAAE,IAAG;AACV,iBAAI,KAAJ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,MAGK;AACH,cAAI,KAAI,CAAC,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,YAAA,KAAI,CAAC,WAAL;;AACA,mBAAO,EAAP;AACD;;AAED,UAAA,IAAI,GAAG,KAAK,CAAC,KAAN,EAAP;AACA,UAAA,KAAK,CAAC,MAAN,GAAe,CAAf;AACD;AACF;;AACD,aAAO,MAAM,IAAI,EAAjB;AArCc;AAsCf;;AA7E0B;;;;AAgF7B,SAAS,UAAT,CAAoB,MAApB,EAAwC;AACtC,MAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AACvB,UAAM,MAAM,CAAC,CAAD,CAAZ;AACD,GAFD,MAGK,IAAI,MAAM,CAAC,MAAP,GAAgB,CAApB,EAAuB;AAC1B,UAAM,KAAI,sBAAJ,EAAgB,MAAhB,EAAwB,kBAAxB,CAAN;AACD;AACF,C","sourcesContent":["import { CancellationToken } from \"builder-util-runtime\"\nimport { log } from \"./log\"\nimport { NestedError } from \"./promise\"\n\nexport class AsyncTaskManager {\n readonly tasks: Array> = []\n private readonly errors: Array = []\n\n constructor(private readonly cancellationToken: CancellationToken) {\n }\n\n add(task: () => Promise) {\n if (this.cancellationToken == null || !this.cancellationToken.cancelled) {\n this.addTask(task())\n }\n }\n\n addTask(promise: Promise) {\n if (this.cancellationToken.cancelled) {\n log.debug({reason: \"cancelled\", stack: new Error().stack}, \"async task not added\")\n if (\"cancel\" in promise) {\n (promise as any).cancel()\n }\n return\n }\n\n this.tasks.push(promise\n .catch(it => {\n log.debug({error: it.message || it.toString()}, \"async task error\")\n this.errors.push(it)\n return Promise.resolve(null)\n }))\n }\n\n cancelTasks() {\n for (const task of this.tasks) {\n if (\"cancel\" in task) {\n (task as any).cancel()\n }\n }\n this.tasks.length = 0\n }\n\n async awaitTasks(): Promise> {\n if (this.cancellationToken.cancelled) {\n this.cancelTasks()\n return []\n }\n\n const checkErrors = () => {\n if (this.errors.length > 0) {\n this.cancelTasks()\n throwError(this.errors)\n return\n }\n }\n\n checkErrors()\n\n let result: Array | null = null\n const tasks = this.tasks\n let list = tasks.slice()\n tasks.length = 0\n while (list.length > 0) {\n const subResult = await Promise.all(list)\n result = result == null ? subResult : result.concat(subResult)\n checkErrors()\n if (tasks.length === 0) {\n break\n }\n else {\n if (this.cancellationToken.cancelled) {\n this.cancelTasks()\n return []\n }\n\n list = tasks.slice()\n tasks.length = 0\n }\n }\n return result || []\n }\n}\n\nfunction throwError(errors: Array) {\n if (errors.length === 1) {\n throw errors[0]\n }\n else if (errors.length > 1) {\n throw new NestedError(errors, \"Cannot cleanup: \")\n }\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/deepAssign.d.ts b/node_modules/builder-util/out/deepAssign.d.ts deleted file mode 100644 index d48681b..0000000 --- a/node_modules/builder-util/out/deepAssign.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function deepAssign(target: T, ...objects: Array): T; diff --git a/node_modules/builder-util/out/deepAssign.js b/node_modules/builder-util/out/deepAssign.js deleted file mode 100644 index 9efa896..0000000 --- a/node_modules/builder-util/out/deepAssign.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.deepAssign = deepAssign; - -function isObject(x) { - if (Array.isArray(x)) { - return false; - } - - const type = typeof x; - return type === "object" || type === "function"; -} - -function assignKey(target, from, key) { - const value = from[key]; // https://github.com/electron-userland/electron-builder/pull/562 - - if (value === undefined) { - return; - } - - const prevValue = target[key]; - - if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) { - target[key] = value; - } else { - target[key] = assign(prevValue, value); - } -} - -function assign(to, from) { - if (to !== from) { - for (const key of Object.getOwnPropertyNames(from)) { - assignKey(to, from, key); - } - } - - return to; -} - -function deepAssign(target, ...objects) { - for (const o of objects) { - if (o != null) { - assign(target, o); - } - } - - return target; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=deepAssign.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/deepAssign.js.map b/node_modules/builder-util/out/deepAssign.js.map deleted file mode 100644 index 60f5cd7..0000000 --- a/node_modules/builder-util/out/deepAssign.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/deepAssign.ts"],"names":[],"mappings":";;;;;;;AAAA,SAAS,QAAT,CAAkB,CAAlB,EAAwB;AACtB,MAAI,KAAK,CAAC,OAAN,CAAc,CAAd,CAAJ,EAAsB;AACpB,WAAO,KAAP;AACD;;AAED,QAAM,IAAI,GAAG,OAAO,CAApB;AACA,SAAO,IAAI,KAAK,QAAT,IAAqB,IAAI,KAAK,UAArC;AACD;;AAED,SAAS,SAAT,CAAmB,MAAnB,EAAgC,IAAhC,EAA2C,GAA3C,EAAsD;AACpD,QAAM,KAAK,GAAG,IAAI,CAAC,GAAD,CAAlB,CADoD,CAEpD;;AACA,MAAI,KAAK,KAAK,SAAd,EAAyB;AACvB;AACD;;AAED,QAAM,SAAS,GAAG,MAAM,CAAC,GAAD,CAAxB;;AACA,MAAI,SAAS,IAAI,IAAb,IAAqB,KAAK,IAAI,IAA9B,IAAsC,CAAC,QAAQ,CAAC,SAAD,CAA/C,IAA8D,CAAC,QAAQ,CAAC,KAAD,CAA3E,EAAoF;AAClF,IAAA,MAAM,CAAC,GAAD,CAAN,GAAc,KAAd;AACD,GAFD,MAGK;AACH,IAAA,MAAM,CAAC,GAAD,CAAN,GAAc,MAAM,CAAC,SAAD,EAAY,KAAZ,CAApB;AACD;AACF;;AAED,SAAS,MAAT,CAAgB,EAAhB,EAAyB,IAAzB,EAAkC;AAChC,MAAI,EAAE,KAAK,IAAX,EAAiB;AACf,SAAK,MAAM,GAAX,IAAkB,MAAM,CAAC,mBAAP,CAA2B,IAA3B,CAAlB,EAAoD;AAClD,MAAA,SAAS,CAAC,EAAD,EAAK,IAAL,EAAW,GAAX,CAAT;AACD;AACF;;AACD,SAAO,EAAP;AACD;;AAEK,SAAU,UAAV,CAAwB,MAAxB,EAAmC,GAAG,OAAtC,EAAyD;AAC7D,OAAK,MAAM,CAAX,IAAgB,OAAhB,EAAyB;AACvB,QAAI,CAAC,IAAI,IAAT,EAAe;AACb,MAAA,MAAM,CAAC,MAAD,EAAS,CAAT,CAAN;AACD;AACF;;AACD,SAAO,MAAP;AACD,C","sourcesContent":["function isObject(x: any) {\n if (Array.isArray(x)) {\n return false\n }\n\n const type = typeof x\n return type === \"object\" || type === \"function\"\n}\n\nfunction assignKey(target: any, from: any, key: string) {\n const value = from[key]\n // https://github.com/electron-userland/electron-builder/pull/562\n if (value === undefined) {\n return\n }\n\n const prevValue = target[key]\n if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {\n target[key] = value\n }\n else {\n target[key] = assign(prevValue, value)\n }\n}\n\nfunction assign(to: any, from: any) {\n if (to !== from) {\n for (const key of Object.getOwnPropertyNames(from)) {\n assignKey(to, from, key)\n }\n }\n return to\n}\n\nexport function deepAssign(target: T, ...objects: Array): T {\n for (const o of objects) {\n if (o != null) {\n assign(target, o)\n }\n }\n return target\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/fs.d.ts b/node_modules/builder-util/out/fs.d.ts deleted file mode 100644 index d4c28b9..0000000 --- a/node_modules/builder-util/out/fs.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/// -import { Stats } from "fs-extra-p"; -export declare const MAX_FILE_REQUESTS = 8; -export declare const CONCURRENCY: { - concurrency: number; -}; -export declare type AfterCopyFileTransformer = (file: string) => Promise; -export declare class CopyFileTransformer { - readonly afterCopyTransformer: AfterCopyFileTransformer; - constructor(afterCopyTransformer: AfterCopyFileTransformer); -} -export declare type FileTransformer = (file: string) => Promise | null | string | Buffer | CopyFileTransformer; -export declare type Filter = (file: string, stat: Stats) => boolean; -export declare function unlinkIfExists(file: string): Promise; -export declare function statOrNull(file: string): Promise; -export declare function exists(file: string): Promise; -export interface FileConsumer { - consume(file: string, fileStat: Stats, parent: string, siblingNames: Array): any; - /** - * @default false - */ - isIncludeDir?: boolean; -} -/** - * Returns list of file paths (system-dependent file separator) - */ -export declare function walk(initialDirPath: string, filter?: Filter | null, consumer?: FileConsumer): Promise>; -export declare function copyFile(src: string, dest: string, isEnsureDir?: boolean): Promise; -/** - * Hard links is used if supported and allowed. - * File permission is fixed — allow execute for all if owner can, allow read for all if owner can. - * - * ensureDir is not called, dest parent dir must exists - */ -export declare function copyOrLinkFile(src: string, dest: string, stats?: Stats | null, isUseHardLink?: boolean, exDevErrorHandler?: (() => boolean) | null): Promise; -export declare class FileCopier { - private readonly isUseHardLinkFunction?; - private readonly transformer?; - isUseHardLink: boolean; - constructor(isUseHardLinkFunction?: ((file: string) => boolean) | null | undefined, transformer?: FileTransformer | null | undefined); - copy(src: string, dest: string, stat: Stats | undefined): Promise; -} -export interface CopyDirOptions { - filter?: Filter | null; - transformer?: FileTransformer | null; - isUseHardLink?: ((file: string) => boolean) | null; -} -/** - * Empty directories is never created. - * Hard links is used if supported and allowed. - */ -export declare function copyDir(src: string, destination: string, options?: CopyDirOptions): Promise; -export declare const DO_NOT_USE_HARD_LINKS: (file: string) => boolean; -export declare const USE_HARD_LINKS: (file: string) => boolean; -export interface Link { - readonly link: string; - readonly file: string; -} diff --git a/node_modules/builder-util/out/fs.js b/node_modules/builder-util/out/fs.js deleted file mode 100644 index 713dbb6..0000000 --- a/node_modules/builder-util/out/fs.js +++ /dev/null @@ -1,427 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.unlinkIfExists = unlinkIfExists; -exports.statOrNull = statOrNull; -exports.exists = exists; -exports.walk = walk; -exports.copyFile = copyFile; -exports.copyOrLinkFile = copyOrLinkFile; -exports.copyDir = copyDir; -exports.USE_HARD_LINKS = exports.DO_NOT_USE_HARD_LINKS = exports.FileCopier = exports.CopyFileTransformer = exports.CONCURRENCY = exports.MAX_FILE_REQUESTS = void 0; - -function _bluebirdLst() { - const data = _interopRequireWildcard(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _statMode() { - const data = _interopRequireDefault(require("stat-mode")); - - _statMode = function () { - return data; - }; - - return data; -} - -function _log() { - const data = require("./log"); - - _log = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("./promise"); - - _promise = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const MAX_FILE_REQUESTS = 8; -exports.MAX_FILE_REQUESTS = MAX_FILE_REQUESTS; -const CONCURRENCY = { - concurrency: MAX_FILE_REQUESTS -}; -exports.CONCURRENCY = CONCURRENCY; - -class CopyFileTransformer { - constructor(afterCopyTransformer) { - this.afterCopyTransformer = afterCopyTransformer; - } - -} - -exports.CopyFileTransformer = CopyFileTransformer; - -function unlinkIfExists(file) { - return (0, _fsExtraP().unlink)(file).catch(() => {}); -} - -function statOrNull(_x) { - return _statOrNull.apply(this, arguments); -} - -function _statOrNull() { - _statOrNull = (0, _bluebirdLst().coroutine)(function* (file) { - return (0, _promise().orNullIfFileNotExist)((0, _fsExtraP().stat)(file)); - }); - return _statOrNull.apply(this, arguments); -} - -function exists(_x2) { - return _exists.apply(this, arguments); -} -/** - * Returns list of file paths (system-dependent file separator) - */ - - -function _exists() { - _exists = (0, _bluebirdLst().coroutine)(function* (file) { - try { - yield (0, _fsExtraP().access)(file); - return true; - } catch (e) { - return false; - } - }); - return _exists.apply(this, arguments); -} - -function walk(_x3, _x4, _x5) { - return _walk.apply(this, arguments); -} - -function _walk() { - _walk = (0, _bluebirdLst().coroutine)(function* (initialDirPath, filter, consumer) { - let result = []; - const queue = [initialDirPath]; - let addDirToResult = false; - const isIncludeDir = consumer == null ? false : consumer.isIncludeDir === true; - - while (queue.length > 0) { - const dirPath = queue.pop(); - - if (isIncludeDir) { - if (addDirToResult) { - result.push(dirPath); - } else { - addDirToResult = true; - } - } - - const childNames = yield (0, _fsExtraP().readdir)(dirPath); - childNames.sort(); - let nodeModuleContent = null; - const dirs = []; // our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map - - const sortedFilePaths = yield _bluebirdLst().default.map(childNames, name => { - if (name === ".DS_Store" || name === ".gitkeep") { - return null; - } - - const filePath = dirPath + path.sep + name; - return (0, _fsExtraP().lstat)(filePath).then(stat => { - if (filter != null && !filter(filePath, stat)) { - return null; - } - - const consumerResult = consumer == null ? null : consumer.consume(filePath, stat, dirPath, childNames); - - if (consumerResult === false) { - return null; - } else if (consumerResult == null || !("then" in consumerResult)) { - if (stat.isDirectory()) { - dirs.push(name); - return null; - } else { - return filePath; - } - } else { - return consumerResult.then(it => { - if (it != null && Array.isArray(it)) { - nodeModuleContent = it; - return null; - } // asarUtil can return modified stat (symlink handling) - - - if ((it != null && "isDirectory" in it ? it : stat).isDirectory()) { - dirs.push(name); - return null; - } else { - return filePath; - } - }); - } - }); - }, CONCURRENCY); - - for (const child of sortedFilePaths) { - if (child != null) { - result.push(child); - } - } - - dirs.sort(); - - for (const child of dirs) { - queue.push(dirPath + path.sep + child); - } - - if (nodeModuleContent != null) { - result = result.concat(nodeModuleContent); - } - } - - return result; - }); - return _walk.apply(this, arguments); -} - -const _isUseHardLink = process.platform !== "win32" && process.env.USE_HARD_LINKS !== "false" && (require("is-ci") || process.env.USE_HARD_LINKS === "true"); - -function copyFile(src, dest, isEnsureDir = true) { - return (isEnsureDir ? (0, _fsExtraP().ensureDir)(path.dirname(dest)) : Promise.resolve()).then(() => copyOrLinkFile(src, dest, null, false)); -} -/** - * Hard links is used if supported and allowed. - * File permission is fixed — allow execute for all if owner can, allow read for all if owner can. - * - * ensureDir is not called, dest parent dir must exists - */ - - -function copyOrLinkFile(src, dest, stats, isUseHardLink, exDevErrorHandler) { - if (isUseHardLink === undefined) { - isUseHardLink = _isUseHardLink; - } - - if (stats != null) { - const originalModeNumber = stats.mode; - const mode = new (_statMode().default)(stats); - - if (mode.owner.execute) { - mode.group.execute = true; - mode.others.execute = true; - } - - mode.group.read = true; - mode.others.read = true; - - if (originalModeNumber !== stats.mode) { - if (_log().log.isDebugEnabled) { - const oldMode = new (_statMode().default)({ - mode: originalModeNumber - }); - - _log().log.debug({ - file: dest, - oldMode, - mode - }, "permissions fixed from"); - } // https://helgeklein.com/blog/2009/05/hard-links-and-permissions-acls/ - // Permissions on all hard links to the same data on disk are always identical. The same applies to attributes. - // That means if you change the permissions/owner/attributes on one hard link, you will immediately see the changes on all other hard links. - - - if (isUseHardLink) { - isUseHardLink = false; - - _log().log.debug({ - dest - }, "copied, but not linked, because file permissions need to be fixed"); - } - } - } - - if (isUseHardLink) { - return (0, _fsExtraP().link)(src, dest).catch(e => { - if (e.code === "EXDEV") { - const isLog = exDevErrorHandler == null ? true : exDevErrorHandler(); - - if (isLog && _log().log.isDebugEnabled) { - _log().log.debug({ - error: e.message - }, "cannot copy using hard link"); - } - - return doCopyFile(src, dest, stats); - } else { - throw e; - } - }); - } - - return doCopyFile(src, dest, stats); -} - -function doCopyFile(src, dest, stats) { - if (_fsExtraP().copyFile == null) { - return new Promise((resolve, reject) => { - const reader = (0, _fsExtraP().createReadStream)(src); - const writer = (0, _fsExtraP().createWriteStream)(dest, stats == null ? undefined : { - mode: stats.mode - }); - reader.on("error", reject); - writer.on("error", reject); - writer.on("open", () => { - reader.pipe(writer); - }); - writer.once("close", resolve); - }); - } // node 8.5.0+ - - - const promise = (0, _fsExtraP().copyFile)(src, dest); - - if (stats == null) { - return promise; - } - - return promise.then(() => (0, _fsExtraP().chmod)(dest, stats.mode)); -} - -class FileCopier { - constructor(isUseHardLinkFunction, transformer) { - this.isUseHardLinkFunction = isUseHardLinkFunction; - this.transformer = transformer; - - if (isUseHardLinkFunction === USE_HARD_LINKS) { - this.isUseHardLink = true; - } else { - this.isUseHardLink = _isUseHardLink && isUseHardLinkFunction !== DO_NOT_USE_HARD_LINKS; - } - } - - copy(src, dest, stat) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - let afterCopyTransformer = null; - - if (_this.transformer != null && stat != null && stat.isFile()) { - let data = _this.transformer(src); - - if (data != null) { - if (typeof data === "object" && "then" in data) { - data = yield data; - } - - if (data != null) { - if (data instanceof CopyFileTransformer) { - afterCopyTransformer = data.afterCopyTransformer; - } else { - yield (0, _fsExtraP().writeFile)(dest, data); - return; - } - } - } - } - - const isUseHardLink = afterCopyTransformer == null && (!_this.isUseHardLink || _this.isUseHardLinkFunction == null ? _this.isUseHardLink : _this.isUseHardLinkFunction(dest)); - yield copyOrLinkFile(src, dest, stat, isUseHardLink, isUseHardLink ? () => { - // files are copied concurrently, so, we must not check here currentIsUseHardLink — our code can be executed after that other handler will set currentIsUseHardLink to false - if (_this.isUseHardLink) { - _this.isUseHardLink = false; - return true; - } else { - return false; - } - } : null); - - if (afterCopyTransformer != null) { - yield afterCopyTransformer(dest); - } - })(); - } - -} -/** - * Empty directories is never created. - * Hard links is used if supported and allowed. - */ - - -exports.FileCopier = FileCopier; - -function copyDir(src, destination, options = {}) { - const fileCopier = new FileCopier(options.isUseHardLink, options.transformer); - - if (_log().log.isDebugEnabled) { - _log().log.debug({ - src, - destination - }, `copying${fileCopier.isUseHardLink ? " using hard links" : ""}`); - } - - const createdSourceDirs = new Set(); - const links = []; - return walk(src, options.filter, { - consume: function () { - var _ref = (0, _bluebirdLst().coroutine)(function* (file, stat, parent) { - if (!stat.isFile() && !stat.isSymbolicLink()) { - return; - } - - if (!createdSourceDirs.has(parent)) { - yield (0, _fsExtraP().ensureDir)(parent.replace(src, destination)); - createdSourceDirs.add(parent); - } - - const destFile = file.replace(src, destination); - - if (stat.isFile()) { - yield fileCopier.copy(file, destFile, stat); - } else { - links.push({ - file: destFile, - link: yield (0, _fsExtraP().readlink)(file) - }); - } - }); - - return function consume(_x6, _x7, _x8) { - return _ref.apply(this, arguments); - }; - }() - }).then(() => _bluebirdLst().default.map(links, it => (0, _fsExtraP().symlink)(it.link, it.file), CONCURRENCY)); -} - -const DO_NOT_USE_HARD_LINKS = file => false; - -exports.DO_NOT_USE_HARD_LINKS = DO_NOT_USE_HARD_LINKS; - -const USE_HARD_LINKS = file => true; exports.USE_HARD_LINKS = USE_HARD_LINKS; -// __ts-babel@6.0.4 -//# sourceMappingURL=fs.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/fs.js.map b/node_modules/builder-util/out/fs.js.map deleted file mode 100644 index 43e46d3..0000000 --- a/node_modules/builder-util/out/fs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEO,MAAM,iBAAiB,GAAG,CAA1B;;AACA,MAAM,WAAW,GAAG;AAAC,EAAA,WAAW,EAAE;AAAd,CAApB;;;AAID,MAAO,mBAAP,CAA0B;AAC9B,EAAA,WAAA,CAA4B,oBAA5B,EAA0E;AAA9C,SAAA,oBAAA,GAAA,oBAAA;AAC3B;;AAF6B;;;;AAQ1B,SAAU,cAAV,CAAyB,IAAzB,EAAqC;AACzC,SAAO,wBAAO,IAAP,EACJ,KADI,CACE,MAAK,CAAe,CADtB,CAAP;AAED;;SAEqB,U;;;;;8CAAf,WAA0B,IAA1B,EAAsC;AAC3C,WAAO,qCAAqB,sBAAK,IAAL,CAArB,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;AAEM,MAAM,qBAAqB,GAAI,IAAD,IAAkB,KAAhD;;;;AACA,MAAM,cAAc,GAAI,IAAD,IAAkB,IAAzC,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { access, chmod, copyFile as _nodeCopyFile, createReadStream, createWriteStream, ensureDir, link, lstat, readdir, readlink, stat, Stats, symlink, unlink, writeFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport Mode from \"stat-mode\"\nimport { log } from \"./log\"\nimport { orNullIfFileNotExist } from \"./promise\"\n\nexport const MAX_FILE_REQUESTS = 8\nexport const CONCURRENCY = {concurrency: MAX_FILE_REQUESTS}\n\nexport type AfterCopyFileTransformer = (file: string) => Promise\n\nexport class CopyFileTransformer {\n constructor(public readonly afterCopyTransformer: AfterCopyFileTransformer) {\n }\n}\n\nexport type FileTransformer = (file: string) => Promise | null | string | Buffer | CopyFileTransformer\nexport type Filter = (file: string, stat: Stats) => boolean\n\nexport function unlinkIfExists(file: string) {\n return unlink(file)\n .catch(() => {/* ignore */})\n}\n\nexport async function statOrNull(file: string): Promise {\n return orNullIfFileNotExist(stat(file))\n}\n\nexport async function exists(file: string): Promise {\n try {\n await access(file)\n return true\n }\n catch (e) {\n return false\n }\n}\n\nexport interface FileConsumer {\n consume(file: string, fileStat: Stats, parent: string, siblingNames: Array): any\n\n /**\n * @default false\n */\n isIncludeDir?: boolean\n}\n\n/**\n * Returns list of file paths (system-dependent file separator)\n */\nexport async function walk(initialDirPath: string, filter?: Filter | null, consumer?: FileConsumer): Promise> {\n let result: Array = []\n const queue: Array = [initialDirPath]\n let addDirToResult = false\n const isIncludeDir = consumer == null ? false : consumer.isIncludeDir === true\n while (queue.length > 0) {\n const dirPath = queue.pop()!\n if (isIncludeDir) {\n if (addDirToResult) {\n result.push(dirPath)\n }\n else {\n addDirToResult = true\n }\n }\n\n const childNames = await readdir(dirPath)\n childNames.sort()\n\n let nodeModuleContent: Array | null = null\n\n const dirs: Array = []\n // our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map\n const sortedFilePaths = await BluebirdPromise.map(childNames, name => {\n if (name === \".DS_Store\" || name === \".gitkeep\") {\n return null\n }\n\n const filePath = dirPath + path.sep + name\n return lstat(filePath)\n .then(stat => {\n if (filter != null && !filter(filePath, stat)) {\n return null\n }\n\n const consumerResult = consumer == null ? null : consumer.consume(filePath, stat, dirPath, childNames)\n if (consumerResult === false) {\n return null\n }\n else if (consumerResult == null || !(\"then\" in consumerResult)) {\n if (stat.isDirectory()) {\n dirs.push(name)\n return null\n }\n else {\n return filePath\n }\n }\n else {\n return (consumerResult as Promise)\n .then((it): any => {\n if (it != null && Array.isArray(it)) {\n nodeModuleContent = it\n return null\n }\n\n // asarUtil can return modified stat (symlink handling)\n if ((it != null && \"isDirectory\" in it ? (it as Stats) : stat).isDirectory()) {\n dirs.push(name)\n return null\n }\n else {\n return filePath\n }\n })\n }\n })\n }, CONCURRENCY)\n\n for (const child of sortedFilePaths) {\n if (child != null) {\n result.push(child)\n }\n }\n\n dirs.sort()\n for (const child of dirs) {\n queue.push(dirPath + path.sep + child)\n }\n\n if (nodeModuleContent != null) {\n result = result.concat(nodeModuleContent)\n }\n }\n\n return result\n}\n\nconst _isUseHardLink = process.platform !== \"win32\" && process.env.USE_HARD_LINKS !== \"false\" && (require(\"is-ci\") || process.env.USE_HARD_LINKS === \"true\")\n\nexport function copyFile(src: string, dest: string, isEnsureDir = true) {\n return (isEnsureDir ? ensureDir(path.dirname(dest)) : Promise.resolve())\n .then(() => copyOrLinkFile(src, dest, null, false))\n}\n\n/**\n * Hard links is used if supported and allowed.\n * File permission is fixed — allow execute for all if owner can, allow read for all if owner can.\n *\n * ensureDir is not called, dest parent dir must exists\n */\nexport function copyOrLinkFile(src: string, dest: string, stats?: Stats | null, isUseHardLink?: boolean, exDevErrorHandler?: (() => boolean) | null): Promise {\n if (isUseHardLink === undefined) {\n isUseHardLink = _isUseHardLink\n }\n\n if (stats != null) {\n const originalModeNumber = stats.mode\n const mode = new Mode(stats)\n if (mode.owner.execute) {\n mode.group.execute = true\n mode.others.execute = true\n }\n\n mode.group.read = true\n mode.others.read = true\n\n if (originalModeNumber !== stats.mode) {\n if (log.isDebugEnabled) {\n const oldMode = new Mode({mode: originalModeNumber})\n log.debug({file: dest, oldMode, mode}, \"permissions fixed from\")\n }\n\n // https://helgeklein.com/blog/2009/05/hard-links-and-permissions-acls/\n // Permissions on all hard links to the same data on disk are always identical. The same applies to attributes.\n // That means if you change the permissions/owner/attributes on one hard link, you will immediately see the changes on all other hard links.\n if (isUseHardLink) {\n isUseHardLink = false\n log.debug({dest}, \"copied, but not linked, because file permissions need to be fixed\")\n }\n }\n }\n\n if (isUseHardLink) {\n return link(src, dest)\n .catch(e => {\n if (e.code === \"EXDEV\") {\n const isLog = exDevErrorHandler == null ? true : exDevErrorHandler()\n if (isLog && log.isDebugEnabled) {\n log.debug({error: e.message}, \"cannot copy using hard link\")\n }\n return doCopyFile(src, dest, stats)\n }\n else {\n throw e\n }\n })\n }\n return doCopyFile(src, dest, stats)\n}\n\nfunction doCopyFile(src: string, dest: string, stats: Stats | null | undefined): Promise {\n if (_nodeCopyFile == null) {\n return new Promise((resolve, reject) => {\n const reader = createReadStream(src)\n const writer = createWriteStream(dest, stats == null ? undefined : {mode: stats!!.mode})\n reader.on(\"error\", reject)\n writer.on(\"error\", reject)\n writer.on(\"open\", () => {\n reader.pipe(writer)\n })\n writer.once(\"close\", resolve)\n })\n }\n\n // node 8.5.0+\n const promise = _nodeCopyFile(src, dest)\n if (stats == null) {\n return promise\n }\n\n return promise\n .then(() => chmod(dest, stats.mode))\n}\n\nexport class FileCopier {\n isUseHardLink: boolean\n\n constructor(private readonly isUseHardLinkFunction?: ((file: string) => boolean) | null, private readonly transformer?: FileTransformer | null) {\n if (isUseHardLinkFunction === USE_HARD_LINKS) {\n this.isUseHardLink = true\n }\n else {\n this.isUseHardLink = _isUseHardLink && isUseHardLinkFunction !== DO_NOT_USE_HARD_LINKS\n }\n }\n\n async copy(src: string, dest: string, stat: Stats | undefined) {\n let afterCopyTransformer: AfterCopyFileTransformer | null = null\n if (this.transformer != null && stat != null && stat.isFile()) {\n let data = this.transformer(src)\n if (data != null) {\n if (typeof data === \"object\" && \"then\" in data) {\n data = await data\n }\n\n if (data != null) {\n if (data instanceof CopyFileTransformer) {\n afterCopyTransformer = data.afterCopyTransformer\n }\n else {\n await writeFile(dest, data)\n return\n }\n }\n }\n }\n\n const isUseHardLink = afterCopyTransformer == null && ((!this.isUseHardLink || this.isUseHardLinkFunction == null) ? this.isUseHardLink : this.isUseHardLinkFunction(dest))\n await copyOrLinkFile(src, dest, stat, isUseHardLink, isUseHardLink ? () => {\n // files are copied concurrently, so, we must not check here currentIsUseHardLink — our code can be executed after that other handler will set currentIsUseHardLink to false\n if (this.isUseHardLink) {\n this.isUseHardLink = false\n return true\n }\n else {\n return false\n }\n } : null)\n\n if (afterCopyTransformer != null) {\n await afterCopyTransformer(dest)\n }\n }\n}\n\nexport interface CopyDirOptions {\n filter?: Filter | null\n transformer?: FileTransformer | null\n isUseHardLink?: ((file: string) => boolean) | null\n}\n\n/**\n * Empty directories is never created.\n * Hard links is used if supported and allowed.\n */\nexport function copyDir(src: string, destination: string, options: CopyDirOptions = {}): Promise {\n const fileCopier = new FileCopier(options.isUseHardLink, options.transformer)\n\n if (log.isDebugEnabled) {\n log.debug({src, destination}, `copying${fileCopier.isUseHardLink ? \" using hard links\" : \"\"}`)\n }\n\n const createdSourceDirs = new Set()\n const links: Array = []\n return walk(src, options.filter, {\n consume: async (file, stat, parent) => {\n if (!stat.isFile() && !stat.isSymbolicLink()) {\n return\n }\n\n if (!createdSourceDirs.has(parent)) {\n await ensureDir(parent.replace(src, destination))\n createdSourceDirs.add(parent)\n }\n\n const destFile = file.replace(src, destination)\n if (stat.isFile()) {\n await fileCopier.copy(file, destFile, stat)\n }\n else {\n links.push({file: destFile, link: await readlink(file)})\n }\n }\n })\n .then(() => BluebirdPromise.map(links, it => symlink(it.link, it.file), CONCURRENCY))\n}\n\nexport const DO_NOT_USE_HARD_LINKS = (file: string) => false\nexport const USE_HARD_LINKS = (file: string) => true\n\nexport interface Link {\n readonly link: string,\n readonly file: string\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/log.d.ts b/node_modules/builder-util/out/log.d.ts deleted file mode 100644 index 0e84dff..0000000 --- a/node_modules/builder-util/out/log.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// -import _debug from "debug"; -import WritableStream = NodeJS.WritableStream; -export declare const debug: _debug.IDebugger; -export interface Fields { - [index: string]: any; -} -export declare function setPrinter(value: ((message: string) => void) | null): void; -export declare type LogLevel = "info" | "warn" | "debug" | "notice" | "error"; -export declare const PADDING = 2; -export declare class Logger { - protected readonly stream: WritableStream; - constructor(stream: WritableStream); - messageTransformer: ((message: string, level: LogLevel) => string); - filePath(file: string): string; - readonly isDebugEnabled: boolean; - info(messageOrFields: Fields | null | string, message?: string): void; - notice(messageOrFields: Fields | null | string, message?: string): void; - warn(messageOrFields: Fields | null | string, message?: string): void; - debug(fields: Fields | null, message: string): void; - private doLog; - private _doLog; - static createMessage(message: string, fields: Fields | null, level: LogLevel, color: (it: string) => string, messagePadding?: number): string; - log(message: string): void; -} -export declare const log: Logger; diff --git a/node_modules/builder-util/out/log.js b/node_modules/builder-util/out/log.js deleted file mode 100644 index f1792b6..0000000 --- a/node_modules/builder-util/out/log.js +++ /dev/null @@ -1,152 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setPrinter = setPrinter; -exports.log = exports.Logger = exports.PADDING = exports.debug = void 0; - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} - -var _debug2 = _interopRequireDefault(require("debug")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -let printer = null; -const debug = (0, _debug2.default)("electron-builder"); -exports.debug = debug; - -function setPrinter(value) { - printer = value; -} - -const PADDING = 2; -exports.PADDING = PADDING; - -class Logger { - constructor(stream) { - this.stream = stream; - - this.messageTransformer = it => it; - } - - filePath(file) { - const cwd = process.cwd(); - return file.startsWith(cwd) ? file.substring(cwd.length + 1) : file; - } // noinspection JSMethodCanBeStatic - - - get isDebugEnabled() { - return debug.enabled; - } - - info(messageOrFields, message) { - this.doLog(message, messageOrFields, "info"); - } - - notice(messageOrFields, message) { - this.doLog(message, messageOrFields, "notice"); - } - - warn(messageOrFields, message) { - this.doLog(message, messageOrFields, "warn"); - } - - debug(fields, message) { - if (debug.enabled) { - this._doLog(message, fields, "debug"); - } - } - - doLog(message, messageOrFields, level) { - if (message === undefined) { - this._doLog(messageOrFields, null, level); - } else { - this._doLog(message, messageOrFields, level); - } - } - - _doLog(message, fields, level) { - // noinspection SuspiciousInstanceOfGuard - if (message instanceof Error) { - message = message.stack || message.toString(); - } else { - message = message.toString(); - } - - const levelIndicator = "•"; - const color = LEVEL_TO_COLOR[level]; - this.stream.write(`${" ".repeat(PADDING)}${color(levelIndicator)} `); - this.stream.write(Logger.createMessage(this.messageTransformer(message, level), fields, level, color, PADDING + 2 - /* level indicator and space */ - )); - this.stream.write("\n"); - } - - static createMessage(message, fields, level, color, messagePadding = 0) { - if (fields == null) { - return message; - } - - let text = message; - const fieldPadding = " ".repeat(Math.max(1, 16 - message.length)); - text += fieldPadding; - const fieldNames = Object.keys(fields); - let counter = 0; - - for (const name of fieldNames) { - let fieldValue = fields[name]; - let valuePadding = null; - - if (fieldValue != null && typeof fieldValue === "string" && fieldValue.includes("\n")) { - valuePadding = " ".repeat(messagePadding + message.length + fieldPadding.length + 2); - fieldValue = "\n" + valuePadding + fieldValue.replace(/\n/g, `\n${valuePadding}`); - } else if (Array.isArray(fieldValue)) { - fieldValue = JSON.stringify(fieldValue); - } else if (Array.isArray(fieldValue)) { - fieldValue = JSON.stringify(fieldValue); - } else if (typeof fieldValue === "object") {// fieldValue = safeStringifyJson(fieldValue) - } - - text += `${color(name)}=${fieldValue}`; - - if (++counter !== fieldNames.length) { - if (valuePadding == null) { - text += " "; - } else { - text += "\n" + valuePadding; - } - } - } - - return text; - } - - log(message) { - if (printer == null) { - this.stream.write(`${message}\n`); - } else { - printer(message); - } - } - -} - -exports.Logger = Logger; -const LEVEL_TO_COLOR = { - info: _chalk().default.blue, - notice: _chalk().default.yellow, - warn: _chalk().default.yellow, - debug: _chalk().default.white -}; -const log = new Logger(process.stdout); exports.log = log; -// __ts-babel@6.0.4 -//# sourceMappingURL=log.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/log.js.map b/node_modules/builder-util/out/log.js.map deleted file mode 100644 index 0acdb51..0000000 --- a/node_modules/builder-util/out/log.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/log.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAGA,IAAI,OAAO,GAAuC,IAAlD;AAEO,MAAM,KAAK,GAAG,qBAAO,kBAAP,CAAd;;;AAMD,SAAU,UAAV,CAAqB,KAArB,EAA8D;AAClE,EAAA,OAAO,GAAG,KAAV;AACD;;AAIM,MAAM,OAAO,GAAG,CAAhB;;;AAED,MAAO,MAAP,CAAa;AACjB,EAAA,WAAA,CAA+B,MAA/B,EAAqD;AAAtB,SAAA,MAAA,GAAA,MAAA;;AAG/B,SAAA,kBAAA,GAAqE,EAAE,IAAI,EAA3E;AAFC;;AAID,EAAA,QAAQ,CAAC,IAAD,EAAa;AACnB,UAAM,GAAG,GAAG,OAAO,CAAC,GAAR,EAAZ;AACA,WAAO,IAAI,CAAC,UAAL,CAAgB,GAAhB,IAAuB,IAAI,CAAC,SAAL,CAAe,GAAG,CAAC,MAAJ,GAAa,CAA5B,CAAvB,GAAwD,IAA/D;AACD,GATgB,CAWjB;;;AACA,MAAI,cAAJ,GAAkB;AAChB,WAAO,KAAK,CAAC,OAAb;AACD;;AAED,EAAA,IAAI,CAAC,eAAD,EAA0C,OAA1C,EAA0D;AAC5D,SAAK,KAAL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d,CAAJ,EAA+B;AAClC,QAAA,UAAU,GAAG,IAAI,CAAC,SAAL,CAAe,UAAf,CAAb;AACD,OAFI,MAGA,IAAI,OAAO,UAAP,KAAsB,QAA1B,EAAoC,CACvC;AACD;;AAED,MAAA,IAAI,IAAI,GAAG,KAAK,CAAC,IAAD,CAAM,IAAI,UAAU,EAApC;;AACA,UAAI,EAAE,OAAF,KAAc,UAAU,CAAC,MAA7B,EAAqC;AACnC,YAAI,YAAY,IAAI,IAApB,EAA0B;AACxB,UAAA,IAAI,IAAI,GAAR;AACD,SAFD,MAGK;AACH,UAAA,IAAI,IAAI,OAAO,YAAf;AACD;AACF;AACF;;AACD,WAAO,IAAP;AACD;;AAED,EAAA,GAAG,CAAC,OAAD,EAAgB;AACjB,QAAI,OAAO,IAAI,IAAf,EAAqB;AACnB,WAAK,MAAL,CAAY,KAAZ,CAAkB,GAAG,OAAO,IAA5B;AACD,KAFD,MAGK;AACH,MAAA,OAAO,CAAC,OAAD,CAAP;AACD;AACF;;AA5GgB;;;AA+GnB,MAAM,cAAc,GAA+B;AACjD,EAAA,IAAI,EAAE,iBAAM,IADqC;AAEjD,EAAA,MAAM,EAAE,iBAAM,MAFmC;AAGjD,EAAA,IAAI,EAAE,iBAAM,MAHqC;AAIjD,EAAA,KAAK,EAAE,iBAAM;AAJoC,CAAnD;AAOO,MAAM,GAAG,GAAG,IAAI,MAAJ,CAAW,OAAO,CAAC,MAAnB,CAAZ,C","sourcesContent":["import chalk, { Chalk } from \"chalk\"\nimport _debug from \"debug\"\nimport WritableStream = NodeJS.WritableStream\n\nlet printer: ((message: string) => void) | null = null\n\nexport const debug = _debug(\"electron-builder\")\n\nexport interface Fields {\n [index: string]: any\n}\n\nexport function setPrinter(value: ((message: string) => void) | null) {\n printer = value\n}\n\nexport type LogLevel = \"info\" | \"warn\" | \"debug\" | \"notice\" | \"error\"\n\nexport const PADDING = 2\n\nexport class Logger {\n constructor(protected readonly stream: WritableStream) {\n }\n\n messageTransformer: ((message: string, level: LogLevel) => string) = it => it\n\n filePath(file: string) {\n const cwd = process.cwd()\n return file.startsWith(cwd) ? file.substring(cwd.length + 1) : file\n }\n\n // noinspection JSMethodCanBeStatic\n get isDebugEnabled() {\n return debug.enabled\n }\n\n info(messageOrFields: Fields | null | string, message?: string) {\n this.doLog(message, messageOrFields, \"info\")\n }\n\n notice(messageOrFields: Fields | null | string, message?: string): void {\n this.doLog(message, messageOrFields, \"notice\")\n }\n\n warn(messageOrFields: Fields | null | string, message?: string): void {\n this.doLog(message, messageOrFields, \"warn\")\n }\n\n debug(fields: Fields | null, message: string) {\n if (debug.enabled) {\n this._doLog(message, fields, \"debug\")\n }\n }\n\n private doLog(message: string | undefined | Error, messageOrFields: Fields | null | string, level: LogLevel) {\n if (message === undefined) {\n this._doLog(messageOrFields as string, null, level)\n }\n else {\n this._doLog(message, messageOrFields as Fields | null, level)\n }\n }\n\n private _doLog(message: string | Error, fields: Fields | null, level: LogLevel) {\n // noinspection SuspiciousInstanceOfGuard\n if (message instanceof Error) {\n message = message.stack || message.toString()\n }\n else {\n message = message.toString()\n }\n\n const levelIndicator = \"•\"\n const color = LEVEL_TO_COLOR[level]\n this.stream.write(`${\" \".repeat(PADDING)}${color(levelIndicator)} `)\n this.stream.write(Logger.createMessage(this.messageTransformer(message, level), fields, level, color, PADDING + 2 /* level indicator and space */))\n this.stream.write(\"\\n\")\n }\n\n static createMessage(message: string, fields: Fields | null, level: LogLevel, color: (it: string) => string, messagePadding = 0): string {\n if (fields == null) {\n return message\n }\n\n let text = message\n\n const fieldPadding = \" \".repeat(Math.max(1, 16 - message.length))\n text += fieldPadding\n\n const fieldNames = Object.keys(fields)\n let counter = 0\n for (const name of fieldNames) {\n let fieldValue = fields[name]\n let valuePadding: string | null = null\n if (fieldValue != null && typeof fieldValue === \"string\" && fieldValue.includes(\"\\n\")) {\n valuePadding = \" \".repeat(messagePadding + message.length + fieldPadding.length + 2)\n fieldValue = \"\\n\" + valuePadding + fieldValue.replace(/\\n/g, `\\n${valuePadding}`)\n }\n else if (Array.isArray(fieldValue)) {\n fieldValue = JSON.stringify(fieldValue)\n }\n else if (Array.isArray(fieldValue)) {\n fieldValue = JSON.stringify(fieldValue)\n }\n else if (typeof fieldValue === \"object\") {\n // fieldValue = safeStringifyJson(fieldValue)\n }\n\n text += `${color(name)}=${fieldValue}`\n if (++counter !== fieldNames.length) {\n if (valuePadding == null) {\n text += \" \"\n }\n else {\n text += \"\\n\" + valuePadding\n }\n }\n }\n return text\n }\n\n log(message: string): void {\n if (printer == null) {\n this.stream.write(`${message}\\n`)\n }\n else {\n printer(message)\n }\n }\n}\n\nconst LEVEL_TO_COLOR: { [index: string]: Chalk } = {\n info: chalk.blue,\n notice: chalk.yellow,\n warn: chalk.yellow,\n debug: chalk.white,\n}\n\nexport const log = new Logger(process.stdout)"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/nodeHttpExecutor.d.ts b/node_modules/builder-util/out/nodeHttpExecutor.d.ts deleted file mode 100644 index ceab57c..0000000 --- a/node_modules/builder-util/out/nodeHttpExecutor.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { HttpExecutor } from "builder-util-runtime"; -import { ClientRequest } from "http"; -export declare class NodeHttpExecutor extends HttpExecutor { - createRequest(options: any, callback: (response: any) => void): any; -} -export declare const httpExecutor: NodeHttpExecutor; diff --git a/node_modules/builder-util/out/nodeHttpExecutor.js b/node_modules/builder-util/out/nodeHttpExecutor.js deleted file mode 100644 index fb8c82f..0000000 --- a/node_modules/builder-util/out/nodeHttpExecutor.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.httpExecutor = exports.NodeHttpExecutor = void 0; - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _http() { - const data = require("http"); - - _http = function () { - return data; - }; - - return data; -} - -function https() { - const data = _interopRequireWildcard(require("https")); - - https = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class NodeHttpExecutor extends _builderUtilRuntime().HttpExecutor { - // noinspection JSMethodCanBeStatic - // noinspection JSUnusedGlobalSymbols - createRequest(options, callback) { - return (options.protocol === "http:" ? _http().request : https().request)(options, callback); - } - -} - -exports.NodeHttpExecutor = NodeHttpExecutor; -const httpExecutor = new NodeHttpExecutor(); exports.httpExecutor = httpExecutor; -// __ts-babel@6.0.4 -//# sourceMappingURL=nodeHttpExecutor.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/nodeHttpExecutor.js.map b/node_modules/builder-util/out/nodeHttpExecutor.js.map deleted file mode 100644 index aca1afc..0000000 --- a/node_modules/builder-util/out/nodeHttpExecutor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/nodeHttpExecutor.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,MAAO,gBAAP,SAAgC,kCAAhC,CAA2D;AAC/D;AACA;AACA,EAAA,aAAa,CAAC,OAAD,EAAe,QAAf,EAAgD;AAC3D,WAAO,CAAC,OAAO,CAAC,QAAR,KAAqB,OAArB,GAA+B,eAA/B,GAA6C,KAAK,GAAC,OAApD,EAA6D,OAA7D,EAAsE,QAAtE,CAAP;AACD;;AAL8D;;;AAQ1D,MAAM,YAAY,GAAG,IAAI,gBAAJ,EAArB,C","sourcesContent":["import { HttpExecutor } from \"builder-util-runtime\"\nimport { ClientRequest, request as httpRequest } from \"http\"\nimport * as https from \"https\"\n\nexport class NodeHttpExecutor extends HttpExecutor {\n // noinspection JSMethodCanBeStatic\n // noinspection JSUnusedGlobalSymbols\n createRequest(options: any, callback: (response: any) => void): any {\n return (options.protocol === \"http:\" ? httpRequest : https.request)(options, callback)\n }\n}\n\nexport const httpExecutor = new NodeHttpExecutor()"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/promise.d.ts b/node_modules/builder-util/out/promise.d.ts deleted file mode 100644 index fb49d23..0000000 --- a/node_modules/builder-util/out/promise.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare function printErrorAndExit(error: Error): void; -export declare function executeFinally(promise: Promise, task: (isErrorOccurred: boolean) => Promise): Promise; -export declare class NestedError extends Error { - constructor(errors: Array, message?: string); -} -export declare function orNullIfFileNotExist(promise: Promise): Promise; -export declare function orIfFileNotExist(promise: Promise, fallbackValue: T): Promise; diff --git a/node_modules/builder-util/out/promise.js b/node_modules/builder-util/out/promise.js deleted file mode 100644 index d0dccd5..0000000 --- a/node_modules/builder-util/out/promise.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.printErrorAndExit = printErrorAndExit; -exports.executeFinally = executeFinally; -exports.orNullIfFileNotExist = orNullIfFileNotExist; -exports.orIfFileNotExist = orIfFileNotExist; -exports.NestedError = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function printErrorAndExit(error) { - console.error(_chalk().default.red((error.stack || error).toString())); - process.exit(1); -} // you don't need to handle error in your task - it is passed only indicate status of promise - - -function executeFinally(_x, _x2) { - return _executeFinally.apply(this, arguments); -} - -function _executeFinally() { - _executeFinally = (0, _bluebirdLst().coroutine)(function* (promise, task) { - let result = null; - - try { - result = yield promise; - } catch (originalError) { - try { - yield task(true); - } catch (taskError) { - throw new NestedError([originalError, taskError]); - } - - throw originalError; - } - - yield task(false); - return result; - }); - return _executeFinally.apply(this, arguments); -} - -class NestedError extends Error { - constructor(errors, message = "Compound error: ") { - let m = message; - let i = 1; - - for (const error of errors) { - const prefix = `Error #${i++} `; - m += "\n\n" + prefix + "-".repeat(80) + "\n" + error.stack; - } - - super(m); - } - -} - -exports.NestedError = NestedError; - -function orNullIfFileNotExist(promise) { - return orIfFileNotExist(promise, null); -} - -function orIfFileNotExist(promise, fallbackValue) { - return promise.catch(e => { - if (e.code === "ENOENT" || e.code === "ENOTDIR") { - return fallbackValue; - } - - throw e; - }); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=promise.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/promise.js.map b/node_modules/builder-util/out/promise.js.map deleted file mode 100644 index 39c8451..0000000 --- a/node_modules/builder-util/out/promise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/promise.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,SAAU,iBAAV,CAA4B,KAA5B,EAAwC;AAC5C,EAAA,OAAO,CAAC,KAAR,CAAc,iBAAM,GAAN,CAAU,CAAC,KAAK,CAAC,KAAN,IAAe,KAAhB,EAAuB,QAAvB,EAAV,CAAd;AACA,EAAA,OAAO,CAAC,IAAR,CAAa,CAAb;AACD,C,CAED;;;SACsB,c;;;;;kDAAf,WAAiC,OAAjC,EAAsD,IAAtD,EAAsG;AAC3G,QAAI,MAAM,GAAa,IAAvB;;AACA,QAAI;AACF,MAAA,MAAM,SAAS,OAAf;AACD,KAFD,CAGA,OAAO,aAAP,EAAsB;AACpB,UAAI;AACF,cAAM,IAAI,CAAC,IAAD,CAAV;AACD,OAFD,CAGA,OAAO,SAAP,EAAkB;AAChB,cAAM,IAAI,WAAJ,CAAgB,CAAC,aAAD,EAAgB,SAAhB,CAAhB,CAAN;AACD;;AAED,YAAM,aAAN;AACD;;AAED,UAAM,IAAI,CAAC,KAAD,CAAV;AACA,WAAO,MAAP;AACD,G;;;;AAEK,MAAO,WAAP,SAA2B,KAA3B,CAAgC;AACpC,EAAA,WAAA,CAAY,MAAZ,EAAkC,OAAA,GAAkB,kBAApD,EAAsE;AACpE,QAAI,CAAC,GAAG,OAAR;AACA,QAAI,CAAC,GAAG,CAAR;;AACA,SAAK,MAAM,KAAX,IAAoB,MAApB,EAA4B;AAC1B,YAAM,MAAM,GAAG,UAAU,CAAC,EAAE,GAA5B;AACA,MAAA,CAAC,IAAI,SAAS,MAAT,GAAkB,IAAI,MAAJ,CAAW,EAAX,CAAlB,GAAmC,IAAnC,GAA0C,KAAM,CAAC,KAAtD;AACD;;AACD,UAAM,CAAN;AACD;;AATmC;;;;AAYhC,SAAU,oBAAV,CAAkC,OAAlC,EAAqD;AACzD,SAAO,gBAAgB,CAAC,OAAD,EAAU,IAAV,CAAvB;AACD;;AAEK,SAAU,gBAAV,CAA8B,OAA9B,EAAmD,aAAnD,EAAmE;AACvE,SAAO,OAAO,CACX,KADI,CACE,CAAC,IAAG;AACT,QAAI,CAAC,CAAC,IAAF,KAAW,QAAX,IAAuB,CAAC,CAAC,IAAF,KAAW,SAAtC,EAAiD;AAC/C,aAAO,aAAP;AACD;;AACD,UAAM,CAAN;AACD,GANI,CAAP;AAOD,C","sourcesContent":["import chalk from \"chalk\"\n\nexport function printErrorAndExit(error: Error) {\n console.error(chalk.red((error.stack || error).toString()))\n process.exit(1)\n}\n\n// you don't need to handle error in your task - it is passed only indicate status of promise\nexport async function executeFinally(promise: Promise, task: (isErrorOccurred: boolean) => Promise): Promise {\n let result: T | null = null\n try {\n result = await promise\n }\n catch (originalError) {\n try {\n await task(true)\n }\n catch (taskError) {\n throw new NestedError([originalError, taskError])\n }\n\n throw originalError\n }\n\n await task(false)\n return result\n}\n\nexport class NestedError extends Error {\n constructor(errors: Array, message: string = \"Compound error: \") {\n let m = message\n let i = 1\n for (const error of errors) {\n const prefix = `Error #${i++} `\n m += \"\\n\\n\" + prefix + \"-\".repeat(80) + \"\\n\" + error!.stack\n }\n super(m)\n }\n}\n\nexport function orNullIfFileNotExist(promise: Promise): Promise {\n return orIfFileNotExist(promise, null)\n}\n\nexport function orIfFileNotExist(promise: Promise, fallbackValue: T): Promise {\n return promise\n .catch(e => {\n if (e.code === \"ENOENT\" || e.code === \"ENOTDIR\") {\n return fallbackValue\n }\n throw e\n })\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util/out/util.d.ts b/node_modules/builder-util/out/util.d.ts deleted file mode 100644 index 61235e3..0000000 --- a/node_modules/builder-util/out/util.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/// -import { ChildProcess, ExecFileOptions, SpawnOptions } from "child_process"; -import _debug from "debug"; -import "source-map-support/register"; -export { safeStringifyJson } from "builder-util-runtime"; -export { TmpDir } from "temp-file"; -export { log, debug } from "./log"; -export { Arch, getArchCliNames, toLinuxArchString, getArchSuffix, ArchType, archFromString } from "./arch"; -export { AsyncTaskManager } from "./asyncTaskManager"; -export { DebugLogger } from "./DebugLogger"; -export { copyFile } from "./fs"; -export { asArray } from "builder-util-runtime"; -export { deepAssign } from "./deepAssign"; -export declare const debug7z: _debug.IDebugger; -export declare function serializeToYaml(object: object, skipInvalid?: boolean, noRefs?: boolean): string; -export declare function removePassword(input: string): string; -export declare function exec(file: string, args?: Array | null, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise; -export interface ExtraSpawnOptions { - isPipeInput?: boolean; -} -export declare function doSpawn(command: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): ChildProcess; -export declare function spawnAndWrite(command: string, args: Array, data: string, options?: SpawnOptions): Promise; -export declare function spawn(command: string, args?: Array | null, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise; -export declare function use(value: T | null, task: (it: T) => R): R | null; -export declare function isEmptyOrSpaces(s: string | null | undefined): s is "" | null | undefined; -export declare function isTokenCharValid(token: string): boolean; -export declare function addValue(map: Map>, key: K, value: T): void; -export declare function replaceDefault(inList: Array | null | undefined, defaultList: Array): Array; -export declare function getPlatformIconFileName(value: string | null | undefined, isMac: boolean): string | null | undefined; -export declare function isPullRequest(): boolean | "" | undefined; -export declare function isEnvTrue(value: string | null | undefined): boolean; -export declare class InvalidConfigurationError extends Error { - constructor(message: string, code?: string); -} -export declare function executeAppBuilder(args: Array, childProcessConsumer?: (childProcess: ChildProcess) => void, extraOptions?: ExecFileOptions): Promise; diff --git a/node_modules/builder-util/out/util.js b/node_modules/builder-util/out/util.js deleted file mode 100644 index b51faa0..0000000 --- a/node_modules/builder-util/out/util.js +++ /dev/null @@ -1,617 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.serializeToYaml = serializeToYaml; -exports.removePassword = removePassword; -exports.exec = exec; -exports.doSpawn = doSpawn; -exports.spawnAndWrite = spawnAndWrite; -exports.spawn = spawn; -exports.use = use; -exports.isEmptyOrSpaces = isEmptyOrSpaces; -exports.isTokenCharValid = isTokenCharValid; -exports.addValue = addValue; -exports.replaceDefault = replaceDefault; -exports.getPlatformIconFileName = getPlatformIconFileName; -exports.isPullRequest = isPullRequest; -exports.isEnvTrue = isEnvTrue; -exports.executeAppBuilder = executeAppBuilder; -Object.defineProperty(exports, "safeStringifyJson", { - enumerable: true, - get: function () { - return _builderUtilRuntime().safeStringifyJson; - } -}); -Object.defineProperty(exports, "asArray", { - enumerable: true, - get: function () { - return _builderUtilRuntime().asArray; - } -}); -Object.defineProperty(exports, "log", { - enumerable: true, - get: function () { - return _log().log; - } -}); -Object.defineProperty(exports, "debug", { - enumerable: true, - get: function () { - return _log().debug; - } -}); -Object.defineProperty(exports, "TmpDir", { - enumerable: true, - get: function () { - return _tempFile().TmpDir; - } -}); -Object.defineProperty(exports, "Arch", { - enumerable: true, - get: function () { - return _arch().Arch; - } -}); -Object.defineProperty(exports, "getArchCliNames", { - enumerable: true, - get: function () { - return _arch().getArchCliNames; - } -}); -Object.defineProperty(exports, "toLinuxArchString", { - enumerable: true, - get: function () { - return _arch().toLinuxArchString; - } -}); -Object.defineProperty(exports, "getArchSuffix", { - enumerable: true, - get: function () { - return _arch().getArchSuffix; - } -}); -Object.defineProperty(exports, "archFromString", { - enumerable: true, - get: function () { - return _arch().archFromString; - } -}); -Object.defineProperty(exports, "AsyncTaskManager", { - enumerable: true, - get: function () { - return _asyncTaskManager().AsyncTaskManager; - } -}); -Object.defineProperty(exports, "DebugLogger", { - enumerable: true, - get: function () { - return _DebugLogger().DebugLogger; - } -}); -Object.defineProperty(exports, "copyFile", { - enumerable: true, - get: function () { - return _fs().copyFile; - } -}); -Object.defineProperty(exports, "deepAssign", { - enumerable: true, - get: function () { - return _deepAssign().deepAssign; - } -}); -exports.InvalidConfigurationError = exports.debug7z = void 0; - -function _zipBin() { - const data = require("7zip-bin"); - - _zipBin = function () { - return data; - }; - - return data; -} - -function _appBuilderBin() { - const data = require("app-builder-bin"); - - _appBuilderBin = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} - -function _child_process() { - const data = require("child_process"); - - _child_process = function () { - return data; - }; - - return data; -} - -function _crypto() { - const data = require("crypto"); - - _crypto = function () { - return data; - }; - - return data; -} - -var _debug2 = _interopRequireDefault(require("debug")); - -function _jsYaml() { - const data = require("js-yaml"); - - _jsYaml = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -require("source-map-support/register"); - -function _log() { - const data = require("./log"); - - _log = function () { - return data; - }; - - return data; -} - -function _isCi() { - const data = _interopRequireDefault(require("is-ci")); - - _isCi = function () { - return data; - }; - - return data; -} - -function _tempFile() { - const data = require("temp-file"); - - _tempFile = function () { - return data; - }; - - return data; -} - -function _arch() { - const data = require("./arch"); - - _arch = function () { - return data; - }; - - return data; -} - -function _asyncTaskManager() { - const data = require("./asyncTaskManager"); - - _asyncTaskManager = function () { - return data; - }; - - return data; -} - -function _DebugLogger() { - const data = require("./DebugLogger"); - - _DebugLogger = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("./fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _deepAssign() { - const data = require("./deepAssign"); - - _deepAssign = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const debug7z = (0, _debug2.default)("electron-builder:7z"); -exports.debug7z = debug7z; - -function serializeToYaml(object, skipInvalid = false, noRefs = false) { - return (0, _jsYaml().safeDump)(object, { - lineWidth: 8000, - skipInvalid, - noRefs - }); -} - -function removePassword(input) { - return input.replace(/(-String |-P |pass:| \/p |-pass |--secretKey |--accessKey )([^ ]+)/g, (match, p1, p2) => { - if (p1.trim() === "/p" && p2.startsWith("\\\\Mac\\Host\\\\")) { - // appx /p - return `${p1}${p2}`; - } - - return `${p1}${(0, _crypto().createHash)("sha256").update(p2).digest("hex")} (sha256 hash)`; - }); -} - -function getProcessEnv(env) { - if (process.platform === "win32") { - return env == null ? undefined : env; - } - - const finalEnv = Object.assign({}, env || process.env); // without LC_CTYPE dpkg can returns encoded unicode symbols - // set LC_CTYPE to avoid crash https://github.com/electron-userland/electron-builder/issues/503 Even "en_DE.UTF-8" leads to error. - - const locale = process.platform === "linux" ? process.env.LANG || "C.UTF-8" : "en_US.UTF-8"; - finalEnv.LANG = locale; - finalEnv.LC_CTYPE = locale; - finalEnv.LC_ALL = locale; - return finalEnv; -} - -function exec(file, args, options, isLogOutIfDebug = true) { - if (_log().log.isDebugEnabled) { - const logFields = { - file, - args: args == null ? "" : removePassword(args.join(" ")) - }; - - if (options != null) { - if (options.cwd != null) { - logFields.cwd = options.cwd; - } - - if (options.env != null) { - const diffEnv = Object.assign({}, options.env); - - for (const name of Object.keys(process.env)) { - if (process.env[name] === options.env[name]) { - delete diffEnv[name]; - } - } - - logFields.env = (0, _builderUtilRuntime().safeStringifyJson)(diffEnv); - } - } - - _log().log.debug(logFields, "executing"); - } - - return new Promise((resolve, reject) => { - (0, _child_process().execFile)(file, args, Object.assign({}, options, { - maxBuffer: 10 * 1024 * 1024, - env: getProcessEnv(options == null ? null : options.env) - }), (error, stdout, stderr) => { - if (error == null) { - if (isLogOutIfDebug && _log().log.isDebugEnabled) { - const logFields = { - file - }; - - if (stdout.length > 0) { - logFields.stdout = stdout; - } - - if (stderr.length > 0) { - logFields.stderr = stderr; - } - - _log().log.debug(logFields, "executed"); - } - - resolve(stdout.toString()); - } else { - let message = _chalk().default.red(removePassword(`Exit code: ${error.code}. ${error.message}`)); - - if (stdout.length !== 0) { - if (file.endsWith("wine")) { - stdout = stdout.toString(); - } - - message += `\n${_chalk().default.yellow(stdout.toString())}`; - } - - if (stderr.length !== 0) { - if (file.endsWith("wine")) { - stderr = stderr.toString(); - } - - message += `\n${_chalk().default.red(stderr.toString())}`; - } - - reject(new Error(message)); - } - }); - }); -} - -function logSpawn(command, args, options) { - // use general debug.enabled to log spawn, because it doesn't produce a lot of output (the only line), but important in any case - if (!_log().log.isDebugEnabled) { - return; - } - - const argsString = removePassword(args.join(" ")); - const logFields = { - command: command + " " + (command === "docker" ? argsString : removePassword(argsString)) - }; - - if (options != null && options.cwd != null) { - logFields.cwd = options.cwd; - } - - _log().log.debug(logFields, "spawning"); -} - -function doSpawn(command, args, options, extraOptions) { - if (options == null) { - options = {}; - } - - options.env = getProcessEnv(options.env); - - if (options.stdio == null) { - const isDebugEnabled = _log().debug.enabled; // do not ignore stdout/stderr if not debug, because in this case we will read into buffer and print on error - - - options.stdio = [extraOptions != null && extraOptions.isPipeInput ? "pipe" : "ignore", isDebugEnabled ? "inherit" : "pipe", isDebugEnabled ? "inherit" : "pipe"]; - } - - logSpawn(command, args, options); - - try { - return (0, _child_process().spawn)(command, args, options); - } catch (e) { - throw new Error(`Cannot spawn ${command}: ${e.stack || e}`); - } -} - -function spawnAndWrite(command, args, data, options) { - const childProcess = doSpawn(command, args, options, { - isPipeInput: true - }); - const timeout = setTimeout(() => childProcess.kill(), 4 * 60 * 1000); - return new Promise((resolve, reject) => { - handleProcess("close", childProcess, command, () => { - try { - clearTimeout(timeout); - } finally { - resolve(); - } - }, error => { - try { - clearTimeout(timeout); - } finally { - reject(error.stack || error.toString()); - } - }); - childProcess.stdin.end(data); - }); -} - -function spawn(command, args, options, extraOptions) { - return new Promise((resolve, reject) => { - handleProcess("close", doSpawn(command, args || [], options, extraOptions), command, resolve, reject); - }); -} - -function handleProcess(event, childProcess, command, resolve, reject) { - childProcess.on("error", reject); - let out = ""; - - if (childProcess.stdout != null) { - childProcess.stdout.on("data", data => { - out += data; - }); - } - - let errorOut = ""; - - if (childProcess.stderr != null) { - childProcess.stderr.on("data", data => { - errorOut += data; - }); - } - - childProcess.once(event, code => { - if (_log().log.isDebugEnabled) { - const fields = { - command: path.basename(command), - code, - pid: childProcess.pid - }; - - if (out.length > 0) { - fields.out = out; - } - - _log().log.debug(fields, "exited"); - } - - if (code === 0) { - if (resolve != null) { - resolve(out); - } - } else { - function formatOut(text, title) { - return text.length === 0 ? "" : `\n${title}:\n${text}`; - } - - reject(new Error(`${command} exited with code ${code}${formatOut(out, "Output")}${formatOut(errorOut, "Error output")}`)); - } - }); -} - -function use(value, task) { - return value == null ? null : task(value); -} - -function isEmptyOrSpaces(s) { - return s == null || s.trim().length === 0; -} - -function isTokenCharValid(token) { - return /^[\w\/=+-]+$/.test(token); -} - -function addValue(map, key, value) { - const list = map.get(key); - - if (list == null) { - map.set(key, [value]); - } else if (!list.includes(value)) { - list.push(value); - } -} - -function replaceDefault(inList, defaultList) { - if (inList == null || inList.length === 1 && inList[0] === "default") { - return defaultList; - } - - const index = inList.indexOf("default"); - - if (index >= 0) { - const list = inList.slice(0, index); - list.push(...defaultList); - - if (index !== inList.length - 1) { - list.push(...inList.slice(index + 1)); - } - - inList = list; - } - - return inList; -} - -function getPlatformIconFileName(value, isMac) { - if (value === undefined) { - return undefined; - } - - if (value === null) { - return null; - } - - if (!value.includes(".")) { - return `${value}.${isMac ? "icns" : "ico"}`; - } - - return value.replace(isMac ? ".ico" : ".icns", isMac ? ".icns" : ".ico"); -} - -function isPullRequest() { - // TRAVIS_PULL_REQUEST is set to the pull request number if the current job is a pull request build, or false if it’s not. - function isSet(value) { - // value can be or null, or empty string - return value && value !== "false"; - } - - return isSet(process.env.TRAVIS_PULL_REQUEST) || isSet(process.env.CI_PULL_REQUEST) || isSet(process.env.CI_PULL_REQUESTS) || isSet(process.env.BITRISE_PULL_REQUEST) || isSet(process.env.APPVEYOR_PULL_REQUEST_NUMBER); -} - -function isEnvTrue(value) { - if (value != null) { - value = value.trim(); - } - - return value === "true" || value === "" || value === "1"; -} - -class InvalidConfigurationError extends Error { - constructor(message, code = "ERR_ELECTRON_BUILDER_INVALID_CONFIGURATION") { - super(message); - this.code = code; - } - -} - -exports.InvalidConfigurationError = InvalidConfigurationError; - -function executeAppBuilder(args, childProcessConsumer, extraOptions = {}) { - return new Promise((resolve, reject) => { - const command = _appBuilderBin().appBuilderPath; - - const env = Object.assign({ - // before process.env to allow customize by user - SNAP_USE_HARD_LINKS_IF_POSSIBLE: _isCi().default.toString() - }, process.env, { - SZA_PATH: _zipBin().path7za - }); - const cacheEnv = process.env.ELECTRON_BUILDER_CACHE; - - if (cacheEnv != null && cacheEnv.length > 0) { - env.ELECTRON_BUILDER_CACHE = path.resolve(cacheEnv); - } - - if (extraOptions.env != null) { - Object.assign(env, extraOptions.env); - } - - const childProcess = doSpawn(command, args, Object.assign({}, extraOptions, { - env, - stdio: ["ignore", "pipe", process.stdout] - })); - - if (childProcessConsumer != null) { - childProcessConsumer(childProcess); - } - - handleProcess("close", childProcess, command, resolve, reject); - }); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/builder-util/out/util.js.map b/node_modules/builder-util/out/util.js.map deleted file mode 100644 index 3d25c28..0000000 --- a/node_modules/builder-util/out/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEO,MAAM,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,GADe;AAEf,MAAA,KAAK,EAAE,CAAC,QAAD,EAAW,MAAX,EAAmB,OAAO,CAAC,MAA3B;AAFQ,KADyB,CAAd,CAA5B;;AAKA,QAAI,oBAAoB,IAAI,IAA5B,EAAkC;AAChC,MAAA,oBAAoB,CAAC,YAAD,CAApB;AACD;;AACD,IAAA,aAAa,CAAC,OAAD,EAAU,YAAV,EAAwB,OAAxB,EAAiC,OAAjC,EAA0C,MAA1C,CAAb;AACD,GA1BM,CAAP;AA2BD,C","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport { appBuilderPath } from \"app-builder-bin\"\nimport { safeStringifyJson } from \"builder-util-runtime\"\nimport chalk from \"chalk\"\nimport { ChildProcess, execFile, ExecFileOptions, spawn as _spawn, SpawnOptions } from \"child_process\"\nimport { createHash } from \"crypto\"\nimport _debug from \"debug\"\nimport { safeDump } from \"js-yaml\"\nimport * as path from \"path\"\nimport \"source-map-support/register\"\nimport { debug, log } from \"./log\"\nimport isCI from \"is-ci\"\n\nexport { safeStringifyJson } from \"builder-util-runtime\"\nexport { TmpDir } from \"temp-file\"\nexport { log, debug } from \"./log\"\nexport { Arch, getArchCliNames, toLinuxArchString, getArchSuffix, ArchType, archFromString } from \"./arch\"\nexport { AsyncTaskManager } from \"./asyncTaskManager\"\nexport { DebugLogger } from \"./DebugLogger\"\n\nexport { copyFile } from \"./fs\"\nexport { asArray } from \"builder-util-runtime\"\n\nexport { deepAssign } from \"./deepAssign\"\n\nexport const debug7z = _debug(\"electron-builder:7z\")\n\nexport function serializeToYaml(object: object, skipInvalid = false, noRefs = false) {\n return safeDump(object, {\n lineWidth: 8000,\n skipInvalid,\n noRefs,\n })\n}\n\nexport function removePassword(input: string) {\n return input.replace(/(-String |-P |pass:| \\/p |-pass |--secretKey |--accessKey )([^ ]+)/g, (match, p1, p2) => {\n if (p1.trim() === \"/p\" && p2.startsWith(\"\\\\\\\\Mac\\\\Host\\\\\\\\\")) {\n // appx /p\n return `${p1}${p2}`\n }\n return `${p1}${createHash(\"sha256\").update(p2).digest(\"hex\")} (sha256 hash)`\n })\n}\n\nfunction getProcessEnv(env: { [key: string]: string | undefined } | undefined | null): NodeJS.ProcessEnv | undefined {\n if (process.platform === \"win32\") {\n return env == null ? undefined : env\n }\n\n const finalEnv = {\n ...(env || process.env)\n }\n\n // without LC_CTYPE dpkg can returns encoded unicode symbols\n // set LC_CTYPE to avoid crash https://github.com/electron-userland/electron-builder/issues/503 Even \"en_DE.UTF-8\" leads to error.\n const locale = process.platform === \"linux\" ? (process.env.LANG || \"C.UTF-8\") : \"en_US.UTF-8\"\n finalEnv.LANG = locale\n finalEnv.LC_CTYPE = locale\n finalEnv.LC_ALL = locale\n return finalEnv\n}\n\nexport function exec(file: string, args?: Array | null, options?: ExecFileOptions, isLogOutIfDebug = true): Promise {\n if (log.isDebugEnabled) {\n const logFields: any = {\n file,\n args: args == null ? \"\" : removePassword(args.join(\" \")),\n }\n if (options != null) {\n if (options.cwd != null) {\n logFields.cwd = options.cwd\n }\n\n if (options.env != null) {\n const diffEnv = {...options.env}\n for (const name of Object.keys(process.env)) {\n if (process.env[name] === options.env[name]) {\n delete diffEnv[name]\n }\n }\n logFields.env = safeStringifyJson(diffEnv)\n }\n }\n\n log.debug(logFields, \"executing\")\n }\n\n return new Promise((resolve, reject) => {\n execFile(file, args, {\n ...options,\n maxBuffer: 10 * 1024 * 1024,\n env: getProcessEnv(options == null ? null : options.env),\n }, (error, stdout, stderr) => {\n if (error == null) {\n if (isLogOutIfDebug && log.isDebugEnabled) {\n const logFields: any = {\n file,\n }\n if (stdout.length > 0) {\n logFields.stdout = stdout\n }\n if (stderr.length > 0) {\n logFields.stderr = stderr\n }\n\n log.debug(logFields, \"executed\")\n }\n resolve(stdout.toString())\n }\n else {\n let message = chalk.red(removePassword(`Exit code: ${(error as any).code}. ${error.message}`))\n if (stdout.length !== 0) {\n if (file.endsWith(\"wine\")) {\n stdout = stdout.toString()\n }\n message += `\\n${chalk.yellow(stdout.toString())}`\n }\n if (stderr.length !== 0) {\n if (file.endsWith(\"wine\")) {\n stderr = stderr.toString()\n }\n message += `\\n${chalk.red(stderr.toString())}`\n }\n\n reject(new Error(message))\n }\n })\n })\n}\n\nexport interface ExtraSpawnOptions {\n isPipeInput?: boolean\n}\n\nfunction logSpawn(command: string, args: Array, options: SpawnOptions) {\n // use general debug.enabled to log spawn, because it doesn't produce a lot of output (the only line), but important in any case\n if (!log.isDebugEnabled) {\n return\n }\n\n const argsString = removePassword(args.join(\" \"))\n const logFields: any = {\n command: command + \" \" + (command === \"docker\" ? argsString : removePassword(argsString)),\n }\n if (options != null && options.cwd != null) {\n logFields.cwd = options.cwd\n }\n log.debug(logFields, \"spawning\")\n}\n\nexport function doSpawn(command: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): ChildProcess {\n if (options == null) {\n options = {}\n }\n\n options.env = getProcessEnv(options.env)\n\n if (options.stdio == null) {\n const isDebugEnabled = debug.enabled\n // do not ignore stdout/stderr if not debug, because in this case we will read into buffer and print on error\n options.stdio = [extraOptions != null && extraOptions.isPipeInput ? \"pipe\" : \"ignore\", isDebugEnabled ? \"inherit\" : \"pipe\", isDebugEnabled ? \"inherit\" : \"pipe\"] as any\n }\n\n logSpawn(command, args, options)\n try {\n return _spawn(command, args, options)\n }\n catch (e) {\n throw new Error(`Cannot spawn ${command}: ${e.stack || e}`)\n }\n}\n\nexport function spawnAndWrite(command: string, args: Array, data: string, options?: SpawnOptions) {\n const childProcess = doSpawn(command, args, options, {isPipeInput: true})\n const timeout = setTimeout(() => childProcess.kill(), 4 * 60 * 1000)\n return new Promise((resolve, reject) => {\n handleProcess(\"close\", childProcess, command, () => {\n try {\n clearTimeout(timeout)\n }\n finally {\n resolve()\n }\n }, error => {\n try {\n clearTimeout(timeout)\n }\n finally {\n reject(error.stack || error.toString())\n }\n })\n\n childProcess.stdin.end(data)\n })\n}\n\nexport function spawn(command: string, args?: Array | null, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise {\n return new Promise((resolve, reject) => {\n handleProcess(\"close\", doSpawn(command, args || [], options, extraOptions), command, resolve, reject)\n })\n}\n\nfunction handleProcess(event: string, childProcess: ChildProcess, command: string, resolve: ((value?: any) => void) | null, reject: (reason?: any) => void) {\n childProcess.on(\"error\", reject)\n\n let out = \"\"\n if (childProcess.stdout != null) {\n childProcess.stdout.on(\"data\", (data: string) => {\n out += data\n })\n }\n\n let errorOut = \"\"\n if (childProcess.stderr != null) {\n childProcess.stderr.on(\"data\", (data: string) => {\n errorOut += data\n })\n }\n\n childProcess.once(event, (code: number) => {\n if (log.isDebugEnabled) {\n const fields: any = {\n command: path.basename(command),\n code,\n pid: childProcess.pid,\n }\n if (out.length > 0) {\n fields.out = out\n }\n log.debug(fields, \"exited\")\n }\n\n if (code === 0) {\n if (resolve != null) {\n resolve(out)\n }\n }\n else {\n function formatOut(text: string, title: string) {\n return text.length === 0 ? \"\" : `\\n${title}:\\n${text}`\n }\n\n reject(new Error(`${command} exited with code ${code}${formatOut(out, \"Output\")}${formatOut(errorOut, \"Error output\")}`))\n }\n })\n}\n\nexport function use(value: T | null, task: (it: T) => R): R | null {\n return value == null ? null : task(value)\n}\n\nexport function isEmptyOrSpaces(s: string | null | undefined): s is \"\" | null | undefined {\n return s == null || s.trim().length === 0\n}\n\nexport function isTokenCharValid(token: string) {\n return /^[\\w\\/=+-]+$/.test(token)\n}\n\nexport function addValue(map: Map>, key: K, value: T) {\n const list = map.get(key)\n if (list == null) {\n map.set(key, [value])\n }\n else if (!list.includes(value)) {\n list.push(value)\n }\n}\n\nexport function replaceDefault(inList: Array | null | undefined, defaultList: Array): Array {\n if (inList == null || (inList.length === 1 && inList[0] === \"default\")) {\n return defaultList\n }\n\n const index = inList.indexOf(\"default\")\n if (index >= 0) {\n const list = inList.slice(0, index)\n list.push(...defaultList)\n if (index !== (inList.length - 1)) {\n list.push(...inList.slice(index + 1))\n }\n inList = list\n }\n return inList\n}\n\nexport function getPlatformIconFileName(value: string | null | undefined, isMac: boolean) {\n if (value === undefined) {\n return undefined\n }\n if (value === null) {\n return null\n }\n\n if (!value.includes(\".\")) {\n return `${value}.${isMac ? \"icns\" : \"ico\"}`\n }\n\n return value.replace(isMac ? \".ico\" : \".icns\", isMac ? \".icns\" : \".ico\")\n}\n\nexport function isPullRequest() {\n // TRAVIS_PULL_REQUEST is set to the pull request number if the current job is a pull request build, or false if it’s not.\n function isSet(value: string | undefined) {\n // value can be or null, or empty string\n return value && value !== \"false\"\n }\n\n return isSet(process.env.TRAVIS_PULL_REQUEST) || isSet(process.env.CI_PULL_REQUEST) || isSet(process.env.CI_PULL_REQUESTS) || isSet(process.env.BITRISE_PULL_REQUEST) || isSet(process.env.APPVEYOR_PULL_REQUEST_NUMBER)\n}\n\nexport function isEnvTrue(value: string | null | undefined) {\n if (value != null) {\n value = value.trim()\n }\n return value === \"true\" || value === \"\" || value === \"1\"\n}\n\nexport class InvalidConfigurationError extends Error {\n constructor(message: string, code: string = \"ERR_ELECTRON_BUILDER_INVALID_CONFIGURATION\") {\n super(message);\n\n (this as NodeJS.ErrnoException).code = code\n }\n}\n\nexport function executeAppBuilder(args: Array, childProcessConsumer?: (childProcess: ChildProcess) => void, extraOptions: ExecFileOptions = {}): Promise {\n return new Promise((resolve, reject) => {\n const command = appBuilderPath\n const env: any = {\n // before process.env to allow customize by user\n SNAP_USE_HARD_LINKS_IF_POSSIBLE: isCI.toString(),\n ...process.env,\n SZA_PATH: path7za,\n }\n const cacheEnv = process.env.ELECTRON_BUILDER_CACHE\n if (cacheEnv != null && cacheEnv.length > 0) {\n env.ELECTRON_BUILDER_CACHE = path.resolve(cacheEnv)\n }\n\n if (extraOptions.env != null) {\n Object.assign(env, extraOptions.env)\n }\n\n const childProcess = doSpawn(command, args, {\n ...extraOptions,\n env,\n stdio: [\"ignore\", \"pipe\", process.stdout]\n })\n if (childProcessConsumer != null) {\n childProcessConsumer(childProcess)\n }\n handleProcess(\"close\", childProcess, command, resolve, reject)\n })\n}"],"sourceRoot":""} diff --git a/node_modules/builder-util/package.json b/node_modules/builder-util/package.json deleted file mode 100644 index 6e5b0b5..0000000 --- a/node_modules/builder-util/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "builder-util@9.6.1", - "_id": "builder-util@9.6.1", - "_inBundle": false, - "_integrity": "sha512-8MljKTjeV+A+LLVexuWEV3EpWbiUcsHHrB4Bg2qNo/3dC+vTo6g/27+W3Ij7Ij1UTobSkNBstFieWijXJCco9A==", - "_location": "/builder-util", - "_phantomChildren": { - "ms": "2.1.1" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "builder-util@9.6.1", - "name": "builder-util", - "escapedName": "builder-util", - "rawSpec": "9.6.1", - "saveSpec": null, - "fetchSpec": "9.6.1" - }, - "_requiredBy": [ - "/app-builder-lib", - "/dmg-builder", - "/electron-builder", - "/electron-publish" - ], - "_resolved": "https://registry.npmjs.org/builder-util/-/builder-util-9.6.1.tgz", - "_shasum": "4625620b1535fe40dcacb178d24fe56d0d7c8957", - "_spec": "builder-util@9.6.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", - "author": { - "name": "Vladimir Krivosheev" - }, - "bugs": { - "url": "https://github.com/electron-userland/electron-builder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "7zip-bin": "~4.1.0", - "app-builder-bin": "2.6.1", - "bluebird-lst": "^1.0.6", - "builder-util-runtime": "^8.1.0", - "chalk": "^2.4.1", - "debug": "^4.1.0", - "fs-extra-p": "^7.0.0", - "is-ci": "^2.0.0", - "js-yaml": "^3.12.0", - "source-map-support": "^0.5.9", - "stat-mode": "^0.2.2", - "temp-file": "^3.3.2" - }, - "deprecated": false, - "description": "Various utilities. Used by [electron-builder](https://github.com/electron-userland/electron-builder).", - "files": [ - "out" - ], - "homepage": "https://github.com/electron-userland/electron-builder", - "license": "MIT", - "main": "out/util.js", - "name": "builder-util", - "repository": { - "type": "git", - "url": "git+https://github.com/electron-userland/electron-builder.git" - }, - "typings": "./out/util.d.ts", - "version": "9.6.1" -} diff --git a/node_modules/builder-util/readme.md b/node_modules/builder-util/readme.md deleted file mode 100644 index c1d309b..0000000 --- a/node_modules/builder-util/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# builder-util - -Various utilities. Used by [electron-builder](https://github.com/electron-userland/electron-builder). \ No newline at end of file diff --git a/node_modules/builtin-modules/package.json b/node_modules/builtin-modules/package.json index ff563f4..163c3fa 100644 --- a/node_modules/builtin-modules/package.json +++ b/node_modules/builtin-modules/package.json @@ -1,27 +1,33 @@ { - "_from": "builtin-modules@^1.0.0", + "_args": [ + [ + "builtin-modules@1.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "builtin-modules@1.1.1", "_id": "builtin-modules@1.1.1", "_inBundle": false, "_integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "_location": "/builtin-modules", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "builtin-modules@^1.0.0", + "raw": "builtin-modules@1.1.1", "name": "builtin-modules", "escapedName": "builtin-modules", - "rawSpec": "^1.0.0", + "rawSpec": "1.1.1", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.1.1" }, "_requiredBy": [ "/is-builtin-module" ], "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "_shasum": "270f076c5a72c02f5b65a47df94c5fe3a278892f", - "_spec": "builtin-modules@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/is-builtin-module", + "_spec": "1.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/builtin-modules/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "List of the Node.js builtin modules", "devDependencies": { "ava": "*", diff --git a/node_modules/camelcase-keys/package.json b/node_modules/camelcase-keys/package.json index a698f34..a518b37 100644 --- a/node_modules/camelcase-keys/package.json +++ b/node_modules/camelcase-keys/package.json @@ -1,27 +1,33 @@ { - "_from": "camelcase-keys@^2.0.0", + "_args": [ + [ + "camelcase-keys@2.1.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "camelcase-keys@2.1.0", "_id": "camelcase-keys@2.1.0", "_inBundle": false, "_integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "_location": "/camelcase-keys", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "camelcase-keys@^2.0.0", + "raw": "camelcase-keys@2.1.0", "name": "camelcase-keys", "escapedName": "camelcase-keys", - "rawSpec": "^2.0.0", + "rawSpec": "2.1.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "2.1.0" }, "_requiredBy": [ "/meow" ], "_resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "_shasum": "308beeaffdf28119051efa1d932213c91b8f92e7", - "_spec": "camelcase-keys@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/meow", + "_spec": "2.1.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,12 +36,10 @@ "bugs": { "url": "https://github.com/sindresorhus/camelcase-keys/issues" }, - "bundleDependencies": false, "dependencies": { "camelcase": "^2.0.0", "map-obj": "^1.0.0" }, - "deprecated": false, "description": "Convert object keys to camelCase", "devDependencies": { "ava": "*", diff --git a/node_modules/camelcase/package.json b/node_modules/camelcase/package.json index 685888c..8c2593c 100644 --- a/node_modules/camelcase/package.json +++ b/node_modules/camelcase/package.json @@ -1,27 +1,33 @@ { - "_from": "camelcase@^2.0.0", + "_args": [ + [ + "camelcase@2.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "camelcase@2.1.1", "_id": "camelcase@2.1.1", "_inBundle": false, "_integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", "_location": "/camelcase", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "camelcase@^2.0.0", + "raw": "camelcase@2.1.1", "name": "camelcase", "escapedName": "camelcase", - "rawSpec": "^2.0.0", + "rawSpec": "2.1.1", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "2.1.1" }, "_requiredBy": [ "/camelcase-keys" ], "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "_shasum": "7c1d16d679a1bbe59ca02cacecfb011e201f5a1f", - "_spec": "camelcase@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/camelcase-keys", + "_spec": "2.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/camelcase/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar", "devDependencies": { "ava": "*", diff --git a/node_modules/capture-stack-trace/index.js b/node_modules/capture-stack-trace/index.js deleted file mode 100644 index 1b696c8..0000000 --- a/node_modules/capture-stack-trace/index.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = Error.captureStackTrace || function (error) { - var container = new Error(); - - Object.defineProperty(error, 'stack', { - configurable: true, - get: function getStack() { - var stack = container.stack; - - Object.defineProperty(this, 'stack', { - value: stack - }); - - return stack; - } - }); -}; diff --git a/node_modules/capture-stack-trace/license b/node_modules/capture-stack-trace/license deleted file mode 100644 index 1aeb74f..0000000 --- a/node_modules/capture-stack-trace/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -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/capture-stack-trace/package.json b/node_modules/capture-stack-trace/package.json deleted file mode 100644 index 2636647..0000000 --- a/node_modules/capture-stack-trace/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "capture-stack-trace@^1.0.0", - "_id": "capture-stack-trace@1.0.1", - "_inBundle": false, - "_integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", - "_location": "/capture-stack-trace", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "capture-stack-trace@^1.0.0", - "name": "capture-stack-trace", - "escapedName": "capture-stack-trace", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/create-error-class" - ], - "_resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "_shasum": "a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d", - "_spec": "capture-stack-trace@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/create-error-class", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/capture-stack-trace/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Error.captureStackTrace ponyfill", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/capture-stack-trace#readme", - "keywords": [ - "Error", - "captureStackTrace" - ], - "license": "MIT", - "name": "capture-stack-trace", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/capture-stack-trace.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "1.0.1" -} diff --git a/node_modules/capture-stack-trace/readme.md b/node_modules/capture-stack-trace/readme.md deleted file mode 100644 index a944ab9..0000000 --- a/node_modules/capture-stack-trace/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# capture-stack-trace [![Build Status](https://travis-ci.org/floatdrop/capture-stack-trace.svg?branch=master)](https://travis-ci.org/floatdrop/capture-stack-trace) - -> Ponyfill for Error.captureStackTrace - - -## Install - -``` -$ npm install --save capture-stack-trace -``` - - -## Usage - -```js -var captureStackTrace = require('capture-stack-trace'); - -captureStackTrace({}); -// => {stack: ...} -``` - - -## API - -### captureStackTrace(error) - -#### error - -*Required* -Type: `Object` - -Target Object, that will recieve stack property. - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/caseless/package.json b/node_modules/caseless/package.json index 04a399b..35c1f8a 100644 --- a/node_modules/caseless/package.json +++ b/node_modules/caseless/package.json @@ -1,27 +1,32 @@ { - "_from": "caseless@~0.12.0", + "_args": [ + [ + "caseless@0.12.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "caseless@0.12.0", "_id": "caseless@0.12.0", "_inBundle": false, "_integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "_location": "/caseless", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "caseless@~0.12.0", + "raw": "caseless@0.12.0", "name": "caseless", "escapedName": "caseless", - "rawSpec": "~0.12.0", + "rawSpec": "0.12.0", "saveSpec": null, - "fetchSpec": "~0.12.0" + "fetchSpec": "0.12.0" }, "_requiredBy": [ "/request" ], "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "_shasum": "1b681c21ff84033c826543090689420d187151dc", - "_spec": "caseless@~0.12.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "0.12.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" @@ -29,8 +34,6 @@ "bugs": { "url": "https://github.com/mikeal/caseless/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Caseless object set/get/has, very useful when working with HTTP headers.", "devDependencies": { "tape": "^2.10.2" diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json index d1e7fd3..8401887 100644 --- a/node_modules/chalk/package.json +++ b/node_modules/chalk/package.json @@ -1,5 +1,5 @@ { - "_from": "chalk@^2.4.1", + "_from": "chalk@^2.1.0", "_id": "chalk@2.4.1", "_inBundle": false, "_integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", @@ -8,24 +8,21 @@ "_requested": { "type": "range", "registry": true, - "raw": "chalk@^2.4.1", + "raw": "chalk@^2.1.0", "name": "chalk", "escapedName": "chalk", - "rawSpec": "^2.4.1", + "rawSpec": "^2.1.0", "saveSpec": null, - "fetchSpec": "^2.4.1" + "fetchSpec": "^2.1.0" }, "_requiredBy": [ - "/boxen", - "/builder-util", - "/electron-builder", - "/electron-publish", - "/update-notifier" + "/log-symbols", + "/ora" ], "_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "_shasum": "18c49ab16a037b6eb0152cc83e3471338215b66e", - "_spec": "chalk@^2.4.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", + "_spec": "chalk@^2.1.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/ora", "bugs": { "url": "https://github.com/chalk/chalk/issues" }, diff --git a/node_modules/chromium-pickle-js/package.json b/node_modules/chromium-pickle-js/package.json index 3c848db..c3a2c1c 100644 --- a/node_modules/chromium-pickle-js/package.json +++ b/node_modules/chromium-pickle-js/package.json @@ -1,32 +1,36 @@ { - "_from": "chromium-pickle-js@^0.2.0", + "_args": [ + [ + "chromium-pickle-js@0.2.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "chromium-pickle-js@0.2.0", "_id": "chromium-pickle-js@0.2.0", "_inBundle": false, "_integrity": "sha1-BKEGZywYsIWrd02YPfo+oTjyIgU=", "_location": "/chromium-pickle-js", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "chromium-pickle-js@^0.2.0", + "raw": "chromium-pickle-js@0.2.0", "name": "chromium-pickle-js", "escapedName": "chromium-pickle-js", - "rawSpec": "^0.2.0", + "rawSpec": "0.2.0", "saveSpec": null, - "fetchSpec": "^0.2.0" + "fetchSpec": "0.2.0" }, "_requiredBy": [ - "/app-builder-lib" + "/asar" ], "_resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", - "_shasum": "04a106672c18b085ab774d983dfa3ea138f22205", - "_spec": "chromium-pickle-js@^0.2.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", + "_spec": "0.2.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/electron/node-chromium-pickle-js/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Binary value packing and unpacking", "devDependencies": { "mocha": "^3.0.2", diff --git a/node_modules/ci-info/CHANGELOG.md b/node_modules/ci-info/CHANGELOG.md deleted file mode 100644 index 66b9cf0..0000000 --- a/node_modules/ci-info/CHANGELOG.md +++ /dev/null @@ -1,78 +0,0 @@ -# Changelog - -## v2.0.0 - -Breaking changes: - -* Drop support for Node.js end-of-life versions: 0.10, 0.12, 4, 5, 7, - and 9 -* Team Foundation Server will now be detected as Azure Pipelines. The - constant `ci.TFS` no longer exists - use `ci.AZURE_PIPELINES` instead -* Remove deprecated `ci.TDDIUM` constant - use `ci.SOLANDO` instead - -New features: - -* feat: support Azure Pipelines ([#23](https://github.com/watson/ci-info/pull/23)) -* feat: support Netlify CI ([#26](https://github.com/watson/ci-info/pull/26)) -* feat: support Bitbucket pipelines PR detection ([#27](https://github.com/watson/ci-info/pull/27)) - -## v1.6.0 - -* feat: add Sail CI support -* feat: add Buddy support -* feat: add Bitrise support -* feat: detect Jenkins PRs -* feat: detect Drone PRs - -## v1.5.1 - -* fix: use full path to vendors.json - -## v1.5.0 - -* feat: add dsari detection ([#15](https://github.com/watson/ci-info/pull/15)) -* feat: add ci.isPR ([#16](https://github.com/watson/ci-info/pull/16)) - -## v1.4.0 - -* feat: add Cirrus CI detection ([#13](https://github.com/watson/ci-info/pull/13)) -* feat: add Shippable CI detection ([#14](https://github.com/watson/ci-info/pull/14)) - -## v1.3.1 - -* chore: reduce npm package size by not including `.github` folder content ([#11](https://github.com/watson/ci-info/pull/11)) - -## v1.3.0 - -* feat: add support for Strider CD -* chore: deprecate vendor constant `TDDIUM` in favor of `SOLANO` -* docs: add missing vendor constant to docs - -## v1.2.0 - -* feat: detect solano-ci ([#9](https://github.com/watson/ci-info/pull/9)) - -## v1.1.3 - -* fix: fix spelling of Hunson in `ci.name` - -## v1.1.2 - -* fix: no more false positive matches for Jenkins - -## v1.1.1 - -* docs: sort lists of CI servers in README.md -* docs: add missing AWS CodeBuild to the docs - -## v1.1.0 - -* feat: add AWS CodeBuild to CI detection ([#2](https://github.com/watson/ci-info/pull/2)) - -## v1.0.1 - -* chore: reduce npm package size by using an `.npmignore` file ([#3](https://github.com/watson/ci-info/pull/3)) - -## v1.0.0 - -* Initial release diff --git a/node_modules/ci-info/LICENSE b/node_modules/ci-info/LICENSE deleted file mode 100644 index 6784683..0000000 --- a/node_modules/ci-info/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018 Thomas Watson Steen - -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/ci-info/README.md b/node_modules/ci-info/README.md deleted file mode 100644 index 12c4f62..0000000 --- a/node_modules/ci-info/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# ci-info - -Get details about the current Continuous Integration environment. - -Please [open an -issue](https://github.com/watson/ci-info/issues/new?template=ci-server-not-detected.md) -if your CI server isn't properly detected :) - -[![npm](https://img.shields.io/npm/v/ci-info.svg)](https://www.npmjs.com/package/ci-info) -[![Build status](https://travis-ci.org/watson/ci-info.svg?branch=master)](https://travis-ci.org/watson/ci-info) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) - -## Installation - -```bash -npm install ci-info --save -``` - -## Usage - -```js -var ci = require('ci-info') - -if (ci.isCI) { - console.log('The name of the CI server is:', ci.name) -} else { - console.log('This program is not running on a CI server') -} -``` - -## Supported CI tools - -Officially supported CI servers: - -| Name | Constant | isPR | -|------|----------|------| -| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | 🚫 | -| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | ✅ | -| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) | `ci.AZURE_PIPELINES` | ✅ | -| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | 🚫 | -| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | ✅ | -| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | ✅ | -| [Buddy](https://buddy.works/) | `ci.BUDDY` | ✅ | -| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | ✅ | -| [CircleCI](http://circleci.com) | `ci.CIRCLE` | ✅ | -| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | ✅ | -| [Codeship](https://codeship.com) | `ci.CODESHIP` | 🚫 | -| [Drone](https://drone.io) | `ci.DRONE` | ✅ | -| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | 🚫 | -| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | 🚫 | -| [GoCD](https://www.go.cd/) | `ci.GOCD` | 🚫 | -| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | 🚫 | -| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | ✅ | -| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | 🚫 | -| [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` | ✅ | -| [Sail CI](https://sail.ci/) | `ci.SAIL` | ✅ | -| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | ✅ | -| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | ✅ | -| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | ✅ | -| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | 🚫 | -| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | 🚫 | -| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | 🚫 | -| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | ✅ | - -## API - -### `ci.name` - -Returns a string containing name of the CI server the code is running on. -If CI server is not detected, it returns `null`. - -Don't depend on the value of this string not to change for a specific -vendor. If you find your self writing `ci.name === 'Travis CI'`, you -most likely want to use `ci.TRAVIS` instead. - -### `ci.isCI` - -Returns a boolean. Will be `true` if the code is running on a CI server, -otherwise `false`. - -Some CI servers not listed here might still trigger the `ci.isCI` -boolean to be set to `true` if they use certain vendor neutral -environment variables. In those cases `ci.name` will be `null` and no -vendor specific boolean will be set to `true`. - -### `ci.isPR` - -Returns a boolean if PR detection is supported for the current CI server. Will -be `true` if a PR is being tested, otherwise `false`. If PR detection is -not supported for the current CI server, the value will be `null`. - -### `ci.` - -A vendor specific boolean constant is exposed for each support CI -vendor. A constant will be `true` if the code is determined to run on -the given CI server, otherwise `false`. - -Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a -complete list, see the support table above. - -Deprecated vendor constants that will be removed in the next major -release: - -- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO` - -## License - -[MIT](LICENSE) diff --git a/node_modules/ci-info/index.js b/node_modules/ci-info/index.js deleted file mode 100644 index 9928fee..0000000 --- a/node_modules/ci-info/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict' - -var vendors = require('./vendors.json') - -var env = process.env - -// Used for testing only -Object.defineProperty(exports, '_vendors', { - value: vendors.map(function (v) { return v.constant }) -}) - -exports.name = null -exports.isPR = null - -vendors.forEach(function (vendor) { - var envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env] - var isCI = envs.every(function (obj) { - return checkEnv(obj) - }) - - exports[vendor.constant] = isCI - - if (isCI) { - exports.name = vendor.name - - switch (typeof vendor.pr) { - case 'string': - // "pr": "CIRRUS_PR" - exports.isPR = !!env[vendor.pr] - break - case 'object': - if ('env' in vendor.pr) { - // "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } - exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne - } else if ('any' in vendor.pr) { - // "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } - exports.isPR = vendor.pr.any.some(function (key) { - return !!env[key] - }) - } else { - // "pr": { "DRONE_BUILD_EVENT": "pull_request" } - exports.isPR = checkEnv(vendor.pr) - } - break - default: - // PR detection not supported for this vendor - exports.isPR = null - } - } -}) - -exports.isCI = !!( - env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari - env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI - env.BUILD_NUMBER || // Jenkins, TeamCity - env.RUN_ID || // TaskCluster, dsari - exports.name || - false -) - -function checkEnv (obj) { - if (typeof obj === 'string') return !!env[obj] - return Object.keys(obj).every(function (k) { - return env[k] === obj[k] - }) -} diff --git a/node_modules/ci-info/package.json b/node_modules/ci-info/package.json deleted file mode 100644 index bf5f68b..0000000 --- a/node_modules/ci-info/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "ci-info@^2.0.0", - "_id": "ci-info@2.0.0", - "_inBundle": false, - "_integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "_location": "/ci-info", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ci-info@^2.0.0", - "name": "ci-info", - "escapedName": "ci-info", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/is-ci" - ], - "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "_shasum": "67a9e964be31a51e15e5010d58e6f12834002f46", - "_spec": "ci-info@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/is-ci", - "author": { - "name": "Thomas Watson Steen", - "email": "w@tson.dk", - "url": "https://twitter.com/wa7son" - }, - "bugs": { - "url": "https://github.com/watson/ci-info/issues" - }, - "bundleDependencies": false, - "coordinates": [ - 55.778231, - 12.593179 - ], - "dependencies": {}, - "deprecated": false, - "description": "Get details about the current Continuous Integration environment", - "devDependencies": { - "clear-require": "^1.0.1", - "standard": "^12.0.1", - "tape": "^4.9.1" - }, - "homepage": "https://github.com/watson/ci-info", - "keywords": [ - "ci", - "continuous", - "integration", - "test", - "detect" - ], - "license": "MIT", - "main": "index.js", - "name": "ci-info", - "repository": { - "type": "git", - "url": "git+https://github.com/watson/ci-info.git" - }, - "scripts": { - "test": "standard && node test.js" - }, - "version": "2.0.0" -} diff --git a/node_modules/ci-info/vendors.json b/node_modules/ci-info/vendors.json deleted file mode 100644 index 266a724..0000000 --- a/node_modules/ci-info/vendors.json +++ /dev/null @@ -1,153 +0,0 @@ -[ - { - "name": "AppVeyor", - "constant": "APPVEYOR", - "env": "APPVEYOR", - "pr": "APPVEYOR_PULL_REQUEST_NUMBER" - }, - { - "name": "Azure Pipelines", - "constant": "AZURE_PIPELINES", - "env": "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI", - "pr": "SYSTEM_PULLREQUEST_PULLREQUESTID" - }, - { - "name": "Bamboo", - "constant": "BAMBOO", - "env": "bamboo_planKey" - }, - { - "name": "Bitbucket Pipelines", - "constant": "BITBUCKET", - "env": "BITBUCKET_COMMIT", - "pr": "BITBUCKET_PR_ID" - }, - { - "name": "Bitrise", - "constant": "BITRISE", - "env": "BITRISE_IO", - "pr": "BITRISE_PULL_REQUEST" - }, - { - "name": "Buddy", - "constant": "BUDDY", - "env": "BUDDY_WORKSPACE_ID", - "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID" - }, - { - "name": "Buildkite", - "constant": "BUILDKITE", - "env": "BUILDKITE", - "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } - }, - { - "name": "CircleCI", - "constant": "CIRCLE", - "env": "CIRCLECI", - "pr": "CIRCLE_PULL_REQUEST" - }, - { - "name": "Cirrus CI", - "constant": "CIRRUS", - "env": "CIRRUS_CI", - "pr": "CIRRUS_PR" - }, - { - "name": "AWS CodeBuild", - "constant": "CODEBUILD", - "env": "CODEBUILD_BUILD_ARN" - }, - { - "name": "Codeship", - "constant": "CODESHIP", - "env": { "CI_NAME": "codeship" } - }, - { - "name": "Drone", - "constant": "DRONE", - "env": "DRONE", - "pr": { "DRONE_BUILD_EVENT": "pull_request" } - }, - { - "name": "dsari", - "constant": "DSARI", - "env": "DSARI" - }, - { - "name": "GitLab CI", - "constant": "GITLAB", - "env": "GITLAB_CI" - }, - { - "name": "GoCD", - "constant": "GOCD", - "env": "GO_PIPELINE_LABEL" - }, - { - "name": "Hudson", - "constant": "HUDSON", - "env": "HUDSON_URL" - }, - { - "name": "Jenkins", - "constant": "JENKINS", - "env": ["JENKINS_URL", "BUILD_ID"], - "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } - }, - { - "name": "Magnum CI", - "constant": "MAGNUM", - "env": "MAGNUM" - }, - { - "name": "Netlify CI", - "constant": "NETLIFY", - "env": "NETLIFY_BUILD_BASE", - "pr": { "env": "PULL_REQUEST", "ne": "false" } - }, - { - "name": "Sail CI", - "constant": "SAIL", - "env": "SAILCI", - "pr": "SAIL_PULL_REQUEST_NUMBER" - }, - { - "name": "Semaphore", - "constant": "SEMAPHORE", - "env": "SEMAPHORE", - "pr": "PULL_REQUEST_NUMBER" - }, - { - "name": "Shippable", - "constant": "SHIPPABLE", - "env": "SHIPPABLE", - "pr": { "IS_PULL_REQUEST": "true" } - }, - { - "name": "Solano CI", - "constant": "SOLANO", - "env": "TDDIUM", - "pr": "TDDIUM_PR_ID" - }, - { - "name": "Strider CD", - "constant": "STRIDER", - "env": "STRIDER" - }, - { - "name": "TaskCluster", - "constant": "TASKCLUSTER", - "env": ["TASK_ID", "RUN_ID"] - }, - { - "name": "TeamCity", - "constant": "TEAMCITY", - "env": "TEAMCITY_VERSION" - }, - { - "name": "Travis CI", - "constant": "TRAVIS", - "env": "TRAVIS", - "pr": { "env": "TRAVIS_PULL_REQUEST", "ne": "false" } - } -] diff --git a/node_modules/cli-boxes/boxes.json b/node_modules/cli-boxes/boxes.json deleted file mode 100644 index 4a093c9..0000000 --- a/node_modules/cli-boxes/boxes.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "single": { - "topLeft": "┌", - "topRight": "┐", - "bottomRight": "┘", - "bottomLeft": "└", - "vertical": "│", - "horizontal": "─" - }, - "double": { - "topLeft": "╔", - "topRight": "╗", - "bottomRight": "╝", - "bottomLeft": "╚", - "vertical": "║", - "horizontal": "═" - }, - "round": { - "topLeft": "╭", - "topRight": "╮", - "bottomRight": "╯", - "bottomLeft": "╰", - "vertical": "│", - "horizontal": "─" - }, - "single-double": { - "topLeft": "╓", - "topRight": "╖", - "bottomRight": "╜", - "bottomLeft": "╙", - "vertical": "║", - "horizontal": "─" - }, - "double-single": { - "topLeft": "╒", - "topRight": "╕", - "bottomRight": "╛", - "bottomLeft": "╘", - "vertical": "│", - "horizontal": "═" - }, - "classic": { - "topLeft": "+", - "topRight": "+", - "bottomRight": "+", - "bottomLeft": "+", - "vertical": "|", - "horizontal": "-" - } -} diff --git a/node_modules/cli-boxes/index.js b/node_modules/cli-boxes/index.js deleted file mode 100644 index 1d7c81f..0000000 --- a/node_modules/cli-boxes/index.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = require('./boxes.json'); diff --git a/node_modules/cli-boxes/license b/node_modules/cli-boxes/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/cli-boxes/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/cli-boxes/package.json b/node_modules/cli-boxes/package.json deleted file mode 100644 index b3e5f56..0000000 --- a/node_modules/cli-boxes/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "cli-boxes@^1.0.0", - "_id": "cli-boxes@1.0.0", - "_inBundle": false, - "_integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", - "_location": "/cli-boxes", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cli-boxes@^1.0.0", - "name": "cli-boxes", - "escapedName": "cli-boxes", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "_shasum": "4fa917c3e59c94a004cd61f8ee509da651687143", - "_spec": "cli-boxes@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/cli-boxes/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Boxes for use in the terminal", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "boxes.json" - ], - "homepage": "https://github.com/sindresorhus/cli-boxes#readme", - "keywords": [ - "cli", - "box", - "boxes", - "terminal", - "term", - "console", - "ascii", - "unicode", - "border", - "text", - "json" - ], - "license": "MIT", - "name": "cli-boxes", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/cli-boxes.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0" -} diff --git a/node_modules/cli-boxes/readme.md b/node_modules/cli-boxes/readme.md deleted file mode 100644 index b81816b..0000000 --- a/node_modules/cli-boxes/readme.md +++ /dev/null @@ -1,94 +0,0 @@ -# cli-boxes [![Build Status](https://travis-ci.org/sindresorhus/cli-boxes.svg?branch=master)](https://travis-ci.org/sindresorhus/cli-boxes) - -> Boxes for use in the terminal - -The list of boxes is just a [JSON file](boxes.json) and can be used wherever. - - -## Install - -``` -$ npm install --save cli-boxes -``` - - -## Usage - -```js -const cliBoxes = require('cli-boxes'); - -console.log(cliBoxes.single); -/* -{ - "topLeft": "┌", - "topRight": "┐", - "bottomRight": "┘", - "bottomLeft": "└", - "vertical": "│", - "horizontal": "─" -} -*/ -``` - - -## API - -### cliBoxes - -#### `single` - -``` -┌────┐ -│ │ -└────┘ -``` - -#### `double` - -``` -╔════╗ -║ ║ -╚════╝ -``` - -#### `round` - -``` -╭────╮ -│ │ -╰────╯ -``` - -#### `single-double` - -``` -╓────╖ -║ ║ -╙────╜ -``` - -#### `double-single` - -``` -╒════╕ -│ │ -╘════╛ -``` - -#### `classic` - -``` -+----+ -| | -+----+ -``` - - -## Related - -- [boxen](https://github.com/sindresorhus/boxen) - Create boxes in the terminal - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/cliui/CHANGELOG.md b/node_modules/cliui/CHANGELOG.md index d9e6fbb..ef6a35e 100644 --- a/node_modules/cliui/CHANGELOG.md +++ b/node_modules/cliui/CHANGELOG.md @@ -2,42 +2,6 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -# [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23) - - -### Features - -* add resetOutput method ([#57](https://github.com/yargs/cliui/issues/57)) ([7246902](https://github.com/yargs/cliui/commit/7246902)) - - - - -# [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18) - - -### Bug Fixes - -* downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46)) -* set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36)) - - -### Chores - -* drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376)) - - -### Features - -* add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922)) - - -### BREAKING CHANGES - -* officially drop support for Node < 4 - - - # [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11) diff --git a/node_modules/cliui/README.md b/node_modules/cliui/README.md index 7861976..028392c 100644 --- a/node_modules/cliui/README.md +++ b/node_modules/cliui/README.md @@ -10,7 +10,9 @@ easily create complex multi-column command-line-interfaces. ## Example ```js -var ui = require('cliui')() +var ui = require('cliui')({ + width: 80 +}) ui.div('Usage: $0 [command] [options]') @@ -86,7 +88,6 @@ cliui = require('cliui') ### cliui({width: integer}) Specify the maximum width of the UI being generated. -If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`. ### cliui({wrap: boolean}) @@ -98,7 +99,6 @@ Create a row with any number of columns, a column can either be a string, or an object with the following options: -* **text:** some text to place in the column. * **width:** the width of a column. * **align:** alignment, `right` or `center`. * **padding:** `[top, right, bottom, left]`. @@ -108,8 +108,3 @@ options: Similar to `div`, except the next row will be appended without a new line being created. - -### cliui.resetOutput() - -Resets the UI elements of the current cliui instance, maintaining the values -set for `width` and `wrap`. diff --git a/node_modules/cliui/index.js b/node_modules/cliui/index.js index b42d982..e501e78 100644 --- a/node_modules/cliui/index.js +++ b/node_modules/cliui/index.js @@ -21,10 +21,6 @@ UI.prototype.span = function () { cols.span = true } -UI.prototype.resetOutput = function () { - this.rows = [] -} - UI.prototype.div = function () { if (arguments.length === 0) this.div('') if (this.wrap && this._shouldApplyLayoutDSL.apply(this, arguments)) { @@ -213,7 +209,7 @@ UI.prototype._rasterize = function (row) { row.forEach(function (col, c) { // leave room for left and right padding. col.width = widths[c] - if (_this.wrap) wrapped = wrap(col.text, _this._negatePadding(col), { hard: true }).split('\n') + if (_this.wrap) wrapped = wrap(col.text, _this._negatePadding(col), {hard: true}).split('\n') else wrapped = col.text.split('\n') if (col.border) { @@ -286,10 +282,6 @@ function _minWidth (col) { return minWidth } -function getWindowWidth () { - if (typeof process === 'object' && process.stdout && process.stdout.columns) return process.stdout.columns -} - function alignRight (str, width) { str = str.trim() var padding = '' @@ -318,7 +310,7 @@ module.exports = function (opts) { opts = opts || {} return new UI({ - width: (opts || {}).width || getWindowWidth() || 80, + width: (opts || {}).width || 80, wrap: typeof opts.wrap === 'boolean' ? opts.wrap : true }) } diff --git a/node_modules/cliui/node_modules/ansi-regex/index.js b/node_modules/cliui/node_modules/ansi-regex/index.js deleted file mode 100644 index c4aaecf..0000000 --- a/node_modules/cliui/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = () => { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, 'g'); -}; diff --git a/node_modules/cliui/node_modules/ansi-regex/license b/node_modules/cliui/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/cliui/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/cliui/node_modules/ansi-regex/package.json b/node_modules/cliui/node_modules/ansi-regex/package.json deleted file mode 100644 index ab2466e..0000000 --- a/node_modules/cliui/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "ansi-regex@^3.0.0", - "_id": "ansi-regex@3.0.0", - "_inBundle": false, - "_integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "_location": "/cliui/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-regex@^3.0.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/cliui/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "_shasum": "ed0317c322064f79466c02966bddb605ab37d998", - "_spec": "ansi-regex@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/cliui/node_modules/strip-ansi", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/ansi-regex#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "3.0.0" -} diff --git a/node_modules/cliui/node_modules/ansi-regex/readme.md b/node_modules/cliui/node_modules/ansi-regex/readme.md deleted file mode 100644 index 22db1c3..0000000 --- a/node_modules/cliui/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] -``` - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js b/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index d506327..0000000 --- a/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -/* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { - return false; - } - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || - // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || - // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || - // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || - // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || - // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || - // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || - // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || - // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || - // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) - ) - ) { - return true; - } - - return false; -}; diff --git a/node_modules/cliui/node_modules/is-fullwidth-code-point/license b/node_modules/cliui/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/cliui/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/cliui/node_modules/is-fullwidth-code-point/package.json b/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index afc885e..0000000 --- a/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-fullwidth-code-point@^2.0.0", - "_id": "is-fullwidth-code-point@2.0.0", - "_inBundle": false, - "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "_location": "/cliui/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-fullwidth-code-point@^2.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/cliui/string-width" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", - "_spec": "is-fullwidth-code-point@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/cliui/node_modules/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "license": "MIT", - "name": "is-fullwidth-code-point", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md b/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 093b028..0000000 --- a/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/cliui/node_modules/string-width/index.js b/node_modules/cliui/node_modules/string-width/index.js deleted file mode 100644 index bbc49d2..0000000 --- a/node_modules/cliui/node_modules/string-width/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -module.exports = str => { - if (typeof str !== 'string' || str.length === 0) { - return 0; - } - - str = stripAnsi(str); - - let width = 0; - - for (let i = 0; i < str.length; i++) { - const code = str.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; diff --git a/node_modules/cliui/node_modules/string-width/license b/node_modules/cliui/node_modules/string-width/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/cliui/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/cliui/node_modules/string-width/package.json b/node_modules/cliui/node_modules/string-width/package.json deleted file mode 100644 index e09c6b3..0000000 --- a/node_modules/cliui/node_modules/string-width/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "string-width@^2.1.1", - "_id": "string-width@2.1.1", - "_inBundle": false, - "_integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "_location": "/cliui/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^2.1.1", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^2.1.1", - "saveSpec": null, - "fetchSpec": "^2.1.1" - }, - "_requiredBy": [ - "/cliui" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "_shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e", - "_spec": "string-width@^2.1.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/cliui", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "license": "MIT", - "name": "string-width", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/string-width.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.1.1" -} diff --git a/node_modules/cliui/node_modules/string-width/readme.md b/node_modules/cliui/node_modules/string-width/readme.md deleted file mode 100644 index df5b719..0000000 --- a/node_modules/cliui/node_modules/string-width/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/cliui/node_modules/strip-ansi/index.js b/node_modules/cliui/node_modules/strip-ansi/index.js deleted file mode 100644 index 96e0292..0000000 --- a/node_modules/cliui/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; diff --git a/node_modules/cliui/node_modules/strip-ansi/license b/node_modules/cliui/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/cliui/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/cliui/node_modules/strip-ansi/package.json b/node_modules/cliui/node_modules/strip-ansi/package.json deleted file mode 100644 index b5e4e22..0000000 --- a/node_modules/cliui/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "strip-ansi@^4.0.0", - "_id": "strip-ansi@4.0.0", - "_inBundle": false, - "_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "_location": "/cliui/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^4.0.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/cliui", - "/cliui/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "_shasum": "a8479022eb1ac368a871389b635262c505ee368f", - "_spec": "strip-ansi@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/cliui", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/strip-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/strip-ansi#readme", - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} diff --git a/node_modules/cliui/node_modules/strip-ansi/readme.md b/node_modules/cliui/node_modules/strip-ansi/readme.md deleted file mode 100644 index dc76f0c..0000000 --- a/node_modules/cliui/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/cliui/package.json b/node_modules/cliui/package.json index 529f508..0a1bcba 100644 --- a/node_modules/cliui/package.json +++ b/node_modules/cliui/package.json @@ -1,26 +1,26 @@ { - "_from": "cliui@^4.0.0", - "_id": "cliui@4.1.0", + "_from": "cliui@^3.2.0", + "_id": "cliui@3.2.0", "_inBundle": false, - "_integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "_integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "_location": "/cliui", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "cliui@^4.0.0", + "raw": "cliui@^3.2.0", "name": "cliui", "escapedName": "cliui", - "rawSpec": "^4.0.0", + "rawSpec": "^3.2.0", "saveSpec": null, - "fetchSpec": "^4.0.0" + "fetchSpec": "^3.2.0" }, "_requiredBy": [ "/yargs" ], - "_resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "_shasum": "348422dbe82d800b3022eef4f6ac10bf2e4d1b49", - "_spec": "cliui@^4.0.0", + "_resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "_shasum": "120601537a916d29940f934da3b48d585a39213d", + "_spec": "cliui@^3.2.0", "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/yargs", "author": { "name": "Ben Coe", @@ -43,8 +43,8 @@ } }, "dependencies": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", "wrap-ansi": "^2.0.0" }, "deprecated": false, @@ -53,13 +53,10 @@ "chai": "^3.5.0", "chalk": "^1.1.2", "coveralls": "^2.11.8", - "mocha": "^3.0.0", - "nyc": "^10.0.0", - "standard": "^8.0.0", - "standard-version": "^3.0.0" - }, - "engine": { - "node": ">=4" + "mocha": "^2.4.5", + "nyc": "^6.4.0", + "standard": "^6.0.8", + "standard-version": "^2.1.2" }, "files": [ "index.js" @@ -84,8 +81,8 @@ "scripts": { "coverage": "nyc --reporter=text-lcov mocha | coveralls", "pretest": "standard", - "release": "standard-version", - "test": "nyc mocha" + "test": "nyc mocha", + "version": "standard-version" }, "standard": { "ignore": [ @@ -95,5 +92,5 @@ "it" ] }, - "version": "4.1.0" + "version": "3.2.0" } diff --git a/node_modules/code-point-at/package.json b/node_modules/code-point-at/package.json index e1e228b..a1021bf 100644 --- a/node_modules/code-point-at/package.json +++ b/node_modules/code-point-at/package.json @@ -1,27 +1,32 @@ { - "_from": "code-point-at@^1.0.0", + "_args": [ + [ + "code-point-at@1.1.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "code-point-at@1.1.0", "_id": "code-point-at@1.1.0", "_inBundle": false, "_integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "_location": "/code-point-at", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "code-point-at@^1.0.0", + "raw": "code-point-at@1.1.0", "name": "code-point-at", "escapedName": "code-point-at", - "rawSpec": "^1.0.0", + "rawSpec": "1.1.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.1.0" }, "_requiredBy": [ "/string-width" ], "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "_shasum": "0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77", - "_spec": "code-point-at@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/string-width", + "_spec": "1.1.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +35,6 @@ "bugs": { "url": "https://github.com/sindresorhus/code-point-at/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "ES2015 `String#codePointAt()` ponyfill", "devDependencies": { "ava": "*", diff --git a/node_modules/combined-stream/package.json b/node_modules/combined-stream/package.json index 12ff4ca..4e50833 100644 --- a/node_modules/combined-stream/package.json +++ b/node_modules/combined-stream/package.json @@ -1,28 +1,33 @@ { - "_from": "combined-stream@~1.0.6", + "_args": [ + [ + "combined-stream@1.0.7", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "combined-stream@1.0.7", "_id": "combined-stream@1.0.7", "_inBundle": false, "_integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "_location": "/combined-stream", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "combined-stream@~1.0.6", + "raw": "combined-stream@1.0.7", "name": "combined-stream", "escapedName": "combined-stream", - "rawSpec": "~1.0.6", + "rawSpec": "1.0.7", "saveSpec": null, - "fetchSpec": "~1.0.6" + "fetchSpec": "1.0.7" }, "_requiredBy": [ "/form-data", "/request" ], "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "_shasum": "2d1d24317afb8abe95d6d2c0b07b57813539d828", - "_spec": "combined-stream@~1.0.6", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "1.0.7", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Felix Geisendörfer", "email": "felix@debuggable.com", @@ -31,11 +36,9 @@ "bugs": { "url": "https://github.com/felixge/node-combined-stream/issues" }, - "bundleDependencies": false, "dependencies": { "delayed-stream": "~1.0.0" }, - "deprecated": false, "description": "A stream that emits multiple other streams one after another.", "devDependencies": { "far": "~0.0.7" diff --git a/node_modules/compare-version/package.json b/node_modules/compare-version/package.json index 3666420..9c3c1fc 100644 --- a/node_modules/compare-version/package.json +++ b/node_modules/compare-version/package.json @@ -1,27 +1,33 @@ { - "_from": "compare-version@^0.1.2", + "_args": [ + [ + "compare-version@0.1.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "compare-version@0.1.2", "_id": "compare-version@0.1.2", "_inBundle": false, "_integrity": "sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA=", "_location": "/compare-version", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "compare-version@^0.1.2", + "raw": "compare-version@0.1.2", "name": "compare-version", "escapedName": "compare-version", - "rawSpec": "^0.1.2", + "rawSpec": "0.1.2", "saveSpec": null, - "fetchSpec": "^0.1.2" + "fetchSpec": "0.1.2" }, "_requiredBy": [ "/electron-osx-sign" ], "_resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz", - "_shasum": "0162ec2d9351f5ddd59a9202cba935366a725080", - "_spec": "compare-version@^0.1.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-osx-sign", + "_spec": "0.1.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Kevin Mårtensson", "email": "kevinmartensson@gmail.com", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/kevva/compare-version/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Compare semver version numbers", "devDependencies": { "browserify": "^3.44.2", diff --git a/node_modules/concat-map/package.json b/node_modules/concat-map/package.json index 4a32500..330a6cc 100644 --- a/node_modules/concat-map/package.json +++ b/node_modules/concat-map/package.json @@ -1,4 +1,11 @@ { + "_args": [ + [ + "concat-map@0.0.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, "_from": "concat-map@0.0.1", "_id": "concat-map@0.0.1", "_inBundle": false, @@ -19,9 +26,8 @@ "/brace-expansion" ], "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_spec": "concat-map@0.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/brace-expansion", + "_spec": "0.0.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "James Halliday", "email": "mail@substack.net", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/substack/node-concat-map/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "concatenative mapdashery", "devDependencies": { "tape": "~2.4.0" diff --git a/node_modules/concat-stream/node_modules/isarray/package.json b/node_modules/concat-stream/node_modules/isarray/package.json index d45f954..20de602 100644 --- a/node_modules/concat-stream/node_modules/isarray/package.json +++ b/node_modules/concat-stream/node_modules/isarray/package.json @@ -1,27 +1,33 @@ { - "_from": "isarray@~1.0.0", + "_args": [ + [ + "isarray@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "isarray@1.0.0", "_id": "isarray@1.0.0", "_inBundle": false, "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "_location": "/concat-stream/isarray", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "isarray@~1.0.0", + "raw": "isarray@1.0.0", "name": "isarray", "escapedName": "isarray", - "rawSpec": "~1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "~1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/concat-stream/readable-stream" ], "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "_spec": "isarray@~1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/concat-stream/node_modules/readable-stream", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", @@ -30,9 +36,7 @@ "bugs": { "url": "https://github.com/juliangruber/isarray/issues" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, "description": "Array#isArray for older browsers", "devDependencies": { "tape": "~2.13.4" diff --git a/node_modules/concat-stream/node_modules/readable-stream/package.json b/node_modules/concat-stream/node_modules/readable-stream/package.json index fbda14e..0e53dd8 100644 --- a/node_modules/concat-stream/node_modules/readable-stream/package.json +++ b/node_modules/concat-stream/node_modules/readable-stream/package.json @@ -1,27 +1,33 @@ { - "_from": "readable-stream@^2.2.2", + "_args": [ + [ + "readable-stream@2.3.6", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "readable-stream@2.3.6", "_id": "readable-stream@2.3.6", "_inBundle": false, "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "_location": "/concat-stream/readable-stream", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "readable-stream@^2.2.2", + "raw": "readable-stream@2.3.6", "name": "readable-stream", "escapedName": "readable-stream", - "rawSpec": "^2.2.2", + "rawSpec": "2.3.6", "saveSpec": null, - "fetchSpec": "^2.2.2" + "fetchSpec": "2.3.6" }, "_requiredBy": [ "/concat-stream" ], "_resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@^2.2.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/concat-stream", + "_spec": "2.3.6", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "browser": { "util": false, "./readable.js": "./readable-browser.js", @@ -32,7 +38,6 @@ "bugs": { "url": "https://github.com/nodejs/readable-stream/issues" }, - "bundleDependencies": false, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -42,7 +47,6 @@ "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" }, - "deprecated": false, "description": "Streams3, a user-land copy of the stream library from Node.js", "devDependencies": { "assert": "^1.4.0", diff --git a/node_modules/concat-stream/node_modules/string_decoder/package.json b/node_modules/concat-stream/node_modules/string_decoder/package.json index 07fa3e1..863fb7a 100644 --- a/node_modules/concat-stream/node_modules/string_decoder/package.json +++ b/node_modules/concat-stream/node_modules/string_decoder/package.json @@ -1,35 +1,39 @@ { - "_from": "string_decoder@~1.1.1", + "_args": [ + [ + "string_decoder@1.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "string_decoder@1.1.1", "_id": "string_decoder@1.1.1", "_inBundle": false, "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "_location": "/concat-stream/string_decoder", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "string_decoder@~1.1.1", + "raw": "string_decoder@1.1.1", "name": "string_decoder", "escapedName": "string_decoder", - "rawSpec": "~1.1.1", + "rawSpec": "1.1.1", "saveSpec": null, - "fetchSpec": "~1.1.1" + "fetchSpec": "1.1.1" }, "_requiredBy": [ "/concat-stream/readable-stream" ], "_resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", - "_spec": "string_decoder@~1.1.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/concat-stream/node_modules/readable-stream", + "_spec": "1.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/nodejs/string_decoder/issues" }, - "bundleDependencies": false, "dependencies": { "safe-buffer": "~5.1.0" }, - "deprecated": false, "description": "The string_decoder module from Node core", "devDependencies": { "babel-polyfill": "^6.23.0", diff --git a/node_modules/concat-stream/package.json b/node_modules/concat-stream/package.json index 20af11d..2bb6873 100644 --- a/node_modules/concat-stream/package.json +++ b/node_modules/concat-stream/package.json @@ -1,4 +1,11 @@ { + "_args": [ + [ + "concat-stream@1.6.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, "_from": "concat-stream@1.6.2", "_id": "concat-stream@1.6.2", "_inBundle": false, @@ -25,9 +32,8 @@ "/extract-zip" ], "_resolved": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "_shasum": "904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34", - "_spec": "concat-stream@1.6.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/extract-zip", + "_spec": "1.6.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Max Ogden", "email": "max@maxogden.com" @@ -35,14 +41,12 @@ "bugs": { "url": "http://github.com/maxogden/concat-stream/issues" }, - "bundleDependencies": false, "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^2.2.2", "typedarray": "^0.0.6" }, - "deprecated": false, "description": "writable stream that concatenates strings or binary data and calls a callback with the result", "devDependencies": { "tape": "^4.6.3" diff --git a/node_modules/configstore/index.js b/node_modules/configstore/index.js deleted file mode 100644 index fb94420..0000000 --- a/node_modules/configstore/index.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict'; -const path = require('path'); -const os = require('os'); -const fs = require('graceful-fs'); -const makeDir = require('make-dir'); -const xdgBasedir = require('xdg-basedir'); -const writeFileAtomic = require('write-file-atomic'); -const dotProp = require('dot-prop'); -const uniqueString = require('unique-string'); - -const configDir = xdgBasedir.config || path.join(os.tmpdir(), uniqueString()); -const permissionError = 'You don\'t have access to this file.'; -const makeDirOptions = {mode: 0o0700}; -const writeFileOptions = {mode: 0o0600}; - -class Configstore { - constructor(id, defaults, opts) { - opts = opts || {}; - - const pathPrefix = opts.globalConfigPath ? - path.join(id, 'config.json') : - path.join('configstore', `${id}.json`); - - this.path = path.join(configDir, pathPrefix); - this.all = Object.assign({}, defaults, this.all); - } - - get all() { - try { - return JSON.parse(fs.readFileSync(this.path, 'utf8')); - } catch (err) { - // Create dir if it doesn't exist - if (err.code === 'ENOENT') { - makeDir.sync(path.dirname(this.path), makeDirOptions); - return {}; - } - - // Improve the message of permission errors - if (err.code === 'EACCES') { - err.message = `${err.message}\n${permissionError}\n`; - } - - // Empty the file if it encounters invalid JSON - if (err.name === 'SyntaxError') { - writeFileAtomic.sync(this.path, '', writeFileOptions); - return {}; - } - - throw err; - } - } - - set all(val) { - try { - // Make sure the folder exists as it could have been deleted in the meantime - makeDir.sync(path.dirname(this.path), makeDirOptions); - - writeFileAtomic.sync(this.path, JSON.stringify(val, null, '\t'), writeFileOptions); - } catch (err) { - // Improve the message of permission errors - if (err.code === 'EACCES') { - err.message = `${err.message}\n${permissionError}\n`; - } - - throw err; - } - } - - get size() { - return Object.keys(this.all || {}).length; - } - - get(key) { - return dotProp.get(this.all, key); - } - - set(key, val) { - const config = this.all; - - if (arguments.length === 1) { - for (const k of Object.keys(key)) { - dotProp.set(config, k, key[k]); - } - } else { - dotProp.set(config, key, val); - } - - this.all = config; - } - - has(key) { - return dotProp.has(this.all, key); - } - - delete(key) { - const config = this.all; - dotProp.delete(config, key); - this.all = config; - } - - clear() { - this.all = {}; - } -} - -module.exports = Configstore; diff --git a/node_modules/configstore/license b/node_modules/configstore/license deleted file mode 100644 index be304e2..0000000 --- a/node_modules/configstore/license +++ /dev/null @@ -1,9 +0,0 @@ -Copyright Sindre Sorhus (sindresorhus.com) - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/configstore/package.json b/node_modules/configstore/package.json deleted file mode 100644 index 6db8a33..0000000 --- a/node_modules/configstore/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "configstore@^3.0.0", - "_id": "configstore@3.1.2", - "_inBundle": false, - "_integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", - "_location": "/configstore", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "configstore@^3.0.0", - "name": "configstore", - "escapedName": "configstore", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "_shasum": "c6f25defaeef26df12dd33414b001fe81a543f8f", - "_spec": "configstore@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/yeoman/configstore/issues" - }, - "bundleDependencies": false, - "dependencies": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - }, - "deprecated": false, - "description": "Easily load and save config without having to think about where and how", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/yeoman/configstore#readme", - "keywords": [ - "config", - "store", - "storage", - "conf", - "configuration", - "settings", - "preferences", - "json", - "data", - "persist", - "persistent", - "save" - ], - "license": "BSD-2-Clause", - "name": "configstore", - "repository": { - "type": "git", - "url": "git+https://github.com/yeoman/configstore.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.1.2" -} diff --git a/node_modules/configstore/readme.md b/node_modules/configstore/readme.md deleted file mode 100644 index 6af3771..0000000 --- a/node_modules/configstore/readme.md +++ /dev/null @@ -1,116 +0,0 @@ -# configstore [![Build Status](https://travis-ci.org/yeoman/configstore.svg?branch=master)](https://travis-ci.org/yeoman/configstore) - -> Easily load and persist config without having to think about where and how - -Config is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.config`.
-Example: `~/.config/configstore/some-id.json` - -*If you need this for Electron, check out [`electron-store`](https://github.com/sindresorhus/electron-store) instead.* - - -## Usage - -```js -const Configstore = require('configstore'); -const pkg = require('./package.json'); - -// create a Configstore instance with an unique ID e.g. -// Package name and optionally some default values -const conf = new Configstore(pkg.name, {foo: 'bar'}); - -console.log(conf.get('foo')); -//=> 'bar' - -conf.set('awesome', true); -console.log(conf.get('awesome')); -//=> true - -// Use dot-notation to access nested properties -conf.set('bar.baz', true); -console.log(conf.get('bar')); -//=> {baz: true} - -conf.delete('awesome'); -console.log(conf.get('awesome')); -//=> undefined -``` - - -## API - -### Configstore(packageName, [defaults], [options]) - -Returns a new instance. - -#### packageName - -Type: `string` - -Name of your package. - -#### defaults - -Type: `Object` - -Default config. - -#### options - -##### globalConfigPath - -Type: `boolean`
-Default: `false` - -Store the config at `$CONFIG/package-name/config.json` instead of the default `$CONFIG/configstore/package-name.json`. This is not recommended as you might end up conflicting with other tools, rendering the "without having to think" idea moot. - -### Instance - -You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties. - -### .set(key, value) - -Set an item. - -### .set(object) - -Set multiple items at once. - -### .get(key) - -Get an item. - -### .has(key) - -Check if an item exists. - -### .delete(key) - -Delete an item. - -### .clear() - -Delete all items. - -### .size - -Get the item count. - -### .path - -Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them. - -### .all - -Get all the config as an object or replace the current config with an object: - -```js -conf.all = { - hello: 'world' -}; -``` - - -## License - -[BSD license](http://opensource.org/licenses/bsd-license.php)
-Copyright Google diff --git a/node_modules/core-util-is/package.json b/node_modules/core-util-is/package.json index 094a15e..b785b6a 100644 --- a/node_modules/core-util-is/package.json +++ b/node_modules/core-util-is/package.json @@ -1,29 +1,38 @@ { - "_from": "core-util-is@~1.0.0", + "_args": [ + [ + "core-util-is@1.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "core-util-is@1.0.2", "_id": "core-util-is@1.0.2", "_inBundle": false, "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "_location": "/core-util-is", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "core-util-is@~1.0.0", + "raw": "core-util-is@1.0.2", "name": "core-util-is", "escapedName": "core-util-is", - "rawSpec": "~1.0.0", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "~1.0.0" + "fetchSpec": "1.0.2" }, "_requiredBy": [ + "/are-we-there-yet/readable-stream", + "/bl/readable-stream", "/concat-stream/readable-stream", + "/data-table/readable-stream", "/readable-stream", + "/tar-stream/readable-stream", "/verror" ], "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "_spec": "core-util-is@~1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/readable-stream", + "_spec": "1.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -32,8 +41,6 @@ "bugs": { "url": "https://github.com/isaacs/core-util-is/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "The `util.is*` functions introduced in Node v0.12.", "devDependencies": { "tap": "^2.3.0" diff --git a/node_modules/create-error-class/index.js b/node_modules/create-error-class/index.js deleted file mode 100644 index e415aa7..0000000 --- a/node_modules/create-error-class/index.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; -var captureStackTrace = require('capture-stack-trace'); - -function inherits(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -} - -module.exports = function createErrorClass(className, setup) { - if (typeof className !== 'string') { - throw new TypeError('Expected className to be a string'); - } - - if (/[^0-9a-zA-Z_$]/.test(className)) { - throw new Error('className contains invalid characters'); - } - - setup = setup || function (message) { - this.message = message; - }; - - var ErrorClass = function () { - Object.defineProperty(this, 'name', { - configurable: true, - value: className, - writable: true - }); - - captureStackTrace(this, this.constructor); - - setup.apply(this, arguments); - }; - - inherits(ErrorClass, Error); - - return ErrorClass; -}; diff --git a/node_modules/create-error-class/license b/node_modules/create-error-class/license deleted file mode 100644 index 1aeb74f..0000000 --- a/node_modules/create-error-class/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -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/create-error-class/package.json b/node_modules/create-error-class/package.json deleted file mode 100644 index 7abe7f4..0000000 --- a/node_modules/create-error-class/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "create-error-class@^3.0.0", - "_id": "create-error-class@3.0.2", - "_inBundle": false, - "_integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", - "_location": "/create-error-class", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "create-error-class@^3.0.0", - "name": "create-error-class", - "escapedName": "create-error-class", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "_shasum": "06be7abef947a3f14a30fd610671d401bca8b7b6", - "_spec": "create-error-class@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/got", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/create-error-class/issues" - }, - "bundleDependencies": false, - "dependencies": { - "capture-stack-trace": "^1.0.0" - }, - "deprecated": false, - "description": "Create Error classes", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/create-error-class#readme", - "keywords": [], - "license": "MIT", - "name": "create-error-class", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/create-error-class.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "3.0.2" -} diff --git a/node_modules/create-error-class/readme.md b/node_modules/create-error-class/readme.md deleted file mode 100644 index d993cea..0000000 --- a/node_modules/create-error-class/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# create-error-class [![Build Status](https://travis-ci.org/floatdrop/create-error-class.svg?branch=master)](https://travis-ci.org/floatdrop/create-error-class) - -> Create error class - - -## Install - -``` -$ npm install --save create-error-class -``` - - -## Usage - -```js -var createErrorClass = require('create-error-class'); - -var HTTPError = createErrorClass('HTTPError', function (props) { - this.message = 'Status code is ' + props.statusCode; -}); - -throw new HTTPError({statusCode: 404}); -``` - - -## API - -### createErrorClass(className, [setup]) - -Return constructor of Errors with `className`. - -#### className - -*Required* -Type: `string` - -Class name of Error Object. Should contain characters from `[0-9a-zA-Z_$]` range. - -#### setup -Type: `function` - -Setup function, that will be called after each Error object is created from constructor with context of Error object. - -By default `setup` function sets `this.message` as first argument: - -```js -var MyError = createErrorClass('MyError'); - -new MyError('Something gone wrong!').message; // => 'Something gone wrong!' -``` - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/cross-spawn/CHANGELOG.md b/node_modules/cross-spawn/CHANGELOG.md deleted file mode 100644 index f1298a8..0000000 --- a/node_modules/cross-spawn/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -## 5.0.0 - 2016-10-30 - -- Add support for `options.shell` -- Improve parsing of shebangs by using [`shebang-command`](https://github.com/kevva/shebang-command) module -- Refactor some code to make it more clear -- Update README caveats diff --git a/node_modules/cross-spawn/LICENSE b/node_modules/cross-spawn/LICENSE deleted file mode 100644 index db5e914..0000000 --- a/node_modules/cross-spawn/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 IndigoUnited - -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/cross-spawn/README.md b/node_modules/cross-spawn/README.md deleted file mode 100644 index dde730d..0000000 --- a/node_modules/cross-spawn/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# cross-spawn - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] - -[npm-url]:https://npmjs.org/package/cross-spawn -[downloads-image]:http://img.shields.io/npm/dm/cross-spawn.svg -[npm-image]:http://img.shields.io/npm/v/cross-spawn.svg -[travis-url]:https://travis-ci.org/IndigoUnited/node-cross-spawn -[travis-image]:http://img.shields.io/travis/IndigoUnited/node-cross-spawn/master.svg -[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn -[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg -[david-dm-url]:https://david-dm.org/IndigoUnited/node-cross-spawn -[david-dm-image]:https://img.shields.io/david/IndigoUnited/node-cross-spawn.svg -[david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-cross-spawn#info=devDependencies -[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/node-cross-spawn.svg - -A cross platform solution to node's spawn and spawnSync. - - -## Installation - -`$ npm install cross-spawn` - -If you are using `spawnSync` on node 0.10 or older, you will also need to install `spawn-sync`: - -`$ npm install spawn-sync` - - -## Why - -Node has issues when using spawn on Windows: - -- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318) -- It does not support [shebangs](http://pt.wikipedia.org/wiki/Shebang) -- No `options.shell` support on node < v6 -- It does not allow you to run `del` or `dir` - -All these issues are handled correctly by `cross-spawn`. -There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments. - - -## Usage - -Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement. - - -```js -var spawn = require('cross-spawn'); - -// Spawn NPM asynchronously -var child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' }); - -// Spawn NPM synchronously -var results = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' }); -``` - - -## Caveats - -#### `options.shell` as an alternative to `cross-spawn` - -Starting from node v6, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves most of the problems that `cross-spawn` attempts to solve, but: - -- It's not supported in node < v6 -- It has no support for shebangs on Windows -- You must manually escape the command and arguments which is very error prone, specially when passing user input - -If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned. - - -#### Shebangs - -While `cross-spawn` handles shebangs on Windows, its support is limited: e.g.: it doesn't handle arguments after the path, e.g.: `#!/bin/bash -e`. - -Remember to always test your code on Windows! - - -## Tests - -`$ npm test` - - -## License - -Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/node_modules/cross-spawn/index.js b/node_modules/cross-spawn/index.js deleted file mode 100644 index 7814a96..0000000 --- a/node_modules/cross-spawn/index.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -var cp = require('child_process'); -var parse = require('./lib/parse'); -var enoent = require('./lib/enoent'); - -var cpSpawnSync = cp.spawnSync; - -function spawn(command, args, options) { - var parsed; - var spawned; - - // Parse the arguments - parsed = parse(command, args, options); - - // Spawn the child process - spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); - - return spawned; -} - -function spawnSync(command, args, options) { - var parsed; - var result; - - if (!cpSpawnSync) { - try { - cpSpawnSync = require('spawn-sync'); // eslint-disable-line global-require - } catch (ex) { - throw new Error( - 'In order to use spawnSync on node 0.10 or older, you must ' + - 'install spawn-sync:\n\n' + - ' npm install spawn-sync --save' - ); - } - } - - // Parse the arguments - parsed = parse(command, args, options); - - // Spawn the child process - result = cpSpawnSync(parsed.command, parsed.args, parsed.options); - - // Analyze if the command does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); - - return result; -} - -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; - -module.exports._parse = parse; -module.exports._enoent = enoent; diff --git a/node_modules/cross-spawn/lib/enoent.js b/node_modules/cross-spawn/lib/enoent.js deleted file mode 100644 index d0a193a..0000000 --- a/node_modules/cross-spawn/lib/enoent.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -var isWin = process.platform === 'win32'; -var resolveCommand = require('./util/resolveCommand'); - -var isNode10 = process.version.indexOf('v0.10.') === 0; - -function notFoundError(command, syscall) { - var err; - - err = new Error(syscall + ' ' + command + ' ENOENT'); - err.code = err.errno = 'ENOENT'; - err.syscall = syscall + ' ' + command; - - return err; -} - -function hookChildProcess(cp, parsed) { - var originalEmit; - - if (!isWin) { - return; - } - - originalEmit = cp.emit; - cp.emit = function (name, arg1) { - var err; - - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - err = verifyENOENT(arg1, parsed, 'spawn'); - - if (err) { - return originalEmit.call(cp, 'error', err); - } - } - - return originalEmit.apply(cp, arguments); - }; -} - -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } - - return null; -} - -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } - - // If we are in node 10, then we are using spawn-sync; if it exited - // with -1 it probably means that the command does not exist - if (isNode10 && status === -1) { - parsed.file = isWin ? parsed.file : resolveCommand(parsed.original); - - if (!parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } - } - - return null; -} - -module.exports.hookChildProcess = hookChildProcess; -module.exports.verifyENOENT = verifyENOENT; -module.exports.verifyENOENTSync = verifyENOENTSync; -module.exports.notFoundError = notFoundError; diff --git a/node_modules/cross-spawn/lib/parse.js b/node_modules/cross-spawn/lib/parse.js deleted file mode 100644 index 10a0136..0000000 --- a/node_modules/cross-spawn/lib/parse.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -var resolveCommand = require('./util/resolveCommand'); -var hasEmptyArgumentBug = require('./util/hasEmptyArgumentBug'); -var escapeArgument = require('./util/escapeArgument'); -var escapeCommand = require('./util/escapeCommand'); -var readShebang = require('./util/readShebang'); - -var isWin = process.platform === 'win32'; -var skipShellRegExp = /\.(?:com|exe)$/i; - -// Supported in Node >= 6 and >= 4.8 -var supportsShellOption = parseInt(process.version.substr(1).split('.')[0], 10) >= 6 || - parseInt(process.version.substr(1).split('.')[0], 10) === 4 && parseInt(process.version.substr(1).split('.')[1], 10) >= 8; - -function parseNonShell(parsed) { - var shebang; - var needsShell; - var applyQuotes; - - if (!isWin) { - return parsed; - } - - // Detect & add support for shebangs - parsed.file = resolveCommand(parsed.command); - parsed.file = parsed.file || resolveCommand(parsed.command, true); - shebang = parsed.file && readShebang(parsed.file); - - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; - needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(resolveCommand(shebang) || resolveCommand(shebang, true)); - } else { - needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(parsed.file); - } - - // If a shell is required, use cmd.exe and take care of escaping everything correctly - if (needsShell) { - // Escape command & arguments - applyQuotes = (parsed.command !== 'echo'); // Do not quote arguments for the special "echo" command - parsed.command = escapeCommand(parsed.command); - parsed.args = parsed.args.map(function (arg) { - return escapeArgument(arg, applyQuotes); - }); - - // Make use of cmd.exe - parsed.args = ['/d', '/s', '/c', '"' + parsed.command + (parsed.args.length ? ' ' + parsed.args.join(' ') : '') + '"']; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } - - return parsed; -} - -function parseShell(parsed) { - var shellCommand; - - // If node supports the shell option, there's no need to mimic its behavior - if (supportsShellOption) { - return parsed; - } - - // Mimic node shell option, see: https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 - shellCommand = [parsed.command].concat(parsed.args).join(' '); - - if (isWin) { - parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; - parsed.args = ['/d', '/s', '/c', '"' + shellCommand + '"']; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } else { - if (typeof parsed.options.shell === 'string') { - parsed.command = parsed.options.shell; - } else if (process.platform === 'android') { - parsed.command = '/system/bin/sh'; - } else { - parsed.command = '/bin/sh'; - } - - parsed.args = ['-c', shellCommand]; - } - - return parsed; -} - -// ------------------------------------------------ - -function parse(command, args, options) { - var parsed; - - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } - - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = options || {}; - - // Build our parsed object - parsed = { - command: command, - args: args, - options: options, - file: undefined, - original: command, - }; - - // Delegate further parsing to shell or non-shell - return options.shell ? parseShell(parsed) : parseNonShell(parsed); -} - -module.exports = parse; diff --git a/node_modules/cross-spawn/lib/util/escapeArgument.js b/node_modules/cross-spawn/lib/util/escapeArgument.js deleted file mode 100644 index 367263f..0000000 --- a/node_modules/cross-spawn/lib/util/escapeArgument.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -function escapeArgument(arg, quote) { - // Convert to string - arg = '' + arg; - - // If we are not going to quote the argument, - // escape shell metacharacters, including double and single quotes: - if (!quote) { - arg = arg.replace(/([()%!^<>&|;,"'\s])/g, '^$1'); - } else { - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, '$1$1'); - - // All other backslashes occur literally - - // Quote the whole thing: - arg = '"' + arg + '"'; - } - - return arg; -} - -module.exports = escapeArgument; diff --git a/node_modules/cross-spawn/lib/util/escapeCommand.js b/node_modules/cross-spawn/lib/util/escapeCommand.js deleted file mode 100644 index d9c25b2..0000000 --- a/node_modules/cross-spawn/lib/util/escapeCommand.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var escapeArgument = require('./escapeArgument'); - -function escapeCommand(command) { - // Do not escape if this command is not dangerous.. - // We do this so that commands like "echo" or "ifconfig" work - // Quoting them, will make them unaccessible - return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true); -} - -module.exports = escapeCommand; diff --git a/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js b/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js deleted file mode 100644 index 9f2eba6..0000000 --- a/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -// See: https://github.com/IndigoUnited/node-cross-spawn/pull/34#issuecomment-221623455 -function hasEmptyArgumentBug() { - var nodeVer; - - if (process.platform !== 'win32') { - return false; - } - - nodeVer = process.version.substr(1).split('.').map(function (num) { - return parseInt(num, 10); - }); - - return (nodeVer[0] === 0 && nodeVer[1] < 12); -} - -module.exports = hasEmptyArgumentBug(); diff --git a/node_modules/cross-spawn/lib/util/readShebang.js b/node_modules/cross-spawn/lib/util/readShebang.js deleted file mode 100644 index 2cf3541..0000000 --- a/node_modules/cross-spawn/lib/util/readShebang.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var fs = require('fs'); -var LRU = require('lru-cache'); -var shebangCommand = require('shebang-command'); - -var shebangCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec - -function readShebang(command) { - var buffer; - var fd; - var shebang; - - // Check if it is in the cache first - if (shebangCache.has(command)) { - return shebangCache.get(command); - } - - // Read the first 150 bytes from the file - buffer = new Buffer(150); - - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, 150, 0); - fs.closeSync(fd); - } catch (e) { /* empty */ } - - // Attempt to extract shebang (null is returned if not a shebang) - shebang = shebangCommand(buffer.toString()); - - // Store the shebang in the cache - shebangCache.set(command, shebang); - - return shebang; -} - -module.exports = readShebang; diff --git a/node_modules/cross-spawn/lib/util/resolveCommand.js b/node_modules/cross-spawn/lib/util/resolveCommand.js deleted file mode 100644 index b7a9490..0000000 --- a/node_modules/cross-spawn/lib/util/resolveCommand.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var path = require('path'); -var which = require('which'); -var LRU = require('lru-cache'); - -var commandCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec - -function resolveCommand(command, noExtension) { - var resolved; - - noExtension = !!noExtension; - resolved = commandCache.get(command + '!' + noExtension); - - // Check if its resolved in the cache - if (commandCache.has(command)) { - return commandCache.get(command); - } - - try { - resolved = !noExtension ? - which.sync(command) : - which.sync(command, { pathExt: path.delimiter + (process.env.PATHEXT || '') }); - } catch (e) { /* empty */ } - - commandCache.set(command + '!' + noExtension, resolved); - - return resolved; -} - -module.exports = resolveCommand; diff --git a/node_modules/cross-spawn/package.json b/node_modules/cross-spawn/package.json deleted file mode 100644 index 8664bd4..0000000 --- a/node_modules/cross-spawn/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "cross-spawn@^5.0.1", - "_id": "cross-spawn@5.1.0", - "_inBundle": false, - "_integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "_location": "/cross-spawn", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cross-spawn@^5.0.1", - "name": "cross-spawn", - "escapedName": "cross-spawn", - "rawSpec": "^5.0.1", - "saveSpec": null, - "fetchSpec": "^5.0.1" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "_shasum": "e8bd0efee58fcff6f8f94510a0a554bbfa235449", - "_spec": "cross-spawn@^5.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/execa", - "author": { - "name": "IndigoUnited", - "email": "hello@indigounited.com", - "url": "http://indigounited.com" - }, - "bugs": { - "url": "https://github.com/IndigoUnited/node-cross-spawn/issues/" - }, - "bundleDependencies": false, - "dependencies": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "deprecated": false, - "description": "Cross platform child_process#spawn and child_process#spawnSync", - "devDependencies": { - "@satazor/eslint-config": "^3.0.0", - "eslint": "^3.0.0", - "expect.js": "^0.3.0", - "glob": "^7.0.0", - "mkdirp": "^0.5.1", - "mocha": "^3.0.2", - "once": "^1.4.0", - "rimraf": "^2.5.0" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/IndigoUnited/node-cross-spawn#readme", - "keywords": [ - "spawn", - "spawnSync", - "windows", - "cross", - "platform", - "path", - "ext", - "path-ext", - "path_ext", - "shebang", - "hashbang", - "cmd", - "execute" - ], - "license": "MIT", - "main": "index.js", - "name": "cross-spawn", - "repository": { - "type": "git", - "url": "git://github.com/IndigoUnited/node-cross-spawn.git" - }, - "scripts": { - "lint": "eslint '{*.js,lib/**/*.js,test/**/*.js}'", - "test": "node test/prepare && mocha --bail test/test" - }, - "version": "5.1.0" -} diff --git a/node_modules/crypto-random-string/index.js b/node_modules/crypto-random-string/index.js deleted file mode 100644 index ceaf65b..0000000 --- a/node_modules/crypto-random-string/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -const crypto = require('crypto'); - -module.exports = len => { - if (!Number.isFinite(len)) { - throw new TypeError('Expected a finite number'); - } - - return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len); -}; diff --git a/node_modules/crypto-random-string/license b/node_modules/crypto-random-string/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/crypto-random-string/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/crypto-random-string/package.json b/node_modules/crypto-random-string/package.json deleted file mode 100644 index 4c3d0a8..0000000 --- a/node_modules/crypto-random-string/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "crypto-random-string@^1.0.0", - "_id": "crypto-random-string@1.0.0", - "_inBundle": false, - "_integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", - "_location": "/crypto-random-string", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "crypto-random-string@^1.0.0", - "name": "crypto-random-string", - "escapedName": "crypto-random-string", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/unique-string" - ], - "_resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "_shasum": "a230f64f568310e1498009940790ec99545bca7e", - "_spec": "crypto-random-string@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/unique-string", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/crypto-random-string/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Generate a cryptographically strong random string", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/crypto-random-string#readme", - "keywords": [ - "random", - "string", - "str", - "rand", - "text", - "id", - "identifier", - "slug", - "salt", - "crypto", - "strong", - "secure", - "hex" - ], - "license": "MIT", - "name": "crypto-random-string", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/crypto-random-string.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/crypto-random-string/readme.md b/node_modules/crypto-random-string/readme.md deleted file mode 100644 index dab5a2e..0000000 --- a/node_modules/crypto-random-string/readme.md +++ /dev/null @@ -1,49 +0,0 @@ -# crypto-random-string [![Build Status](https://travis-ci.org/sindresorhus/crypto-random-string.svg?branch=master)](https://travis-ci.org/sindresorhus/crypto-random-string) - -> Generate a [cryptographically strong](https://en.m.wikipedia.org/wiki/Strong_cryptography) random string - -Can be useful for creating an identifier, slug, salt, fixture, etc. - - -## Install - -``` -$ npm install --save crypto-random-string -``` - - -## Usage - -```js -const cryptoRandomString = require('crypto-random-string'); - -cryptoRandomString(10); -//=> '2cf05d94db' -``` - - -## API - -### cryptoRandomString(length) - -#### length - -Type: `number` - -Length of the returned string. - - -## Related - -- [random-int](https://github.com/sindresorhus/random-int) - Generate a random integer -- [random-float](https://github.com/sindresorhus/random-float) - Generate a random float -- [random-item](https://github.com/sindresorhus/random-item) - Get a random item from an array -- [random-boolean](https://github.com/arthurvr/random-boolean) - Get a random boolean -- [random-obj-key](https://github.com/sindresorhus/random-obj-key) - Get a random key from an object -- [random-obj-prop](https://github.com/sindresorhus/random-obj-prop) - Get a random property from an object -- [unique-random](https://github.com/sindresorhus/unique-random) - Generate random numbers that are consecutively unique - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/currently-unhandled/package.json b/node_modules/currently-unhandled/package.json index 0ea6a1e..39828f4 100644 --- a/node_modules/currently-unhandled/package.json +++ b/node_modules/currently-unhandled/package.json @@ -1,27 +1,33 @@ { - "_from": "currently-unhandled@^0.4.1", + "_args": [ + [ + "currently-unhandled@0.4.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "currently-unhandled@0.4.1", "_id": "currently-unhandled@0.4.1", "_inBundle": false, "_integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "_location": "/currently-unhandled", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "currently-unhandled@^0.4.1", + "raw": "currently-unhandled@0.4.1", "name": "currently-unhandled", "escapedName": "currently-unhandled", - "rawSpec": "^0.4.1", + "rawSpec": "0.4.1", "saveSpec": null, - "fetchSpec": "^0.4.1" + "fetchSpec": "0.4.1" }, "_requiredBy": [ "/loud-rejection" ], "_resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "_shasum": "988df33feab191ef799a61369dd76c17adf957ea", - "_spec": "currently-unhandled@^0.4.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/loud-rejection", + "_spec": "0.4.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "James Talmage", "email": "james@talmage.io", @@ -36,11 +42,9 @@ "bugs": { "url": "https://github.com/jamestalmage/currently-unhandled/issues" }, - "bundleDependencies": false, "dependencies": { "array-find-index": "^1.0.1" }, - "deprecated": false, "description": "Track the list of currently unhandled promise rejections.", "devDependencies": { "ava": "^0.15.1", diff --git a/node_modules/dashdash/package.json b/node_modules/dashdash/package.json index 75f5598..b7438f4 100644 --- a/node_modules/dashdash/package.json +++ b/node_modules/dashdash/package.json @@ -1,27 +1,32 @@ { - "_from": "dashdash@^1.12.0", + "_args": [ + [ + "dashdash@1.14.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "dashdash@1.14.1", "_id": "dashdash@1.14.1", "_inBundle": false, "_integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "_location": "/dashdash", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "dashdash@^1.12.0", + "raw": "dashdash@1.14.1", "name": "dashdash", "escapedName": "dashdash", - "rawSpec": "^1.12.0", + "rawSpec": "1.14.1", "saveSpec": null, - "fetchSpec": "^1.12.0" + "fetchSpec": "1.14.1" }, "_requiredBy": [ "/sshpk" ], "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "_shasum": "853cfa0f7cbe2fed5de20326b8dd581035f6e2f0", - "_spec": "dashdash@^1.12.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sshpk", + "_spec": "1.14.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Trent Mick", "email": "trentm@gmail.com", @@ -30,11 +35,9 @@ "bugs": { "url": "https://github.com/trentm/node-dashdash/issues" }, - "bundleDependencies": false, "dependencies": { "assert-plus": "^1.0.0" }, - "deprecated": false, "description": "A light, featureful and explicit option parsing library.", "devDependencies": { "nodeunit": "0.9.x" diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json index a9cf11e..1ff5d43 100644 --- a/node_modules/debug/package.json +++ b/node_modules/debug/package.json @@ -1,27 +1,35 @@ { - "_from": "debug@^3.0.0", + "_args": [ + [ + "debug@3.2.6", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "debug@3.2.6", "_id": "debug@3.2.6", "_inBundle": false, "_integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "_location": "/debug", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "debug@^3.0.0", + "raw": "debug@3.2.6", "name": "debug", "escapedName": "debug", - "rawSpec": "^3.0.0", + "rawSpec": "3.2.6", "saveSpec": null, - "fetchSpec": "^3.0.0" + "fetchSpec": "3.2.6" }, "_requiredBy": [ - "/electron-download" + "/electron-download", + "/flora-colossus", + "/galactus" ], "_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "_shasum": "e83d17de16d8a7efb7717edbe5fb10135eee629b", - "_spec": "debug@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-download", + "_spec": "3.2.6", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -30,7 +38,6 @@ "bugs": { "url": "https://github.com/visionmedia/debug/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Nathan Rajlich", @@ -45,7 +52,6 @@ "dependencies": { "ms": "^2.1.1" }, - "deprecated": false, "description": "small debugging utility", "devDependencies": { "@babel/cli": "^7.0.0", diff --git a/node_modules/decamelize/package.json b/node_modules/decamelize/package.json index a02fe26..d3ccf0f 100644 --- a/node_modules/decamelize/package.json +++ b/node_modules/decamelize/package.json @@ -1,27 +1,34 @@ { - "_from": "decamelize@^1.1.2", + "_args": [ + [ + "decamelize@1.2.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "decamelize@1.2.0", "_id": "decamelize@1.2.0", "_inBundle": false, "_integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "_location": "/decamelize", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "decamelize@^1.1.2", + "raw": "decamelize@1.2.0", "name": "decamelize", "escapedName": "decamelize", - "rawSpec": "^1.1.2", + "rawSpec": "1.2.0", "saveSpec": null, - "fetchSpec": "^1.1.2" + "fetchSpec": "1.2.0" }, "_requiredBy": [ - "/meow" + "/meow", + "/yargs-parser" ], "_resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "_shasum": "f6534d15148269b20352e7bee26f501f9a191290", - "_spec": "decamelize@^1.1.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/meow", + "_spec": "1.2.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +37,6 @@ "bugs": { "url": "https://github.com/sindresorhus/decamelize/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow", "devDependencies": { "ava": "*", diff --git a/node_modules/deep-extend/package.json b/node_modules/deep-extend/package.json index 53cfab1..11740c0 100644 --- a/node_modules/deep-extend/package.json +++ b/node_modules/deep-extend/package.json @@ -1,27 +1,32 @@ { - "_from": "deep-extend@^0.6.0", + "_args": [ + [ + "deep-extend@0.6.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "deep-extend@0.6.0", "_id": "deep-extend@0.6.0", "_inBundle": false, "_integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "_location": "/deep-extend", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "deep-extend@^0.6.0", + "raw": "deep-extend@0.6.0", "name": "deep-extend", "escapedName": "deep-extend", - "rawSpec": "^0.6.0", + "rawSpec": "0.6.0", "saveSpec": null, - "fetchSpec": "^0.6.0" + "fetchSpec": "0.6.0" }, "_requiredBy": [ "/rc" ], "_resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "_shasum": "c4fa7c95404a17a9c3e8ca7e1537312b736330ac", - "_spec": "deep-extend@^0.6.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/rc", + "_spec": "0.6.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Viacheslav Lotsmanov", "email": "lotsmanov89@gmail.com" @@ -29,7 +34,6 @@ "bugs": { "url": "https://github.com/unclechu/node-deep-extend/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Romain Prieto", @@ -48,7 +52,6 @@ "url": "https://github.com/mwakerman" } ], - "deprecated": false, "description": "Recursive object extending", "devDependencies": { "mocha": "5.2.0", diff --git a/node_modules/delayed-stream/package.json b/node_modules/delayed-stream/package.json index deadc32..b071708 100644 --- a/node_modules/delayed-stream/package.json +++ b/node_modules/delayed-stream/package.json @@ -1,27 +1,32 @@ { - "_from": "delayed-stream@~1.0.0", + "_args": [ + [ + "delayed-stream@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "delayed-stream@1.0.0", "_id": "delayed-stream@1.0.0", "_inBundle": false, "_integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "_location": "/delayed-stream", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "delayed-stream@~1.0.0", + "raw": "delayed-stream@1.0.0", "name": "delayed-stream", "escapedName": "delayed-stream", - "rawSpec": "~1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "~1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/combined-stream" ], "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", - "_spec": "delayed-stream@~1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/combined-stream", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Felix Geisendörfer", "email": "felix@debuggable.com", @@ -30,7 +35,6 @@ "bugs": { "url": "https://github.com/felixge/node-delayed-stream/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Mike Atkins", @@ -38,7 +42,6 @@ } ], "dependencies": {}, - "deprecated": false, "description": "Buffers events from a stream until you are ready to handle them.", "devDependencies": { "fake": "0.2.0", diff --git a/node_modules/dmg-builder/out/dmg.d.ts b/node_modules/dmg-builder/out/dmg.d.ts deleted file mode 100755 index e3ddf75..0000000 --- a/node_modules/dmg-builder/out/dmg.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Arch } from "builder-util"; -import { Target, DmgOptions } from "app-builder-lib"; -import MacPackager from "app-builder-lib/out/macPackager"; -export declare class DmgTarget extends Target { - private readonly packager; - readonly outDir: string; - readonly options: DmgOptions; - constructor(packager: MacPackager, outDir: string); - build(appPath: string, arch: Arch): Promise; - private signDmg; - computeVolumeName(custom?: string | null): string; - computeDmgOptions(): Promise; -} diff --git a/node_modules/dmg-builder/out/dmg.js b/node_modules/dmg-builder/out/dmg.js deleted file mode 100755 index a94dfad..0000000 --- a/node_modules/dmg-builder/out/dmg.js +++ /dev/null @@ -1,501 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.DmgTarget = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _dmgLicense() { - const data = require("./dmgLicense"); - - _dmgLicense = function () { - return data; - }; - - return data; -} - -function _dmgUtil() { - const data = require("./dmgUtil"); - - _dmgUtil = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _sanitizeFilename() { - const data = _interopRequireDefault(require("sanitize-filename")); - - _sanitizeFilename = function () { - return data; - }; - - return data; -} - -function _macCodeSign() { - const data = require("app-builder-lib/out/codeSign/macCodeSign"); - - _macCodeSign = function () { - return data; - }; - - return data; -} - -function _appBuilderLib() { - const data = require("app-builder-lib"); - - _appBuilderLib = function () { - return data; - }; - - return data; -} - -function _differentialUpdateInfoBuilder() { - const data = require("app-builder-lib/out/targets/differentialUpdateInfoBuilder"); - - _differentialUpdateInfoBuilder = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class DmgTarget extends _appBuilderLib().Target { - constructor(packager, outDir) { - super("dmg"); - this.packager = packager; - this.outDir = outDir; - this.options = this.packager.config.dmg || Object.create(null); - } - - build(appPath, arch) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const packager = _this.packager; // tslint:disable-next-line:no-invalid-template-strings - - const artifactName = packager.expandArtifactNamePattern(packager.config.dmg, "dmg", null, "${productName}-" + (packager.platformSpecificBuildOptions.bundleShortVersion || "${version}") + ".${ext}"); - const artifactPath = path.join(_this.outDir, artifactName); - yield packager.info.callArtifactBuildStarted({ - targetPresentableName: "DMG", - file: artifactPath, - arch - }); - const specification = yield _this.computeDmgOptions(); - const volumeName = (0, _sanitizeFilename().default)(_this.computeVolumeName(specification.title)); - const tempDmg = yield createStageDmg((yield packager.getTempFile(".dmg")), appPath, volumeName); // https://github.com/electron-userland/electron-builder/issues/2115 - - const backgroundFile = specification.background == null ? null : yield (0, _dmgUtil().transformBackgroundFileIfNeed)(specification.background, packager.info.tempDirManager); - const finalSize = yield computeAssetSize(packager.info.cancellationToken, tempDmg, specification, backgroundFile); - yield (0, _builderUtil().exec)("hdiutil", ["resize", "-size", finalSize.toString(), tempDmg]); - const volumePath = path.join("/Volumes", volumeName); - - if (yield (0, _fs().exists)(volumePath)) { - _builderUtil().log.debug({ - volumePath - }, "unmounting previous disk image"); - - yield (0, _dmgUtil().detach)(volumePath); - } - - if (!(yield (0, _dmgUtil().attachAndExecute)(tempDmg, true, () => customizeDmg(volumePath, specification, packager, backgroundFile)))) { - return; - } // dmg file must not exist otherwise hdiutil failed (https://github.com/electron-userland/electron-builder/issues/1308#issuecomment-282847594), so, -ov must be specified - - - const args = ["convert", tempDmg, "-ov", "-format", specification.format, "-o", artifactPath]; - - if (specification.format === "UDZO") { - args.push("-imagekey", `zlib-level=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || "9"}`); - } - - yield (0, _builderUtil().spawn)("hdiutil", addLogLevel(args)); - - if (_this.options.internetEnabled) { - yield (0, _builderUtil().exec)("hdiutil", addLogLevel(["internet-enable"]).concat(artifactPath)); - } - - const licenseData = yield (0, _dmgLicense().addLicenseToDmg)(packager, artifactPath); - - if (packager.packagerOptions.effectiveOptionComputed != null) { - yield packager.packagerOptions.effectiveOptionComputed({ - licenseData - }); - } - - yield _this.signDmg(artifactPath); - const safeArtifactName = packager.computeSafeArtifactName(artifactName, "dmg"); - const updateInfo = yield (0, _differentialUpdateInfoBuilder().createBlockmap)(artifactPath, _this, packager, safeArtifactName); - yield packager.info.callArtifactBuildCompleted({ - file: artifactPath, - safeArtifactName, - target: _this, - arch, - packager, - isWriteUpdateInfo: true, - updateInfo - }); - })(); - } - - signDmg(artifactPath) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (!(0, _macCodeSign().isSignAllowed)(false)) { - return; - } - - const packager = _this2.packager; - const qualifier = packager.platformSpecificBuildOptions.identity; // explicitly disabled if set to null - - if (qualifier === null) { - // macPackager already somehow handle this situation, so, here just return - return; - } - - const keychainName = (yield packager.codeSigningInfo.value).keychainName; - const certificateType = "Developer ID Application"; - let identity = yield (0, _macCodeSign().findIdentity)(certificateType, qualifier, keychainName); - - if (identity == null) { - identity = yield (0, _macCodeSign().findIdentity)("Mac Developer", qualifier, keychainName); - - if (identity == null) { - return; - } - } - - const args = ["--sign", identity.hash]; - - if (keychainName != null) { - args.push("--keychain", keychainName); - } - - args.push(artifactPath); - yield (0, _builderUtil().exec)("codesign", args); - })(); - } - - computeVolumeName(custom) { - const appInfo = this.packager.appInfo; - const shortVersion = this.packager.platformSpecificBuildOptions.bundleShortVersion || appInfo.version; - - if (custom == null) { - return `${appInfo.productFilename} ${shortVersion}`; - } - - return custom.replace(/\${shortVersion}/g, shortVersion).replace(/\${version}/g, appInfo.version).replace(/\${name}/g, appInfo.name).replace(/\${productName}/g, appInfo.productName); - } // public to test - - - computeDmgOptions() { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - // appdmg - const appdmgWindow = _this3.options.window || {}; - const oldPosition = appdmgWindow.position; - const oldSize = appdmgWindow.size; - const oldIconSize = _this3.options["icon-size"]; - const oldBackgroundColor = _this3.options["background-color"]; - - if (oldPosition != null) { - _builderUtil().log.warn({ - solution: "use dmg.window" - }, "dmg.window.position is deprecated"); - } - - if (oldSize != null) { - _builderUtil().log.warn({ - solution: "use dmg.window" - }, "dmg.window.size is deprecated"); - } - - if (oldIconSize != null) { - _builderUtil().log.warn({ - solution: "use dmg.iconSize" - }, "dmg.icon-size is deprecated"); - } - - if (oldBackgroundColor != null) { - _builderUtil().log.warn({ - solution: "use dmg.backgroundColor" - }, "dmg.background-color is deprecated"); - } - - const packager = _this3.packager; - const specification = (0, _builderUtil().deepAssign)({ - window: { - x: 400, - y: 100 - }, - iconSize: oldIconSize, - backgroundColor: oldBackgroundColor, - icon: "icon" in _this3.options ? undefined : yield packager.getIconPath() - }, _this3.options, oldPosition == null ? null : { - window: { - x: oldPosition.x, - y: oldPosition.y - } - }, oldSize == null ? null : { - window: { - width: oldSize.width, - height: oldSize.height - } - }); - - if (specification.icon != null && (0, _builderUtil().isEmptyOrSpaces)(specification.icon)) { - throw new (_builderUtil().InvalidConfigurationError)("dmg.icon cannot be specified as empty string"); - } - - const background = specification.background; - - if (specification.backgroundColor != null) { - if (background != null) { - throw new (_builderUtil().InvalidConfigurationError)("Both dmg.backgroundColor and dmg.background are specified — please set the only one"); - } - - specification.backgroundColor = (0, _dmgUtil().computeBackgroundColor)(specification.backgroundColor); - } else if (background == null) { - specification.background = yield (0, _dmgUtil().computeBackground)(packager); - } else { - specification.background = path.resolve(packager.info.projectDir, background); - } - - if (specification.format == null) { - if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) { - specification.format = "UDZO"; - } else if (packager.compression === "store") { - specification.format = "UDRO"; - } else { - specification.format = packager.compression === "maximum" ? "UDBZ" : "UDZO"; - } - } - - if (specification.contents == null) { - specification.contents = [{ - x: 130, - y: 220 - }, { - x: 410, - y: 220, - type: "link", - path: "/Applications" - }]; - } - - return specification; - })(); - } - -} - -exports.DmgTarget = DmgTarget; - -function createStageDmg(_x, _x2, _x3) { - return _createStageDmg.apply(this, arguments); -} - -function _createStageDmg() { - _createStageDmg = (0, _bluebirdLst().coroutine)(function* (tempDmg, appPath, volumeName) { - //noinspection SpellCheckingInspection - const imageArgs = addLogLevel(["create", "-srcfolder", appPath, "-volname", volumeName, "-anyowners", "-nospotlight", "-format", "UDRW"]); - imageArgs.push("-fs", "HFS+", "-fsargs", "-c c=64,a=16,e=16"); - imageArgs.push(tempDmg); - yield (0, _builderUtil().spawn)("hdiutil", imageArgs); - return tempDmg; - }); - return _createStageDmg.apply(this, arguments); -} - -function addLogLevel(args) { - args.push(process.env.DEBUG_DMG === "true" ? "-verbose" : "-quiet"); - return args; -} - -function computeAssetSize(_x4, _x5, _x6, _x7) { - return _computeAssetSize.apply(this, arguments); -} - -function _computeAssetSize() { - _computeAssetSize = (0, _bluebirdLst().coroutine)(function* (cancellationToken, dmgFile, specification, backgroundFile) { - const asyncTaskManager = new (_builderUtil().AsyncTaskManager)(cancellationToken); - asyncTaskManager.addTask((0, _fsExtraP().stat)(dmgFile)); - - if (specification.icon != null) { - asyncTaskManager.addTask((0, _fs().statOrNull)(specification.icon)); - } - - if (backgroundFile != null) { - asyncTaskManager.addTask((0, _fsExtraP().stat)(backgroundFile)); - } - - let result = 32 * 1024; - - for (const stat of yield asyncTaskManager.awaitTasks()) { - if (stat != null) { - result += stat.size; - } - } - - return result; - }); - return _computeAssetSize.apply(this, arguments); -} - -function customizeDmg(_x8, _x9, _x10, _x11) { - return _customizeDmg.apply(this, arguments); -} - -function _customizeDmg() { - _customizeDmg = (0, _bluebirdLst().coroutine)(function* (volumePath, specification, packager, backgroundFile) { - const window = specification.window; - const env = Object.assign({}, process.env, { - volumePath, - appFileName: `${packager.appInfo.productFilename}.app`, - iconSize: specification.iconSize || 80, - iconTextSize: specification.iconTextSize || 12, - windowX: window.x, - windowY: window.y, - VERSIONER_PERL_PREFER_32_BIT: "true" - }); - - if (specification.backgroundColor != null || specification.background == null) { - env.backgroundColor = specification.backgroundColor || "#ffffff"; - env.windowWidth = (window.width || 540).toString(); - env.windowHeight = (window.height || 380).toString(); - } else { - delete env.backgroundColor; - - if (window.width == null) { - delete env.windowWidth; - } else { - env.windowWidth = window.width.toString(); - } - - if (window.height == null) { - delete env.windowHeight; - } else { - env.windowHeight = window.height.toString(); - } - } - - const args = ["dmg", "--volume", volumePath]; - - if (specification.icon != null) { - args.push("--icon", (yield packager.getResource(specification.icon))); - } - - if (backgroundFile != null) { - env.backgroundFilename = path.basename(backgroundFile); - args.push("--background", backgroundFile); - } - - yield (0, _builderUtil().executeAppBuilder)(args); - const asyncTaskManager = new (_builderUtil().AsyncTaskManager)(packager.info.cancellationToken); - yield (0, _dmgUtil().applyProperties)((yield computeDmgEntries(specification, volumePath, packager, asyncTaskManager)), env, asyncTaskManager, packager); - return packager.packagerOptions.effectiveOptionComputed == null || !(yield packager.packagerOptions.effectiveOptionComputed({ - volumePath, - specification, - packager - })); - }); - return _customizeDmg.apply(this, arguments); -} - -function computeDmgEntries(_x12, _x13, _x14, _x15) { - return _computeDmgEntries.apply(this, arguments); -} function _computeDmgEntries() { - _computeDmgEntries = (0, _bluebirdLst().coroutine)(function* (specification, volumePath, packager, asyncTaskManager) { - let result = ""; - - for (const c of specification.contents) { - if (c.path != null && c.path.endsWith(".app") && c.type !== "link") { - _builderUtil().log.warn({ - path: c.path, - reason: "actual path to app will be used instead" - }, `do not specify path for application`); - } - - const entryPath = c.path || `${packager.appInfo.productFilename}.app`; - const entryName = c.name || path.basename(entryPath); - result += `&makeEntries("${entryName}", Iloc_xy => [ ${c.x}, ${c.y} ]),\n`; - - if (c.type === "link") { - asyncTaskManager.addTask((0, _builderUtil().exec)("ln", ["-s", `/${entryPath.startsWith("/") ? entryPath.substring(1) : entryPath}`, `${volumePath}/${entryName}`])); - } // use c.path instead of entryPath (to be sure that this logic is not applied to .app bundle) https://github.com/electron-userland/electron-builder/issues/2147 - else if (!(0, _builderUtil().isEmptyOrSpaces)(c.path) && (c.type === "file" || c.type === "dir")) { - const source = yield packager.getResource(c.path); - - if (source == null) { - _builderUtil().log.warn({ - entryPath, - reason: "doesn't exist" - }, `skipped DMG item copying`); - - continue; - } - - const destination = `${volumePath}/${entryName}`; - asyncTaskManager.addTask(c.type === "dir" || (yield (0, _fsExtraP().stat)(source)).isDirectory() ? (0, _fs().copyDir)(source, destination) : (0, _fs().copyFile)(source, destination)); - } - } - - return result; - }); - return _computeDmgEntries.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=dmg.js.map \ No newline at end of file diff --git a/node_modules/dmg-builder/out/dmg.js.map b/node_modules/dmg-builder/out/dmg.js.map deleted file mode 100755 index a90d284..0000000 --- a/node_modules/dmg-builder/out/dmg.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/dmg.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;A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J,EAAyE;AAC5E,gBAAM,MAAM,SAAS,QAAQ,CAAC,WAAT,CAAqB,CAAC,CAAC,IAAvB,CAArB;;AACA,cAAI,MAAM,IAAI,IAAd,EAAoB;AAClB,+BAAI,IAAJ,CAAS;AAAC,cAAA,SAAD;AAAY,cAAA,MAAM,EAAE;AAApB,aAAT,EAA+C,0BAA/C;;AACA;AACD;;AAED,gBAAM,WAAW,GAAG,GAAG,UAAU,IAAI,SAAS,EAA9C;AACA,UAAA,gBAAgB,CAAC,OAAjB,CAAyB,CAAC,CAAC,IAAF,KAAW,KAAX,IAAoB,OAAO,sBAAK,MAAL,CAAP,EAAqB,WAArB,EAApB,GAAyD,mBAAQ,MAAR,EAAgB,WAAhB,CAAzD,GAAwF,oBAAS,MAAT,EAAiB,WAAjB,CAAjH;AACD;AACF;;AACD,WAAO,MAAP;AACD,G","sourcesContent":["import { Arch, AsyncTaskManager, exec, InvalidConfigurationError, isEmptyOrSpaces, log, spawn, deepAssign, executeAppBuilder } from \"builder-util\"\nimport { CancellationToken } from \"builder-util-runtime\"\nimport { copyDir, copyFile, exists, statOrNull } from \"builder-util/out/fs\"\nimport { addLicenseToDmg } from \"./dmgLicense\"\nimport { applyProperties, attachAndExecute, computeBackground, computeBackgroundColor, detach, transformBackgroundFileIfNeed } from \"./dmgUtil\"\nimport { stat } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport sanitizeFileName from \"sanitize-filename\"\nimport { findIdentity, isSignAllowed } from \"app-builder-lib/out/codeSign/macCodeSign\"\nimport { Target, DmgOptions } from \"app-builder-lib\"\nimport MacPackager from \"app-builder-lib/out/macPackager\"\nimport { createBlockmap } from \"app-builder-lib/out/targets/differentialUpdateInfoBuilder\"\n\nexport class DmgTarget extends Target {\n readonly options: DmgOptions = this.packager.config.dmg || Object.create(null)\n\n constructor(private readonly packager: MacPackager, readonly outDir: string) {\n super(\"dmg\")\n }\n\n async build(appPath: string, arch: Arch) {\n const packager = this.packager\n // tslint:disable-next-line:no-invalid-template-strings\n const artifactName = packager.expandArtifactNamePattern(packager.config.dmg, \"dmg\", null, \"${productName}-\" + (packager.platformSpecificBuildOptions.bundleShortVersion || \"${version}\") + \".${ext}\")\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"DMG\",\n file: artifactPath,\n arch,\n })\n\n const specification = await this.computeDmgOptions()\n const volumeName = sanitizeFileName(this.computeVolumeName(specification.title))\n\n const tempDmg = await createStageDmg(await packager.getTempFile(\".dmg\"), appPath, volumeName)\n\n // https://github.com/electron-userland/electron-builder/issues/2115\n const backgroundFile = specification.background == null ? null : await transformBackgroundFileIfNeed(specification.background, packager.info.tempDirManager)\n const finalSize = await computeAssetSize(packager.info.cancellationToken, tempDmg, specification, backgroundFile)\n await exec(\"hdiutil\", [\"resize\", \"-size\", finalSize.toString(), tempDmg])\n\n const volumePath = path.join(\"/Volumes\", volumeName)\n if (await exists(volumePath)) {\n log.debug({volumePath}, \"unmounting previous disk image\")\n await detach(volumePath)\n }\n\n if (!await attachAndExecute(tempDmg, true, () => customizeDmg(volumePath, specification, packager, backgroundFile))) {\n return\n }\n\n // dmg file must not exist otherwise hdiutil failed (https://github.com/electron-userland/electron-builder/issues/1308#issuecomment-282847594), so, -ov must be specified\n const args = [\"convert\", tempDmg, \"-ov\", \"-format\", specification.format!, \"-o\", artifactPath]\n if (specification.format === \"UDZO\") {\n args.push(\"-imagekey\", `zlib-level=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || \"9\"}`)\n }\n await spawn(\"hdiutil\", addLogLevel(args))\n if (this.options.internetEnabled) {\n await exec(\"hdiutil\", addLogLevel([\"internet-enable\"]).concat(artifactPath))\n }\n\n const licenseData = await addLicenseToDmg(packager, artifactPath)\n if (packager.packagerOptions.effectiveOptionComputed != null) {\n await packager.packagerOptions.effectiveOptionComputed({licenseData})\n }\n\n await this.signDmg(artifactPath)\n\n const safeArtifactName = packager.computeSafeArtifactName(artifactName, \"dmg\")\n const updateInfo = await createBlockmap(artifactPath, this, packager, safeArtifactName)\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName,\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: true,\n updateInfo,\n })\n }\n\n private async signDmg(artifactPath: string) {\n if (!isSignAllowed(false)) {\n return\n }\n\n const packager = this.packager\n const qualifier = packager.platformSpecificBuildOptions.identity\n // explicitly disabled if set to null\n if (qualifier === null) {\n // macPackager already somehow handle this situation, so, here just return\n return\n }\n\n const keychainName = (await packager.codeSigningInfo.value).keychainName\n const certificateType = \"Developer ID Application\"\n let identity = await findIdentity(certificateType, qualifier, keychainName)\n if (identity == null) {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainName)\n if (identity == null) {\n return\n }\n }\n\n const args = [\"--sign\", identity.hash]\n if (keychainName != null) {\n args.push(\"--keychain\", keychainName)\n }\n args.push(artifactPath)\n await exec(\"codesign\", args)\n }\n\n computeVolumeName(custom?: string | null): string {\n const appInfo = this.packager.appInfo\n const shortVersion = this.packager.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n\n if (custom == null) {\n return `${appInfo.productFilename} ${shortVersion}`\n }\n\n return custom\n .replace(/\\${shortVersion}/g, shortVersion)\n .replace(/\\${version}/g, appInfo.version)\n .replace(/\\${name}/g, appInfo.name)\n .replace(/\\${productName}/g, appInfo.productName)\n }\n\n // public to test\n async computeDmgOptions(): Promise {\n // appdmg\n const appdmgWindow = (this.options.window as any) || {}\n const oldPosition = appdmgWindow.position\n const oldSize = appdmgWindow.size\n const oldIconSize = (this.options as any)[\"icon-size\"]\n const oldBackgroundColor = (this.options as any)[\"background-color\"]\n if (oldPosition != null) {\n log.warn({solution: \"use dmg.window\"}, \"dmg.window.position is deprecated\")\n }\n if (oldSize != null) {\n log.warn({solution: \"use dmg.window\"}, \"dmg.window.size is deprecated\")\n }\n if (oldIconSize != null) {\n log.warn({solution: \"use dmg.iconSize\"}, \"dmg.icon-size is deprecated\")\n }\n if (oldBackgroundColor != null) {\n log.warn({solution: \"use dmg.backgroundColor\"}, \"dmg.background-color is deprecated\")\n }\n\n const packager = this.packager\n const specification = deepAssign({\n window: {\n x: 400,\n y: 100,\n },\n iconSize: oldIconSize,\n backgroundColor: oldBackgroundColor,\n icon: \"icon\" in this.options ? undefined : await packager.getIconPath()\n },\n this.options,\n oldPosition == null ? null : {\n window: {\n x: oldPosition.x,\n y: oldPosition.y,\n }\n },\n oldSize == null ? null : {\n window: {\n width: oldSize.width,\n height: oldSize.height,\n }\n })\n\n if (specification.icon != null && isEmptyOrSpaces(specification.icon)) {\n throw new InvalidConfigurationError(\"dmg.icon cannot be specified as empty string\")\n }\n\n const background = specification.background\n if (specification.backgroundColor != null) {\n if (background != null) {\n throw new InvalidConfigurationError(\"Both dmg.backgroundColor and dmg.background are specified — please set the only one\")\n }\n specification.backgroundColor = computeBackgroundColor(specification.backgroundColor)\n }\n else if (background == null) {\n specification.background = await computeBackground(packager)\n }\n else {\n specification.background = path.resolve(packager.info.projectDir, background)\n }\n\n if (specification.format == null) {\n if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {\n (specification as any).format = \"UDZO\"\n }\n else if (packager.compression === \"store\") {\n (specification as any).format = \"UDRO\"\n }\n else {\n (specification as any).format = packager.compression === \"maximum\" ? \"UDBZ\" : \"UDZO\"\n }\n }\n\n if (specification.contents == null) {\n specification.contents = [\n {\n x: 130, y: 220\n },\n {\n x: 410, y: 220, type: \"link\", path: \"/Applications\"\n }\n ]\n }\n return specification\n }\n}\n\nasync function createStageDmg(tempDmg: string, appPath: string, volumeName: string) {\n //noinspection SpellCheckingInspection\n const imageArgs = addLogLevel([\"create\",\n \"-srcfolder\", appPath,\n \"-volname\", volumeName,\n \"-anyowners\", \"-nospotlight\",\n \"-format\", \"UDRW\",\n ])\n imageArgs.push(\"-fs\", \"HFS+\", \"-fsargs\", \"-c c=64,a=16,e=16\")\n imageArgs.push(tempDmg)\n await spawn(\"hdiutil\", imageArgs)\n return tempDmg\n}\n\nfunction addLogLevel(args: Array): Array {\n args.push(process.env.DEBUG_DMG === \"true\" ? \"-verbose\" : \"-quiet\")\n return args\n}\n\nasync function computeAssetSize(cancellationToken: CancellationToken, dmgFile: string, specification: DmgOptions, backgroundFile: string | null | undefined) {\n const asyncTaskManager = new AsyncTaskManager(cancellationToken)\n asyncTaskManager.addTask(stat(dmgFile))\n\n if (specification.icon != null) {\n asyncTaskManager.addTask(statOrNull(specification.icon))\n }\n\n if (backgroundFile != null) {\n asyncTaskManager.addTask(stat(backgroundFile))\n }\n\n let result = 32 * 1024\n for (const stat of await asyncTaskManager.awaitTasks()) {\n if (stat != null) {\n result += stat.size\n }\n }\n return result\n}\n\nasync function customizeDmg(volumePath: string, specification: DmgOptions, packager: MacPackager, backgroundFile: string | null | undefined) {\n const window = specification.window!\n const env: any = {\n ...process.env,\n volumePath,\n appFileName: `${packager.appInfo.productFilename}.app`,\n iconSize: specification.iconSize || 80,\n iconTextSize: specification.iconTextSize || 12,\n\n windowX: window.x,\n windowY: window.y,\n\n VERSIONER_PERL_PREFER_32_BIT: \"true\"\n }\n\n if (specification.backgroundColor != null || specification.background == null) {\n env.backgroundColor = specification.backgroundColor || \"#ffffff\"\n env.windowWidth = (window.width || 540).toString()\n env.windowHeight = (window.height || 380).toString()\n }\n else {\n delete env.backgroundColor\n\n if (window.width == null) {\n delete env.windowWidth\n }\n else {\n env.windowWidth = window.width.toString()\n }\n if (window.height == null) {\n delete env.windowHeight\n }\n else {\n env.windowHeight = window.height.toString()\n }\n }\n\n const args = [\"dmg\", \"--volume\", volumePath]\n if (specification.icon != null) {\n args.push(\"--icon\", (await packager.getResource(specification.icon))!!)\n }\n if (backgroundFile != null) {\n env.backgroundFilename = path.basename(backgroundFile)\n args.push(\"--background\", backgroundFile)\n }\n await executeAppBuilder(args)\n\n const asyncTaskManager = new AsyncTaskManager(packager.info.cancellationToken)\n await applyProperties(await computeDmgEntries(specification, volumePath, packager, asyncTaskManager), env, asyncTaskManager, packager)\n return packager.packagerOptions.effectiveOptionComputed == null || !(await packager.packagerOptions.effectiveOptionComputed({volumePath, specification, packager}))\n}\n\nasync function computeDmgEntries(specification: DmgOptions, volumePath: string, packager: MacPackager, asyncTaskManager: AsyncTaskManager) {\n let result = \"\"\n for (const c of specification.contents!!) {\n if (c.path != null && c.path.endsWith(\".app\") && c.type !== \"link\") {\n log.warn({path: c.path, reason: \"actual path to app will be used instead\"}, `do not specify path for application`)\n }\n\n const entryPath = c.path || `${packager.appInfo.productFilename}.app`\n const entryName = c.name || path.basename(entryPath)\n result += `&makeEntries(\"${entryName}\", Iloc_xy => [ ${c.x}, ${c.y} ]),\\n`\n\n if (c.type === \"link\") {\n asyncTaskManager.addTask(exec(\"ln\", [\"-s\", `/${entryPath.startsWith(\"/\") ? entryPath.substring(1) : entryPath}`, `${volumePath}/${entryName}`]))\n }\n // use c.path instead of entryPath (to be sure that this logic is not applied to .app bundle) https://github.com/electron-userland/electron-builder/issues/2147\n else if (!isEmptyOrSpaces(c.path) && (c.type === \"file\" || c.type === \"dir\")) {\n const source = await packager.getResource(c.path)\n if (source == null) {\n log.warn({entryPath, reason: \"doesn't exist\"}, `skipped DMG item copying`)\n continue\n }\n\n const destination = `${volumePath}/${entryName}`\n asyncTaskManager.addTask(c.type === \"dir\" || (await stat(source)).isDirectory() ? copyDir(source, destination) : copyFile(source, destination))\n }\n }\n return result\n}"],"sourceRoot":""} diff --git a/node_modules/dmg-builder/out/dmgLicense.d.ts b/node_modules/dmg-builder/out/dmgLicense.d.ts deleted file mode 100755 index 7f88d04..0000000 --- a/node_modules/dmg-builder/out/dmgLicense.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { PlatformPackager } from "app-builder-lib"; -export declare function addLicenseToDmg(packager: PlatformPackager, dmgPath: string): Promise; diff --git a/node_modules/dmg-builder/out/dmgLicense.js b/node_modules/dmg-builder/out/dmgLicense.js deleted file mode 100755 index 5792e20..0000000 --- a/node_modules/dmg-builder/out/dmgLicense.js +++ /dev/null @@ -1,285 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.addLicenseToDmg = addLicenseToDmg; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _license() { - const data = require("app-builder-lib/out/util/license"); - - _license = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _dmgUtil() { - const data = require("./dmgUtil"); - - _dmgUtil = function () { - return data; - }; - - return data; -} - -function _licenseButtons() { - const data = require("./licenseButtons"); - - _licenseButtons = function () { - return data; - }; - - return data; -} - -// DropDMG/dmgbuild a in any case (even if no english, but only ru/de) set to 0 (en_US), well, without docs, just believe that's correct -const DEFAULT_REGION_CODE = 0; - -function addLicenseToDmg(_x, _x2) { - return _addLicenseToDmg.apply(this, arguments); -} - -function _addLicenseToDmg() { - _addLicenseToDmg = (0, _bluebirdLst().coroutine)(function* (packager, dmgPath) { - // http://www.owsiak.org/?p=700 - const licenseFiles = yield (0, _license().getLicenseFiles)(packager); - - if (licenseFiles.length === 0) { - return null; - } - - const licenseButtonFiles = yield (0, _licenseButtons().getLicenseButtonsFile)(packager); - packager.debugLogger.add("dmg.licenseFiles", licenseFiles); - packager.debugLogger.add("dmg.licenseButtons", licenseButtonFiles); - const style = []; - const rtfs = []; - const defaultButtons = []; - let counter = 5000; - const addedRegionCodes = []; - - for (const item of licenseFiles) { - _builderUtil().log.info({ - lang: item.langName - }, "adding license"); // value from DropDMG, data the same for any language - // noinspection SpellCheckingInspection - - - style.push(`data 'styl' (${counter}, "${item.langName}") { - $"0001 0000 0000 000E 0011 0015 0000 000C" - $"0000 0000 0000" -};`); - let data = `data 'RTF ' (${counter}, "${item.langName}") {\n`; - const fileData = yield (0, _fsExtraP().readFile)(item.file, "utf-8"); - const isRtf = item.file.endsWith(".rtf") || item.file.endsWith(".RTF"); - data += isRtf ? (0, _dmgUtil().serializeString)(Buffer.from(fileData).toString("hex")) : wrapInRtf((yield (0, _fsExtraP().readFile)(item.file, "utf-8"))); - data += "\n};"; - rtfs.push(data); - defaultButtons.push((yield (0, _licenseButtons().getLicenseButtons)(licenseButtonFiles, item.langWithRegion, counter, item.langName))); - addedRegionCodes.push(getRegionCode(item.langWithRegion)); - counter++; - } - - const buffer = Buffer.allocUnsafe((2 + 3 * addedRegionCodes.length) * 2); - let offset = 0; - buffer.writeUInt16BE(DEFAULT_REGION_CODE, offset); - offset += 2; - buffer.writeUInt16BE(addedRegionCodes.length, offset); - offset += 2; - - for (let i = 0; i < addedRegionCodes.length; i++) { - const regionCode = addedRegionCodes[i]; - buffer.writeUInt16BE(regionCode, offset); - offset += 2; - buffer.writeUInt16BE(i, offset); - offset += 2; - buffer.writeUInt16BE( - /* is two byte */ - [14, 51, 52, 53].includes(regionCode) ? 1 : 0, offset); - offset += 2; - } - - const lPic = `data 'LPic' (5000) {\n${(0, _dmgUtil().serializeString)(buffer.toString("hex"))}\n};`; - const data = style.concat(rtfs).concat(lPic).concat(defaultButtons).join("\n\n"); - packager.debugLogger.add("dmg.licenseResource", data); - const tempFile = yield packager.getTempFile(".r"); - yield (0, _fsExtraP().outputFile)(tempFile, data); - yield (0, _builderUtil().exec)("hdiutil", ["unflatten", dmgPath]); - yield (0, _builderUtil().exec)("Rez", ["-a", tempFile, "-o", dmgPath]); - yield (0, _builderUtil().exec)("hdiutil", ["flatten", dmgPath]); - return data; - }); - return _addLicenseToDmg.apply(this, arguments); -} - -function getRtfUnicodeEscapedString(text) { - let result = ""; - - for (let i = 0; i < text.length; i++) { - if (text[i] === "\\" || text[i] === "{" || text[i] === "}" || text[i] === "\n") { - result += `\\${text[i]}`; - } else if (text[i] === "\r") {// ignore - } else if (text.charCodeAt(i) <= 0x7f) { - result += text[i]; - } else { - result += `\\u${text.codePointAt(i)}`; - } - } - - return result; -} - -function wrapInRtf(text) { - return ` $"7B5C 7274 6631 5C61 6E73 695C 616E 7369" - $"6370 6731 3235 325C 636F 636F 6172 7466" - $"3135 3034 5C63 6F63 6F61 7375 6272 7466" - $"3833 300A 7B5C 666F 6E74 7462 6C5C 6630" - $"5C66 7377 6973 735C 6663 6861 7273 6574" - $"3020 4865 6C76 6574 6963 613B 7D0A 7B5C" - $"636F 6C6F 7274 626C 3B5C 7265 6432 3535" - $"5C67 7265 656E 3235 355C 626C 7565 3235" - $"353B 7D0A 7B5C 2A5C 6578 7061 6E64 6564" - $"636F 6C6F 7274 626C 3B3B 7D0A 5C70 6172" - $"645C 7478 3536 305C 7478 3131 3230 5C74" - $"7831 3638 305C 7478 3232 3430 5C74 7832" - $"3830 305C 7478 3333 3630 5C74 7833 3932" - $"305C 7478 3434 3830 5C74 7835 3034 305C" - $"7478 3536 3030 5C74 7836 3136 305C 7478" - $"3637 3230 5C70 6172 6469 726E 6174 7572" - $"616C 5C70 6172 7469 6768 7465 6E66 6163" - $"746F 7230 0A0A 5C66 305C 6673 3234 205C" -${(0, _dmgUtil().serializeString)("63663020" + Buffer.from(getRtfUnicodeEscapedString(text)).toString("hex").toUpperCase() + "7D")}`; // ^ to produce correctly splitted output, this two leading chunks from default wrapper appended here -} - -function getRegionCode(langWithRegion) { - const result = regionCodes[langWithRegion]; - - if (result == null) { - throw new Error(`Cannot determine region code for ${langWithRegion}`); - } - - return result; -} // noinspection SpellCheckingInspection - - -const regionCodes = { - en_US: 0, - fr_FR: 1, - en_GB: 2, - de_DE: 3, - it_IT: 4, - nl_NL: 5, - nl_BE: 6, - sv_SE: 7, - es_ES: 8, - da_DK: 9, - pt_PT: 10, - fr_CA: 11, - nb_NO: 12, - he_IL: 13, - ja_JP: 14, - en_AU: 15, - ar: 16, - fi_FI: 17, - fr_CH: 18, - de_CH: 19, - el_GR: 20, - is_IS: 21, - mt_MT: 22, - el_CY: 23, - tr_TR: 24, - hi_IN: 33, - ur_PK: 34, - it_CH: 36, - ro_RO: 39, - grc: 40, - lt_LT: 41, - pl_PL: 42, - hu_HU: 43, - et_EE: 44, - lv_LV: 45, - se: 46, - fo_FO: 47, - fa_IR: 48, - ru_RU: 49, - ga_IE: 50, - ko_KR: 51, - zh_CN: 52, - zh_TW: 53, - th_TH: 54, - cs_CZ: 56, - sk_SK: 57, - bn: 60, - be_BY: 61, - uk_UA: 62, - sr_RS: 65, - sl_SI: 66, - mk_MK: 67, - hr_HR: 68, - pt_BR: 71, - bg_BG: 72, - ca_ES: 73, - gd: 75, - gv: 76, - br: 77, - iu_CA: 78, - cy: 79, - "ga-Latg_IE": 81, - en_CA: 82, - dz_BT: 83, - hy_AM: 84, - ka_GE: 85, - es_419: 86, - to_TO: 88, - fr_001: 91, - de_AT: 92, - gu_IN: 94, - pa: 95, - ur_IN: 96, - vi_VN: 97, - fr_BE: 98, - uz_UZ: 99, - en_SG: 100, - nn_NO: 101, - af_ZA: 102, - eo: 103, - mr_IN: 104, - bo: 105, - ne_NP: 106, - kl: 107, - en_IE: 108 -}; -// __ts-babel@6.0.4 -//# sourceMappingURL=dmgLicense.js.map \ No newline at end of file diff --git a/node_modules/dmg-builder/out/dmgLicense.js.map b/node_modules/dmg-builder/out/dmgLicense.js.map deleted file mode 100755 index 7cf61f2..0000000 --- a/node_modules/dmg-builder/out/dmgLicense.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/dmgLicense.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AACA,MAAM,mBAAmB,GAAG,CAA5B;;SAEsB,e;;;;;mDAAf,WAA+B,QAA/B,EAAgE,OAAhE,EAA+E;AACp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AAE,EAAE,EAzDmB;AA0DvB,EAAA,EAAE,EAAE,EA1DmB;AA2DvB,EAAA,EAAE,EAAE,EA3DmB;AA4DvB,EAAA,KAAK,EAAE,EA5DgB;AA6DvB,EAAA,EAAE,EAAE,EA7DmB;AA8DvB,gBAAc,EA9DS;AA+DvB,EAAA,KAAK,EAAE,EA/DgB;AAgEvB,EAAA,KAAK,EAAE,EAhEgB;AAiEvB,EAAA,KAAK,EAAE,EAjEgB;AAkEvB,EAAA,KAAK,EAAE,EAlEgB;AAmEvB,EAAA,MAAM,EAAE,EAnEe;AAoEvB,EAAA,KAAK,EAAE,EApEgB;AAqEvB,EAAA,MAAM,EAAE,EArEe;AAsEvB,EAAA,KAAK,EAAE,EAtEgB;AAuEvB,EAAA,KAAK,EAAE,EAvEgB;AAwEvB,EAAA,EAAE,EAAE,EAxEmB;AAyEvB,EAAA,KAAK,EAAE,EAzEgB;AA0EvB,EAAA,KAAK,EAAE,EA1EgB;AA2EvB,EAAA,KAAK,EAAE,EA3EgB;AA4EvB,EAAA,KAAK,EAAE,EA5EgB;AA6EvB,EAAA,KAAK,EAAE,GA7EgB;AA8EvB,EAAA,KAAK,EAAE,GA9EgB;AA+EvB,EAAA,KAAK,EAAE,GA/EgB;AAgFvB,EAAA,EAAE,EAAE,GAhFmB;AAiFvB,EAAA,KAAK,EAAE,GAjFgB;AAkFvB,EAAA,EAAE,EAAE,GAlFmB;AAmFvB,EAAA,KAAK,EAAE,GAnFgB;AAoFvB,EAAA,EAAE,EAAE,GApFmB;AAqFvB,EAAA,KAAK,EAAE;AArFgB,CAAzB,C","sourcesContent":["import { exec, log } from \"builder-util\"\nimport { PlatformPackager } from \"app-builder-lib\"\nimport { getLicenseFiles } from \"app-builder-lib/out/util/license\"\nimport { outputFile, readFile } from \"fs-extra-p\"\nimport { serializeString } from \"./dmgUtil\"\nimport { getLicenseButtons, getLicenseButtonsFile } from \"./licenseButtons\"\n\n// DropDMG/dmgbuild a in any case (even if no english, but only ru/de) set to 0 (en_US), well, without docs, just believe that's correct\nconst DEFAULT_REGION_CODE = 0\n\nexport async function addLicenseToDmg(packager: PlatformPackager, dmgPath: string): Promise {\n // http://www.owsiak.org/?p=700\n const licenseFiles = await getLicenseFiles(packager)\n if (licenseFiles.length === 0) {\n return null\n }\n\n const licenseButtonFiles = await getLicenseButtonsFile(packager)\n packager.debugLogger.add(\"dmg.licenseFiles\", licenseFiles)\n packager.debugLogger.add(\"dmg.licenseButtons\", licenseButtonFiles)\n\n const style: Array = []\n const rtfs: Array = []\n const defaultButtons: Array = []\n\n let counter = 5000\n const addedRegionCodes: Array = []\n for (const item of licenseFiles) {\n log.info({lang: item.langName}, \"adding license\")\n\n // value from DropDMG, data the same for any language\n // noinspection SpellCheckingInspection\n style.push(`data 'styl' (${counter}, \"${item.langName}\") {\n $\"0001 0000 0000 000E 0011 0015 0000 000C\"\n $\"0000 0000 0000\"\n};`)\n\n let data = `data 'RTF ' (${counter}, \"${item.langName}\") {\\n`\n const fileData = await readFile(item.file, \"utf-8\")\n const isRtf = item.file.endsWith(\".rtf\") || item.file.endsWith(\".RTF\")\n data += isRtf ? serializeString((Buffer.from(fileData)).toString(\"hex\")) : wrapInRtf(await readFile(item.file, \"utf-8\"))\n data += \"\\n};\"\n rtfs.push(data)\n\n defaultButtons.push(await getLicenseButtons(licenseButtonFiles, item.langWithRegion, counter, item.langName))\n addedRegionCodes.push(getRegionCode(item.langWithRegion))\n counter++\n }\n\n const buffer = Buffer.allocUnsafe((2 + (3 * addedRegionCodes.length)) * 2)\n let offset = 0\n buffer.writeUInt16BE(DEFAULT_REGION_CODE, offset)\n offset += 2\n buffer.writeUInt16BE(addedRegionCodes.length, offset)\n offset += 2\n\n for (let i = 0; i < addedRegionCodes.length; i++) {\n const regionCode = addedRegionCodes[i]\n buffer.writeUInt16BE(regionCode, offset)\n offset += 2\n buffer.writeUInt16BE(i, offset)\n offset += 2\n buffer.writeUInt16BE(/* is two byte */ [14, 51, 52, 53].includes(regionCode) ? 1 : 0, offset)\n offset += 2\n }\n\n const lPic = `data 'LPic' (5000) {\\n${serializeString(buffer.toString(\"hex\"))}\\n};`\n const data = style\n .concat(rtfs)\n .concat(lPic)\n .concat(defaultButtons)\n .join(\"\\n\\n\")\n\n packager.debugLogger.add(\"dmg.licenseResource\", data)\n const tempFile = await packager.getTempFile(\".r\")\n await outputFile(tempFile, data)\n await exec(\"hdiutil\", [\"unflatten\", dmgPath])\n await exec(\"Rez\", [\"-a\", tempFile, \"-o\", dmgPath])\n await exec(\"hdiutil\", [\"flatten\", dmgPath])\n\n return data\n}\n\nfunction getRtfUnicodeEscapedString(text: string) {\n let result = \"\"\n for (let i = 0; i < text.length; i++) {\n if (text[i] === \"\\\\\" || text[i] === \"{\" || text[i] === \"}\" || text[i] === \"\\n\") {\n result += `\\\\${text[i]}`\n }\n else if (text[i] === \"\\r\") {\n // ignore\n }\n else if (text.charCodeAt(i) <= 0x7f) {\n result += text[i]\n }\n else {\n result += `\\\\u${text.codePointAt(i)}`\n }\n }\n return result\n}\n\nfunction wrapInRtf(text: string) {\n return ` $\"7B5C 7274 6631 5C61 6E73 695C 616E 7369\"\n $\"6370 6731 3235 325C 636F 636F 6172 7466\"\n $\"3135 3034 5C63 6F63 6F61 7375 6272 7466\"\n $\"3833 300A 7B5C 666F 6E74 7462 6C5C 6630\"\n $\"5C66 7377 6973 735C 6663 6861 7273 6574\"\n $\"3020 4865 6C76 6574 6963 613B 7D0A 7B5C\"\n $\"636F 6C6F 7274 626C 3B5C 7265 6432 3535\"\n $\"5C67 7265 656E 3235 355C 626C 7565 3235\"\n $\"353B 7D0A 7B5C 2A5C 6578 7061 6E64 6564\"\n $\"636F 6C6F 7274 626C 3B3B 7D0A 5C70 6172\"\n $\"645C 7478 3536 305C 7478 3131 3230 5C74\"\n $\"7831 3638 305C 7478 3232 3430 5C74 7832\"\n $\"3830 305C 7478 3333 3630 5C74 7833 3932\"\n $\"305C 7478 3434 3830 5C74 7835 3034 305C\"\n $\"7478 3536 3030 5C74 7836 3136 305C 7478\"\n $\"3637 3230 5C70 6172 6469 726E 6174 7572\"\n $\"616C 5C70 6172 7469 6768 7465 6E66 6163\"\n $\"746F 7230 0A0A 5C66 305C 6673 3234 205C\"\n${serializeString(\"63663020\" + Buffer.from(getRtfUnicodeEscapedString(text)).toString(\"hex\").toUpperCase() + \"7D\")}`\n // ^ to produce correctly splitted output, this two leading chunks from default wrapper appended here\n}\n\nfunction getRegionCode(langWithRegion: string) {\n const result = regionCodes[langWithRegion]\n if (result == null) {\n throw new Error(`Cannot determine region code for ${langWithRegion}`)\n }\n return result\n}\n\n// noinspection SpellCheckingInspection\nconst regionCodes: any = {\n en_US: 0,\n fr_FR: 1,\n en_GB: 2,\n de_DE: 3,\n it_IT: 4,\n nl_NL: 5,\n nl_BE: 6,\n sv_SE: 7,\n es_ES: 8,\n da_DK: 9,\n pt_PT: 10,\n fr_CA: 11,\n nb_NO: 12,\n he_IL: 13,\n ja_JP: 14,\n en_AU: 15,\n ar: 16,\n fi_FI: 17,\n fr_CH: 18,\n de_CH: 19,\n el_GR: 20,\n is_IS: 21,\n mt_MT: 22,\n el_CY: 23,\n tr_TR: 24,\n hi_IN: 33,\n ur_PK: 34,\n it_CH: 36,\n ro_RO: 39,\n grc: 40,\n lt_LT: 41,\n pl_PL: 42,\n hu_HU: 43,\n et_EE: 44,\n lv_LV: 45,\n se: 46,\n fo_FO: 47,\n fa_IR: 48,\n ru_RU: 49,\n ga_IE: 50,\n ko_KR: 51,\n zh_CN: 52,\n zh_TW: 53,\n th_TH: 54,\n cs_CZ: 56,\n sk_SK: 57,\n bn: 60,\n be_BY: 61,\n uk_UA: 62,\n sr_RS: 65,\n sl_SI: 66,\n mk_MK: 67,\n hr_HR: 68,\n pt_BR: 71,\n bg_BG: 72,\n ca_ES: 73,\n gd: 75,\n gv: 76,\n br: 77,\n iu_CA: 78,\n cy: 79,\n \"ga-Latg_IE\": 81,\n en_CA: 82,\n dz_BT: 83,\n hy_AM: 84,\n ka_GE: 85,\n es_419: 86,\n to_TO: 88,\n fr_001: 91,\n de_AT: 92,\n gu_IN: 94,\n pa: 95,\n ur_IN: 96,\n vi_VN: 97,\n fr_BE: 98,\n uz_UZ: 99,\n en_SG: 100,\n nn_NO: 101,\n af_ZA: 102,\n eo: 103,\n mr_IN: 104,\n bo: 105,\n ne_NP: 106,\n kl: 107,\n en_IE: 108\n}"],"sourceRoot":""} diff --git a/node_modules/dmg-builder/out/dmgUtil.d.ts b/node_modules/dmg-builder/out/dmgUtil.d.ts deleted file mode 100755 index 9a483d3..0000000 --- a/node_modules/dmg-builder/out/dmgUtil.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { PlatformPackager } from "app-builder-lib"; -import { AsyncTaskManager } from "builder-util/out/asyncTaskManager"; -import { TmpDir } from "temp-file"; -export { DmgTarget } from "./dmg"; -export declare function getDmgTemplatePath(): string; -export declare function getDmgVendorPath(): string; -export declare function attachAndExecute(dmgPath: string, readWrite: boolean, task: () => Promise): Promise; -export declare function detach(name: string): Promise; -export declare function computeBackgroundColor(rawValue: string): any; -export declare function computeBackground(packager: PlatformPackager): Promise; -export declare function applyProperties(entries: any, env: any, asyncTaskManager: AsyncTaskManager, packager: PlatformPackager): Promise; -export declare function transformBackgroundFileIfNeed(file: string, tmpDir: TmpDir): Promise; diff --git a/node_modules/dmg-builder/out/dmgUtil.js b/node_modules/dmg-builder/out/dmgUtil.js deleted file mode 100755 index e790649..0000000 --- a/node_modules/dmg-builder/out/dmgUtil.js +++ /dev/null @@ -1,213 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getDmgTemplatePath = getDmgTemplatePath; -exports.getDmgVendorPath = getDmgVendorPath; -exports.attachAndExecute = attachAndExecute; -exports.detach = detach; -exports.computeBackgroundColor = computeBackgroundColor; -exports.computeBackground = computeBackground; -exports.applyProperties = applyProperties; -exports.transformBackgroundFileIfNeed = transformBackgroundFileIfNeed; -exports.serializeString = serializeString; -Object.defineProperty(exports, "DmgTarget", { - enumerable: true, - get: function () { - return _dmg().DmgTarget; - } -}); - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _dmg() { - const data = require("./dmg"); - - _dmg = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const root = path.join(__dirname, ".."); - -function getDmgTemplatePath() { - return path.join(root, "templates"); -} - -function getDmgVendorPath() { - return path.join(root, "vendor"); -} - -function attachAndExecute(_x, _x2, _x3) { - return _attachAndExecute.apply(this, arguments); -} - -function _attachAndExecute() { - _attachAndExecute = (0, _bluebirdLst().coroutine)(function* (dmgPath, readWrite, task) { - //noinspection SpellCheckingInspection - const args = ["attach", "-noverify", "-noautoopen"]; - - if (readWrite) { - args.push("-readwrite"); - } - - args.push(dmgPath); - const attachResult = yield (0, _builderUtil().exec)("hdiutil", args); - const deviceResult = attachResult == null ? null : /^(\/dev\/\w+)/.exec(attachResult); - const device = deviceResult == null || deviceResult.length !== 2 ? null : deviceResult[1]; - - if (device == null) { - throw new Error(`Cannot mount: ${attachResult}`); - } - - return yield (0, _promise().executeFinally)(task(), () => detach(device)); - }); - return _attachAndExecute.apply(this, arguments); -} - -function detach(_x4) { - return _detach.apply(this, arguments); -} - -function _detach() { - _detach = (0, _bluebirdLst().coroutine)(function* (name) { - try { - yield (0, _builderUtil().exec)("hdiutil", ["detach", "-quiet", name]); - } catch (e) { - yield new Promise((resolve, reject) => { - setTimeout(() => { - (0, _builderUtil().exec)("hdiutil", ["detach", "-force", name]).then(resolve).catch(reject); - }, 1000); - }); - } - }); - return _detach.apply(this, arguments); -} - -function computeBackgroundColor(rawValue) { - return require("parse-color")(rawValue).hex; -} - -function computeBackground(_x5) { - return _computeBackground.apply(this, arguments); -} - -function _computeBackground() { - _computeBackground = (0, _bluebirdLst().coroutine)(function* (packager) { - const resourceList = yield packager.resourceList; - - if (resourceList.includes("background.tiff")) { - return path.join(packager.buildResourcesDir, "background.tiff"); - } else if (resourceList.includes("background.png")) { - return path.join(packager.buildResourcesDir, "background.png"); - } else { - return path.join(getDmgTemplatePath(), "background.tiff"); - } - }); - return _computeBackground.apply(this, arguments); -} - -function applyProperties(_x6, _x7, _x8, _x9) { - return _applyProperties.apply(this, arguments); -} - -function _applyProperties() { - _applyProperties = (0, _bluebirdLst().coroutine)(function* (entries, env, asyncTaskManager, packager) { - const dmgPropertiesFile = yield packager.getTempFile("dmgProperties.pl"); - asyncTaskManager.addTask((0, _fsExtraP().outputFile)(dmgPropertiesFile, (yield (0, _fsExtraP().readFile)(path.join(getDmgTemplatePath(), "dmgProperties.pl"), "utf-8")).replace("$ENTRIES", entries))); - yield asyncTaskManager.awaitTasks(); - yield (0, _builderUtil().exec)("/usr/bin/perl", [dmgPropertiesFile], { - cwd: getDmgVendorPath(), - env - }); - }); - return _applyProperties.apply(this, arguments); -} - -function transformBackgroundFileIfNeed(_x10, _x11) { - return _transformBackgroundFileIfNeed.apply(this, arguments); -} -/** @internal */ - - -function _transformBackgroundFileIfNeed() { - _transformBackgroundFileIfNeed = (0, _bluebirdLst().coroutine)(function* (file, tmpDir) { - if (file.endsWith(".tiff") || file.endsWith(".TIFF")) { - return file; - } - - const retinaFile = file.replace(/\.([a-z]+)$/, "@2x.$1"); - - if (yield (0, _fs().exists)(retinaFile)) { - const tiffFile = yield tmpDir.getTempFile({ - suffix: ".tiff" - }); - yield (0, _builderUtil().exec)("tiffutil", ["-cathidpicheck", file, retinaFile, "-out", tiffFile]); - return tiffFile; - } - - return file; - }); - return _transformBackgroundFileIfNeed.apply(this, arguments); -} - -function serializeString(data) { - return ' $"' + data.match(/.{1,32}/g).map(it => it.match(/.{1,4}/g).join(" ")).join('"\n $"') + '"'; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=dmgUtil.js.map \ No newline at end of file diff --git a/node_modules/dmg-builder/out/dmgUtil.js.map b/node_modules/dmg-builder/out/dmgUtil.js.map deleted file mode 100755 index d3f9991..0000000 --- a/node_modules/dmg-builder/out/dmgUtil.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/dmgUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAL,CAAU,SAAV,EAAqB,IAArB,CAAb;;AAEM,SAAU,kBAAV,GAA4B;AAChC,SAAO,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,WAAhB,CAAP;AACD;;AAEK,SAAU,gBAAV,GAA0B;AAC9B,SAAO,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,QAAhB,CAAP;AACD;;SAEqB,gB;;;;;oDAAf,WAAgC,OAAhC,EAAiD,SAAjD,EAAqE,IAArE,EAA6F;AAClG;AACA,UAAM,IAAI,GAAG,CAAC,QAAD,E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AAnB;;AACA,cAAU,kBAAO,UAAP,CAAV,EAA8B;AAC5B,YAAM,QAAQ,SAAS,MAAM,CAAC,WAAP,CAAmB;AAAC,QAAA,MAAM,EAAE;AAAT,OAAnB,CAAvB;AACA,YAAM,yBAAK,UAAL,EAAiB,CAAC,gBAAD,EAAmB,IAAnB,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,QAA7C,CAAjB,CAAN;AACA,aAAO,QAAP;AACD;;AAED,WAAO,IAAP;AACD,G;;;;AAGK,SAAU,eAAV,CAA0B,IAA1B,EAAsC;AAC1C,SAAO,SAAS,IAAI,CAAC,KAAL,CAAW,UAAX,EAAyB,GAAzB,CAA6B,EAAE,IAAI,EAAE,CAAC,KAAH,CAAS,SAAT,EAAsB,IAAtB,CAA2B,GAA3B,CAAnC,EAAoE,IAApE,CAAyE,SAAzE,CAAT,GAA+F,GAAtG;AACD,C","sourcesContent":["import { exec } from \"builder-util\"\nimport { PlatformPackager } from \"app-builder-lib\"\nimport { AsyncTaskManager } from \"builder-util/out/asyncTaskManager\"\nimport { exists } from \"builder-util/out/fs\"\nimport { executeFinally } from \"builder-util/out/promise\"\nimport { outputFile, readFile } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { TmpDir } from \"temp-file\"\n\nexport { DmgTarget } from \"./dmg\"\n\nconst root = path.join(__dirname, \"..\")\n\nexport function getDmgTemplatePath() {\n return path.join(root, \"templates\")\n}\n\nexport function getDmgVendorPath() {\n return path.join(root, \"vendor\")\n}\n\nexport async function attachAndExecute(dmgPath: string, readWrite: boolean, task: () => Promise) {\n //noinspection SpellCheckingInspection\n const args = [\"attach\", \"-noverify\", \"-noautoopen\"]\n if (readWrite) {\n args.push(\"-readwrite\")\n }\n\n args.push(dmgPath)\n const attachResult = await exec(\"hdiutil\", args)\n const deviceResult = attachResult == null ? null : /^(\\/dev\\/\\w+)/.exec(attachResult)\n const device = deviceResult == null || deviceResult.length !== 2 ? null : deviceResult[1]\n if (device == null) {\n throw new Error(`Cannot mount: ${attachResult}`)\n }\n\n return await executeFinally(task(), () => detach(device))\n}\n\nexport async function detach(name: string) {\n try {\n await exec(\"hdiutil\", [\"detach\", \"-quiet\", name])\n }\n catch (e) {\n await new Promise((resolve, reject) => {\n setTimeout(() => {\n exec(\"hdiutil\", [\"detach\", \"-force\", name])\n .then(resolve)\n .catch(reject)\n }, 1000)\n })\n }\n}\n\nexport function computeBackgroundColor(rawValue: string) {\n return require(\"parse-color\")(rawValue).hex\n}\n\nexport async function computeBackground(packager: PlatformPackager): Promise {\n const resourceList = await packager.resourceList\n if (resourceList.includes(\"background.tiff\")) {\n return path.join(packager.buildResourcesDir, \"background.tiff\")\n }\n else if (resourceList.includes(\"background.png\")) {\n return path.join(packager.buildResourcesDir, \"background.png\")\n }\n else {\n return path.join(getDmgTemplatePath(), \"background.tiff\")\n }\n}\n\nexport async function applyProperties(entries: any, env: any, asyncTaskManager: AsyncTaskManager, packager: PlatformPackager) {\n const dmgPropertiesFile = await packager.getTempFile(\"dmgProperties.pl\")\n asyncTaskManager.addTask(outputFile(dmgPropertiesFile, (await readFile(path.join(getDmgTemplatePath(), \"dmgProperties.pl\"), \"utf-8\")).replace(\"$ENTRIES\", entries)))\n await asyncTaskManager.awaitTasks()\n\n await exec(\"/usr/bin/perl\", [dmgPropertiesFile], {\n cwd: getDmgVendorPath(),\n env\n })\n}\n\nexport async function transformBackgroundFileIfNeed(file: string, tmpDir: TmpDir): Promise {\n if (file.endsWith(\".tiff\") || file.endsWith(\".TIFF\")) {\n return file\n }\n\n const retinaFile = file.replace(/\\.([a-z]+)$/, \"@2x.$1\")\n if (await exists(retinaFile)) {\n const tiffFile = await tmpDir.getTempFile({suffix: \".tiff\"})\n await exec(\"tiffutil\", [\"-cathidpicheck\", file, retinaFile, \"-out\", tiffFile])\n return tiffFile\n }\n\n return file\n}\n\n/** @internal */\nexport function serializeString(data: string) {\n return ' $\"' + data.match(/.{1,32}/g)!!.map(it => it.match(/.{1,4}/g)!!.join(\" \")).join('\"\\n $\"') + '\"'\n}"],"sourceRoot":""} diff --git a/node_modules/dmg-builder/out/licenseButtons.d.ts b/node_modules/dmg-builder/out/licenseButtons.d.ts deleted file mode 100755 index 8a47f2e..0000000 --- a/node_modules/dmg-builder/out/licenseButtons.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { PlatformPackager } from "app-builder-lib"; -export declare function getLicenseButtonsFile(packager: PlatformPackager): Promise>; -export interface LicenseButtonsFile { - file: string; - lang: string; - langWithRegion: string; - langName: string; -} -export declare function getLicenseButtons(licenseButtonFiles: Array, langWithRegion: string, id: number, name: string): Promise; diff --git a/node_modules/dmg-builder/out/licenseButtons.js b/node_modules/dmg-builder/out/licenseButtons.js deleted file mode 100755 index 43979c8..0000000 --- a/node_modules/dmg-builder/out/licenseButtons.js +++ /dev/null @@ -1,314 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getLicenseButtonsFile = getLicenseButtonsFile; -exports.getLicenseButtons = getLicenseButtons; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _license() { - const data = require("app-builder-lib/out/util/license"); - - _license = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function iconv() { - const data = _interopRequireWildcard(require("iconv-lite")); - - iconv = function () { - return data; - }; - - return data; -} - -function _jsYaml() { - const data = require("js-yaml"); - - _jsYaml = function () { - return data; - }; - - return data; -} - -function _dmgUtil() { - const data = require("./dmgUtil"); - - _dmgUtil = function () { - return data; - }; - - return data; -} - -function _licenseDefaultButtons() { - const data = require("./licenseDefaultButtons"); - - _licenseDefaultButtons = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getLicenseButtonsFile(_x) { - return _getLicenseButtonsFile.apply(this, arguments); -} - -function _getLicenseButtonsFile() { - _getLicenseButtonsFile = (0, _bluebirdLst().coroutine)(function* (packager) { - return (0, _license().getLicenseAssets)((yield packager.resourceList).filter(it => { - const name = it.toLowerCase(); // noinspection SpellCheckingInspection - - return name.startsWith("licensebuttons_") && (name.endsWith(".json") || name.endsWith(".yml")); - }), packager); - }); - return _getLicenseButtonsFile.apply(this, arguments); -} - -function getLicenseButtons(_x2, _x3, _x4, _x5) { - return _getLicenseButtons.apply(this, arguments); -} - -function _getLicenseButtons() { - _getLicenseButtons = (0, _bluebirdLst().coroutine)(function* (licenseButtonFiles, langWithRegion, id, name) { - let data = (0, _licenseDefaultButtons().getDefaultButtons)(langWithRegion, id, name); - - for (const item of licenseButtonFiles) { - if (item.langWithRegion !== langWithRegion) { - continue; - } - - try { - const fileData = (0, _jsYaml().safeLoad)((yield (0, _fsExtraP().readFile)(item.file, "utf-8"))); - const buttonsStr = labelToHex(fileData.lang, item.lang, item.langWithRegion) + labelToHex(fileData.agree, item.lang, item.langWithRegion) + labelToHex(fileData.disagree, item.lang, item.langWithRegion) + labelToHex(fileData.print, item.lang, item.langWithRegion) + labelToHex(fileData.save, item.lang, item.langWithRegion) + labelToHex(fileData.description, item.lang, item.langWithRegion); - data = `data 'STR#' (${id}, "${name}") {\n`; - data += (0, _dmgUtil().serializeString)("0006" + buttonsStr); - data += `\n};`; - - if (_builderUtil().log.isDebugEnabled) { - _builderUtil().log.debug({ - lang: item.langName, - data - }, `overwriting license buttons`); - } - - return data; - } catch (e) { - _builderUtil().log.debug({ - error: e - }, "cannot overwrite license buttons"); - - return data; - } - } - - return data; - }); - return _getLicenseButtons.apply(this, arguments); -} - -function labelToHex(label, lang, langWithRegion) { - const lbl = hexEncode(label, lang, langWithRegion).toString().toUpperCase(); - const len = numberToHex(lbl.length / 2); - return len + lbl; -} - -function numberToHex(nb) { - return ("0" + nb.toString(16)).slice(-2); -} - -function hexEncode(str, lang, langWithRegion) { - const macCodePages = getMacCodePage(lang, langWithRegion); - let result = ""; - - for (let i = 0; i < str.length; i++) { - try { - let hex = getMacHexCode(str, i, macCodePages); - - if (hex === undefined) { - hex = "3F"; //? - } - - result += hex; - } catch (e) { - _builderUtil().log.debug({ - error: e, - char: str[i] - }, "cannot convert"); - - result += "3F"; //? - } - } - - return result; -} - -function getMacCodePage(lang, langWithRegion) { - switch (lang) { - case "ja": - //japanese - return ["euc-jp"]; - //Apple Japanese - - case "zh": - //chinese - if (langWithRegion === "zh_CN") { - return ["gb2312"]; //Apple Simplified Chinese (GB 2312) - } - - return ["big5"]; - //Apple Traditional Chinese (Big5) - - case "ko": - //korean - return ["euc-kr"]; - //Apple Korean - - case "ar": //arabic - - case "ur": - //urdu - return ["macarabic"]; - //Apple Arabic - - case "he": - //hebrew - return ["machebrew"]; - //Apple Hebrew - - case "el": //greek - - case "elc": - //greek - return ["macgreek"]; - //Apple Greek - - case "ru": //russian - - case "be": //belarussian - - case "sr": //serbian - - case "bg": //bulgarian - - case "uz": - //uzbek - return ["maccyrillic"]; - //Apple Macintosh Cyrillic - - case "ro": - //romanian - return ["macromania"]; - //Apple Romanian - - case "uk": - //ukrainian - return ["macukraine"]; - //Apple Ukrainian - - case "th": - //thai - return ["macthai"]; - //Apple Thai - - case "et": //estonian - - case "lt": //lithuanian - - case "lv": //latvian - - case "pl": //polish - - case "hu": //hungarian - - case "cs": //czech - - case "sk": - //slovak - return ["maccenteuro"]; - //Apple Macintosh Central Europe - - case "is": //icelandic - - case "fo": - //faroese - return ["maciceland"]; - //Apple Icelandic - - case "tr": - //turkish - return ["macturkish"]; - //Apple Turkish - - case "hr": //croatian - - case "sl": - //slovenian - return ["maccroatian"]; - //Apple Croatian - - default: - return ["macroman"]; - //Apple Macintosh Roman - } -} - -function getMacHexCode(str, i, macCodePages) { - const code = str.charCodeAt(i); - - if (code < 128) { - return code.toString(16); - } else if (code < 256) { - return iconv().encode(str[i], "macroman").toString("hex"); - } else { - for (let i = 0; i < macCodePages.length; i++) { - const result = iconv().encode(str[i], macCodePages[i]).toString("hex"); - - if (result !== undefined) { - return result; - } - } - } - - return code; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=licenseButtons.js.map \ No newline at end of file diff --git a/node_modules/dmg-builder/out/licenseButtons.js.map b/node_modules/dmg-builder/out/licenseButtons.js.map deleted file mode 100755 index 3acba22..0000000 --- a/node_modules/dmg-builder/out/licenseButtons.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/licenseButtons.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;SAEsB,qB;;;;;yDAAf,WAAqC,QAArC,EAAoE;AACzE,WAAO,iCAAiB,OAAO,QAAQ,CAAC,YAAhB,EACrB,MADqB,CACd,EAAE,IAAG;AACX,YAAM,IAAI,GAAG,EAAE,CAAC,WAAH,EAAb,CADW,CAEX;;AACA,aAAO,IAAI,CAAC,UAAL,CAAgB,iBAAhB,MAAuC,IAAI,CAAC,QAAL,CAAc,OAAd,KAA0B,IAAI,CAAC,QAAL,CAAc,MAAd,CAAjE,CAAP;AACD,KALqB,CAAjB,EAKD,QALC,CAAP;AAMD,G;;;;SASqB,iB;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AAL,CAnCF,CAmCa;;AACX,SAAK,IAAL;AAAW;AACT,aAAO,CAAC,aAAD,CAAP;AAAuB;;AACzB,SAAK,IAAL,CAtCF,CAsCa;;AACX,SAAK,IAAL;AAAW;AACT,aAAO,CAAC,YAAD,CAAP;AAAsB;;AACxB,SAAK,IAAL;AAAW;AACT,aAAO,CAAC,YAAD,CAAP;AAAsB;;AACxB,SAAK,IAAL,CA3CF,CA2Ca;;AACX,SAAK,IAAL;AAAW;AACT,aAAO,CAAC,aAAD,CAAP;AAAuB;;AACzB;AACE,aAAO,CAAC,UAAD,CAAP;AAAoB;AA/CxB;AAiDD;;AAED,SAAS,aAAT,CAAuB,GAAvB,EAAoC,CAApC,EAA+C,YAA/C,EAAgE;AAC9D,QAAM,IAAI,GAAG,GAAG,CAAC,UAAJ,CAAe,CAAf,CAAb;;AACA,MAAI,IAAI,GAAG,GAAX,EAAgB;AACd,WAAO,IAAI,CAAC,QAAL,CAAc,EAAd,CAAP;AACD,GAFD,MAGK,IAAI,IAAI,GAAG,GAAX,EAAgB;AACnB,WAAO,KAAK,GAAC,MAAN,CAAa,GAAG,CAAC,CAAD,CAAhB,EAAqB,UAArB,EAAiC,QAAjC,CAA0C,KAA1C,CAAP;AACD,GAFI,MAGA;AACH,SAAK,IAAI,CAAC,GAAG,CAAb,EAAgB,CAAC,GAAG,YAAY,CAAC,MAAjC,EAAyC,CAAC,EAA1C,EAA8C;AAC5C,YAAM,MAAM,GAAG,KAAK,GAAC,MAAN,CAAa,GAAG,CAAC,CAAD,CAAhB,EAAqB,YAAY,CAAC,CAAD,CAAjC,EAAsC,QAAtC,CAA+C,KAA/C,CAAf;;AACA,UAAI,MAAM,KAAK,SAAf,EAA0B;AACxB,eAAO,MAAP;AACD;AACF;AACF;;AACD,SAAO,IAAP;AACD,C","sourcesContent":["import { log } from \"builder-util\"\nimport { PlatformPackager } from \"app-builder-lib\"\nimport { getLicenseAssets } from \"app-builder-lib/out/util/license\"\nimport { readFile } from \"fs-extra-p\"\nimport * as iconv from \"iconv-lite\"\nimport { safeLoad } from \"js-yaml\"\nimport { serializeString } from \"./dmgUtil\"\nimport { getDefaultButtons } from \"./licenseDefaultButtons\"\n\nexport async function getLicenseButtonsFile(packager: PlatformPackager): Promise> {\n return getLicenseAssets((await packager.resourceList)\n .filter(it => {\n const name = it.toLowerCase()\n // noinspection SpellCheckingInspection\n return name.startsWith(\"licensebuttons_\") && (name.endsWith(\".json\") || name.endsWith(\".yml\"))\n }), packager)\n}\n\nexport interface LicenseButtonsFile {\n file: string\n lang: string\n langWithRegion: string\n langName: string\n}\n\nexport async function getLicenseButtons(licenseButtonFiles: Array, langWithRegion: string, id: number, name: string) {\n let data = getDefaultButtons(langWithRegion, id, name)\n\n for (const item of licenseButtonFiles) {\n if (item.langWithRegion !== langWithRegion) {\n continue\n }\n\n try {\n const fileData = safeLoad(await readFile(item.file, \"utf-8\")) as any\n const buttonsStr = labelToHex(fileData.lang, item.lang, item.langWithRegion) +\n labelToHex(fileData.agree, item.lang, item.langWithRegion) +\n labelToHex(fileData.disagree, item.lang, item.langWithRegion) +\n labelToHex(fileData.print, item.lang, item.langWithRegion) +\n labelToHex(fileData.save, item.lang, item.langWithRegion) +\n labelToHex(fileData.description, item.lang, item.langWithRegion)\n\n data = `data 'STR#' (${id}, \"${name}\") {\\n`\n data += serializeString(\"0006\" + buttonsStr)\n data += `\\n};`\n\n if (log.isDebugEnabled) {\n log.debug({lang: item.langName, data}, `overwriting license buttons`)\n }\n return data\n }\n catch (e) {\n log.debug({error: e}, \"cannot overwrite license buttons\")\n return data\n }\n }\n\n return data\n}\n\nfunction labelToHex(label: string, lang: string, langWithRegion: string) {\n const lbl = hexEncode(label, lang, langWithRegion).toString().toUpperCase()\n const len = numberToHex((lbl.length / 2))\n return len + lbl\n}\n\nfunction numberToHex(nb: number) {\n return (\"0\" + (nb.toString(16))).slice(-2)\n}\n\nfunction hexEncode(str: string, lang: string, langWithRegion: string) {\n const macCodePages = getMacCodePage(lang, langWithRegion)\n let result = \"\"\n\n for (let i = 0; i < str.length; i++) {\n try {\n let hex = getMacHexCode(str, i, macCodePages)\n if (hex === undefined) {\n hex = \"3F\" //?\n }\n result += hex\n }\n catch (e) {\n log.debug({error: e, char: str[i]}, \"cannot convert\")\n result += \"3F\" //?\n }\n }\n\n return result\n}\n\nfunction getMacCodePage(lang: string, langWithRegion: string) {\n switch (lang) {\n case \"ja\": //japanese\n return [\"euc-jp\"] //Apple Japanese\n case \"zh\": //chinese\n if (langWithRegion === \"zh_CN\") {\n return [\"gb2312\"] //Apple Simplified Chinese (GB 2312)\n }\n return [\"big5\"] //Apple Traditional Chinese (Big5)\n case \"ko\": //korean\n return [\"euc-kr\"] //Apple Korean\n case \"ar\": //arabic\n case \"ur\": //urdu\n return [\"macarabic\"] //Apple Arabic\n case \"he\": //hebrew\n return [\"machebrew\"] //Apple Hebrew\n case \"el\": //greek\n case \"elc\": //greek\n return [\"macgreek\"] //Apple Greek\n case \"ru\": //russian\n case \"be\": //belarussian\n case \"sr\": //serbian\n case \"bg\": //bulgarian\n case \"uz\": //uzbek\n return [\"maccyrillic\"] //Apple Macintosh Cyrillic\n case \"ro\": //romanian\n return [\"macromania\"] //Apple Romanian\n case \"uk\": //ukrainian\n return [\"macukraine\"] //Apple Ukrainian\n case \"th\": //thai\n return [\"macthai\"] //Apple Thai\n case \"et\": //estonian\n case \"lt\": //lithuanian\n case \"lv\": //latvian\n case \"pl\": //polish\n case \"hu\": //hungarian\n case \"cs\": //czech\n case \"sk\": //slovak\n return [\"maccenteuro\"] //Apple Macintosh Central Europe\n case \"is\": //icelandic\n case \"fo\": //faroese\n return [\"maciceland\"] //Apple Icelandic\n case \"tr\": //turkish\n return [\"macturkish\"] //Apple Turkish\n case \"hr\": //croatian\n case \"sl\": //slovenian\n return [\"maccroatian\"] //Apple Croatian\n default:\n return [\"macroman\"] //Apple Macintosh Roman\n }\n}\n\nfunction getMacHexCode(str: string, i: number, macCodePages: any) {\n const code = str.charCodeAt(i)\n if (code < 128) {\n return code.toString(16)\n }\n else if (code < 256) {\n return iconv.encode(str[i], \"macroman\").toString(\"hex\")\n }\n else {\n for (let i = 0; i < macCodePages.length; i++) {\n const result = iconv.encode(str[i], macCodePages[i]).toString(\"hex\")\n if (result !== undefined) {\n return result\n }\n }\n }\n return code\n}"],"sourceRoot":""} diff --git a/node_modules/dmg-builder/out/licenseDefaultButtons.d.ts b/node_modules/dmg-builder/out/licenseDefaultButtons.d.ts deleted file mode 100755 index f996c79..0000000 --- a/node_modules/dmg-builder/out/licenseDefaultButtons.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getDefaultButtons(langWithRegion: string, id: number, name: string): string; diff --git a/node_modules/dmg-builder/out/licenseDefaultButtons.js b/node_modules/dmg-builder/out/licenseDefaultButtons.js deleted file mode 100755 index 6788fa3..0000000 --- a/node_modules/dmg-builder/out/licenseDefaultButtons.js +++ /dev/null @@ -1,280 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getDefaultButtons = getDefaultButtons; - -function getDefaultButtons(langWithRegion, id, name) { - switch (langWithRegion) { - case "de_DE": - return `data 'STR#' (${id}, "${name}") { - $"0006 0744 6575 7473 6368 0B41 6B7A 6570" - $"7469 6572 656E 0841 626C 6568 6E65 6E07" - $"4472 7563 6B65 6E0A 5369 6368 6572 6E2E" - $"2E2E E74B 6C69 636B 656E 2053 6965 2069" - $"6E20 D241 6B7A 6570 7469 6572 656E D32C" - $"2077 656E 6E20 5369 6520 6D69 7420 6465" - $"6E20 4265 7374 696D 6D75 6E67 656E 2064" - $"6573 2053 6F66 7477 6172 652D 4C69 7A65" - $"6E7A 7665 7274 7261 6773 2065 696E 7665" - $"7273 7461 6E64 656E 2073 696E 642E 2046" - $"616C 6C73 206E 6963 6874 2C20 6269 7474" - $"6520 D241 626C 6568 6E65 6ED3 2061 6E6B" - $"6C69 636B 656E 2E20 5369 6520 6B9A 6E6E" - $"656E 2064 6965 2053 6F66 7477 6172 6520" - $"6E75 7220 696E 7374 616C 6C69 6572 656E" - $"2C20 7765 6E6E 2053 6965 20D2 416B 7A65" - $"7074 6965 7265 6ED3 2061 6E67 656B 6C69" - $"636B 7420 6861 6265 6E2E" -};`; - - case "fr_FR": - return `data 'STR#' (${id}, "${name}") { - $"0006 0846 7261 6E8D 6169 7308 4163 6365" - $"7074 6572 0752 6566 7573 6572 0849 6D70" - $"7269 6D65 720E 456E 7265 6769 7374 7265" - $"722E 2E2E BA53 6920 766F 7573 2061 6363" - $"6570 7465 7A20 6C65 7320 7465 726D 6573" - $"2064 6520 6C61 2070 728E 7365 6E74 6520" - $"6C69 6365 6E63 652C 2063 6C69 7175 657A" - $"2073 7572 2022 4163 6365 7074 6572 2220" - $"6166 696E 2064 2769 6E73 7461 6C6C 6572" - $"206C 6520 6C6F 6769 6369 656C 2E20 5369" - $"2076 6F75 7320 6E27 9074 6573 2070 6173" - $"2064 2761 6363 6F72 6420 6176 6563 206C" - $"6573 2074 6572 6D65 7320 6465 206C 6120" - $"6C69 6365 6E63 652C 2063 6C69 7175 657A" - $"2073 7572 2022 5265 6675 7365 7222 2E" -};`; - - case "fr_CA": - return `data 'STR#' (${id}, "${name}") { - $"0006 1146 7261 6E8D 6169 7320 6361 6E61" - $"6469 656E 0841 6363 6570 7465 7207 5265" - $"6675 7365 7208 496D 7072 696D 6572 0E45" - $"6E72 6567 6973 7472 6572 2E2E 2EBA 5369" - $"2076 6F75 7320 6163 6365 7074 657A 206C" - $"6573 2074 6572 6D65 7320 6465 206C 6120" - $"7072 8E73 656E 7465 206C 6963 656E 6365" - $"2C20 636C 6971 7565 7A20 7375 7220 2241" - $"6363 6570 7465 7222 2061 6669 6E20 6427" - $"696E 7374 616C 6C65 7220 6C65 206C 6F67" - $"6963 6965 6C2E 2053 6920 766F 7573 206E" - $"2790 7465 7320 7061 7320 6427 6163 636F" - $"7264 2061 7665 6320 6C65 7320 7465 726D" - $"6573 2064 6520 6C61 206C 6963 656E 6365" - $"2C20 636C 6971 7565 7A20 7375 7220 2252" - $"6566 7573 6572 222E" -};`; - - case "es_ES": - return `data 'STR#' (${id}, "${name}") { - $"0006 0745 7370 6196 6F6C 0741 6365 7074" - $"6172 0A4E 6F20 6163 6570 7461 7208 496D" - $"7072 696D 6972 0A47 7561 7264 6172 2E2E" - $"2EC0 5369 2065 7374 8720 6465 2061 6375" - $"6572 646F 2063 6F6E 206C 6F73 2074 8E72" - $"6D69 6E6F 7320 6465 2065 7374 6120 6C69" - $"6365 6E63 6961 2C20 7075 6C73 6520 2241" - $"6365 7074 6172 2220 7061 7261 2069 6E73" - $"7461 6C61 7220 656C 2073 6F66 7477 6172" - $"652E 2045 6E20 656C 2073 7570 7565 7374" - $"6F20 6465 2071 7565 206E 6F20 6573 748E" - $"2064 6520 6163 7565 7264 6F20 636F 6E20" - $"6C6F 7320 748E 726D 696E 6F73 2064 6520" - $"6573 7461 206C 6963 656E 6369 612C 2070" - $"756C 7365 2022 4E6F 2061 6365 7074 6172" - $"2E22" -};`; - - case "it_IT": - return `data 'STR#' (${id}, "${name}") { - $"0006 0849 7461 6C69 616E 6F07 4163 6365" - $"7474 6F07 5269 6669 7574 6F06 5374 616D" - $"7061 0B52 6567 6973 7472 612E 2E2E 7F53" - $"6520 6163 6365 7474 6920 6C65 2063 6F6E" - $"6469 7A69 6F6E 6920 6469 2071 7565 7374" - $"6120 6C69 6365 6E7A 612C 2066 6169 2063" - $"6C69 6320 7375 2022 4163 6365 7474 6F22" - $"2070 6572 2069 6E73 7461 6C6C 6172 6520" - $"696C 2073 6F66 7477 6172 652E 2041 6C74" - $"7269 6D65 6E74 6920 6661 6920 636C 6963" - $"2073 7520 2252 6966 6975 746F 222E" -};`; - - case "ja_JP": - return `data 'STR#' (${id}, "${name}") { - $"0006 084A 6170 616E 6573 650A 93AF 88D3" - $"82B5 82DC 82B7 0C93 AF88 D382 B582 DC82" - $"B982 F108 88F3 8DFC 82B7 82E9 0795 DB91" - $"B62E 2E2E B496 7B83 5C83 7483 6783 4583" - $"4783 418E 6797 708B 9691 F88C 5F96 F182" - $"CC8F F08C 8F82 C993 AF88 D382 B382 EA82" - $"E98F EA8D 8782 C982 CD81 4183 5C83 7483" - $"6783 4583 4783 4182 F083 4383 9383 5883" - $"6781 5B83 8B82 B782 E982 BD82 DF82 C981" - $"7593 AF88 D382 B582 DC82 B781 7682 F089" - $"9F82 B582 C482 AD82 BE82 B382 A281 4281" - $"4093 AF88 D382 B382 EA82 C882 A28F EA8D" - $"8782 C982 CD81 4181 7593 AF88 D382 B582" - $"DC82 B982 F181 7682 F089 9F82 B582 C482" - $"AD82 BE82 B382 A281 42" -};`; - - case "nl_NL": - return `data 'STR#' (${id}, "${name}") { - $"0006 0A4E 6564 6572 6C61 6E64 7302 4A61" - $"034E 6565 0550 7269 6E74 0942 6577 6161" - $"722E 2E2E A449 6E64 6965 6E20 7520 616B" - $"6B6F 6F72 6420 6761 6174 206D 6574 2064" - $"6520 766F 6F72 7761 6172 6465 6E20 7661" - $"6E20 6465 7A65 206C 6963 656E 7469 652C" - $"206B 756E 7420 7520 6F70 2027 4A61 2720" - $"6B6C 696B 6B65 6E20 6F6D 2064 6520 7072" - $"6F67 7261 6D6D 6174 7575 7220 7465 2069" - $"6E73 7461 6C6C 6572 656E 2E20 496E 6469" - $"656E 2075 206E 6965 7420 616B 6B6F 6F72" - $"6420 6761 6174 2C20 6B6C 696B 7420 7520" - $"6F70 2027 4E65 6527 2E" -};`; - - case "sv_SE": - return `data 'STR#' (${id}, "${name}") { - $"0006 0653 7665 6E73 6B08 476F 646B 8A6E" - $"6E73 0641 7662 9A6A 7308 536B 7269 7620" - $"7574 0853 7061 7261 2E2E 2E93 4F6D 2044" - $"7520 676F 646B 8A6E 6E65 7220 6C69 6365" - $"6E73 7669 6C6C 6B6F 7265 6E20 6B6C 6963" - $"6B61 2070 8C20 2247 6F64 6B8A 6E6E 7322" - $"2066 9A72 2061 7474 2069 6E73 7461 6C6C" - $"6572 6120 7072 6F67 7261 6D70 726F 6475" - $"6B74 656E 2E20 4F6D 2044 7520 696E 7465" - $"2067 6F64 6B8A 6E6E 6572 206C 6963 656E" - $"7376 696C 6C6B 6F72 656E 2C20 6B6C 6963" - $"6B61 2070 8C20 2241 7662 9A6A 7322 2E" -};`; - - case "br_FR": - return `data 'STR#' (${id}, "${name}") { - $"0006 1150 6F72 7475 6775 9073 2C20 4272" - $"6173 696C 0943 6F6E 636F 7264 6172 0944" - $"6973 636F 7264 6172 0849 6D70 7269 6D69" - $"7209 5361 6C76 6172 2E2E 2E8C 5365 2065" - $"7374 8720 6465 2061 636F 7264 6F20 636F" - $"6D20 6F73 2074 6572 6D6F 7320 6465 7374" - $"6120 6C69 6365 6E8D 612C 2070 7265 7373" - $"696F 6E65 2022 436F 6E63 6F72 6461 7222" - $"2070 6172 6120 696E 7374 616C 6172 206F" - $"2073 6F66 7477 6172 652E 2053 6520 6E8B" - $"6F20 6573 7487 2064 6520 6163 6F72 646F" - $"2C20 7072 6573 7369 6F6E 6520 2244 6973" - $"636F 7264 6172 222E" -};`; - - case "zh_TW": - return `data 'STR#' (${id}, "${name}") { - $"0006 1354 7261 6469 7469 6F6E 616C 2043" - $"6869 6E65 7365 04A6 50B7 4E06 A4A3 A650" - $"B74E 04A6 43A6 4C06 C078 A673 A14B 50A6" - $"70AA 47B1 7AA6 50B7 4EA5 BBB3 5CA5 69C3" - $"D2B8 CCAA BAB1 F8B4 DAA1 41BD D0AB F6A1" - $"A7A6 50B7 4EA1 A8A5 48A6 77B8 CBB3 6EC5" - $"E9A1 43A6 70AA 47A4 A3A6 50B7 4EA1 41BD" - $"D0AB F6A1 A7A4 A3A6 50B7 4EA1 A8A1 43" -};`; - - case "zh_CN": - return `data 'STR#' (${id}, "${name}") { - $"0006 1253 696D 706C 6966 6965 6420 4368" - $"696E 6573 6504 CDAC D2E2 06B2 BBCD ACD2" - $"E204 B4F2 D3A1 06B4 E6B4 A2A1 AD54 C8E7" - $"B9FB C4FA CDAC D2E2 B1BE D0ED BFC9 D0AD" - $"D2E9 B5C4 CCF5 BFEE A3AC C7EB B0B4 A1B0" - $"CDAC D2E2 A1B1 C0B4 B0B2 D7B0 B4CB C8ED" - $"BCFE A1A3 C8E7 B9FB C4FA B2BB CDAC D2E2" - $"A3AC C7EB B0B4 A1B0 B2BB CDAC D2E2 A1B1" - $"A1A3" -};`; - - case "da_DK": - return `data 'STR#' (${id}, "${name}") { - $"0006 0544 616E 736B 0445 6E69 6705 5565" - $"6E69 6707 5564 736B 7269 760A 4172 6B69" - $"7665 722E 2E2E 9848 7669 7320 6475 2061" - $"6363 6570 7465 7265 7220 6265 7469 6E67" - $"656C 7365 726E 6520 6920 6C69 6365 6E73" - $"6166 7461 6C65 6E2C 2073 6B61 6C20 6475" - $"206B 6C69 6B6B 6520 708C 20D2 456E 6967" - $"D320 666F 7220 6174 2069 6E73 7461 6C6C" - $"6572 6520 736F 6674 7761 7265 6E2E 204B" - $"6C69 6B20 708C 20D2 5565 6E69 67D3 2066" - $"6F72 2061 7420 616E 6E75 6C6C 6572 6520" - $"696E 7374 616C 6C65 7269 6E67 656E 2E" -};`; - - case "fi_FI": - return `data 'STR#' (${id}, "${name}") { - $"0006 0553 756F 6D69 0848 7976 8A6B 7379" - $"6E0A 456E 2068 7976 8A6B 7379 0754 756C" - $"6F73 7461 0954 616C 6C65 6E6E 61C9 6F48" - $"7976 8A6B 7379 206C 6973 656E 7373 6973" - $"6F70 696D 756B 7365 6E20 6568 646F 7420" - $"6F73 6F69 7474 616D 616C 6C61 20D5 4879" - $"768A 6B73 79D5 2E20 4A6F 7320 6574 2068" - $"7976 8A6B 7379 2073 6F70 696D 756B 7365" - $"6E20 6568 746F 6A61 2C20 6F73 6F69 7461" - $"20D5 456E 2068 7976 8A6B 7379 D52E" -};`; - - case "ko_KR": - return `data 'STR#' (${id}, "${name}") { - $"0006 064B 6F72 6561 6E04 B5BF C0C7 09B5" - $"BFC0 C720 BEC8 C7D4 06C7 C1B8 B0C6 AE07" - $"C0FA C0E5 2E2E 2E7E BBE7 BFEB 20B0 E8BE" - $"E0BC ADC0 C720 B3BB BFEB BFA1 20B5 BFC0" - $"C7C7 CFB8 E92C 2022 B5BF C0C7 2220 B4DC" - $"C3DF B8A6 20B4 ADB7 AF20 BCD2 C7C1 C6AE" - $"BFFE BEEE B8A6 20BC B3C4 A1C7 CFBD CABD" - $"C3BF C02E 20B5 BFC0 C7C7 CFC1 F620 BECA" - $"B4C2 B4D9 B8E9 2C20 22B5 BFC0 C720 BEC8" - $"C7D4 2220 B4DC C3DF B8A6 20B4 A9B8 A3BD" - $"CABD C3BF C02E" -};`; - - case "nb_NO": - return `data 'STR#' (${id}, "${name}") { - $"0006 054E 6F72 736B 0445 6E69 6709 496B" - $"6B65 2065 6E69 6708 536B 7269 7620 7574" - $"0A41 726B 6976 6572 2E2E 2EA3 4876 6973" - $"2044 6520 6572 2065 6E69 6720 6920 6265" - $"7374 656D 6D65 6C73 656E 6520 6920 6465" - $"6E6E 6520 6C69 7365 6E73 6176 7461 6C65" - $"6E2C 206B 6C69 6B6B 6572 2044 6520 708C" - $"2022 456E 6967 222D 6B6E 6170 7065 6E20" - $"666F 7220 8C20 696E 7374 616C 6C65 7265" - $"2070 726F 6772 616D 7661 7265 6E2E 2048" - $"7669 7320 4465 2069 6B6B 6520 6572 2065" - $"6E69 672C 206B 6C69 6B6B 6572 2044 6520" - $"708C 2022 496B 6B65 2065 6E69 6722 2E" -};`; - - default: - // en_US - return `data 'STR#' (${id}, "${name}") { - $"0006 0745 6E67 6C69 7368 0541 6772 6565" - $"0844 6973 6167 7265 6505 5072 696E 7407" - $"5361 7665 2E2E 2E7A 4966 2079 6F75 2061" - $"6772 6565 2077 6974 6820 7468 6520 7465" - $"726D 7320 6F66 2074 6869 7320 6C69 6365" - $"6E73 652C 2070 7265 7373 20D2 4167 7265" - $"65D3 2074 6F20 696E 7374 616C 6C20 7468" - $"6520 736F 6674 7761 7265 2E20 4966 2079" - $"6F75 2064 6F20 6E6F 7420 6167 7265 652C" - $"2070 7265 7373 20D2 4469 7361 6772 6565" - $"D32E" -};`; - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=licenseDefaultButtons.js.map \ No newline at end of file diff --git a/node_modules/dmg-builder/out/licenseDefaultButtons.js.map b/node_modules/dmg-builder/out/licenseDefaultButtons.js.map deleted file mode 100755 index 4c482b9..0000000 --- a/node_modules/dmg-builder/out/licenseDefaultButtons.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/licenseDefaultButtons.ts"],"names":[],"mappings":";;;;;;;AAAM,SAAU,iBAAV,CAA4B,cAA5B,EAAoD,EAApD,EAAgE,IAAhE,EAA4E;AAChF,UAAQ,cAAR;AACE,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;;;;;;GAAnC;;AAqBF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;;;GAAnC;;AAkBF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;;;;GAAnC;;AAmBF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;;;;GAAnC;;AAmBF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;GAAnC;;AAcF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;;;GAAnC;;AAkBF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;GAAnC;;AAgBF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;GAAnC;;AAeF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;GAAnC;;AAgBF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;GAAnC;;AAWF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;GAAnC;;AAYF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;GAAnC;;AAeF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;GAAnC;;AAaF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;GAAnC;;AAcF,SAAK,OAAL;AACE,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;;;GAAnC;;AAgBF;AACE;AACA,aAAO,gBAAgB,EAAE,MAAM,IAAI;;;;;;;;;;;;GAAnC;AA/PJ;AA6QD,C","sourcesContent":["export function getDefaultButtons(langWithRegion: string, id: number, name: string) {\n switch (langWithRegion) {\n case \"de_DE\":\n return `data 'STR#' (${id}, \"${name}\") {\n $\"0006 0744 6575 7473 6368 0B41 6B7A 6570\"\n $\"7469 6572 656E 0841 626C 6568 6E65 6E07\"\n $\"4472 7563 6B65 6E0A 5369 6368 6572 6E2E\"\n $\"2E2E E74B 6C69 636B 656E 2053 6965 2069\"\n $\"6E20 D241 6B7A 6570 7469 6572 656E D32C\"\n $\"2077 656E 6E20 5369 6520 6D69 7420 6465\"\n $\"6E20 4265 7374 696D 6D75 6E67 656E 2064\"\n $\"6573 2053 6F66 7477 6172 652D 4C69 7A65\"\n $\"6E7A 7665 7274 7261 6773 2065 696E 7665\"\n $\"7273 7461 6E64 656E 2073 696E 642E 2046\"\n $\"616C 6C73 206E 6963 6874 2C20 6269 7474\"\n $\"6520 D241 626C 6568 6E65 6ED3 2061 6E6B\"\n $\"6C69 636B 656E 2E20 5369 6520 6B9A 6E6E\"\n $\"656E 2064 6965 2053 6F66 7477 6172 6520\"\n $\"6E75 7220 696E 7374 616C 6C69 6572 656E\"\n $\"2C20 7765 6E6E 2053 6965 20D2 416B 7A65\"\n $\"7074 6965 7265 6ED3 2061 6E67 656B 6C69\"\n $\"636B 7420 6861 6265 6E2E\"\n};`\n\n case \"fr_FR\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0846 7261 6E8D 6169 7308 4163 6365\"\n\t$\"7074 6572 0752 6566 7573 6572 0849 6D70\"\n\t$\"7269 6D65 720E 456E 7265 6769 7374 7265\"\n\t$\"722E 2E2E BA53 6920 766F 7573 2061 6363\"\n\t$\"6570 7465 7A20 6C65 7320 7465 726D 6573\"\n\t$\"2064 6520 6C61 2070 728E 7365 6E74 6520\"\n\t$\"6C69 6365 6E63 652C 2063 6C69 7175 657A\"\n\t$\"2073 7572 2022 4163 6365 7074 6572 2220\"\n\t$\"6166 696E 2064 2769 6E73 7461 6C6C 6572\"\n\t$\"206C 6520 6C6F 6769 6369 656C 2E20 5369\"\n\t$\"2076 6F75 7320 6E27 9074 6573 2070 6173\"\n\t$\"2064 2761 6363 6F72 6420 6176 6563 206C\"\n\t$\"6573 2074 6572 6D65 7320 6465 206C 6120\"\n\t$\"6C69 6365 6E63 652C 2063 6C69 7175 657A\"\n\t$\"2073 7572 2022 5265 6675 7365 7222 2E\"\n};`\n\n case \"fr_CA\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 1146 7261 6E8D 6169 7320 6361 6E61\"\n\t$\"6469 656E 0841 6363 6570 7465 7207 5265\"\n\t$\"6675 7365 7208 496D 7072 696D 6572 0E45\"\n\t$\"6E72 6567 6973 7472 6572 2E2E 2EBA 5369\"\n\t$\"2076 6F75 7320 6163 6365 7074 657A 206C\"\n\t$\"6573 2074 6572 6D65 7320 6465 206C 6120\"\n\t$\"7072 8E73 656E 7465 206C 6963 656E 6365\"\n\t$\"2C20 636C 6971 7565 7A20 7375 7220 2241\"\n\t$\"6363 6570 7465 7222 2061 6669 6E20 6427\"\n\t$\"696E 7374 616C 6C65 7220 6C65 206C 6F67\"\n\t$\"6963 6965 6C2E 2053 6920 766F 7573 206E\"\n\t$\"2790 7465 7320 7061 7320 6427 6163 636F\"\n\t$\"7264 2061 7665 6320 6C65 7320 7465 726D\"\n\t$\"6573 2064 6520 6C61 206C 6963 656E 6365\"\n\t$\"2C20 636C 6971 7565 7A20 7375 7220 2252\"\n\t$\"6566 7573 6572 222E\"\n};`\n\n case \"es_ES\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0745 7370 6196 6F6C 0741 6365 7074\"\n\t$\"6172 0A4E 6F20 6163 6570 7461 7208 496D\"\n\t$\"7072 696D 6972 0A47 7561 7264 6172 2E2E\"\n\t$\"2EC0 5369 2065 7374 8720 6465 2061 6375\"\n\t$\"6572 646F 2063 6F6E 206C 6F73 2074 8E72\"\n\t$\"6D69 6E6F 7320 6465 2065 7374 6120 6C69\"\n\t$\"6365 6E63 6961 2C20 7075 6C73 6520 2241\"\n\t$\"6365 7074 6172 2220 7061 7261 2069 6E73\"\n\t$\"7461 6C61 7220 656C 2073 6F66 7477 6172\"\n\t$\"652E 2045 6E20 656C 2073 7570 7565 7374\"\n\t$\"6F20 6465 2071 7565 206E 6F20 6573 748E\"\n\t$\"2064 6520 6163 7565 7264 6F20 636F 6E20\"\n\t$\"6C6F 7320 748E 726D 696E 6F73 2064 6520\"\n\t$\"6573 7461 206C 6963 656E 6369 612C 2070\"\n\t$\"756C 7365 2022 4E6F 2061 6365 7074 6172\"\n\t$\"2E22\"\n};`\n\n case \"it_IT\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0849 7461 6C69 616E 6F07 4163 6365\"\n\t$\"7474 6F07 5269 6669 7574 6F06 5374 616D\"\n\t$\"7061 0B52 6567 6973 7472 612E 2E2E 7F53\"\n\t$\"6520 6163 6365 7474 6920 6C65 2063 6F6E\"\n\t$\"6469 7A69 6F6E 6920 6469 2071 7565 7374\"\n\t$\"6120 6C69 6365 6E7A 612C 2066 6169 2063\"\n\t$\"6C69 6320 7375 2022 4163 6365 7474 6F22\"\n\t$\"2070 6572 2069 6E73 7461 6C6C 6172 6520\"\n\t$\"696C 2073 6F66 7477 6172 652E 2041 6C74\"\n\t$\"7269 6D65 6E74 6920 6661 6920 636C 6963\"\n\t$\"2073 7520 2252 6966 6975 746F 222E\"\n};`\n\n case \"ja_JP\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 084A 6170 616E 6573 650A 93AF 88D3\"\n\t$\"82B5 82DC 82B7 0C93 AF88 D382 B582 DC82\"\n\t$\"B982 F108 88F3 8DFC 82B7 82E9 0795 DB91\"\n\t$\"B62E 2E2E B496 7B83 5C83 7483 6783 4583\"\n\t$\"4783 418E 6797 708B 9691 F88C 5F96 F182\"\n\t$\"CC8F F08C 8F82 C993 AF88 D382 B382 EA82\"\n\t$\"E98F EA8D 8782 C982 CD81 4183 5C83 7483\"\n\t$\"6783 4583 4783 4182 F083 4383 9383 5883\"\n\t$\"6781 5B83 8B82 B782 E982 BD82 DF82 C981\"\n\t$\"7593 AF88 D382 B582 DC82 B781 7682 F089\"\n\t$\"9F82 B582 C482 AD82 BE82 B382 A281 4281\"\n\t$\"4093 AF88 D382 B382 EA82 C882 A28F EA8D\"\n\t$\"8782 C982 CD81 4181 7593 AF88 D382 B582\"\n\t$\"DC82 B982 F181 7682 F089 9F82 B582 C482\"\n\t$\"AD82 BE82 B382 A281 42\"\n};`\n\n case \"nl_NL\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0A4E 6564 6572 6C61 6E64 7302 4A61\"\n\t$\"034E 6565 0550 7269 6E74 0942 6577 6161\"\n\t$\"722E 2E2E A449 6E64 6965 6E20 7520 616B\"\n\t$\"6B6F 6F72 6420 6761 6174 206D 6574 2064\"\n\t$\"6520 766F 6F72 7761 6172 6465 6E20 7661\"\n\t$\"6E20 6465 7A65 206C 6963 656E 7469 652C\"\n\t$\"206B 756E 7420 7520 6F70 2027 4A61 2720\"\n\t$\"6B6C 696B 6B65 6E20 6F6D 2064 6520 7072\"\n\t$\"6F67 7261 6D6D 6174 7575 7220 7465 2069\"\n\t$\"6E73 7461 6C6C 6572 656E 2E20 496E 6469\"\n\t$\"656E 2075 206E 6965 7420 616B 6B6F 6F72\"\n\t$\"6420 6761 6174 2C20 6B6C 696B 7420 7520\"\n\t$\"6F70 2027 4E65 6527 2E\"\n};`\n\n case \"sv_SE\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0653 7665 6E73 6B08 476F 646B 8A6E\"\n\t$\"6E73 0641 7662 9A6A 7308 536B 7269 7620\"\n\t$\"7574 0853 7061 7261 2E2E 2E93 4F6D 2044\"\n\t$\"7520 676F 646B 8A6E 6E65 7220 6C69 6365\"\n\t$\"6E73 7669 6C6C 6B6F 7265 6E20 6B6C 6963\"\n\t$\"6B61 2070 8C20 2247 6F64 6B8A 6E6E 7322\"\n\t$\"2066 9A72 2061 7474 2069 6E73 7461 6C6C\"\n\t$\"6572 6120 7072 6F67 7261 6D70 726F 6475\"\n\t$\"6B74 656E 2E20 4F6D 2044 7520 696E 7465\"\n\t$\"2067 6F64 6B8A 6E6E 6572 206C 6963 656E\"\n\t$\"7376 696C 6C6B 6F72 656E 2C20 6B6C 6963\"\n\t$\"6B61 2070 8C20 2241 7662 9A6A 7322 2E\"\n};`\n\n case \"br_FR\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 1150 6F72 7475 6775 9073 2C20 4272\"\n\t$\"6173 696C 0943 6F6E 636F 7264 6172 0944\"\n\t$\"6973 636F 7264 6172 0849 6D70 7269 6D69\"\n\t$\"7209 5361 6C76 6172 2E2E 2E8C 5365 2065\"\n\t$\"7374 8720 6465 2061 636F 7264 6F20 636F\"\n\t$\"6D20 6F73 2074 6572 6D6F 7320 6465 7374\"\n\t$\"6120 6C69 6365 6E8D 612C 2070 7265 7373\"\n\t$\"696F 6E65 2022 436F 6E63 6F72 6461 7222\"\n\t$\"2070 6172 6120 696E 7374 616C 6172 206F\"\n\t$\"2073 6F66 7477 6172 652E 2053 6520 6E8B\"\n\t$\"6F20 6573 7487 2064 6520 6163 6F72 646F\"\n\t$\"2C20 7072 6573 7369 6F6E 6520 2244 6973\"\n\t$\"636F 7264 6172 222E\"\n};`\n\n case \"zh_TW\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 1354 7261 6469 7469 6F6E 616C 2043\"\n\t$\"6869 6E65 7365 04A6 50B7 4E06 A4A3 A650\"\n\t$\"B74E 04A6 43A6 4C06 C078 A673 A14B 50A6\"\n\t$\"70AA 47B1 7AA6 50B7 4EA5 BBB3 5CA5 69C3\"\n\t$\"D2B8 CCAA BAB1 F8B4 DAA1 41BD D0AB F6A1\"\n\t$\"A7A6 50B7 4EA1 A8A5 48A6 77B8 CBB3 6EC5\"\n\t$\"E9A1 43A6 70AA 47A4 A3A6 50B7 4EA1 41BD\"\n\t$\"D0AB F6A1 A7A4 A3A6 50B7 4EA1 A8A1 43\"\n};`\n\n case \"zh_CN\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 1253 696D 706C 6966 6965 6420 4368\"\n\t$\"696E 6573 6504 CDAC D2E2 06B2 BBCD ACD2\"\n\t$\"E204 B4F2 D3A1 06B4 E6B4 A2A1 AD54 C8E7\"\n\t$\"B9FB C4FA CDAC D2E2 B1BE D0ED BFC9 D0AD\"\n\t$\"D2E9 B5C4 CCF5 BFEE A3AC C7EB B0B4 A1B0\"\n\t$\"CDAC D2E2 A1B1 C0B4 B0B2 D7B0 B4CB C8ED\"\n\t$\"BCFE A1A3 C8E7 B9FB C4FA B2BB CDAC D2E2\"\n\t$\"A3AC C7EB B0B4 A1B0 B2BB CDAC D2E2 A1B1\"\n\t$\"A1A3\"\n};`\n\n case \"da_DK\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0544 616E 736B 0445 6E69 6705 5565\"\n\t$\"6E69 6707 5564 736B 7269 760A 4172 6B69\"\n\t$\"7665 722E 2E2E 9848 7669 7320 6475 2061\"\n\t$\"6363 6570 7465 7265 7220 6265 7469 6E67\"\n\t$\"656C 7365 726E 6520 6920 6C69 6365 6E73\"\n\t$\"6166 7461 6C65 6E2C 2073 6B61 6C20 6475\"\n\t$\"206B 6C69 6B6B 6520 708C 20D2 456E 6967\"\n\t$\"D320 666F 7220 6174 2069 6E73 7461 6C6C\"\n\t$\"6572 6520 736F 6674 7761 7265 6E2E 204B\"\n\t$\"6C69 6B20 708C 20D2 5565 6E69 67D3 2066\"\n\t$\"6F72 2061 7420 616E 6E75 6C6C 6572 6520\"\n\t$\"696E 7374 616C 6C65 7269 6E67 656E 2E\"\n};`\n\n case \"fi_FI\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0553 756F 6D69 0848 7976 8A6B 7379\"\n\t$\"6E0A 456E 2068 7976 8A6B 7379 0754 756C\"\n\t$\"6F73 7461 0954 616C 6C65 6E6E 61C9 6F48\"\n\t$\"7976 8A6B 7379 206C 6973 656E 7373 6973\"\n\t$\"6F70 696D 756B 7365 6E20 6568 646F 7420\"\n\t$\"6F73 6F69 7474 616D 616C 6C61 20D5 4879\"\n\t$\"768A 6B73 79D5 2E20 4A6F 7320 6574 2068\"\n\t$\"7976 8A6B 7379 2073 6F70 696D 756B 7365\"\n\t$\"6E20 6568 746F 6A61 2C20 6F73 6F69 7461\"\n\t$\"20D5 456E 2068 7976 8A6B 7379 D52E\"\n};`\n\n case \"ko_KR\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 064B 6F72 6561 6E04 B5BF C0C7 09B5\"\n\t$\"BFC0 C720 BEC8 C7D4 06C7 C1B8 B0C6 AE07\"\n\t$\"C0FA C0E5 2E2E 2E7E BBE7 BFEB 20B0 E8BE\"\n\t$\"E0BC ADC0 C720 B3BB BFEB BFA1 20B5 BFC0\"\n\t$\"C7C7 CFB8 E92C 2022 B5BF C0C7 2220 B4DC\"\n\t$\"C3DF B8A6 20B4 ADB7 AF20 BCD2 C7C1 C6AE\"\n\t$\"BFFE BEEE B8A6 20BC B3C4 A1C7 CFBD CABD\"\n\t$\"C3BF C02E 20B5 BFC0 C7C7 CFC1 F620 BECA\"\n\t$\"B4C2 B4D9 B8E9 2C20 22B5 BFC0 C720 BEC8\"\n\t$\"C7D4 2220 B4DC C3DF B8A6 20B4 A9B8 A3BD\"\n\t$\"CABD C3BF C02E\"\n};`\n\n case \"nb_NO\":\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 054E 6F72 736B 0445 6E69 6709 496B\"\n\t$\"6B65 2065 6E69 6708 536B 7269 7620 7574\"\n\t$\"0A41 726B 6976 6572 2E2E 2EA3 4876 6973\"\n\t$\"2044 6520 6572 2065 6E69 6720 6920 6265\"\n\t$\"7374 656D 6D65 6C73 656E 6520 6920 6465\"\n\t$\"6E6E 6520 6C69 7365 6E73 6176 7461 6C65\"\n\t$\"6E2C 206B 6C69 6B6B 6572 2044 6520 708C\"\n\t$\"2022 456E 6967 222D 6B6E 6170 7065 6E20\"\n\t$\"666F 7220 8C20 696E 7374 616C 6C65 7265\"\n\t$\"2070 726F 6772 616D 7661 7265 6E2E 2048\"\n\t$\"7669 7320 4465 2069 6B6B 6520 6572 2065\"\n\t$\"6E69 672C 206B 6C69 6B6B 6572 2044 6520\"\n\t$\"708C 2022 496B 6B65 2065 6E69 6722 2E\"\n};`\n\n default:\n // en_US\n return `data 'STR#' (${id}, \"${name}\") {\n\t$\"0006 0745 6E67 6C69 7368 0541 6772 6565\"\n\t$\"0844 6973 6167 7265 6505 5072 696E 7407\"\n\t$\"5361 7665 2E2E 2E7A 4966 2079 6F75 2061\"\n\t$\"6772 6565 2077 6974 6820 7468 6520 7465\"\n\t$\"726D 7320 6F66 2074 6869 7320 6C69 6365\"\n\t$\"6E73 652C 2070 7265 7373 20D2 4167 7265\"\n\t$\"65D3 2074 6F20 696E 7374 616C 6C20 7468\"\n\t$\"6520 736F 6674 7761 7265 2E20 4966 2079\"\n\t$\"6F75 2064 6F20 6E6F 7420 6167 7265 652C\"\n\t$\"2070 7265 7373 20D2 4469 7361 6772 6565\"\n\t$\"D32E\"\n};`\n }\n}"],"sourceRoot":""} diff --git a/node_modules/dmg-builder/package.json b/node_modules/dmg-builder/package.json deleted file mode 100644 index b0e2130..0000000 --- a/node_modules/dmg-builder/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "dmg-builder@6.5.3", - "_id": "dmg-builder@6.5.3", - "_inBundle": false, - "_integrity": "sha512-ZNl4GFBg6rdFplnuoK56iftxh/qgM7rXJUxgl21eK4WsjxgQwtQ0REZo+pDSL4OzVeyOO8MMNWSNQcCsBLiDyA==", - "_location": "/dmg-builder", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "dmg-builder@6.5.3", - "name": "dmg-builder", - "escapedName": "dmg-builder", - "rawSpec": "6.5.3", - "saveSpec": null, - "fetchSpec": "6.5.3" - }, - "_requiredBy": [ - "/electron-builder" - ], - "_resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-6.5.3.tgz", - "_shasum": "95afe3deab33fd874f68d299bc71b481e94f5312", - "_spec": "dmg-builder@6.5.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", - "author": { - "name": "Vladimir Krivosheev" - }, - "bugs": { - "url": "https://github.com/electron-userland/electron-builder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "app-builder-lib": "~20.38.3", - "bluebird-lst": "^1.0.6", - "builder-util": "~9.6.0", - "fs-extra-p": "^7.0.0", - "iconv-lite": "^0.4.24", - "js-yaml": "^3.12.0", - "parse-color": "^1.0.0", - "sanitize-filename": "^1.6.1" - }, - "deprecated": false, - "description": "Utilities to build DMG. Used by [electron-builder](https://github.com/electron-userland/electron-builder).", - "files": [ - "out", - "templates", - "vendor" - ], - "homepage": "https://github.com/electron-userland/electron-builder", - "license": "MIT", - "main": "out/dmgUtil.js", - "name": "dmg-builder", - "repository": { - "type": "git", - "url": "git+https://github.com/electron-userland/electron-builder.git" - }, - "typings": "./out/dmg.d.ts", - "version": "6.5.3" -} diff --git a/node_modules/dmg-builder/readme.md b/node_modules/dmg-builder/readme.md deleted file mode 100644 index 842ec4f..0000000 --- a/node_modules/dmg-builder/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# dmg-builder - -Utilities to build DMG. Used by [electron-builder](https://github.com/electron-userland/electron-builder). \ No newline at end of file diff --git a/node_modules/dmg-builder/templates/background.tiff b/node_modules/dmg-builder/templates/background.tiff deleted file mode 100644 index 66d832a..0000000 Binary files a/node_modules/dmg-builder/templates/background.tiff and /dev/null differ diff --git a/node_modules/dmg-builder/templates/dmgProperties.pl b/node_modules/dmg-builder/templates/dmgProperties.pl deleted file mode 100644 index d1a5e7a..0000000 --- a/node_modules/dmg-builder/templates/dmgProperties.pl +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/perl -w - -use Mac::Finder::DSStore qw( writeDSDBEntries makeEntries ); -use Mac::Memory qw( ); -use Mac::Files qw( NewAliasMinimal ); -use Encode (); -use utf8; - -my($backgroundWidth, $backgroundHeight); - -if (defined($ENV{'backgroundFilename'}) && !defined($ENV{'windowWidth'}) && !defined($ENV{'windowHeight'})) { - $ENV{'backgroundFilename'} = Encode::decode("UTF-8", $ENV{'backgroundFilename'}); - open(SIPS, "sips -g pixelHeight -g pixelWidth -g format '$ENV{'volumePath'}/.background/$ENV{'backgroundFilename'}' |") || die; - while() { - if (/\bpixelWidth: (\d+)/) { - $backgroundWidth = $1; - } - elsif (/\bpixelHeight: (\d+)/) { - $backgroundHeight = $1; - } - } - ( close(SIPS) && - defined($backgroundWidth) && - defined($backgroundHeight) )|| die "Cannot query image dimensions"; -} - -# perl DOESN'T DECODE incoming env variables properly, so, you MUST explicitly decode it using Encode::decode("UTF-8", ...) -# see http://stackoverflow.com/questions/2437877/how-can-i-properly-use-environment-variables-encoded-as-windows-1251-in-perl - -&writeDSDBEntries("$ENV{'volumePath'}/.DS_Store", - &makeEntries(".background", Iloc_xy => [ 2560, 170 ]), - &makeEntries(".DS_Store", Iloc_xy => [ 2610, 170 ]), - &makeEntries(".fseventsd", Iloc_xy => [ 2660, 170 ]), - &makeEntries(".Trashes", Iloc_xy => [ 2710, 170 ]), - &makeEntries(".VolumeIcon.icns", Iloc_xy => [ 2760, 170 ]), - &makeEntries(".", - (defined($ENV{'backgroundColor'}) ? BKGD_color : BKGD_alias) => (defined($ENV{'backgroundColor'}) ? "$ENV{'backgroundColor'}" : NewAliasMinimal("$ENV{'volumePath'}/.background/$ENV{'backgroundFilename'}")), - ICVO => 1, - fwi0_flds => [ $ENV{'windowY'}, $ENV{'windowX'}, $ENV{'windowY'} + (defined($ENV{'windowHeight'}) ? $ENV{'windowHeight'} : $backgroundHeight), $ENV{'windowX'} + (defined($ENV{'windowWidth'}) ? $ENV{'windowWidth'} : $backgroundWidth), "icnv", 0, 0 ], - icvo => pack('A4 n A4 A4 n*', "icv4", $ENV{'iconSize'}, "none", "botm", 0, 0, 0, 0, 0, 1, 0, 100, 1), - icvt => $ENV{'iconTextSize'} - ), - $ENTRIES -); diff --git a/node_modules/dmg-builder/templates/settings.py b/node_modules/dmg-builder/templates/settings.py deleted file mode 100644 index 2b791f1..0000000 --- a/node_modules/dmg-builder/templates/settings.py +++ /dev/null @@ -1,230 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import biplist -import os.path - -application = <%= people.join(", "); %> -appname = os.path.basename(application) - -def icon_from_app(app_path): - plist_path = os.path.join(app_path, 'Contents', 'Info.plist') - plist = biplist.readPlist(plist_path) - icon_name = plist['CFBundleIconFile'] - icon_root,icon_ext = os.path.splitext(icon_name) - if not icon_ext: - icon_ext = '.icns' - icon_name = icon_root + icon_ext - return os.path.join(app_path, 'Contents', 'Resources', icon_name) - -# .. Basics .................................................................... - -# Volume format (see hdiutil create -help) -format = defines.get('format') - -# Compression level (if relevant) -compression_level = defines.get('compressionLevel', 9) - -# Volume size -size = defines.get('size', None) - -# Files to include -files = [ application ] - -# Symlinks to create -symlinks = { 'Applications': '/Applications' } - -# Volume icon -# -# You can either define icon, in which case that icon file will be copied to the -# image, *or* you can define badge_icon, in which case the icon file you specify -# will be used to badge the system's Removable Disk icon -# -#icon = '/path/to/icon.icns' -badge_icon = icon_from_app(application) - -# Where to put the icons -icon_locations = { - appname: (140, 120), - 'Applications': (500, 120) - } - -# .. Window configuration ...................................................... - -# Background -# -# This is a STRING containing any of the following: -# -# #3344ff - web-style RGB color -# #34f - web-style RGB color, short form (#34f == #3344ff) -# rgb(1,0,0) - RGB color, each value is between 0 and 1 -# hsl(120,1,.5) - HSL (hue saturation lightness) color -# hwb(300,0,0) - HWB (hue whiteness blackness) color -# cmyk(0,1,0,0) - CMYK color -# goldenrod - X11/SVG named color -# builtin-arrow - A simple built-in background with a blue arrow -# /foo/bar/baz.png - The path to an image file -# -# The hue component in hsl() and hwb() may include a unit; it defaults to -# degrees ('deg'), but also supports radians ('rad') and gradians ('grad' -# or 'gon'). -# -# Other color components may be expressed either in the range 0 to 1, or -# as percentages (e.g. 60% is equivalent to 0.6). -background = 'builtin-arrow' - -show_status_bar = False -show_tab_view = False -show_toolbar = False -show_pathbar = False -show_sidebar = False -sidebar_width = 180 - -# Window position in ((x, y), (w, h)) format -window_rect = ((100, 100), (640, 280)) - -# Select the default view; must be one of -# -# 'icon-view' -# 'list-view' -# 'column-view' -# 'coverflow' -# -default_view = 'icon-view' - -# General view configuration -show_icon_preview = False - -# Set these to True to force inclusion of icon/list view settings (otherwise -# we only include settings for the default view) -include_icon_view_settings = 'auto' -include_list_view_settings = 'auto' - -# .. Icon view configuration ................................................... - -arrange_by = None -grid_offset = (0, 0) -grid_spacing = 100 -scroll_position = (0, 0) -label_pos = 'bottom' # or 'right' -text_size = 16 -icon_size = 128 - -# .. List view configuration ................................................... - -# Column names are as follows: -# -# name -# date-modified -# date-created -# date-added -# date-last-opened -# size -# kind -# label -# version -# comments -# -list_icon_size = 16 -list_text_size = 12 -list_scroll_position = (0, 0) -list_sort_by = 'name' -list_use_relative_dates = True -list_calculate_all_sizes = False, -list_columns = ('name', 'date-modified', 'size', 'kind', 'date-added') -list_column_widths = { - 'name': 300, - 'date-modified': 181, - 'date-created': 181, - 'date-added': 181, - 'date-last-opened': 181, - 'size': 97, - 'kind': 115, - 'label': 100, - 'version': 75, - 'comments': 300, - } -list_column_sort_directions = { - 'name': 'ascending', - 'date-modified': 'descending', - 'date-created': 'descending', - 'date-added': 'descending', - 'date-last-opened': 'descending', - 'size': 'descending', - 'kind': 'ascending', - 'label': 'ascending', - 'version': 'ascending', - 'comments': 'ascending', - } - -# .. License configuration ..................................................... - -# Text in the license configuration is stored in the resources, which means -# it gets stored in a legacy Mac encoding according to the language. dmgbuild -# will *try* to convert Unicode strings to the appropriate encoding, *but* -# you should be aware that Python doesn't support all of the necessary encodings; -# in many cases you will need to encode the text yourself and use byte strings -# instead here. - -# Recognized language names are: -# -# af_ZA, ar, be_BY, bg_BG, bn, bo, br, ca_ES, cs_CZ, cy, da_DK, de_AT, de_CH, -# de_DE, dz_BT, el_CY, el_GR, en_AU, en_CA, en_GB, en_IE, en_SG, en_US, eo, -# es_419, es_ES, et_EE, fa_IR, fi_FI, fo_FO, fr_001, fr_BE, fr_CA, fr_CH, -# fr_FR, ga-Latg_IE, ga_IE, gd, grc, gu_IN, gv, he_IL, hi_IN, hr_HR, hu_HU, -# hy_AM, is_IS, it_CH, it_IT, iu_CA, ja_JP, ka_GE, kl, ko_KR, lt_LT, lv_LV, -# mk_MK, mr_IN, mt_MT, nb_NO, ne_NP, nl_BE, nl_NL, nn_NO, pa, pl_PL, pt_BR, -# pt_PT, ro_RO, ru_RU, se, sk_SK, sl_SI, sr_RS, sv_SE, th_TH, to_TO, tr_TR, -# uk_UA, ur_IN, ur_PK, uz_UZ, vi_VN, zh_CN, zh_TW - -# license = { -# 'default-language': 'en_US', -# 'licenses': { -# # For each language, the text of the license. This can be plain text, -# # RTF (in which case it must start "{\rtf1"), or a path to a file -# # containing the license text. If you're using RTF, -# # watch out for Python escaping (or read it from a file). -# 'English': b'''{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf820 -# {\\fonttbl\\f0\\fnil\\fcharset0 Helvetica-Bold;\\f1\\fnil\\fcharset0 Helvetica;} -# {\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue0;} -# {\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c0;} -# \\paperw11905\\paperh16837\\margl1133\\margr1133\\margb1133\\margt1133 -# \\deftab720 -# \\pard\\pardeftab720\\sa160\\partightenfactor0 - -# \\f0\\b\\fs60 \\cf2 \\expnd0\\expndtw0\\kerning0 -# \\up0 \\nosupersub \\ulnone \\outl0\\strokewidth0 \\strokec2 Test License\\ -# \\pard\\pardeftab720\\sa160\\partightenfactor0 - -# \\fs36 \\cf2 \\strokec2 What is this?\\ -# \\pard\\pardeftab720\\sa160\\partightenfactor0 - -# \\f1\\b0\\fs22 \\cf2 \\strokec2 This is the English license. It says what you are allowed to do with this software.\\ -# \\ -# }''', -# }, -# 'buttons': { -# # For each language, text for the buttons on the licensing window. -# # -# # Default buttons and text are built-in for the following languages: -# # -# # English (en_US), German (de_DE), Spanish (es_ES), French (fr_FR), -# # Italian (it_IT), Japanese (ja_JP), Dutch (nl_NL), Swedish (sv_SE), -# # Brazilian Portuguese (pt_BR), Simplified Chinese (zh_CN), -# # Traditional Chinese (zh_TW), Danish (da_DK), Finnish (fi_FI), -# # Korean (ko_KR), Norwegian (nb_NO) -# # -# # You don't need to specify them for those languages; if you fail to -# # specify them for some other language, English will be used instead. - -# 'en_US': ( -# b'English', -# b'Agree', -# b'Disagree', -# b'Print', -# b'Save', -# b'If you agree with the terms of this license, press "Agree" to ' -# b'install the software. If you do not agree, press "Disagree".' -# ), -# }, -# } diff --git a/node_modules/dmg-builder/vendor/Mac/Finder/DSStore.pm b/node_modules/dmg-builder/vendor/Mac/Finder/DSStore.pm deleted file mode 100644 index 66ae1ec..0000000 --- a/node_modules/dmg-builder/vendor/Mac/Finder/DSStore.pm +++ /dev/null @@ -1,733 +0,0 @@ -package Mac::Finder::DSStore; - -=head1 NAME - -Mac::Finder::DSStore - Read and write Macintosh Finder DS_Store files - -=head1 DESCRIPTION - -C provides a handful of functions for reading and -writing the desktop database files created by the Macintosh Finder. - -=head1 FUNCTIONS - -Many functions take a C<$store> argument which is the opened file as -an instance of L, or a C<$block> -argument which is a specific block of the file as an instance of -L. - -=cut - -use strict; -use warnings; -use POSIX qw(ceil); -use Carp qw(croak); -use Fcntl; -require Exporter; - -our($VERSION) = '1.00'; -our(@ISA) = qw(Exporter); -our(@EXPORT_OK) = qw( getDSDBEntries putDSDBEntries writeDSDBEntries makeEntries ); - -our($testpoint); - -=head2 @records = &Mac::Finder::DSStore::getDSDBEntries($store[, $callback]) - -Retrieves the "superblock" pointed to by the C entry in the store's table -of contents, and traverses the B-tree it points to, returning a list of -the records in the tree. Alternately, you can supply a callback which will -be invoked for each record, and C will return an empty list. - -=cut - -sub getBTreeRootblock { - my($store) = @_; - return $store->blockByNumber($store->{toc}->{DSDB})->read(20, 'N*'); -} - -sub getDSDBEntries { - my($file, $callback) = @_; - - my(@retval); - - $callback = sub { push(@retval, $_[0]); } unless defined $callback; - - my($rootnode, $height, $nrec, $nnodes, $blksize) = &getBTreeRootblock($file); - - my($n) = &traverse_btree($file, $rootnode, $callback); - - warn "Header node count ($nrec) not equal to actual node count ($n)" - if $n != $nrec; - - @retval; -} - -=head2 &Mac::Finder::DSStore::putDSDBEntries($store, $arrayref) - -C<$arrayref> must contain a correctly ordered list of -C objects. They will be evenly -organized into a B-tree structure and written to the C<$store>. If there is -an existing tree of records in the file already, it will be deallocated. - -This function does not flush the allocator's information back to the file. - -=cut - -sub putDSDBEntries { - my($file, $recs) = @_; - - my($tocblock, $pagesize); - my($pagecount, $reccount, $height); - - # Delete the old btree (but keep its superblock), or allocate a superblock. - if(defined($file->{toc}->{DSDB})) { - $tocblock = $file->{toc}->{DSDB}; - my($old_rootblock); - ($old_rootblock, $pagesize) = (&getBTreeRootblock($file))[0, 4]; - &freeBTreeNode($file, $old_rootblock); - } else { - $tocblock = $file->allocate( 20 ); - $file->{toc}->{DSDB} = $tocblock; - $pagesize = 0x1000; - } - - $reccount = @$recs; - $pagecount = 0; - $height = 0; - - my(@children); - - # Partition the records into btree nodes, from the bottom of - # the tree working towards the root. - do { - my(@sizes); - - if (@children) { - # Interior node: child pointers interleaved with records - @sizes = map { 4 + $_->byteSize } @$recs; - } else { - # Leaf node: just a bunch of records - @sizes = map { $_->byteSize } @$recs; - } - - # In addition to @sizes, each page contains a record - # count and a flag/childnode field (4 bytes each) - my(@interleaf) = &partition_sizes($pagesize - 8, @sizes); - my(@nchildren); - - my($next) = 0; - foreach my $non (@interleaf, 1+$#$recs) { - my($blknr) = $file->allocate($pagesize); - push(@nchildren, $blknr); - my($blk) = $file->blockByNumber($blknr, 1); - if (@children) { - &writeBTreeNode($blk, - [ @$recs[ $next .. $non-1 ] ], - [ @children[ $next .. $non ] ] ); - } else { - &writeBTreeNode($blk, - [ @$recs[ $next .. $non-1 ] ]); - } - $blk->close(1); - $next = $non + 1; - $pagecount ++; - } - - $height ++; - $recs = [ map { $recs->[$_] } @interleaf ]; - @children = @nchildren; - die unless @children == 1+@$recs; - } while(@children > 1); - die unless 0 == @$recs; - - my($masterblock) = $file->blockByNumber($tocblock, 1); - $masterblock->write('NNNNN', - $children[0], - $height - 1, - $reccount, - $pagecount, - $pagesize); - $masterblock->close; - - 1; -} - -# Given a list of sizes, break them into groups so that -# each group sums to no more than $max, not including the items -# that separate them (returned in @ejecta). -sub partition_sizes { - my($max, @sizes) = @_; - my($sum) = 0; - $sum += $_ foreach @sizes; - - return () if $sum <= $max; - - my(@ejecta); - my($bcount) = ceil($sum / $max); - my($target) = $sum / $bcount; - - my($n) = 0; - for(;;) { - my($bsum) = 0; - while( $n < @sizes && $bsum < $target && ($bsum + $sizes[$n]) < $max ) { - $bsum += $sizes[$n]; - $n ++; - } - - last if $n >= @sizes; - - push(@ejecta, $n); - $n++; - } - - @ejecta; -} - -sub traverse_btree { - my($store, $nodenr, $callback) = @_; - my($count); - my($values, $pointers) = &readBTreeNode( $store->blockByNumber( $nodenr ) ); - - if ($testpoint) { - my($o) = Mac::Finder::DSStore::BuddyAllocator::StringBlock->new(); - { - # Temporarily disable the test point so writeBTreeNode doesn't - # recursively invoke it - local($testpoint) = undef; - &writeBTreeNode($o, $values, $pointers); - } - my($actual) = $store->blockByNumber( $nodenr )->copyback; - my($roundtrip) = $o->copyback; - $actual = substr($actual, 0, length($roundtrip)); - $testpoint->( $actual, $roundtrip ); - } - - $count = @$values; - - if (defined $pointers) { - die "Value count should be one less than pointer count" - unless ( @$values + 1 ) == ( @$pointers ) ; - $count += &traverse_btree($store, shift(@$pointers), $callback); - while(@$values) { - &{$callback}(shift @$values); - $count += &traverse_btree($store, shift(@$pointers), $callback); - } - } else { - &{$callback}($_) foreach @$values; - } - - $count; -} - -sub freeBTreeNode { - my($allocator, $nodeid) = @_; - my($block) = $allocator->blockByNumber( $nodeid ); - - if($block->read(4, 'N') != 0) { - $block->seek(0); - my(undef, $pointers) = &readBTreeNode($block); - &freeBTreeNode($allocator, $_) foreach @$pointers; - } - - $allocator->free($nodeid); -} - -sub readBTreeNode { - my($node) = @_; - - my($pointer) = $node->read(4, 'N'); - - my($count) = $node->read(4, 'N'); - if ($pointer > 0) { - my(@pointers, @values); - while($count) { - push(@pointers, $node->read(4, 'N')); - push(@values, Mac::Finder::DSStore::Entry->readEntry($node)); - $count --; - } - push(@pointers, $pointer); - return \@values, \@pointers; - } else { - my(@values); - while($count) { - push(@values, Mac::Finder::DSStore::Entry->readEntry($node)); - $count --; - } - return \@values, undef; - } -} - -sub writeBTreeNode { - my($into, $values, $pointers) = @_; - - if (!$pointers) { - # A leaf node: no pointers, just database entries. - $into->write('NN', 0, scalar(@$values)); - $_->write($into) foreach @$values; - } else { - # An internal node: interleaved pointers and values, - # with the final pointer moved to the front. - my(@vals) = @$values; - my(@ps) = @$pointers; - die "number of pointers must be one more than number of entries" - unless 1+@vals == @ps; - $into->write('NN', pop(@ps), scalar(@vals)); - while(@vals) { - $into->write('N', shift(@ps)); - ( shift(@vals) )->write($into); - } - } - - if($testpoint) { - my($x) = [ &readBTreeNode($into->copyback) ]; - $testpoint->( [ $values, $pointers], $x ); - } -} - -=head2 &Mac::Finder::DSStore::writeDSDBEntries($file, @entries) - -A convenience function which sorts a list of entries and writes them -to the specified file using C, then flushes the allocator's -data structures to disk. -C<$file> may be a filename or an open file handle. -The store object is returned, but you don't need to do anything else with it. - -=cut - -sub writeDSDBEntries { - my($store, $recs); - { - my($file, @entries) = @_; - - require IO::File; - require Mac::Finder::DSStore::BuddyAllocator; - - unless(ref $file) { - my($filename) = $file; - $file = IO::File->new( $filename, Fcntl::O_RDWR | Fcntl::O_CREAT ); - croak "$filename: $!, died" unless $file; - } - - if((stat($file))[7] > 32) { - $store = Mac::Finder::DSStore::BuddyAllocator->open($file); - } else { - $store = Mac::Finder::DSStore::BuddyAllocator->new($file); - } - - $recs = [ sort { $a->cmp($b) } @entries ]; - } - - putDSDBEntries($store, $recs); - $store->writeMetaData; - - $store; -} - -=head2 &Mac::Finder::DSStore::makeEntries($filename, [ what => value ... ]) - -C encapsulates some information about the format of individual -records in the DS_Store file. It returns a list of records constructed with the -given filename and with the information specified in the rest of its args. -Most args come in pairs, a name and a value, so C kind of looks -like it takes a hash. Some names take no value and some could take several. -Some produce more than one record as a result. - -See the output of the F script for an example of how -to use this, and check the source code for a list of the formats it accepts. - -This function might change in the future. - -=cut - -sub makeEntries { - my($filename, @info) = @_; - my(@results); - - while(@info) { - my($recordType) = shift @info; - - if ($recordType =~ /^....$/) { - my($record) = Mac::Finder::DSStore::Entry->new($filename, $recordType); - $record->value( shift @info ); - push(@results, $record); - } elsif ($recordType =~ /^(....)_hex$/) { - my($record) = Mac::Finder::DSStore::Entry->new($filename, $1); - $record->value( pack('H*', shift @info) ); - push(@results, $record); - } else { - my($mkr) = $Mac::Finder::DSStore::Entry::{'make_'.$recordType}; - croak "Don't know how to handle '$recordType'" unless $mkr; - push(@results, &{$mkr}($filename, $recordType, \@info)); - } - } - - @results; -} - -package Mac::Finder::DSStore::Entry; - -=head1 Mac::Finder::DSStore::Entry - -This class holds the individual records from the database. Each record -contains a filename (in some cases, "." to refer to the containing -directory), a 4-character record type, and a value. The value is -one of a few concrete types, according to the record type. - -=cut - -use strict; -use warnings; -use Encode (); -use Carp qw(croak); - -# -# Concrete types of known ids -# -our(%types) = ( - 'BKGD' => 'blob', - 'bwsp' => 'blob', - 'cmmt' => 'ustr', - 'dilc' => 'blob', - 'dscl' => 'bool', - 'extn' => 'ustr', - 'fwi0' => 'blob', - 'fwsw' => 'long', - 'fwvh' => 'shor', - 'GRP0' => 'ustr', - 'icgo' => 'blob', - 'icsp' => 'blob', - 'icvo' => 'blob', - 'ICVO' => 'bool', - 'icvp' => 'blob', - 'icvt' => 'shor', - 'Iloc' => 'blob', - 'info' => 'blob', - 'lg1S' => 'comp', - 'logS' => 'comp', - 'lssp' => 'blob', - 'lsvo' => 'blob', - 'LSVO' => 'bool', - 'lsvP' => 'blob', - 'lsvp' => 'blob', - 'lsvt' => 'shor', - 'moDD' => 'dutc', - 'modD' => 'dutc', - 'ph1S' => 'comp', - 'phyS' => 'comp', - 'pict' => 'blob', - 'vSrn' => 'long', - 'vstl' => 'type', - ); - -=head2 $entry = ...::Entry->new($filename, $typecode) - -Creates a new entry with no value. The concrete type is inferred from the -record type code. - -=head2 $entry->filename - -Gets the filename of an entry. - -=head2 $entry->strucId - -Gets the record type of this entry, as a four-character string, indicating -what aspect of the file the entry describes. - -=head2 $entry->value([$value]) - -Gets or sets the value of an entry. - -If the concrete type is C or C, the value is interpreted as a byte string; -if it is C, as a character string. -If the concrete type is C, C, C, C, or C, -then the value should be an integer. - -=cut - -sub new { - my($class, $filename, $strucId, @opts) = @_; - - croak "no opts supported yet, died" if @opts; - - bless([ $filename, $strucId, $types{$strucId}, undef ], - ref $class || $class); -} - -sub filename { - $_[0]->[0]; -} - -sub strucId { - $_[0]->[1]; -} - -sub value { - my($self, $value) = @_; - - return $self->[3] unless defined $value; - - croak "Can't set a value on an entry with no concrete type" - unless defined($self->[2]); - - my($t) = $self->[2]; - if($t eq 'blob' or $t eq 'ustr') { - $self->[3] = '' . $value; - } elsif ($t eq 'bool' or $t eq 'shor' or $t eq 'long') { - $self->[3] = 0 + $value; - } elsif ($t eq 'type') { - $value = '' . $value; - croak "'type' values must be exactly four bytes long" - unless length($value) == 4; - $self->[3] = $value; - } else { - die "Unknown concrete type $t, died"; - } - - $self->[3]; -} - -sub readEntry { - my($class, $block) = @_; - - my($filename, $strucId, $strucType, $value); - - $filename = &readFilename($block); - $strucId = $block->read(4); - $strucType = $block->read(4); - - if ($strucType eq 'bool') { - $value = $block->read(1, 'C'); - } elsif ($strucType eq 'long' or $strucType eq 'shor') { - $value = $block->read(4, 'N'); - } elsif ($strucType eq 'blob') { - my($bloblen) = $block->read(4, 'N'); - $value = $block->read($bloblen); - } elsif ($strucType eq 'ustr') { - my($strlen) = $block->read(4, 'N'); - $value = Encode::decode('UTF-16BE', $block->read(2 * $strlen)); - } elsif ($strucType eq 'type') { - $value = $block->read(4); - } elsif ($strucType eq 'comp' || $strucType eq 'dutc') { - $value = $block->read(8, 'Q>'); - } else { - die "Unknown struc type '$strucType', died"; - } - - return bless([ $filename, $strucId, $strucType, $value ], - ref($class) || $class); -} - -sub readFilename { - my($block) = @_; - - my($flen) = $block->read(4, 'N'); - my($utf16be) = $block->read(2 * $flen); - - return Encode::decode('UTF-16BE', $utf16be, Encode::FB_CROAK); -} - -sub byteSize { - my($filename, $strucId, $strucType, $value) = @{$_[0]}; - my($size); - - # TODO: We're assuming that the filename is completely normal - # basic-multilingual-plane characters, and doesn't need to be de/re- - # composed or anything. - $size = length($filename) * 2 + 12; - # 12 bytes: 4 each for filename length, struct id, and struct type - - if ($strucType eq 'long' or $strucType eq 'shor' or $strucType eq 'type') { - $size += 4; - } elsif ($strucType eq 'bool') { - $size += 1; - } elsif ($strucType eq 'blob') { - $size += 4 + length($value); - } elsif ($strucType eq 'ustr') { - $size += 4 + 2 * length($value); - } elsif ($strucType eq 'comp' or $strucType eq 'dutc') { - $size += 8; - } else { - die "Unknown struc type '$strucType', died"; - } - - $size; -} - -sub write { - my($self, $into) = @_; - - my($fname) = Encode::encode('UTF-16BE', $self->[0]); - - my($strucType) = $self->[2]; - - $into->write('N a* a4 a4', length($fname)/2, $fname, - $self->[1], $strucType); - - if ($strucType eq 'long' or $strucType eq 'shor') { - $into->write('N', $self->[3]); - } elsif ($strucType eq 'bool') { - $into->write('C', $self->[3]); - } elsif ($strucType eq 'blob') { - $into->write('N', length($self->[3])); - $into->write($self->[3]); - } elsif ($strucType eq 'ustr') { - $into->write('N', length($self->[3])); - $into->write(Encode::encode('UTF-16BE', $self->[3])); - } elsif ($strucType eq 'type') { - $into->write('a4', $self->[3]); - } elsif ($strucType eq 'comp' or $strucType eq 'dutc') { - $into->write('Q>', $self->[3]); - } else { - die "Unknown struc type '$strucType', died"; - } -} - -=head2 $entry->cmp($other) - -Returns -1, 0, or 1 depending on the relative ordering of the two entries, -according to (a guess at) the record ordering used by the store's B-tree. - -=cut - -sub cmp { - my($self, $other) = @_; - - # - # There's probably some wacky Mac-specific Unicode collation - # rule for these, but case-insensitive comparison is a good - # approximation - # - - # Ordering in the btree is Finder-filename-ordering on the files, - # and simple bytewise ordering on the structure IDs. - - ( lc($self->[0]) cmp lc($other->[0]) ) - || - ( $self->[1] cmp $other->[1] ); -} - -# -# The make_foo subs are used by Mac::Finder::DSStore::makeEntries. -# - -sub make_BKGD_default { - my($filename, undef, undef) = @_; - - my($rec) = Mac::Finder::DSStore::Entry->new($filename, 'BKGD'); - $rec->value( pack('A4 x8', 'DefB') ); - $rec; -} - -sub make_BKGD_color { - my($filename, $strucId, $argv) = @_; - my($color) = shift @$argv; - my($rgb); - - if ($color =~ /^\#([0-9a-f]+)$/i) { - if(length($1) == 3) { - ( $rgb = $1 ) =~ s/(.)(.)(.)/$1$1$1$1$2$2$2$2$3$3$3$3/; - } elsif (length($1) == 6) { - ( $rgb = $1 ) =~ s/(..)(..)(..)/$1$1$2$2$3$3/; - } elsif (length($1) == 12) { - $rgb = $1; - } - } - - croak "Can't parse color string '$color'" - unless $rgb; - - my($rec) = Mac::Finder::DSStore::Entry->new($filename, 'BKGD'); - $rec->value( pack('A4 H12 x2', 'ClrB', $rgb) ); - - $rec; -} - -sub make_BKGD_alias { - my($filename, $strucId, $argv) = @_; - - my($image) = shift @$argv; - - if(!ref $image) { - require Mac::Memory; - require Mac::Files; - $image = Mac::Files::NewAlias($image); - } - - my($isize) = $image->size; - my($bkgd, $pict); - - $bkgd = Mac::Finder::DSStore::Entry->new($filename, 'BKGD'); - $bkgd->value( pack('A4 N nn', 'PctB', $isize, 0, 0) ); - - $pict = Mac::Finder::DSStore::Entry->new($filename, 'pict'); - $pict->value( $image->get ); - - ( $bkgd, $pict ); -} - -sub _make_packed { - my($filename, $strucId, $fmt, @values) = @_; - my($record) = Mac::Finder::DSStore::Entry->new($filename, $strucId); - $record->value( pack($fmt, @values) ); - $record; -} - -sub _make_packed_arrayref { - my($filename, $strucId, $argv, $format, $reqcount, $dflt) = @_; - my($values) = shift @$argv; - - croak "$strucId argument must be an array ref" - unless ref $values; - - croak "$strucId argument must have at least $reqcount items" - unless $reqcount <= @$values; - - my($max) = $reqcount + @$dflt; - - croak "$strucId argument can't have more than $max items" - if $max < @$values; - - my(@fields) = @$values; - if ($max > @fields) { - push(@fields, @{$dflt}[ ( @fields - $max ) .. -1 ]); - } - - return &_make_packed($filename, substr($strucId, 0, 4), - $format, @fields); -} - -sub make_Iloc_xy { - my($filename, $strucId, $argv) = @_; - return &_make_packed_arrayref($filename, $strucId, $argv, - 'NN nnnn', 2, [65535, 65535, 65535, 0]); -} - -sub make_fwi0_flds { - my($filename, $strucId, $argv) = @_; - my($flds) = shift @$argv; - - croak "$strucId argument must have 7 values" - unless 7 == @$flds; - - return &_make_packed($filename, 'fwi0', 'n4 A4 n*', @$flds); -} - - -=head1 SEE ALSO - -See L for more detailed information on -the record types found in a DS_Store file. - -See L for the low-level organization -of the DS_Store file. - -=head1 AUTHOR - -Copyright 2008 by Wim Lewis Ewiml@hhhh.orgE. - -Some information is from Mark Mentovai via the Mozilla project. -Thanks also to Martin Baker for bug reports. - -=cut - -1; diff --git a/node_modules/dmg-builder/vendor/Mac/Finder/DSStore/BuddyAllocator.pm b/node_modules/dmg-builder/vendor/Mac/Finder/DSStore/BuddyAllocator.pm deleted file mode 100644 index 7664718..0000000 --- a/node_modules/dmg-builder/vendor/Mac/Finder/DSStore/BuddyAllocator.pm +++ /dev/null @@ -1,783 +0,0 @@ -package Mac::Finder::DSStore::BuddyAllocator; - -=head1 NAME - -Mac::Finder::DSStore::BuddyAllocator - Allocate space within a file - -=head1 DESCRIPTION - -C -implements a buddy-allocation scheme within a file. It's used by -C to read certain files created by the Macintosh -Finder. - -The allocation methods do not perform any actual file I/O. -The contents of allocated blocks are read and written by the caller using -methods on C. -If the C and C methods are used, -or if the C hash is modified, -C must be called for the changes to be reflected in the file. - -=head1 METHODS - -=cut - -use strict; -use warnings; -use Carp; - -our($VERSION) = '1.00'; - -# Debug logging. Uncomment these and all uses of them to activate. -# It might be nice to make this more easily switchable. -#our($loglevel) = 0; -#sub logf { -# print STDERR ( ' ' x $loglevel ) . sprintf($_[0], @_[1 .. $#_ ]) . "\n"; -#} - -=head2 $allocator = Mac::Finder::DSStore::BuddyAllocator->open($fh) - -C constructs a new buddy allocator -and initializes its state from the information in the file. -The file handle is retained by the allocator for future -operations. - -=cut - -sub open { - my($class, $fh) = @_; - - binmode($fh); - - # read the file header: 32 bytes, plus a mysterious extra - # four bytes at the front - my($fheader); - $fh->read($fheader, 4 + 0x20) == 0x24 - or die "Can't read file header: $!"; - my($magic1, $magic, $offset, $size, $offset2, $unk2) = unpack('N a4 NNN a16', $fheader); - die 'bad magic' unless $magic eq 'Bud1' and $magic1 == 1; - die 'inconsistency: two root addresses are different' - unless $offset == $offset2; - - my($self) = { - fh => $fh, - unk2 => $unk2, - fudge => 4, # add this to offsets for some unknown reason - }; - bless($self, ref($class) || $class); - - # retrieve the root/index block which contains the allocator's - # book-keeping data - my ($rootblock) = $self->getBlock($offset, $size); - - # parse out the offsets of all the allocated blocks - # these are in tagged offset format (27 bits offset, 5 bits size) - my($offsetcount, $unk3) = $rootblock->read(8, 'NN'); - # not sure what the word following the offset count is - $self->{'unk3'} = $unk3; - # For some reason, offsets are always stored in blocks of 256. - my(@offsets); - while($offsetcount > 0) { - push(@offsets, $rootblock->read(1024, 'N256')); - $offsetcount -= 256; - } - # 0 indicates an empty slot; don't need to keep those around - while($offsets[$#offsets] == 0) { pop(@offsets); } - grep { $_ = undef if $_ == 0 } @offsets; - - # Next, read N key/value pairs - my($toccount) = $rootblock->read(4, 'N'); - my($toc) = { - }; - while($toccount--) { - my($len) = $rootblock->read(1, 'C'); - my($name) = $rootblock->read($len); - my($value) = $rootblock->read(4, 'N'); - $toc->{$name} = $value; - } - - $self->{'offsets'} = \@offsets; - $self->{'toc'} = $toc; - - # Finally, read the free lists. - my($freelists) = { }; - for(my $width = 0; $width < 32; $width ++) { - my($blkcount) = $rootblock->read(4, 'N'); - $freelists->{$width} = [ $rootblock->read(4 * $blkcount, 'N*') ]; - } - $self->{'freelist'} = $freelists; - - return $self; -} - -=head2 $allocator = Mac::Finder::DSStore::BuddyAllocator->new($fh) - -Similar to C, but does not read anything from the file. This -can be used to create a new file from scratch. - -=cut - -sub new { - my($cls, $fh) = @_; - - binmode($fh) if defined($fh); - - my($self) = { - fh => $fh, - toc => { }, - offsets => [ ], - freelist => { }, - - # And the mystery meat goes here... - unk2 => pack('NNNN', 0x100C, 0x0087, 0x200B, 0 ), - unk3 => 0, - fudge => 4 - }; - bless($self, ref $cls || $cls); - - # All our freelists are empty... - foreach my $width (0 .. 30) { - $self->{freelist}->{$width} = [ ]; - } - # ... except for a single 2GB block starting at 0 - $self->{freelist}->{31} = [ 0 ]; - - # Allocate the header block, 2^5 bytes wide - my($hdr) = $self->_alloc(5); - # it had better be at offset zero - ( $hdr == 0 ) or die; - - $self; -} - -=head2 $allocator->close( ) - -Closes the underlying file handle. - -=cut - -sub close { - my($self) = @_; - my($fh) = $self->{fh}; - - delete $self->{fh}; - - $fh->close; -} - -=head2 $allocator->listBlocks($verbose) - -List all the blocks in order and see if there are any gaps or overlaps. -If C<$verbose> is true, then the blocks are listed to the current -output filehandle. Returns true if the allocated and free blocks -have no gaps or overlaps. - -=cut - -sub listBlocks { - my($self, $verbose) = @_; - my(%byaddr); - my($addr, $len); - - # We store all blocks (allocated and free) in %byaddr, - # then go through its keys in order - - # Store the implicit 32-byte block that holds the file header - push(@{$byaddr{0}}, "5 (file header)"); - - # Store all the numbered/allocated blocks from @offsets - for my $blnum (0 .. $#{$self->{'offsets'}}) { - my($addr_size) = $self->{'offsets'}->[$blnum]; - next unless defined $addr_size; - $addr = $addr_size & ~0x1F; - $len = $addr_size & 0x1F; - push(@{$byaddr{$addr}}, "$len (blkid $blnum)"); - } - - # Store all the blocks in the freelist(s) - for $len (keys %{$self->{'freelist'}}) { - for $addr (@{$self->{'freelist'}->{$len}}) { - push(@{$byaddr{$addr}}, "$len (free)"); - } - } - - my($gaps, $overlaps) = (0, 0); - - # Loop through the blocks in order of address - my(@addrs) = sort {$a <=> $b} keys %byaddr; - $addr = 0; - while(@addrs) { - my($next) = shift @addrs; - if ($next > $addr) { - print "... ", ($next - $addr), " bytes unaccounted for\n" - if $verbose; - $gaps ++; - } - my(@uses) = @{$byaddr{$next}}; - printf "%08x %s\n", $next, join(', ', @uses) - if $verbose; - $overlaps ++ if @uses > 1; - - # strip off the length (log_2(length) really) from the info str - ($len = $uses[0]) =~ s/ .*//; - $addr = $next + ( 1 << (0 + $len) ); - } - - ( $gaps == 0 && $overlaps == 0 ); -} - -=head2 $allocator->writeMetaData( ) - -Writes the allocator's metadata (header block and root block) -back to the file. - -=cut - -sub writeMetaData { - my($self) = @_; - - # Root block nr is hardcoded to 0. - # We don't actually care, but the DSStore btree does. - my($blocknr) = 0; - - # Before computing the size of the rootblock to allocate it, - # make sure it'll be large enough to hold its own (eventual) - # allocation information. - $self->{offsets}->[0] = undef unless exists $self->{offsets}->[0]; - - my($rbs) = $self->rootBlockSize(); - $self->allocate($rbs, $blocknr); - - $self->writeRootblock($self->blockByNumber($blocknr, 1)); - - my($blockOffset, $blockLength) = $self->blockOffset($blocknr); - - $self->{fh}->seek(0, 0); - $self->{fh}->write(pack('N', 1)); # magic1 - $self->_sought(0)->write(pack('a4 NNN a16', - 'Bud1', # magic - $blockOffset, $blockLength, $blockOffset, - $self->{unk2})); - - $self->{fh}->flush; -} - -sub rootBlockSize { - my($self) = @_; - my($size); - - $size = 8; # The offset count and the unknown field that follows it - - # The offset blocks, rounded up to a multiple of 256 entries - my($offsetcount) = scalar( @{$self->{'offsets'}} ); - my($tail) = $offsetcount % 256; - $offsetcount += 256 - $tail if ($tail); - $size += 4 * $offsetcount; - - # The table of contents - $size += 4; # count - $size += (5 + length($_)) foreach keys %{$self->{'toc'}}; - - # The freelists - foreach my $width (0 .. 31) { - $size += 4 + 4 * scalar( @{$self->{'freelist'}->{$width}} ); - } - - $size; -} - -sub writeRootblock { - my($self, $into) = @_; - - my(@offsets) = @{$self->{'offsets'}}; - - # Write the offset count & the unknown field that follows it - $into->write('NN', scalar(@offsets), $self->{'unk3'}); - - # Write the offsets (using 0 to indicate an unused slot) - $into->write('N*', map { (defined($_) && $_ > 0)? $_ : 0 } @offsets); - - # The offsets are always written in blocks of 256. - my($offsetcount) = scalar(@offsets) % 256; - if ($offsetcount > 0) { - # Fill out the last block - $into->write('N*', (0) x (256-$offsetcount)); - } - - # The DS_Store files only ever have one item in their - # table of contents, so I'm not sure if it needs to be sorted or what - my(@tockeys) = sort keys %{$self->{'toc'}}; - $into->write('N', scalar(@tockeys)); - foreach my $entry (@tockeys) { - $into->write('C a* N', length($entry), $entry, $self->{'toc'}->{$entry}); - } - - # And finally the freelists - for my $width ( 0 .. 31 ) { - my($blks) = $self->{'freelist'}->{$width}; - $into->write('N N*', scalar(@$blks), @$blks); - } -} - -=head2 $block = $allocator->blockByNumber(blocknumber[, write]) - -Retrieves a block by its block number (I block ID). - -If C is supplied and is true, then the returned block implements the -C method but not the C method. - -=head2 $block = $allocator->getBlock(offset, size) - -Retrieves a block (a BuddyAllocator::Block instance) by offset & length. -Normally you should use C instead of this method. - -=cut - -sub getBlock { - my($self, $offset, $size) = @_; - - return Mac::Finder::DSStore::BuddyAllocator::Block->new($self, $offset, $size); -} - -# Retrieve a block by its block number (small integer) -sub blockByNumber { - my($self, $id, $write) = @_; - my($addr) = $self->{offsets}->[$id]; - return undef unless $addr; - my($offset, $len); - $offset = $addr & ~0x1F; - $len = 1 << ( $addr & 0x1F ); -# print " node id $id is $len bytes at 0x".sprintf('%x', $offset)."\n"; - if (!defined($write) || !$write) { - return Mac::Finder::DSStore::BuddyAllocator::Block->new($self, $offset, $len); - } else { - return Mac::Finder::DSStore::BuddyAllocator::WriteBlock->new($self, $offset, $len); - } -} - -=head2 ( $offset, $size ) = $allocator->blockOffset(blockid) - -Retrieves the file offset and size in bytes of a given block. -The offset doesn't include the 4-byte fudge. -In scalar context, just returns the offset. - -=cut - -sub blockOffset { - my($self, $id) = @_; - my($addr) = $self->{offsets}->[$id]; - croak "Block $id is not allocated" unless $addr; - my($offset) = $addr & ~0x1F; - return $offset unless wantarray; - return ( $offset, 1 << ( $addr & 0x1F ) ); -} - -# Return freelist + index of a block's buddy in its freelist (or empty list) -sub _buddy { - my($self, $offset, $width) = @_; - my($freelist, $buddyaddr); - - $freelist = $self->{'freelist'}->{$width}; - $buddyaddr = $offset ^ ( 1 << $width ); - - return ($freelist, - grep { $freelist->[$_] == $buddyaddr } 0 .. $#$freelist ); -} - -# Free a block, coalescing ith buddies as needed. -sub _free { - my($self, $offset, $width) = @_; - - my($freelist, $buddyindex) = $self->_buddy($offset, $width); - - if(defined($buddyindex)) { - # our buddy is free. Coalesce, and add the coalesced block to flist. - my($buddyoffset) = splice(@$freelist, $buddyindex, 1); - #&logf("Combining %x with buddy %x", $offset, $buddyoffset); - $self->_free($offset & $buddyoffset, $width+1); - } else { - #&logf("Adding block %x to freelist %d", $offset, $width); - @$freelist = sort( @$freelist, $offset ); - } -} - -# Allocate a block of a specified width, splitting as needed. -sub _alloc { - my($self, $width) = @_; - - #&logf("Allocating a block of width %d", $width); - #$loglevel ++; - - my($flist) = $self->{'freelist'}->{$width}; - if (@$flist) { - # There is a block of the desired size; return it. - #&logf("Pulling %x from freelist", $flist->[0]); $loglevel --; - return shift @$flist; - } else { - # Allocate a block of the next larger size; split it. - my($offset) = $self->_alloc($width + 1); - # and put the other half on the free list. - my($buddy) = $offset ^ ( 1 << $width ); - #&logf("Splitting %x into %x and %x", $offset, $offset, $buddy); - #$loglevel ++; - $self->_free($buddy, $width); - #$loglevel -= 2; - return $offset; - } -} - -=head2 $blocknumber = $allocator->allocate($size, [$blocknumber]) - -Allocates or re-allocates a block to be at least C<$size> bytes long. -If C<$blocknumber> is given, the specified block will be grown or -shrunk if needed, otherwise a new block number will be chosen and -given to the allocated block. - -Unlike the libc C function, this may move a block even if the -block is not grown. - -=head2 $allocator->free($blocknumer) - -Releases the block number and the block associated with it back to the -block pool. - -=cut - -sub allocate { - my($self, $bytes, $blocknum) = @_; - my($offsets) = $self->{'offsets'}; - - #if(defined($blocknum)) { - # &logf("(Re)allocating %d bytes for blkid %d", $bytes, $blocknum); - #} - - if(!defined($blocknum)) { - $blocknum = 1; - # search for an empty slot, or extend the array - $blocknum++ while defined($offsets->[$blocknum]); - #&logf("Allocating %d bytes, assigning blkid %d", $bytes, $blocknum); - } - - #$loglevel ++; - - my($wantwidth) = 5; - # Minimum width, since that's how many low-order bits we steal for the tag - $wantwidth ++ while $bytes > 1 << $wantwidth; - - my($blkaddr, $blkwidth, $blkoffset); - - if(exists($offsets->[$blocknum]) && $offsets->[$blocknum]) { - $blkaddr = $offsets->[$blocknum]; - $blkwidth = $blkaddr & 0x1F; - $blkoffset = $blkaddr & ~0x1F; - if ($blkwidth == $wantwidth) { - #&logf("Block is already width %d, no change", $wantwidth); - #$loglevel --; - # The block is currently of the desired size. Leave it alone. - return $blocknum; - } else { - #&logf("Freeing wrong-sized block"); - #$loglevel ++; - # Free the current block, allocate a new one. - $self->_free($blkoffset, $blkwidth); - delete $offsets->[$blocknum]; - #$loglevel --; - } - } - - # Allocate a block, update the offsets table, and return the new offset - $blkoffset = $self->_alloc($wantwidth); - $blkaddr = $blkoffset | $wantwidth; - $offsets->[$blocknum] = $blkaddr; - #$loglevel --; - $blocknum; -} - -sub free { - my($self, $blknum) = @_; - my($blkaddr) = $self->{'offsets'}->[$blknum]; - - #&logf("Freeing block index %d", $blknum); - #$loglevel ++; - - if($blkaddr) { - my($blkoffset, $blkwidth); - $blkwidth = $blkaddr & 0x1F; - $blkoffset = $blkaddr & ~0x1F; - $self->_free($blkoffset, $blkwidth); - } - - delete $self->{'offsets'}->[$blknum]; - #$loglevel --; - undef; -} - -=head1 ATTRIBUTES - -=head2 $allocator->{toc} - -C holds a hashref whose keys are short strings and whose values -are integers. This table of contents is read and written as part of the -allocator's metadata but is not otherwise used by the allocator; -users of the allocator use it to find their data within the file. - -=head2 $allocator->{fh} - -The file handle passed in to C or C. If you find yourself needing -to use this, you should probably try to extend the class so that you don't. - -=cut - -# Used by ...::Block to get a positioned file handle. -sub _sought { - my($self, $offset) = @_; - - my($fh) = $self->{fh}; - $fh->seek($offset + $self->{fudge}, 0) - or croak; - $fh; -} - -package Mac::Finder::DSStore::BuddyAllocator::Block; - -=head1 BuddyAllocator::Block - -C instances are returned by the -C and C methods. They hold a pointer into -the file and provide a handful of useful methods. - -(There are also two other classes, C and C, -which might be returned instead. Think of this as an interface rather -than as a concrete class.) - -=head2 $block->read(length, [format]) - -Reads C bytes from the block (advancing the read pointer -correspondingly). If C is specified, the bytes read are -unpacked using the format; otherwise a byte string is returned. - -=head2 $block->length( ) - -Returns the length (or size) of this block. - -=head2 $block->seek(position[, whence]) - -Adjusts the read/write pointer within the block. - -=head2 $block->write(bytes) - -=head2 $block->write(format, items...) - -Writes data to the underlying file, at the position represented by this -block. If multiple arguments are given, the first is a format string -and the rest are the remaining arguments to C. - -=head2 $block->close([ zerofill ]) - -This is generally a no-op, but if called on a writable block with -C, then zeroes will be written from the current -location to the end of the allocated block. - -=head2 $block->copyback( ) - -Returns the block's contents as a string. For write blocks, this -reads from the file. This is just here for debugging purposes and -might change. - -=cut - -use strict; -use warnings; -use Carp; - -# -# Block objects are created by the buddy allocator; they're a -# reference to an array with the following components: -# -# [ $allocator, $value, $position] -# - -sub new { - my($class, $allocator, $offset, $size) = @_; - - my($value); - $allocator->_sought($offset)->read($value, $size) - > 0 or die; - # Previously, this died if we couldn't read the full block. - # Not sure if it's really an error not to read the full - # block if the next layer up doesn't need the full block. - # So now we're succeeding as long as we get something; if - # the reader overruns it'll die in substr(). - - bless([ $allocator, $value, 0 ], ref $class || $class); -} - -sub read { - my($self, $len, $unpack) = @_; - - my($pos) = $self->[2]; - die "out of range: pos=$pos len=$len max=".(length($self->[1])) if $pos + $len > length($self->[1]); - my($bytes) = substr($self->[1], $pos, $len); - $self->[2] = $pos + $len; - - $unpack? unpack($unpack, $bytes) : $bytes; -} - -sub length { - return CORE::length($_[0]->[1]); -} - -sub close { - 1; -} - -sub seek { - my($self, $pos, $whence) = @_; - $whence = 0 unless defined $whence; - if ($whence == 0) { - # pos = pos - } elsif ($whence == 1) { - $pos += $self->[2]; - } elsif ($whence == 2) { - $pos += $self->length(); - } else { - croak "seek: whence=$whence"; - } - $self->[2] = $pos; -} - -sub copyback { - return $_[0]->[1]; -} - -package Mac::Finder::DSStore::BuddyAllocator::WriteBlock; - -use strict; -use warnings; -use Carp; - -# -# Write blocks -# - -sub new { - my($class, $allocator, $offset, $size) = @_; - - croak "Missing arguments" - unless defined($offset) && defined($size); - croak "Bad offset" - if $offset <= 0; - - bless([ $allocator, undef, 0, $offset, $size ], ref $class || $class); -} - -sub read { - my($self) = @_; - - croak "This is a write-only block"; -} - -sub length { - return ($_[0]->[4]); -} - -sub seek { - my($self, $pos, $whence) = @_; - if ($whence == 0) { - $self->[2] = $pos; - } elsif ($whence == 1) { - $self->[2] += $pos; - } elsif ($whence == 2) { - $self->[2] = $self->length + $pos; - } else { - croak "seek: whence=$whence"; - } - undef $self->[1]; - $self; -} - -sub write { - my($self, $what, @args) = @_;; - - if (!defined($self->[1])) { - $self->[1] = $self->[0]->_sought($self->[2] + $self->[3]); - } - - if (@args) { - $what = pack($what, @args); - } - - my($wlen) = CORE::length($what); - - croak "Writing past end of block (writing $wlen at ".($self->[2]).", end is at ".($self->[4])."), died" - if $self->[2]+$wlen > $self->[4]; - - $self->[1]->write($what); - $self->[2] += $wlen; -} - -sub close { - my($self, $fill) = @_; - if (defined($fill) && $fill && $self->[2] < $self->[4]) { - $self->write("\0" x ($self->[4] - $self->[2])); - } - undef $self->[1]; - 1; -} - -# -# This is just here for debugging/testing purposes -# - -sub copyback { - my($self) = @_; - - my($r) = Mac::Finder::DSStore::BuddyAllocator::Block->new(@{$self}[0, 3, 2]); - - undef $self->[1]; # probably need to re-seek now - - return $r; -} - -package Mac::Finder::DSStore::BuddyAllocator::StringBlock; - -use strict; -use warnings; - -# -# This one's kind of handy, really, but is only used for debugging and -# test harnesses right now. -# - -sub new { - my($x) = ''; - bless(\$x, ref $_[0] || $_[0]); -} - -sub write { - my($self, $what, @args) = @_;; - - if (@args) { - $what = pack($what, @args); - } - - ${$self} .= $what; -} - -sub copyback { - ${$_[0]}; -} - -=head1 AUTHOR - -Written by Wim Lewis as part of the Mac::Finder::DSStore package. - -This file is copyright 2008 by Wim Lewis. -All rights reserved. -This program is free software; you can redistribute it and/or -modify it under the same terms as Perl itself. - - -=cut - -1; diff --git a/node_modules/dmg-builder/vendor/Mac/Finder/DSStore/Format.pod b/node_modules/dmg-builder/vendor/Mac/Finder/DSStore/Format.pod deleted file mode 100644 index af5934a..0000000 --- a/node_modules/dmg-builder/vendor/Mac/Finder/DSStore/Format.pod +++ /dev/null @@ -1,552 +0,0 @@ -=head1 DS_Store Format - -Some notes on the format of the Macintosh Finder's F<.DS_Store> files. - -=head1 OVERVIEW - -The Mac OS X Finder stores information about how it displays directories -and files in files named F<.DS_Store> in each directory which it has touched. -(This seems to be a departure from the pre-OSX method of storing all the -information in one file at the root of each filesystem). -The format is not documented by Apple. -The information in this file is based on the reverse-engineering notes -by Mark Mentovai published on the Mozilla wiki, -and further investigation by me (Wim Lewis). - -=head1 FILE FORMAT - -The F<.DS_Store> file holds a series of records giving attributes of -the files in the directory or of the directory itself (referred to as -F<.>). These records are stored in a B-tree, and the pages of the -B-tree are stored in the file by a "buddy allocator" along with a -small amount of metadata. The allocator also provides a level of -indirection, from small integers to file offsets, presumably allowing -blocks to be relocated as they grow and shrink. - -The file is generally big-endian. Unless otherwise noted, an "integer" -is a four-byte (32-bit) big-endian number, probably unsigned (but I'm -not always sure about that). - -=head2 Records - -A record has the following format: - -=over - -=item * - -Filename length, in characters, as an integer. (4 bytes) - -=item * - -Filename, in big-endian UTF-16. Presumably with the same Unicode -composition rules as the HFS+ filesystem. (2 * length bytes) - -=item * - -Structure id or type, a FourCharCode indicating what property of the -file this entry describes. (4 bytes) - -=item * - -Data type (4 bytes), indicating what kind of data field follows: - -=over - -=item C<'long'> - -An integer (4 bytes) - -=item C<'shor'> - -A short integer? Still stored as four bytes, but the first two are -always zero. - -=item C<'bool'> - -A boolean value, stored as one byte. - -=item C<'blob'> - -An arbitrary block of bytes, stored as an integer followed by that -many bytes of data. - -=item C<'type'> - -Four bytes, containing a FourCharCode. - -=item C<'ustr'> - -A Unicode text string, stored as an integer character count followed -by 2*count bytes of data in UTF-16. - -=item C<'comp'> - -An eight-byte (64-bit) integer. -(I don't know why the abbreviation "comp" was chosen for this.) - -=item C<'dutc'> - -A datestamp, represented as an 8-byte integer count of the number -of (1/65536)-second intervals since the Mac epoch in 1904. Given -the name, this probably corresponds to the C structure. - -=back - -=back - -A given structure id/type always seems to have the same type of data -associated with it, and any structure id appears at most once per -filename. Some only appear on files, and some only appear on -directories (including the filename F<.>). - -Information about a directory (its Finder window view settings, for -example) is usually held in its parent directory's store file, unless -the directory is at the root of its volume, in which case it's held -in the directory itself with the filename F<.>. - -I've encountered the following record types: - -=over - -=item C<'BKGD'> - -12-byte C, directories only. Indicates the background of the -Finder window viewing this directory (in icon mode). The format -depends on the kind of background: - -=over - -=item Default background - -FourCharCode C, followed by eight unknown bytes, probably garbage. - -=item Solid color - -FourCharCode C, followed by an RGB value in six bytes, followed by two unknown bytes. - -=item Picture - -FourCharCode C, followed by the the length of the blob -stored in the C<'pict'> record, followed by four unknown bytes. -The C<'pict'> record points to the actual background image. - -=back - -=item C<'ICVO'> - -C, directories only. Unknown meaning. Always seems to be 1, so -presumably 0 is the default value. - -=item C<'Iloc'> - -16-byte C, attached to files and directories. -The file's icon location. Two 4-byte values representing the -horizontal and vertical positions of the icon's center (not -top-left). (Then, 6 bytes 0xff and 2 bytes 0?) For the purposes of the -center, the icon only is taken into account, not any label. The icon's -size comes from the icvo blob. - -=item C<'LSVO'> - -C, attached to directories. Purpose unknown. - -=item C<'bwsp'> - -A C containing a binary plist. This contains the size -and layout of the window (including whether optional parts like -the sidebar or path bar are visible). -This appeared in Snow Leopard (10.6). - -The plist contains the keys C (a string in the same -format in which AppKit saves window frames); C (a -float), and booleans C, C, C, -and C. Sometimes contains C (a string), -C (a string), and C (an array of strings). - -=item C<'cmmt'> - -C, containing a file's "Spotlight Comments". -(The comment is also stored in the C -xattr; this copy may be historical.) - -=item C<'dilc'> - -32-byte C, attached to files and directories. -Unknown, may indicate the icon location -when files are displayed on the desktop. - -=item C<'dscl'> - -C, attached to subdirectories. Indicates that the -subdirectory is open (disclosed) in list view. - -=item C<'extn'> - -C. Often contains the file extension of the file, but sometimes -contains a different extension. -Purpose unknown. - -=item C<'fwi0'> - -16-byte C, directories only. -Finder window information. -The data is first four two-byte values representing the top, left, -bottom, and right edges of the rect defining the content area of the -window. The next four bytes represent the view of the window: C -is icon view, other values are C and C. -The next four bytes are unknown, and are either zeroes or -C<00 01 00 00>. - -On Leopard (10.5), the view-type information seems to be ignored, -but see C. On Snow Leopard (10.6), some more of this record's -function seems to have been taken over by the plist records C, -C, and and C. - -=item C<'fwsw'> - -C, directories only. Finder window sidebar width, in -pixels/points. Zero if collapsed. - -=item C<'fwvh'> - -C, directories only. -Finder window vertical height. If present, it overrides the height -defined by the rect in fwi0. The Finder seems to create these (at -least on 10.4) even though it will do the right thing for window -height with only an fwi0 around, perhaps this is because the stored -height is weird when accounting for toolbars and status bars. - -=item C<'GRP0'> - -C. Unknown; I've only seen this once. - -=item C<'icgo'> - -8-byte C, directories (and files?). -Unknown. Probably two integers, and often the value C<00 00 00 00 00 -00 00 04>. - -=item C<'icsp'> - -8-byte C, directories only. -Unknown, usually all but the last two bytes are zeroes. - -=item C<'icvo'> - -18- or 26-byte C, directories only. -Icon view options. There seem to be two formats for this blob. - -If the first 4 bytes are "icvo", then 8 unknown bytes (flags?), then 2 bytes -corresponding to the selected icon view size, then 4 unknown bytes -C<6e 6f 6e 65> (the text "none", guess that this is the "keep -arranged by" setting?). - -If the first 4 bytes are "icv4", then: -two bytes indicating the icon size in pixels, typically 48; -a 4CC indicating the "keep arranged by" setting -(or C for none or C for align to grid); -another 4CC, either C or C, indicating the label position I the icon; -and then 12 unknown bytes (flags?). - -Of the flag bytes, the low-order bit of the second byte is 1 if "Show -item info" is checked, and the low-order bit of the 12th (last) byte -is 1 if the "Show icon preview" checkbox is checked. The tenth byte -usually has the value 4, and the remainder are zero. - -=item C<'icvp'> - -A C containing a plist, giving settings for the icon view. -Appeared in Snow Leopard (10.6), probably supplanting C<'icvo'>. - -The plist holds a dictionary with several key-value pairs: -booleans C, C, and C; -numbers C, C, C, C, -C, C, C, and C; -string C. - -The value of the C key (an integer) presumably controls -the presence of further optional keys such as C/C/C. - -=item C<'icvt'> - -C, directories only. -Icon view text label (filename) size, in points. - -=item C<'info'> - -40- or 48-byte C, attached to directories and files. -Unknown. The first 8 bytes look like a timestamp as in C. - -=item C<'logS'> or C<'lg1S'> - -C, directories only. Appears to contain the logical size in -bytes of the directory's contents, perhaps as a cache to speed up -display in the Finder. -I think that C<'logS'> appeared in 10.7 and was -supplanted by C<'lg1S'> in 10.8. See also C<'ph1S'>. - -=item C<'lssp'> - -8-byte C, directories only. -Unknown. Possibly the scroll position in list view mode? - -=item C<'lsvo'> - -76-byte C, directories only. -List view options. Seems to contain the columns displayed in list -view, their widths, and their sort ordering if any. Presumably -supplanted by C and/or C. - -These list view settings are shared between list view and the list -portion of coverflow view. - -=item C<'lsvt'> - -C, directories only. -List view text (filename) size, in points. - -=item C<'lsvp'> - -A C containing a binary plist. List view settings, perhaps -supplanting the C<'lsvo'> record. Appeared in Snow Leopard (10.6). - -The plist contains boolean values for the keys C, -C, and C; numbers for -C, C, C, C, and -C (typically 1); and a string, C. - -There is also a C key containing the set of columns, their widths, -visibility, column ordering, sort ordering. -The only difference between C and C appears to be the -format of the columns specification: an array or a dictionary. - -=item C<'lsvP'> - -A C containing a binary plist. -Often occurs with C, but may have appeared in 10.7 or 10.8. - -=item C<'modD'> and C<'moDD'> - -C timestamps; directories only. -One or both may appear. -Typically the same as the directory's modification date. -Unknown purpose; appeared in 10.7 or 10.8. -Possibly used to detect when C needs to be recalculated? - -=item C<'phyS'> or C<'ph1S'> - -C, directories only. This number is always a multiple of -8192 and slightly larger than C<'logS'> / C<'lg1S'>, which always -seems to be present if this is (though the reverse is not always true). -Presumably it is the corresponding physical size (an integer number of -8k-byte disk blocks). - -=item C<'pict'> - -Variable-length C, directories only. -Despite the name, this contains not a PICT image but an Alias record -(see I) which resolves to the file containing -the actual background image. See also C<'BKGD'>. - -=item C<'vSrn'> - -C, attached to directories. -Always appears to contain the value 1. -Appeared in 10.7 or 10.8. - -=item C<'vstl'> - -C, directories only. Indicates the style of the view -(one of C, C, C, or C, -indicating respectively: icon view, column/browser view, list view, and coverflow view) -selected by the Finder's "Always open in icon [or other style] view" -checkbox. -This appears to be a new addition to the Leopard (10.5) Finder. - -=back - -=head2 B-Tree - -The records are stored in a B-tree structure. The B-tree consists of a -small master block containing a few statistics and a pointer to the -root node; one or more leaf (external) nodes; and zero or more -non-leaf (internal) nodes. - -The header block is pointed to by the C entry in the buddy -allocator's directory. It is 20 bytes long and contains five integers: - -=over - -=item - -The block number of the root node of the B-tree - -=item - -The number of levels of internal nodes (tree height minus one --- that -is, for a tree containing only a single, leaf, node this will be zero) - -=item - -The number of records in the tree - -=item - -The number of nodes in the tree (tree nodes, not including this header -block) - -=item - -Always 0x1000, probably the tree node page size - -=back - -Individual nodes are either leaf nodes containing a bunch of records, -or non-leaf (internal) nodes containing N records and N+1 pointers to -child nodes. - -Each node starts with two integers, C

and C. If C

is 0, -then this is a leaf node and C is immediately followed by that -many records. If C

is nonzero, then this is an internal node, and -C is followed by the block number of the leftmost child, then a -record, then another block number, I, for a total of C -child pointers and C records. C

is itself the rightmost -child pointer, that is, it is logically at the end of the node. - -This relies on 0 not being a valid value for a block number. As far as -I can tell, 0 is a valid value for a block number but it always holds -the block containing the buddy allocator's internal information, -presumably because that block is allocated first. - -The ordering of records within the B-tree is by case-insensitive -comparison of their filenames, secondarily sorted on the structure -ID (record type) field. My guess is that the string comparison follows -the same rules as HFS+ described in Apple's TN1150. - -=head2 Buddy Allocator - -B-tree pages and other info are stored in blocks managed by a buddy -allocator. The allocator maintains a list of the offsets and sizes of -blocks (indexed by small integers) and a freelist. -The allocator also stores a small amount of metadata, including a -directory or table of contents which maps short strings to block -numbers. The only entry in that table of contents maps the string -C ("desktop services database"?) to the B-tree's master block. - -The buddy allocator is in charge of all but the first 36 bytes of -the file, and manages a notional 2GB address space, although the file is -of course truncated to the last allocated block. All its offsets are -relative to the fourth byte of the file. Another way to describe this -is that the file consists of a four-byte header (always C<00 00 00 -01>) followed by a 2GB buddy-allocated area, the first 32-byte block -of which is allocated but does not appear on the buddy allocator's -allocation list. - -The 32-byte header has the following fields: - -=over - -=item * - -Magic number C (C<42 75 64 31>) - -=item * - -Offset to the allocator's bookkeeping information block - -=item * - -Size of the allocator's bookkeeping information block - -=item * - -A second copy of the offset; the Finder will refuse to read the file -if this does not match the first copy. Perhaps this is a safeguard -against corruption from an interrupted write transaction. - -=item * - -Sixteen bytes of unknown purpose. -These might simply be the unused space at the end of the block, -since -the minimum allocation size is 32 bytes, as will be seen later. - -=back - -The offset and size indicate where to find the block containing the -rest of the buddy allocator's state. That block has the following -fields: - -=over - -=item Block count - -Integer. The number of blocks in the allocated-blocks list. - -=item Unknown - -Four unknown bytes. Appear to always be 0. - -=item Block addresses - -Array of integers. There are I block addresses here, with -unassigned block numbers represented by zeroes. This is followed by -enough zeroes to round the section up to the next multiple of 256 -entries (1024 bytes). - -=item Directory count - -Integer, indicates the number of directory entries. - -=item Directory entries - -Each consists of a 1-byte count, followed by that many bytes of name -(in ASCII or perhaps some 1-byte superset such as MacRoman), followed -by a 4-byte integer containing the entry's block number. - -=item Free lists - -There are 32 freelists, one for each power of two from 2^0 to -2^31. Each freelist has a count followed by that many offsets. - -=back - -There are three different ways to refer to a given block. Most of the -file uses what I call block numbers or block IDs, which are indexes -into the C table. Block ID 0 always seems to refer to -the buddy allocator's metadata block itself. - -The entries in the block address table are what I call block addresses. -Each address is a packed offset+size. The least-significant 5 bits of -the number indicate the block's size, as a power of 2 (from 2^5 to -2^31). If those bits are masked off, the result is the starting offset -of the block (keeping in mind the 4-byte fudge factor). Since the -lower 5 bits are unusable to store an offset, blocks must be allocated -on 32-byte boundaries, and as a side effect the minimum block size is -32 bytes -(in which case the least significant 5 bits are equal to C<0x05>). - -The free lists contain actual block offsets, not "addresses". The -size of the referenced blocks is implied by which freelist the block -is in; a free block in freelist N is 2^N bytes long. - -Although the header block is not explicitly allocated, the allocator -behaves as if it is; other blocks are split in order to accommodate it -in the buddy scheme, and its buddy block (at 0x20) is either on the -freelist or allocated. (Usually it holds the B-tree's master block.) - -Other than the 4-byte prefix and the 32-byte header block, every byte -in the file is either in a block on the allocated blocks list, or is in a -block on one of the free lists. - -=head1 CREDITS - -Original reverse-engineering effort by Mark Mentovai, -L. Some of the text -describing record types has been copied from that wiki page. - -Further investigation and documentation by Wim Lewis -Ewiml@hhhh.orgE. - -Also thanks to Yvan BARTHELEMY for investigation and bugfixes. diff --git a/node_modules/dmg-builder/vendor/biplist/__init__.py b/node_modules/dmg-builder/vendor/biplist/__init__.py deleted file mode 100644 index 17d3517..0000000 --- a/node_modules/dmg-builder/vendor/biplist/__init__.py +++ /dev/null @@ -1,873 +0,0 @@ -"""biplist -- a library for reading and writing binary property list files. - -Binary Property List (plist) files provide a faster and smaller serialization -format for property lists on OS X. This is a library for generating binary -plists which can be read by OS X, iOS, or other clients. - -The API models the plistlib API, and will call through to plistlib when -XML serialization or deserialization is required. - -To generate plists with UID values, wrap the values with the Uid object. The -value must be an int. - -To generate plists with NSData/CFData values, wrap the values with the -Data object. The value must be a string. - -Date values can only be datetime.datetime objects. - -The exceptions InvalidPlistException and NotBinaryPlistException may be -thrown to indicate that the data cannot be serialized or deserialized as -a binary plist. - -Plist generation example: - - from biplist import * - from datetime import datetime - plist = {'aKey':'aValue', - '0':1.322, - 'now':datetime.now(), - 'list':[1,2,3], - 'tuple':('a','b','c') - } - try: - writePlist(plist, "example.plist") - except (InvalidPlistException, NotBinaryPlistException), e: - print "Something bad happened:", e - -Plist parsing example: - - from biplist import * - try: - plist = readPlist("example.plist") - print plist - except (InvalidPlistException, NotBinaryPlistException), e: - print "Not a plist:", e -""" - -from collections import namedtuple -import datetime -import io -import math -import plistlib -from struct import pack, unpack, unpack_from -from struct import error as struct_error -import sys -import time - -try: - unicode - unicodeEmpty = r'' -except NameError: - unicode = str - unicodeEmpty = '' -try: - long -except NameError: - long = int -try: - {}.iteritems - iteritems = lambda x: x.iteritems() -except AttributeError: - iteritems = lambda x: x.items() - -__all__ = [ - 'Uid', 'Data', 'readPlist', 'writePlist', 'readPlistFromString', - 'writePlistToString', 'InvalidPlistException', 'NotBinaryPlistException' -] - -# Apple uses Jan 1, 2001 as a base for all plist date/times. -apple_reference_date = datetime.datetime.utcfromtimestamp(978307200) - -class Uid(object): - """Wrapper around integers for representing UID values. This - is used in keyed archiving.""" - integer = 0 - def __init__(self, integer): - self.integer = integer - - def __repr__(self): - return "Uid(%d)" % self.integer - - def __eq__(self, other): - if isinstance(self, Uid) and isinstance(other, Uid): - return self.integer == other.integer - return False - - def __cmp__(self, other): - return self.integer - other.integer - - def __lt__(self, other): - return self.integer < other.integer - - def __hash__(self): - return self.integer - - def __int__(self): - return int(self.integer) - -class Data(bytes): - """Wrapper around bytes to distinguish Data values.""" - -class InvalidPlistException(Exception): - """Raised when the plist is incorrectly formatted.""" - -class NotBinaryPlistException(Exception): - """Raised when a binary plist was expected but not encountered.""" - -def readPlist(pathOrFile): - """Raises NotBinaryPlistException, InvalidPlistException""" - didOpen = False - result = None - if isinstance(pathOrFile, (bytes, unicode)): - pathOrFile = open(pathOrFile, 'rb') - didOpen = True - try: - reader = PlistReader(pathOrFile) - result = reader.parse() - except NotBinaryPlistException as e: - try: - pathOrFile.seek(0) - result = None - if hasattr(plistlib, 'loads'): - contents = None - if isinstance(pathOrFile, (bytes, unicode)): - with open(pathOrFile, 'rb') as f: - contents = f.read() - else: - contents = pathOrFile.read() - result = plistlib.loads(contents) - else: - result = plistlib.readPlist(pathOrFile) - result = wrapDataObject(result, for_binary=True) - except Exception as e: - raise InvalidPlistException(e) - finally: - if didOpen: - pathOrFile.close() - return result - -def wrapDataObject(o, for_binary=False): - if isinstance(o, Data) and not for_binary: - v = sys.version_info - if not (v[0] >= 3 and v[1] >= 4): - o = plistlib.Data(o) - elif isinstance(o, (bytes, plistlib.Data)) and for_binary: - if hasattr(o, 'data'): - o = Data(o.data) - elif isinstance(o, tuple): - o = wrapDataObject(list(o), for_binary) - o = tuple(o) - elif isinstance(o, list): - for i in range(len(o)): - o[i] = wrapDataObject(o[i], for_binary) - elif isinstance(o, dict): - for k in o: - o[k] = wrapDataObject(o[k], for_binary) - return o - -def writePlist(rootObject, pathOrFile, binary=True): - if not binary: - rootObject = wrapDataObject(rootObject, binary) - if hasattr(plistlib, "dump"): - if isinstance(pathOrFile, (bytes, unicode)): - with open(pathOrFile, 'wb') as f: - return plistlib.dump(rootObject, f) - else: - return plistlib.dump(rootObject, pathOrFile) - else: - return plistlib.writePlist(rootObject, pathOrFile) - else: - didOpen = False - if isinstance(pathOrFile, (bytes, unicode)): - pathOrFile = open(pathOrFile, 'wb') - didOpen = True - writer = PlistWriter(pathOrFile) - result = writer.writeRoot(rootObject) - if didOpen: - pathOrFile.close() - return result - -def readPlistFromString(data): - return readPlist(io.BytesIO(data)) - -def writePlistToString(rootObject, binary=True): - if not binary: - rootObject = wrapDataObject(rootObject, binary) - if hasattr(plistlib, "dumps"): - return plistlib.dumps(rootObject) - elif hasattr(plistlib, "writePlistToBytes"): - return plistlib.writePlistToBytes(rootObject) - else: - return plistlib.writePlistToString(rootObject) - else: - ioObject = io.BytesIO() - writer = PlistWriter(ioObject) - writer.writeRoot(rootObject) - return ioObject.getvalue() - -def is_stream_binary_plist(stream): - stream.seek(0) - header = stream.read(7) - if header == b'bplist0': - return True - else: - return False - -PlistTrailer = namedtuple('PlistTrailer', 'offsetSize, objectRefSize, offsetCount, topLevelObjectNumber, offsetTableOffset') -PlistByteCounts = namedtuple('PlistByteCounts', 'nullBytes, boolBytes, intBytes, realBytes, dateBytes, dataBytes, stringBytes, uidBytes, arrayBytes, setBytes, dictBytes') - -class PlistReader(object): - file = None - contents = '' - offsets = None - trailer = None - currentOffset = 0 - - def __init__(self, fileOrStream): - """Raises NotBinaryPlistException.""" - self.reset() - self.file = fileOrStream - - def parse(self): - return self.readRoot() - - def reset(self): - self.trailer = None - self.contents = '' - self.offsets = [] - self.currentOffset = 0 - - def readRoot(self): - result = None - self.reset() - # Get the header, make sure it's a valid file. - if not is_stream_binary_plist(self.file): - raise NotBinaryPlistException() - self.file.seek(0) - self.contents = self.file.read() - if len(self.contents) < 32: - raise InvalidPlistException("File is too short.") - trailerContents = self.contents[-32:] - try: - self.trailer = PlistTrailer._make(unpack("!xxxxxxBBQQQ", trailerContents)) - offset_size = self.trailer.offsetSize * self.trailer.offsetCount - offset = self.trailer.offsetTableOffset - offset_contents = self.contents[offset:offset+offset_size] - offset_i = 0 - while offset_i < self.trailer.offsetCount: - begin = self.trailer.offsetSize*offset_i - tmp_contents = offset_contents[begin:begin+self.trailer.offsetSize] - tmp_sized = self.getSizedInteger(tmp_contents, self.trailer.offsetSize) - self.offsets.append(tmp_sized) - offset_i += 1 - self.setCurrentOffsetToObjectNumber(self.trailer.topLevelObjectNumber) - result = self.readObject() - except TypeError as e: - raise InvalidPlistException(e) - return result - - def setCurrentOffsetToObjectNumber(self, objectNumber): - self.currentOffset = self.offsets[objectNumber] - - def readObject(self): - result = None - tmp_byte = self.contents[self.currentOffset:self.currentOffset+1] - marker_byte = unpack("!B", tmp_byte)[0] - format = (marker_byte >> 4) & 0x0f - extra = marker_byte & 0x0f - self.currentOffset += 1 - - def proc_extra(extra): - if extra == 0b1111: - #self.currentOffset += 1 - extra = self.readObject() - return extra - - # bool, null, or fill byte - if format == 0b0000: - if extra == 0b0000: - result = None - elif extra == 0b1000: - result = False - elif extra == 0b1001: - result = True - elif extra == 0b1111: - pass # fill byte - else: - raise InvalidPlistException("Invalid object found at offset: %d" % (self.currentOffset - 1)) - # int - elif format == 0b0001: - extra = proc_extra(extra) - result = self.readInteger(pow(2, extra)) - # real - elif format == 0b0010: - extra = proc_extra(extra) - result = self.readReal(extra) - # date - elif format == 0b0011 and extra == 0b0011: - result = self.readDate() - # data - elif format == 0b0100: - extra = proc_extra(extra) - result = self.readData(extra) - # ascii string - elif format == 0b0101: - extra = proc_extra(extra) - result = self.readAsciiString(extra) - # Unicode string - elif format == 0b0110: - extra = proc_extra(extra) - result = self.readUnicode(extra) - # uid - elif format == 0b1000: - result = self.readUid(extra) - # array - elif format == 0b1010: - extra = proc_extra(extra) - result = self.readArray(extra) - # set - elif format == 0b1100: - extra = proc_extra(extra) - result = set(self.readArray(extra)) - # dict - elif format == 0b1101: - extra = proc_extra(extra) - result = self.readDict(extra) - else: - raise InvalidPlistException("Invalid object found: {format: %s, extra: %s}" % (bin(format), bin(extra))) - return result - - def readInteger(self, byteSize): - result = 0 - original_offset = self.currentOffset - data = self.contents[self.currentOffset:self.currentOffset + byteSize] - result = self.getSizedInteger(data, byteSize, as_number=True) - self.currentOffset = original_offset + byteSize - return result - - def readReal(self, length): - result = 0.0 - to_read = pow(2, length) - data = self.contents[self.currentOffset:self.currentOffset+to_read] - if length == 2: # 4 bytes - result = unpack('>f', data)[0] - elif length == 3: # 8 bytes - result = unpack('>d', data)[0] - else: - raise InvalidPlistException("Unknown real of length %d bytes" % to_read) - return result - - def readRefs(self, count): - refs = [] - i = 0 - while i < count: - fragment = self.contents[self.currentOffset:self.currentOffset+self.trailer.objectRefSize] - ref = self.getSizedInteger(fragment, len(fragment)) - refs.append(ref) - self.currentOffset += self.trailer.objectRefSize - i += 1 - return refs - - def readArray(self, count): - result = [] - values = self.readRefs(count) - i = 0 - while i < len(values): - self.setCurrentOffsetToObjectNumber(values[i]) - value = self.readObject() - result.append(value) - i += 1 - return result - - def readDict(self, count): - result = {} - keys = self.readRefs(count) - values = self.readRefs(count) - i = 0 - while i < len(keys): - self.setCurrentOffsetToObjectNumber(keys[i]) - key = self.readObject() - self.setCurrentOffsetToObjectNumber(values[i]) - value = self.readObject() - result[key] = value - i += 1 - return result - - def readAsciiString(self, length): - result = unpack("!%ds" % length, self.contents[self.currentOffset:self.currentOffset+length])[0] - self.currentOffset += length - return str(result.decode('ascii')) - - def readUnicode(self, length): - actual_length = length*2 - data = self.contents[self.currentOffset:self.currentOffset+actual_length] - # unpack not needed?!! data = unpack(">%ds" % (actual_length), data)[0] - self.currentOffset += actual_length - return data.decode('utf_16_be') - - def readDate(self): - result = unpack(">d", self.contents[self.currentOffset:self.currentOffset+8])[0] - # Use timedelta to workaround time_t size limitation on 32-bit python. - result = datetime.timedelta(seconds=result) + apple_reference_date - self.currentOffset += 8 - return result - - def readData(self, length): - result = self.contents[self.currentOffset:self.currentOffset+length] - self.currentOffset += length - return Data(result) - - def readUid(self, length): - return Uid(self.readInteger(length+1)) - - def getSizedInteger(self, data, byteSize, as_number=False): - """Numbers of 8 bytes are signed integers when they refer to numbers, but unsigned otherwise.""" - result = 0 - # 1, 2, and 4 byte integers are unsigned - if byteSize == 1: - result = unpack('>B', data)[0] - elif byteSize == 2: - result = unpack('>H', data)[0] - elif byteSize == 4: - result = unpack('>L', data)[0] - elif byteSize == 8: - if as_number: - result = unpack('>q', data)[0] - else: - result = unpack('>Q', data)[0] - elif byteSize <= 16: - # Handle odd-sized or integers larger than 8 bytes - # Don't naively go over 16 bytes, in order to prevent infinite loops. - result = 0 - if hasattr(int, 'from_bytes'): - result = int.from_bytes(data, 'big') - else: - for byte in data: - if not isinstance(byte, int): # Python3.0-3.1.x return ints, 2.x return str - byte = unpack_from('>B', byte)[0] - result = (result << 8) | byte - else: - raise InvalidPlistException("Encountered integer longer than 16 bytes.") - return result - -class HashableWrapper(object): - def __init__(self, value): - self.value = value - def __repr__(self): - return "" % [self.value] - -class BoolWrapper(object): - def __init__(self, value): - self.value = value - def __repr__(self): - return "" % self.value - -class FloatWrapper(object): - _instances = {} - def __new__(klass, value): - # Ensure FloatWrapper(x) for a given float x is always the same object - wrapper = klass._instances.get(value) - if wrapper is None: - wrapper = object.__new__(klass) - wrapper.value = value - klass._instances[value] = wrapper - return wrapper - def __repr__(self): - return "" % self.value - -class StringWrapper(object): - __instances = {} - - encodedValue = None - encoding = None - - def __new__(cls, value): - '''Ensure we only have a only one instance for any string, - and that we encode ascii as 1-byte-per character when possible''' - - encodedValue = None - - for encoding in ('ascii', 'utf_16_be'): - try: - encodedValue = value.encode(encoding) - except: pass - if encodedValue is not None: - if encodedValue not in cls.__instances: - cls.__instances[encodedValue] = super(StringWrapper, cls).__new__(cls) - cls.__instances[encodedValue].encodedValue = encodedValue - cls.__instances[encodedValue].encoding = encoding - return cls.__instances[encodedValue] - - raise ValueError('Unable to get ascii or utf_16_be encoding for %s' % repr(value)) - - def __len__(self): - '''Return roughly the number of characters in this string (half the byte length)''' - if self.encoding == 'ascii': - return len(self.encodedValue) - else: - return len(self.encodedValue)//2 - - def __lt__(self, other): - return self.encodedValue < other.encodedValue - - @property - def encodingMarker(self): - if self.encoding == 'ascii': - return 0b0101 - else: - return 0b0110 - - def __repr__(self): - return '' % (self.encoding, self.encodedValue) - -class PlistWriter(object): - header = b'bplist00bybiplist1.0' - file = None - byteCounts = None - trailer = None - computedUniques = None - writtenReferences = None - referencePositions = None - wrappedTrue = None - wrappedFalse = None - - def __init__(self, file): - self.reset() - self.file = file - self.wrappedTrue = BoolWrapper(True) - self.wrappedFalse = BoolWrapper(False) - - def reset(self): - self.byteCounts = PlistByteCounts(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - self.trailer = PlistTrailer(0, 0, 0, 0, 0) - - # A set of all the uniques which have been computed. - self.computedUniques = set() - # A list of all the uniques which have been written. - self.writtenReferences = {} - # A dict of the positions of the written uniques. - self.referencePositions = {} - - def positionOfObjectReference(self, obj): - """If the given object has been written already, return its - position in the offset table. Otherwise, return None.""" - return self.writtenReferences.get(obj) - - def writeRoot(self, root): - """ - Strategy is: - - write header - - wrap root object so everything is hashable - - compute size of objects which will be written - - need to do this in order to know how large the object refs - will be in the list/dict/set reference lists - - write objects - - keep objects in writtenReferences - - keep positions of object references in referencePositions - - write object references with the length computed previously - - computer object reference length - - write object reference positions - - write trailer - """ - output = self.header - wrapped_root = self.wrapRoot(root) - self.computeOffsets(wrapped_root, asReference=True, isRoot=True) - self.trailer = self.trailer._replace(**{'objectRefSize':self.intSize(len(self.computedUniques))}) - self.writeObjectReference(wrapped_root, output) - output = self.writeObject(wrapped_root, output, setReferencePosition=True) - - # output size at this point is an upper bound on how big the - # object reference offsets need to be. - self.trailer = self.trailer._replace(**{ - 'offsetSize':self.intSize(len(output)), - 'offsetCount':len(self.computedUniques), - 'offsetTableOffset':len(output), - 'topLevelObjectNumber':0 - }) - - output = self.writeOffsetTable(output) - output += pack('!xxxxxxBBQQQ', *self.trailer) - self.file.write(output) - - def wrapRoot(self, root): - if isinstance(root, bool): - if root is True: - return self.wrappedTrue - else: - return self.wrappedFalse - elif isinstance(root, float): - return FloatWrapper(root) - elif isinstance(root, set): - n = set() - for value in root: - n.add(self.wrapRoot(value)) - return HashableWrapper(n) - elif isinstance(root, dict): - n = {} - for key, value in iteritems(root): - n[self.wrapRoot(key)] = self.wrapRoot(value) - return HashableWrapper(n) - elif isinstance(root, list): - n = [] - for value in root: - n.append(self.wrapRoot(value)) - return HashableWrapper(n) - elif isinstance(root, tuple): - n = tuple([self.wrapRoot(value) for value in root]) - return HashableWrapper(n) - elif isinstance(root, (str, unicode)) and not isinstance(root, Data): - return StringWrapper(root) - elif isinstance(root, bytes): - return Data(root) - else: - return root - - def incrementByteCount(self, field, incr=1): - self.byteCounts = self.byteCounts._replace(**{field:self.byteCounts.__getattribute__(field) + incr}) - - def computeOffsets(self, obj, asReference=False, isRoot=False): - def check_key(key): - if key is None: - raise InvalidPlistException('Dictionary keys cannot be null in plists.') - elif isinstance(key, Data): - raise InvalidPlistException('Data cannot be dictionary keys in plists.') - elif not isinstance(key, StringWrapper): - raise InvalidPlistException('Keys must be strings.') - - def proc_size(size): - if size > 0b1110: - size += self.intSize(size) - return size - # If this should be a reference, then we keep a record of it in the - # uniques table. - if asReference: - if obj in self.computedUniques: - return - else: - self.computedUniques.add(obj) - - if obj is None: - self.incrementByteCount('nullBytes') - elif isinstance(obj, BoolWrapper): - self.incrementByteCount('boolBytes') - elif isinstance(obj, Uid): - size = self.intSize(obj.integer) - self.incrementByteCount('uidBytes', incr=1+size) - elif isinstance(obj, (int, long)): - size = self.intSize(obj) - self.incrementByteCount('intBytes', incr=1+size) - elif isinstance(obj, FloatWrapper): - size = self.realSize(obj) - self.incrementByteCount('realBytes', incr=1+size) - elif isinstance(obj, datetime.datetime): - self.incrementByteCount('dateBytes', incr=2) - elif isinstance(obj, Data): - size = proc_size(len(obj)) - self.incrementByteCount('dataBytes', incr=1+size) - elif isinstance(obj, StringWrapper): - size = proc_size(len(obj)) - self.incrementByteCount('stringBytes', incr=1+size) - elif isinstance(obj, HashableWrapper): - obj = obj.value - if isinstance(obj, set): - size = proc_size(len(obj)) - self.incrementByteCount('setBytes', incr=1+size) - for value in obj: - self.computeOffsets(value, asReference=True) - elif isinstance(obj, (list, tuple)): - size = proc_size(len(obj)) - self.incrementByteCount('arrayBytes', incr=1+size) - for value in obj: - asRef = True - self.computeOffsets(value, asReference=True) - elif isinstance(obj, dict): - size = proc_size(len(obj)) - self.incrementByteCount('dictBytes', incr=1+size) - for key, value in iteritems(obj): - check_key(key) - self.computeOffsets(key, asReference=True) - self.computeOffsets(value, asReference=True) - else: - raise InvalidPlistException("Unknown object type: %s (%s)" % (type(obj).__name__, repr(obj))) - - def writeObjectReference(self, obj, output): - """Tries to write an object reference, adding it to the references - table. Does not write the actual object bytes or set the reference - position. Returns a tuple of whether the object was a new reference - (True if it was, False if it already was in the reference table) - and the new output. - """ - position = self.positionOfObjectReference(obj) - if position is None: - self.writtenReferences[obj] = len(self.writtenReferences) - output += self.binaryInt(len(self.writtenReferences) - 1, byteSize=self.trailer.objectRefSize) - return (True, output) - else: - output += self.binaryInt(position, byteSize=self.trailer.objectRefSize) - return (False, output) - - def writeObject(self, obj, output, setReferencePosition=False): - """Serializes the given object to the output. Returns output. - If setReferencePosition is True, will set the position the - object was written. - """ - def proc_variable_length(format, length): - result = b'' - if length > 0b1110: - result += pack('!B', (format << 4) | 0b1111) - result = self.writeObject(length, result) - else: - result += pack('!B', (format << 4) | length) - return result - - def timedelta_total_seconds(td): - # Shim for Python 2.6 compatibility, which doesn't have total_seconds. - # Make one argument a float to ensure the right calculation. - return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10.0**6) / 10.0**6 - - if setReferencePosition: - self.referencePositions[obj] = len(output) - - if obj is None: - output += pack('!B', 0b00000000) - elif isinstance(obj, BoolWrapper): - if obj.value is False: - output += pack('!B', 0b00001000) - else: - output += pack('!B', 0b00001001) - elif isinstance(obj, Uid): - size = self.intSize(obj.integer) - output += pack('!B', (0b1000 << 4) | size - 1) - output += self.binaryInt(obj.integer) - elif isinstance(obj, (int, long)): - byteSize = self.intSize(obj) - root = math.log(byteSize, 2) - output += pack('!B', (0b0001 << 4) | int(root)) - output += self.binaryInt(obj, as_number=True) - elif isinstance(obj, FloatWrapper): - # just use doubles - output += pack('!B', (0b0010 << 4) | 3) - output += self.binaryReal(obj) - elif isinstance(obj, datetime.datetime): - try: - timestamp = (obj - apple_reference_date).total_seconds() - except AttributeError: - timestamp = timedelta_total_seconds(obj - apple_reference_date) - output += pack('!B', 0b00110011) - output += pack('!d', float(timestamp)) - elif isinstance(obj, Data): - output += proc_variable_length(0b0100, len(obj)) - output += obj - elif isinstance(obj, StringWrapper): - output += proc_variable_length(obj.encodingMarker, len(obj)) - output += obj.encodedValue - elif isinstance(obj, bytes): - output += proc_variable_length(0b0101, len(obj)) - output += obj - elif isinstance(obj, HashableWrapper): - obj = obj.value - if isinstance(obj, (set, list, tuple)): - if isinstance(obj, set): - output += proc_variable_length(0b1100, len(obj)) - else: - output += proc_variable_length(0b1010, len(obj)) - - objectsToWrite = [] - for objRef in sorted(obj) if isinstance(obj, set) else obj: - (isNew, output) = self.writeObjectReference(objRef, output) - if isNew: - objectsToWrite.append(objRef) - for objRef in objectsToWrite: - output = self.writeObject(objRef, output, setReferencePosition=True) - elif isinstance(obj, dict): - output += proc_variable_length(0b1101, len(obj)) - keys = [] - values = [] - objectsToWrite = [] - for key, value in sorted(iteritems(obj)): - keys.append(key) - values.append(value) - for key in keys: - (isNew, output) = self.writeObjectReference(key, output) - if isNew: - objectsToWrite.append(key) - for value in values: - (isNew, output) = self.writeObjectReference(value, output) - if isNew: - objectsToWrite.append(value) - for objRef in objectsToWrite: - output = self.writeObject(objRef, output, setReferencePosition=True) - return output - - def writeOffsetTable(self, output): - """Writes all of the object reference offsets.""" - all_positions = [] - writtenReferences = list(self.writtenReferences.items()) - writtenReferences.sort(key=lambda x: x[1]) - for obj,order in writtenReferences: - # Porting note: Elsewhere we deliberately replace empty unicdoe strings - # with empty binary strings, but the empty unicode string - # goes into writtenReferences. This isn't an issue in Py2 - # because u'' and b'' have the same hash; but it is in - # Py3, where they don't. - if bytes != str and obj == unicodeEmpty: - obj = b'' - position = self.referencePositions.get(obj) - if position is None: - raise InvalidPlistException("Error while writing offsets table. Object not found. %s" % obj) - output += self.binaryInt(position, self.trailer.offsetSize) - all_positions.append(position) - return output - - def binaryReal(self, obj): - # just use doubles - result = pack('>d', obj.value) - return result - - def binaryInt(self, obj, byteSize=None, as_number=False): - result = b'' - if byteSize is None: - byteSize = self.intSize(obj) - if byteSize == 1: - result += pack('>B', obj) - elif byteSize == 2: - result += pack('>H', obj) - elif byteSize == 4: - result += pack('>L', obj) - elif byteSize == 8: - if as_number: - result += pack('>q', obj) - else: - result += pack('>Q', obj) - elif byteSize <= 16: - try: - result = pack('>Q', 0) + pack('>Q', obj) - except struct_error as e: - raise InvalidPlistException("Unable to pack integer %d: %s" % (obj, e)) - else: - raise InvalidPlistException("Core Foundation can't handle integers with size greater than 16 bytes.") - return result - - def intSize(self, obj): - """Returns the number of bytes necessary to store the given integer.""" - # SIGNED - if obj < 0: # Signed integer, always 8 bytes - return 8 - # UNSIGNED - elif obj <= 0xFF: # 1 byte - return 1 - elif obj <= 0xFFFF: # 2 bytes - return 2 - elif obj <= 0xFFFFFFFF: # 4 bytes - return 4 - # SIGNED - # 0x7FFFFFFFFFFFFFFF is the max. - elif obj <= 0x7FFFFFFFFFFFFFFF: # 8 bytes signed - return 8 - elif obj <= 0xffffffffffffffff: # 8 bytes unsigned - return 16 - else: - raise InvalidPlistException("Core Foundation can't handle integers with size greater than 8 bytes.") - - def realSize(self, obj): - return 8 diff --git a/node_modules/dmg-builder/vendor/dmgbuild/__init__.py b/node_modules/dmg-builder/vendor/dmgbuild/__init__.py deleted file mode 100644 index e7f985c..0000000 --- a/node_modules/dmg-builder/vendor/dmgbuild/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .core import build_dmg - -__all__ = ['dmgbuild'] diff --git a/node_modules/dmg-builder/vendor/dmgbuild/badge.py b/node_modules/dmg-builder/vendor/dmgbuild/badge.py deleted file mode 100644 index 159a537..0000000 --- a/node_modules/dmg-builder/vendor/dmgbuild/badge.py +++ /dev/null @@ -1,143 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from Quartz import * -import math - -_REMOVABLE_DISK_PATH = '/System/Library/Extensions/IOStorageFamily.kext/Contents/Resources/Removable.icns' - -def badge_disk_icon(badge_file, output_file): - # Load the Removable disk icon - url = CFURLCreateWithFileSystemPath(None, _REMOVABLE_DISK_PATH, - kCFURLPOSIXPathStyle, False) - backdrop = CGImageSourceCreateWithURL(url, None) - backdropCount = CGImageSourceGetCount(backdrop) - - # Load the badge - url = CFURLCreateWithFileSystemPath(None, badge_file, - kCFURLPOSIXPathStyle, False) - badge = CGImageSourceCreateWithURL(url, None) - assert badge is not None, 'Unable to process image file: %s' % badge_file - badgeCount = CGImageSourceGetCount(badge) - - # Set up a destination for our target - url = CFURLCreateWithFileSystemPath(None, output_file, - kCFURLPOSIXPathStyle, False) - target = CGImageDestinationCreateWithURL(url, 'com.apple.icns', - backdropCount, None) - - # Get the RGB colorspace - rgbColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB) - - # Scale - scale = 1.0 - - # Perspective transform - corners = ((0.2, 0.95), (0.8, 0.95), (0.85, 0.35), (0.15, 0.35)) - - # Translation - position = (0.5, 0.5) - - for n in range(backdropCount): - props = CGImageSourceCopyPropertiesAtIndex(backdrop, n, None) - width = props['PixelWidth'] - height = props['PixelHeight'] - dpi = props['DPIWidth'] - depth = props['Depth'] - - # Choose the best sized badge image - bestWidth = None - bestHeight = None - bestBadge = None - bestDepth = None - bestDPI = None - for m in range(badgeCount): - badgeProps = CGImageSourceCopyPropertiesAtIndex(badge, m, None) - badgeWidth = badgeProps['PixelWidth'] - badgeHeight = badgeProps['PixelHeight'] - badgeDPI = badgeProps['DPIWidth'] - badgeDepth = badgeProps['Depth'] - - if bestBadge is None or (badgeWidth <= width - and (bestWidth > width - or badgeWidth > bestWidth - or (badgeWidth == bestWidth - and badgeDPI == dpi - and badgeDepth <= depth - and (bestDepth is None - or badgeDepth > bestDepth)))): - bestBadge = m - bestWidth = badgeWidth - bestHeight = badgeHeight - bestDPI = badgeDPI - bestDepth = badgeDepth - - badgeImage = CGImageSourceCreateImageAtIndex(badge, bestBadge, None) - badgeCI = CIImage.imageWithCGImage_(badgeImage) - - backgroundImage = CGImageSourceCreateImageAtIndex(backdrop, n, None) - backgroundCI = CIImage.imageWithCGImage_(backgroundImage) - - compositor = CIFilter.filterWithName_('CISourceOverCompositing') - lanczos = CIFilter.filterWithName_('CILanczosScaleTransform') - perspective = CIFilter.filterWithName_('CIPerspectiveTransform') - transform = CIFilter.filterWithName_('CIAffineTransform') - - lanczos.setValue_forKey_(badgeCI, kCIInputImageKey) - lanczos.setValue_forKey_(scale * float(width)/bestWidth, kCIInputScaleKey) - lanczos.setValue_forKey_(1.0, kCIInputAspectRatioKey) - - topLeft = (width * scale * corners[0][0], - width * scale * corners[0][1]) - topRight = (width * scale * corners[1][0], - width * scale * corners[1][1]) - bottomRight = (width * scale * corners[2][0], - width * scale * corners[2][1]) - bottomLeft = (width * scale * corners[3][0], - width * scale * corners[3][1]) - - out = lanczos.valueForKey_(kCIOutputImageKey) - if width >= 16: - perspective.setValue_forKey_(out, kCIInputImageKey) - perspective.setValue_forKey_(CIVector.vectorWithX_Y_(*topLeft), - 'inputTopLeft') - perspective.setValue_forKey_(CIVector.vectorWithX_Y_(*topRight), - 'inputTopRight') - perspective.setValue_forKey_(CIVector.vectorWithX_Y_(*bottomRight), - 'inputBottomRight') - perspective.setValue_forKey_(CIVector.vectorWithX_Y_(*bottomLeft), - 'inputBottomLeft') - out = perspective.valueForKey_(kCIOutputImageKey) - - tfm = NSAffineTransform.transform() - tfm.translateXBy_yBy_(math.floor((position[0] - 0.5 * scale) * width), - math.floor((position[1] - 0.5 * scale) * height)) - - transform.setValue_forKey_(out, kCIInputImageKey) - transform.setValue_forKey_(tfm, 'inputTransform') - out = transform.valueForKey_(kCIOutputImageKey) - - compositor.setValue_forKey_(out, kCIInputImageKey) - compositor.setValue_forKey_(backgroundCI, kCIInputBackgroundImageKey) - - result = compositor.valueForKey_(kCIOutputImageKey) - - cgContext = CGBitmapContextCreate(None, - width, - height, - 8, - 0, - rgbColorSpace, - kCGImageAlphaPremultipliedLast) - context = CIContext.contextWithCGContext_options_(cgContext, None) - - context.drawImage_inRect_fromRect_(result, - ((0, 0), (width, height)), - ((0, 0), (width, height))) - - image = CGBitmapContextCreateImage(cgContext) - - CGImageDestinationAddImage(target, image, props) - - CGImageDestinationFinalize(target) - diff --git a/node_modules/dmg-builder/vendor/dmgbuild/colors.py b/node_modules/dmg-builder/vendor/dmgbuild/colors.py deleted file mode 100644 index 1d252a6..0000000 --- a/node_modules/dmg-builder/vendor/dmgbuild/colors.py +++ /dev/null @@ -1,494 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import re -import math - -class Color (object): - def to_rgb(self): - raise Exception('Must implement to_rgb() in subclasses') - -class RGB (Color): - def __init__(self, r, g, b): - self.r = r - self.g = g - self.b = b - - def to_rgb(self): - return self - -class HSL (Color): - def __init__(self, h, s, l): - self.h = h - self.s = s - self.l = l - - @staticmethod - def _hue_to_rgb(t1, t2, hue): - if hue < 0: - hue += 6 - elif hue >= 6: - hue -= 6 - - if hue < 1: - return (t2 - t1) * hue + t1 - elif hue < 3: - return t2 - elif hue < 4: - return (t2 - t1) * (4 - hue) + t1 - else: - return t1 - - def to_rgb(self): - hue = self.h / 60.0 - if self.l <= 0.5: - t2 = self.l * (self.s + 1) - else: - t2 = self.l + self.s - (self.l * self.s) - t1 = self.l * 2 - t2 - r = self._hue_to_rgb(t1, t2, hue + 2) - g = self._hue_to_rgb(t1, t2, hue) - b = self._hue_to_rgb(t1, t2, hue - 2) - return RGB(r, g, b) - -class HWB (Color): - def __init__(self, h, w, b): - self.h = h - self.w = w - self.b = b - - @staticmethod - def _hue_to_rgb(hue): - if hue < 0: - hue += 6 - elif hue >= 6: - hue -= 6 - - if hue < 1: - return hue - elif hue < 3: - return 1 - elif hue < 4: - return (4 - hue) - else: - return 0 - - def to_rgb(self): - hue = self.h / 60.0 - t1 = 1 - self.w - self.b - r = self._hue_to_rgb(hue + 2) * t1 + self.w - g = self._hue_to_rgb(hue) * t1 + self.w - b = self._hue_to_rgb(hue - 2) * t1 + self.w - return RGB(r, g, b) - -class CMYK (Color): - def __init__(self, c, m, y, k): - self.c = c - self.m = m - self.y = y - self.k = k - - def to_rgb(self): - r = 1.0 - min(1.0, self.c + self.k) - g = 1.0 - min(1.0, self.m + self.k) - b = 1.0 - min(1.0, self.y + self.k) - return RGB(r, g, b) - -class Gray (Color): - def __init__(self, g): - self.g = g - - def to_rgb(self): - return RGB(g, g, g) - -_x11_colors = { - 'aliceblue': (240, 248, 255), - 'antiquewhite': (250, 235, 215), - 'aqua': ( 0, 255, 255), - 'aquamarine': (127, 255, 212), - 'azure': (240, 255, 255), - 'beige': (245, 245, 220), - 'bisque': (255, 228, 196), - 'black': ( 0, 0, 0), - 'blanchedalmond': (255, 235, 205), - 'blue': ( 0, 0, 255), - 'blueviolet': (138, 43, 226), - 'brown': (165, 42, 42), - 'burlywood': (222, 184, 135), - 'cadetblue': ( 95, 158, 160), - 'chartreuse': (127, 255, 0), - 'chocolate': (210, 105, 30), - 'coral': (255, 127, 80), - 'cornflowerblue': (100, 149, 237), - 'cornsilk': (255, 248, 220), - 'crimson': (220, 20, 60), - 'cyan': ( 0, 255, 255), - 'darkblue': ( 0, 0, 139), - 'darkcyan': ( 0, 139, 139), - 'darkgoldenrod': (184, 134, 11), - 'darkgray': (169, 169, 169), - 'darkgreen': ( 0, 100, 0), - 'darkgrey': (169, 169, 169), - 'darkkhaki': (189, 183, 107), - 'darkmagenta': (139, 0, 139), - 'darkolivegreen': ( 85, 107, 47), - 'darkorange': (255, 140, 0), - 'darkorchid': (153, 50, 204), - 'darkred': (139, 0, 0), - 'darksalmon': (233, 150, 122), - 'darkseagreen': (143, 188, 143), - 'darkslateblue': ( 72, 61, 139), - 'darkslategray': ( 47, 79, 79), - 'darkslategrey': ( 47, 79, 79), - 'darkturquoise': ( 0, 206, 209), - 'darkviolet': (148, 0, 211), - 'deeppink': (255, 20, 147), - 'deepskyblue': ( 0, 191, 255), - 'dimgray': (105, 105, 105), - 'dimgrey': (105, 105, 105), - 'dodgerblue': ( 30, 144, 255), - 'firebrick': (178, 34, 34), - 'floralwhite': (255, 250, 240), - 'forestgreen': ( 34, 139, 34), - 'fuchsia': (255, 0, 255), - 'gainsboro': (220, 220, 220), - 'ghostwhite': (248, 248, 255), - 'gold': (255, 215, 0), - 'goldenrod': (218, 165, 32), - 'gray': (128, 128, 128), - 'grey': (128, 128, 128), - 'green': ( 0, 128, 0), - 'greenyellow': (173, 255, 47), - 'honeydew': (240, 255, 240), - 'hotpink': (255, 105, 180), - 'indianred': (205, 92, 92), - 'indigo': ( 75, 0, 130), - 'ivory': (255, 255, 240), - 'khaki': (240, 230, 140), - 'lavender': (230, 230, 250), - 'lavenderblush': (255, 240, 245), - 'lawngreen': (124, 252, 0), - 'lemonchiffon': (255, 250, 205), - 'lightblue': (173, 216, 230), - 'lightcoral': (240, 128, 128), - 'lightcyan': (224, 255, 255), - 'lightgoldenrodyellow': (250, 250, 210), - 'lightgray': (211, 211, 211), - 'lightgreen': (144, 238, 144), - 'lightgrey': (211, 211, 211), - 'lightpink': (255, 182, 193), - 'lightsalmon': (255, 160, 122), - 'lightseagreen': ( 32, 178, 170), - 'lightskyblue': (135, 206, 250), - 'lightslategray': (119, 136, 153), - 'lightslategrey': (119, 136, 153), - 'lightsteelblue': (176, 196, 222), - 'lightyellow': (255, 255, 224), - 'lime': ( 0, 255, 0), - 'limegreen': ( 50, 205, 50), - 'linen': (250, 240, 230), - 'magenta': (255, 0, 255), - 'maroon': (128, 0, 0), - 'mediumaquamarine': (102, 205, 170), - 'mediumblue': ( 0, 0, 205), - 'mediumorchid': (186, 85, 211), - 'mediumpurple': (147, 112, 219), - 'mediumseagreen': ( 60, 179, 113), - 'mediumslateblue': (123, 104, 238), - 'mediumspringgreen': ( 0, 250, 154), - 'mediumturquoise': ( 72, 209, 204), - 'mediumvioletred': (199, 21, 133), - 'midnightblue': ( 25, 25, 112), - 'mintcream': (245, 255, 250), - 'mistyrose': (255, 228, 225), - 'moccasin': (255, 228, 181), - 'navajowhite': (255, 222, 173), - 'navy': ( 0, 0, 128), - 'oldlace': (253, 245, 230), - 'olive': (128, 128, 0), - 'olivedrab': (107, 142, 35), - 'orange': (255, 165, 0), - 'orangered': (255, 69, 0), - 'orchid': (218, 112, 214), - 'palegoldenrod': (238, 232, 170), - 'palegreen': (152, 251, 152), - 'paleturquoise': (175, 238, 238), - 'palevioletred': (219, 112, 147), - 'papayawhip': (255, 239, 213), - 'peachpuff': (255, 218, 185), - 'peru': (205, 133, 63), - 'pink': (255, 192, 203), - 'plum': (221, 160, 221), - 'powderblue': (176, 224, 230), - 'purple': (128, 0, 128), - 'red': (255, 0, 0), - 'rosybrown': (188, 143, 143), - 'royalblue': ( 65, 105, 225), - 'saddlebrown': (139, 69, 19), - 'salmon': (250, 128, 114), - 'sandybrown': (244, 164, 96), - 'seagreen': ( 46, 139, 87), - 'seashell': (255, 245, 238), - 'sienna': (160, 82, 45), - 'silver': (192, 192, 192), - 'skyblue': (135, 206, 235), - 'slateblue': (106, 90, 205), - 'slategray': (112, 128, 144), - 'slategrey': (112, 128, 144), - 'snow': (255, 250, 250), - 'springgreen': ( 0, 255, 127), - 'steelblue': ( 70, 130, 180), - 'tan': (210, 180, 140), - 'teal': ( 0, 128, 128), - 'thistle': (216, 191, 216), - 'tomato': (255, 99, 71), - 'turquoise': ( 64, 224, 208), - 'violet': (238, 130, 238), - 'wheat': (245, 222, 179), - 'white': (255, 255, 255), - 'whitesmoke': (245, 245, 245), - 'yellow': (255, 255, 0), - 'yellowgreen': (154, 205, 50) - } - -_ws_re = re.compile('\s+') -_token_re = re.compile('[A-Za-z_][A-Za-z0-9_]*') -_hex_re = re.compile('#([0-9a-f]{3}(?:[0-9a-f]{3})?)$') -_number_re = re.compile('[0-9]*(\.[0-9]*)') - -class ColorParser (object): - def __init__(self, s): - self._string = s - self._pos = 0 - - def skipws(self): - m = _ws_re.match(self._string, self._pos) - if m: - self._pos = m.end(0) - - def expect(self, s, context=''): - if len(self._string) - self._pos < len(s) \ - or self._string[self._pos:self._pos + len(s)] != s: - raise ValueError('bad color "%s" - expected "%s"%s' - % (self._string, s, context)) - self._pos += len(s) - - def expectEnd(self): - if self._pos != len(self._string): - raise ValueError('junk at end of color "%s"' % self._string) - - def getToken(self): - m = _token_re.match(self._string, self._pos) - if m: - token = m.group(0) - - self._pos = m.end(0) - return token - return None - - def parseNumber(self, context=''): - m = _number_re.match(self._string, self._pos) - if m: - self._pos = m.end(0) - return float(m.group(0)) - raise ValueError('bad color "%s" - expected a number%s' - % (self._string, context)) - - def parseColor(self): - self.skipws() - - token = self.getToken() - if token: - if token == 'rgb': - return self.parseRGB() - elif token == 'hsl': - return self.parseHSL() - elif token == 'hwb': - return self.parseHWB() - elif token == 'cmyk': - return self.parseCMYK() - elif token == 'gray' or token == 'grey': - return self.parseGray() - - try: - r, g, b = _x11_colors[token] - except KeyError: - raise ValueError('unknown color name "%s"' % token) - - self.expectEnd() - - return RGB(r / 255.0, g / 255.0, b / 255.0) - - m = _hex_re.match(self._string, self._pos) - if m: - hrgb = m.group(1) - - if len(hrgb) == 3: - r = int('0x' + 2 * hrgb[0], 16) - g = int('0x' + 2 * hrgb[1], 16) - b = int('0x' + 2 * hrgb[2], 16) - else: - r = int('0x' + hrgb[0:2], 16) - g = int('0x' + hrgb[2:4], 16) - b = int('0x' + hrgb[4:6], 16) - - self._pos = m.end(0) - self.skipws() - - self.expectEnd() - - return RGB(r / 255.0, g / 255.0, b / 255.0) - - raise ValueError('bad color syntax "%s"' % self._string) - - def parseRGB(self): - self.expect('(', 'after "rgb"') - self.skipws() - - r = self.parseValue() - - self.skipws() - self.expect(',', 'in "rgb"') - self.skipws() - - g = self.parseValue() - - self.skipws() - self.expect(',', 'in "rgb"') - self.skipws() - - b = self.parseValue() - - self.skipws() - self.expect(')', 'at end of "rgb"') - - self.skipws() - self.expectEnd() - - return RGB(r, g, b) - - def parseHSL(self): - self.expect('(', 'after "hsl"') - self.skipws() - - h = self.parseAngle() - - self.skipws() - self.expect(',', 'in "hsl"') - self.skipws() - - s = self.parseValue() - - self.skipws() - self.expect(',', 'in "hsl"') - self.skipws() - - l = self.parseValue() - - self.skipws() - self.expect(')', 'at end of "hsl"') - - self.skipws() - self.expectEnd() - - return HSL(h, s, l) - - def parseHWB(self): - self.expect('(', 'after "hwb"') - self.skipws() - - h = self.parseAngle() - - self.skipws() - self.expect(',', 'in "hwb"') - self.skipws() - - w = self.parseValue() - - self.skipws() - self.expect(',', 'in "hwb"') - self.skipws() - - b = self.parseValue() - - self.skipws() - self.expect(')', 'at end of "hwb"') - - self.skipws() - self.expectEnd() - - return HWB(h, w, b) - - def parseCMYK(self): - self.expect('(', 'after "cmyk"') - self.skipws() - - c = self.parseValue() - - self.skipws() - self.expect(',', 'in "cmyk"') - self.skipws() - - m = self.parseValue() - - self.skipws() - self.expect(',', 'in "cmyk"') - self.skipws() - - y = self.parseValue() - - self.skipws() - self.expect(',', 'in "cmyk"') - self.skipws() - - k = self.parseValue() - - self.skipws() - self.expect(')', 'at end of "cmyk"') - - self.skipws() - self.expectEnd() - - return CMYK(c, m, y, k) - - def parseGray(self): - self.expect('(', 'after "gray"') - self.skipws() - - g = self.parseValue() - - self.skipws() - self.expect(')', 'at end of "gray') - - self.skipws() - self.expectEnd() - - return Gray(g) - - def parseValue(self): - n = self.parseNumber() - self.skipws() - if self._string[self._pos] == '%': - n = n / 100.0 - self.pos += 1 - return n - - def parseAngle(self): - n = self.parseNumber() - self.skipws() - tok = self.getToken() - if tok == 'rad': - n = n * 180.0 / math.pi - elif tok == 'grad' or tok == 'gon': - n = n * 0.9 - elif tok != 'deg': - raise ValueError('bad angle unit "%s"' % tok) - return n - -_color_re = re.compile('\s*(#|rgb|hsl|hwb|cmyk|gray|grey|%s)' - % '|'.join(_x11_colors.keys())) -def isAColor(s): - return _color_re.match(s) - -def parseColor(s): - return ColorParser(s).parseColor() diff --git a/node_modules/dmg-builder/vendor/dmgbuild/core.py b/node_modules/dmg-builder/vendor/dmgbuild/core.py deleted file mode 100644 index ee1abe6..0000000 --- a/node_modules/dmg-builder/vendor/dmgbuild/core.py +++ /dev/null @@ -1,582 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import json -import os -import pkg_resources -import re -import shutil -import subprocess -import sys -import tempfile -import tokenize - -try: - {}.iteritems - iteritems = lambda x: x.iteritems() - iterkeys = lambda x: x.iterkeys() -except AttributeError: - iteritems = lambda x: x.items() - iterkeys = lambda x: x.keys() -try: - unicode -except NameError: - unicode = str - -import biplist -from mac_alias import * -from ds_store import * - -from . import colors - -try: - from . import badge -except ImportError: - badge = None - -_hexcolor_re = re.compile(r'#[0-9a-f]{3}(?:[0-9a-f]{3})?') - -class DMGError(Exception): - pass - -def hdiutil(cmd, *args, **kwargs): - plist = kwargs.get('plist', True) - all_args = ['/usr/bin/hdiutil', cmd] - all_args.extend(args) - if plist: - all_args.append('-plist') - p = subprocess.Popen(all_args, stdout=subprocess.PIPE, close_fds=True) - output, errors = p.communicate() - if plist: - results = biplist.readPlistFromString(output) - else: - results = output - retcode = p.wait() - return retcode, results - -# On Python 2 we can just execfile() it, but Python 3 deprecated that -def load_settings(filename, settings): - if sys.version_info[0] == 2: - execfile(filename, settings, settings) - else: - encoding = 'utf-8' - with open(filename, 'rb') as fp: - try: - encoding = tokenize.detect_encoding(fp.readline)[0] - except SyntaxError: - pass - - with open(filename, 'r', encoding=encoding) as fp: - exec(compile(fp.read(), filename, 'exec'), settings, settings) - -def load_json(filename, settings): - """Read an appdmg .json spec. Uses the defaults for appdmg, rather than - the usual defaults for dmgbuild. """ - - with open(filename, 'r') as fp: - json_data = json.load(fp) - - if 'title' not in json_data: - raise ValueError('missing \'title\' in JSON settings file') - if 'contents' not in json_data: - raise ValueError('missing \'contents\' in JSON settings file') - - settings['volume_name'] = json_data['title'] - settings['icon'] = json_data.get('icon', None) - settings['badge_icon'] = json_data.get('badge-icon', None) - bk = json_data.get('background', None) - if bk is None: - bk = json_data.get('background-color', None) - if bk is not None: - settings['background'] = bk - settings['icon_size'] = json_data.get('icon-size', 80) - wnd = json_data.get('window', { 'position': (100, 100), - 'size': (640, 480) }) - pos = wnd.get('position', { 'x': 100, 'y': 100 }) - siz = wnd.get('size', { 'width': 640, 'height': 480 }) - settings['window_rect'] = ((pos.get('x', 100), pos.get('y', 100)), - (siz.get('width', 640), siz.get('height', 480))) - settings['format'] = json_data.get('format', 'UDZO') - settings['compression_level'] = json_data.get('compression-level', None) - settings['license'] = json_data.get('license', None) - files = [] - symlinks = {} - icon_locations = {} - for fileinfo in json_data.get('contents', []): - if 'path' not in fileinfo: - raise ValueError('missing \'path\' in contents in JSON settings file') - if 'x' not in fileinfo: - raise ValueError('missing \'x\' in contents in JSON settings file') - if 'y' not in fileinfo: - raise ValueError('missing \'y\' in contents in JSON settings file') - - kind = fileinfo.get('type', 'file') - path = fileinfo['path'] - name = fileinfo.get('name', os.path.basename(path.rstrip('/'))) - if kind == 'file': - files.append((path, name)) - elif kind == 'link': - symlinks[name] = path - elif kind == 'position': - pass - icon_locations[name] = (fileinfo['x'], fileinfo['y']) - - settings['files'] = files - settings['symlinks'] = symlinks - settings['icon_locations'] = icon_locations - -def build_dmg(filename, volume_name, settings_file=None, settings={}, - defines={}, lookForHiDPI=True): - options = { - # Default settings - 'filename': filename, - 'volume_name': volume_name, - 'format': 'UDBZ', - 'compression_level': None, - 'size': None, - 'files': [], - 'symlinks': {}, - 'icon': None, - 'badge_icon': None, - 'background': None, - 'show_status_bar': False, - 'show_tab_view': False, - 'show_toolbar': False, - 'show_pathbar': False, - 'show_sidebar': False, - 'sidebar_width': 180, - 'arrange_by': None, - 'grid_offset': (0, 0), - 'grid_spacing': 100.0, - 'scroll_position': (0.0, 0.0), - 'show_icon_preview': False, - 'show_item_info': False, - 'label_pos': 'bottom', - 'text_size': 16.0, - 'icon_size': 128.0, - 'include_icon_view_settings': 'auto', - 'include_list_view_settings': 'auto', - 'list_icon_size': 16.0, - 'list_text_size': 12.0, - 'list_scroll_position': (0, 0), - 'list_sort_by': 'name', - 'list_use_relative_dates': True, - 'list_calculate_all_sizes': False, - 'list_columns': ('name', 'date-modified', 'size', 'kind', 'date-added'), - 'list_column_widths': { - 'name': 300, - 'date-modified': 181, - 'date-created': 181, - 'date-added': 181, - 'date-last-opened': 181, - 'size': 97, - 'kind': 115, - 'label': 100, - 'version': 75, - 'comments': 300, - }, - 'list_column_sort_directions': { - 'name': 'ascending', - 'date-modified': 'descending', - 'date-created': 'descending', - 'date-added': 'descending', - 'date-last-opened': 'descending', - 'size': 'descending', - 'kind': 'ascending', - 'label': 'ascending', - 'version': 'ascending', - 'comments': 'ascending', - }, - 'window_rect': ((100, 100), (640, 280)), - 'default_view': 'icon-view', - 'icon_locations': {}, - 'license': None, - 'defines': defines - } - - # Execute the settings file - if settings_file: - # We now support JSON settings files using appdmg's format - if settings_file.endswith('.json'): - load_json(settings_file, options) - else: - load_settings(settings_file, options) - - # Add any overrides - options.update(settings) - - # Set up the finder data - bounds = options['window_rect'] - - bounds_string = '{{%s, %s}, {%s, %s}}' % (bounds[0][0], - bounds[0][1], - bounds[1][0], - bounds[1][1]) - bwsp = { - 'ShowStatusBar': options['show_status_bar'], - 'WindowBounds': bounds_string.encode('utf-8'), - 'ContainerShowSidebar': False, - 'PreviewPaneVisibility': False, - 'SidebarWidth': options['sidebar_width'], - 'ShowTabView': options['show_tab_view'], - 'ShowToolbar': options['show_toolbar'], - 'ShowPathbar': options['show_pathbar'], - 'ShowSidebar': options['show_sidebar'] - } - - arrange_options = { - 'name': 'name', - 'date-modified': 'dateModified', - 'date-created': 'dateCreated', - 'date-added': 'dateAdded', - 'date-last-opened': 'dateLastOpened', - 'size': 'size', - 'kind': 'kind', - 'label': 'label', - } - - icvp = { - 'viewOptionsVersion': 1, - 'backgroundType': 0, - 'backgroundColorRed': 1.0, - 'backgroundColorGreen': 1.0, - 'backgroundColorBlue': 1.0, - 'gridOffsetX': float(options['grid_offset'][0]), - 'gridOffsetY': float(options['grid_offset'][1]), - 'gridSpacing': float(options['grid_spacing']), - 'arrangeBy': str(arrange_options.get(options['arrange_by'], 'none')), - 'showIconPreview': options['show_icon_preview'] == True, - 'showItemInfo': options['show_item_info'] == True, - 'labelOnBottom': options['label_pos'] == 'bottom', - 'textSize': float(options['text_size']), - 'iconSize': float(options['icon_size']), - 'scrollPositionX': float(options['scroll_position'][0]), - 'scrollPositionY': float(options['scroll_position'][1]) - } - - background = options['background'] - - columns = { - 'name': 'name', - 'date-modified': 'dateModified', - 'date-created': 'dateCreated', - 'date-added': 'dateAdded', - 'date-last-opened': 'dateLastOpened', - 'size': 'size', - 'kind': 'kind', - 'label': 'label', - 'version': 'version', - 'comments': 'comments' - } - - default_widths = { - 'name': 300, - 'date-modified': 181, - 'date-created': 181, - 'date-added': 181, - 'date-last-opened': 181, - 'size': 97, - 'kind': 115, - 'label': 100, - 'version': 75, - 'comments': 300, - } - - default_sort_directions = { - 'name': 'ascending', - 'date-modified': 'descending', - 'date-created': 'descending', - 'date-added': 'descending', - 'date-last-opened': 'descending', - 'size': 'descending', - 'kind': 'ascending', - 'label': 'ascending', - 'version': 'ascending', - 'comments': 'ascending', - } - - lsvp = { - 'viewOptionsVersion': 1, - 'sortColumn': columns.get(options['list_sort_by'], 'name'), - 'textSize': float(options['list_text_size']), - 'iconSize': float(options['list_icon_size']), - 'showIconPreview': options['show_icon_preview'], - 'scrollPositionX': options['list_scroll_position'][0], - 'scrollPositionY': options['list_scroll_position'][1], - 'useRelativeDates': options['list_use_relative_dates'], - 'calculateAllSizes': options['list_calculate_all_sizes'], - } - - lsvp['columns'] = {} - cndx = {} - - for n, column in enumerate(options['list_columns']): - cndx[column] = n - width = options['list_column_widths'].get(column, - default_widths[column]) - asc = 'ascending' == options['list_column_sort_directions'].get(column, - default_sort_directions[column]) - - lsvp['columns'][columns[column]] = { - 'index': n, - 'width': width, - 'identifier': columns[column], - 'visible': True, - 'ascending': asc - } - - n = len(options['list_columns']) - for k in iterkeys(columns): - if cndx.get(k, None) is None: - cndx[k] = n - width = default_widths[k] - asc = 'ascending' == default_sort_directions[k] - - lsvp['columns'][columns[column]] = { - 'index': n, - 'width': width, - 'identifier': columns[column], - 'visible': False, - 'ascending': asc - } - - n += 1 - - default_view = options['default_view'] - views = { - 'icon-view': b'icnv', - 'column-view': b'clmv', - 'list-view': b'Nlsv', - 'coverflow': b'Flwv' - } - - icvl = (b'type', views.get(default_view, 'icnv')) - - include_icon_view_settings = default_view == 'icon-view' \ - or options['include_icon_view_settings'] not in \ - ('auto', 'no', 0, False, None) - include_list_view_settings = default_view in ('list-view', 'coverflow') \ - or options['include_list_view_settings'] not in \ - ('auto', 'no', 0, False, None) - - filename = options['filename'] - volume_name = options['volume_name'] - - # Construct a writeable image to start with - dirname, basename = os.path.split(os.path.realpath(filename)) - if not basename.endswith('.dmg'): - basename += '.dmg' - writableFile = tempfile.NamedTemporaryFile(dir=dirname, prefix='.temp', - suffix=basename) - - total_size = options['size'] - if total_size == None: - # Start with a size of 128MB - this way we don't need to calculate the - # size of the background image, volume icon, and .DS_Store file (and - # 128 MB should be well sufficient for even the most outlandish image - # sizes, like an uncompressed 5K multi-resolution TIFF) - total_size = 128 * 1024 * 1024 - - def roundup(x, n): - return x if x % n == 0 else x + n - x % n - - for path in options['files']: - if isinstance(path, tuple): - path = path[0] - - if not os.path.islink(path) and os.path.isdir(path): - for dirpath, dirnames, filenames in os.walk(path): - for f in filenames: - fp = os.path.join(dirpath, f) - total_size += roundup(os.lstat(fp).st_size, 4096) - else: - total_size += roundup(os.lstat(path).st_size, 4096) - - for name,target in iteritems(options['symlinks']): - total_size += 4096 - - total_size = str(max(total_size / 1024, 1024)) + 'K' - - ret, output = hdiutil('create', - '-ov', - '-volname', volume_name, - '-fs', 'HFS+', - '-fsargs', '-c c=64,a=16,e=16', - '-size', total_size, - writableFile.name) - - if ret: - raise DMGError('Unable to create disk image') - - ret, output = hdiutil('attach', - '-nobrowse', - '-owners', 'off', - '-noidme', - writableFile.name) - - if ret: - raise DMGError('Unable to attach disk image') - - try: - for info in output['system-entities']: - if info.get('mount-point', None): - device = info['dev-entry'] - mount_point = info['mount-point'] - - icon = options['icon'] - if badge: - badge_icon = options['badge_icon'] - else: - badge_icon = None - icon_target_path = os.path.join(mount_point, '.VolumeIcon.icns') - if icon: - shutil.copyfile(icon, icon_target_path) - elif badge_icon: - badge.badge_disk_icon(badge_icon, icon_target_path) - - if icon or badge_icon: - subprocess.call(['/usr/bin/SetFile', '-a', 'C', mount_point]) - - background_bmk = None - - if not isinstance(background, (str, unicode)): - pass - elif colors.isAColor(background): - c = colors.parseColor(background).to_rgb() - - icvp['backgroundType'] = 1 - icvp['backgroundColorRed'] = float(c.r) - icvp['backgroundColorGreen'] = float(c.g) - icvp['backgroundColorBlue'] = float(c.b) - else: - if os.path.isfile(background): - # look to see if there are HiDPI resources available - - if lookForHiDPI is True: - name, extension = os.path.splitext(os.path.basename(background)) - orderedImages = [background] - imageDirectory = os.path.dirname(background) - if imageDirectory == '': - imageDirectory = '.' - for candidateName in os.listdir(imageDirectory): - hasScale = re.match( - '^(?P.+)@(?P\d+)x(?P\.\w+)$', - candidateName) - if hasScale and name == hasScale.group('name') and \ - extension == hasScale.group('extension'): - scale = int(hasScale.group('scale')) - if len(orderedImages) < scale: - orderedImages += [None] * (scale - len(orderedImages)) - orderedImages[scale - 1] = os.path.join(imageDirectory, candidateName) - - if len(orderedImages) > 1: - # compile the grouped tiff - backgroundFile = tempfile.NamedTemporaryFile(suffix='.tiff') - background = backgroundFile.name - output = tempfile.TemporaryFile(mode='w+') - try: - subprocess.check_call( - ['/usr/bin/tiffutil', '-cathidpicheck'] + - filter(None, orderedImages) + - ['-out', background], stdout=output, stderr=output) - except Exception as e: - output.seek(0) - raise ValueError( - 'unable to compile combined HiDPI file "%s" got error: %s\noutput: %s' - % (background, str(e), output.read())) - - _, kind = os.path.splitext(background) - path_in_image = os.path.join(mount_point, '.background' + kind) - shutil.copyfile(background, path_in_image) - elif pkg_resources.resource_exists('dmgbuild', 'resources/' + background + '.tiff'): - tiffdata = pkg_resources.resource_string( - 'dmgbuild', - 'resources/' + background + '.tiff') - path_in_image = os.path.join(mount_point, '.background.tiff') - - with open(path_in_image, 'wb') as f: - f.write(tiffdata) - else: - raise ValueError('background file "%s" not found' % background) - - alias = Alias.for_file(path_in_image) - background_bmk = Bookmark.for_file(path_in_image) - - icvp['backgroundType'] = 2 - icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes()) - - for f in options['files']: - if isinstance(f, tuple): - f_in_image = os.path.join(mount_point, f[1]) - f = f[0] - else: - basename = os.path.basename(f.rstrip('/')) - f_in_image = os.path.join(mount_point, basename) - - # use system ditto command to preserve code signing, etc. - subprocess.call(['/usr/bin/ditto', f, f_in_image]) - - for name,target in iteritems(options['symlinks']): - name_in_image = os.path.join(mount_point, name) - os.symlink(target, name_in_image) - - userfn = options.get('create_hook', None) - if callable(userfn): - userfn(mount_point, options) - - image_dsstore = os.path.join(mount_point, '.DS_Store') - - with DSStore.open(image_dsstore, 'w+') as d: - d['.']['vSrn'] = ('long', 1) - d['.']['bwsp'] = bwsp - if include_icon_view_settings: - d['.']['icvp'] = icvp - if background_bmk: - d['.']['pBBk'] = background_bmk - if include_list_view_settings: - d['.']['lsvp'] = lsvp - d['.']['icvl'] = icvl - - for k,v in iteritems(options['icon_locations']): - d[k]['Iloc'] = v - - # Delete .Trashes, if it gets created - shutil.rmtree(os.path.join(mount_point, '.Trashes'), True) - except: - # Always try to detach - hdiutil('detach', '-force', device, plist=False) - raise - - ret, output = hdiutil('detach', device, plist=False) - - if ret: - hdiutil('detach', '-force', device, plist=False) - raise DMGError('Unable to detach device cleanly') - - # Shrink the output to the minimum possible size - ret, output = hdiutil('resize', - '-quiet', - '-sectors', 'min', - writableFile.name, - plist=False) - - if ret: - raise DMGError('Unable to shrink') - - key_prefix = {'UDZO': 'zlib', 'UDBZ': 'bzip2', 'ULFO': 'lzfse'} - compression_level = options['compression_level'] - if options['format'] in key_prefix and compression_level: - compression_args = [ - '-imagekey', - key_prefix[options['format']] + '-level=' + str(compression_level) - ] - else: - compression_args = [] - - ret, output = hdiutil('convert', writableFile.name, - '-format', options['format'], - '-ov', - '-o', filename, *compression_args) - - if ret: - raise DMGError('Unable to convert') \ No newline at end of file diff --git a/node_modules/dmg-builder/vendor/dmgbuild/resources.py b/node_modules/dmg-builder/vendor/dmgbuild/resources.py deleted file mode 100644 index d2f58e6..0000000 --- a/node_modules/dmg-builder/vendor/dmgbuild/resources.py +++ /dev/null @@ -1,355 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import struct - -class Resource (object): - def __init__(self, res_type, res_id, res_name, data=None, res_attrs=0): - self.res_type = str(res_type) - self.res_id = res_id - if isinstance(res_name, basestring): - res_name = str(res_name) - self.res_name = res_name - self.res_attrs = res_attrs - if data is None: - self.data = None - self.data = str(data) - - self.data_offset = None - self.name_offset = None - - def __repr__(self): - return 'Resource(%r, %r, %r, data=%r, res_attrs=%r)' % (self.res_type, - self.res_id, - self.res_name, - self.data, - self.res_attrs) - -class TMPLResource (Resource): - def __init__(self, res_id, res_name, tmpl, res_attrs=0): - data = [] - for name,typecode in tmpl: - data.append(struct.pack(b'B', len(name))) - data.append(str(name)) - data.append(str(typecode)) - super(TMPLResource, self).__init__(b'TMPL', res_id, res_name, - b''.join(data), res_attrs) - -class StringListResource (Resource): - def __init__(self, res_id, res_name, strings, res_attrs=0): - data = [] - data.append(struct.pack(b'>H', len(strings))) - for s in strings: - data.append(struct.pack(b'B', len(s))) - data.append(str(s)) - super(StringListResource, self).__init__(b'STR#', res_id, res_name, - b''.join(data), res_attrs) - -class TextResource (Resource): - def __init__(self, res_id, res_name, string, res_attrs=0): - super(TextResource, self).__init__(b'TEXT', res_id, res_name, - str(string), res_attrs) - -class Style (object): - # Fonts - NewYork = 2 - Geneva = 3 - Monaco = 4 - Venice = 5 - London = 6 - Athens = 7 - SanFrancisco = 8 - Toronto = 9 - Cairo = 11 - LosAngeles = 12 - Times = 20 - Helvetica = 21 - Courier = 22 - Symbol = 23 - Mobile = 24 - - # Styles - Bold = 0x0100 - Italic = 0x0200 - Underline = 0x0400 - Outline = 0x0800 - Shadow = 0x1000 - Condense = 0x2000 - Expand = 0x4000 - - def __init__(self, start_character, height, ascent, font_id, face, - size, color): - self.start_character = start_character - self.height = height - self.ascent = ascent - self.font_id = font_id - self.face = face - self.size = size - self.color = color - - def __repr__(self): - styles = [] - if self.face & Style.Bold: - styles.append('Style.Bold') - if self.face & Style.Italic: - styles.append('Style.Italic') - if self.face & Style.Underline: - styles.append('Style.Underline') - if self.face & Style.Outline: - styles.append('Style.Outline') - if self.face & Style.Shadow: - styles.append('Style.Shadow') - if self.face & Style.Condense: - styles.append('Style.Condense') - if self.face & Style.Expand: - styles.append('Style.Expand') - if self.face & ~0x4f00: - styles.append('%#06x' % (self.face & ~0x4f00)) - if styles: - styles = '|'.join(styles) - else: - styles = '0' - - font_revmap = { - 2: 'Style.NewYork', - 3: 'Style.Geneva', - 4: 'Style.Monaco', - 5: 'Style.Venice', - 6: 'Style.London', - 7: 'Style.Athens', - 8: 'Style.SanFrancisco', - 9: 'Style.Toronto', - 11: 'Style.Cairo', - 12: 'Style.LosAngeles', - 20: 'Style.Times', - 21: 'Style.Helvetica', - 22: 'Style.Courier', - 23: 'Style.Symbol', - 24: 'Style.Mobile' - } - - font = font_revmap.get(self.font_id, '%s' % self.font_id) - - return 'Style(%r, %r, %r, %s, %s, %r, %r)' % ( - self.start_character, - self.height, - self.ascent, - font, - styles, - self.size, - self.color) - -class StyleResource (Resource): - def __init__(self, res_id, res_name, styles, res_attrs=0): - data = [] - data.append(struct.pack(b'>H', len(styles))) - for style in styles: - data.append(struct.pack(b'>LHHHHHHHH', - style.start_character, - style.height, - style.ascent, - style.font_id, - style.face, - style.size, - style.color[0], - style.color[1], - style.color[2])) - super(StyleResource, self).__init__(b'styl', res_id, res_name, - b''.join(data), res_attrs) - -class ResourceFork (object): - def __init__(self, resources=None): - self.types = {} - self.attrs = 0 - if resources is not None: - for res in resources: - self.add(res) - - @classmethod - def from_data(clss, data): - if len(data) < 16: - raise ValueError('Bad resource data - data too short') - - # Read the header - data_start, map_start, data_len, map_len = struct.unpack(b'>LLLL', - data[0:16]) - - if data_start + data_len > len(data): - raise ValueError('Bad resource data - data out of range') - if map_start + map_len > len(data): - raise ValueError('Bad resource data - map out of range') - if map_len < 30: - raise ValueError('Bad resource data - map too short') - - # Read the map header - fork_attrs, type_offset, name_offset, max_type_ndx \ - = struct.unpack(b'>HHHH', data[map_start + 22:map_start + 30]) - num_types = max_type_ndx + 1 - - if type_offset + 8 * num_types > map_len: - raise ValueError('Bad resource data - type data outside map') - - if name_offset > map_len: - raise ValueError('Bad resource data - names outside map') - - type_offset += map_start - name_offset += map_start - - result = ResourceFork() - - # Now read the type list - for ntype in range(0, num_types): - type_pos = 2 + type_offset + 8 * ntype - res_type, max_item_ndx, ref_offset \ - = struct.unpack(b'>4sHH', data[type_pos:type_pos+8]) - num_items = max_item_ndx + 1 - - result.types[res_type] = [] - - ref_list_offset = type_offset + ref_offset - if ref_list_offset + 12 * num_items > map_start + map_len: - raise ValueError('Bad resource data - ref list outside map') - - for nitem in range(0, num_items): - ref_elt = ref_list_offset + 12 * nitem - res_id, res_name_offset, data_offset \ - = struct.unpack(b'>hHL', data[ref_elt:ref_elt+8]) - - res_attrs = data_offset >> 24 - data_offset &= 0xffffff - - if data_offset >= data_len: - raise ValueError('Bad resource data - item data out of range') - - data_offset += data_start - res_len = struct.unpack(b'>L', data[data_offset:data_offset+4])[0] - if data_offset + res_len >= data_start + data_len: - raise ValueError('Bad resource data - item data too large') - - res_data = data[data_offset + 4:data_offset + res_len + 4] - - if res_name_offset == 0xffff: - res_name = None - else: - res_name_offset += name_offset - if res_name_offset >= map_start + map_len: - raise ValueError('Bad resource data - name out of range') - res_name_len = struct.unpack(b'B', data[res_name_offset])[0] - res_name = data[res_name_offset + 1:res_name_offset + res_name_len + 1] - - result.types[res_type].append(Resource(res_type, res_id, - res_name, - res_data, res_attrs)) - - return result - - @classmethod - def from_file(clss, filename): - with open(filename + '/..namedfork/rsrc', 'rb') as f: - data = f.read() - return clss.from_data(data) - - def to_data(self): - data = [] - data_len = 0 - names = [] - names_len = 0 - types_len = len(self.types) * 8 - types_data = [] - reflist_data = [] - reflist_len = 0 - - for res_type, items in self.types.items(): - types_data.append(struct.pack(b'>4sHH', - res_type, - len(items) - 1, - 2 + types_len + reflist_len)) - for item in items: - data_offset = data_len - - if item.res_name is None: - name_offset = 65535 - else: - name_offset = names_len - n = str(item.res_name) - names.append(struct.pack(b'B', len(n)) + n) - names_len += 1 + len(n) - - if item.data is None: - data_len += 4 - else: - data_len += 4 + (len(item.data) + 3) & ~3 - - reflist_len += 12 - reflist_data.append(struct.pack(b'>hHLL', - item.res_id, - name_offset, - (item.res_attrs << 24) \ - | data_offset, - 0)) - - # Header - data.append(struct.pack(b'>LLLL240s', 256, 256 + data_len, data_len, - 30 + types_len + reflist_len + names_len, - b'')) - - # Resource data - for res_type, items in self.types.items(): - for item in items: - if item.data is None: - dlen = 0 - else: - dlen = len(item.data) - plen = (dlen + 3) & ~3 - data.append(struct.pack(b'>L', dlen)) - if item.data is not None: - data.append(item.data) - if plen != dlen: - data.append(b'\0' * (plen - dlen)) - - # Resource map header - data.append(struct.pack(b'>16sLHHHHH', - b'', 0, 0, - self.attrs, 28, 30 + types_len + reflist_len, - len(self.types) - 1)) - - # Type list - data.append(b''.join(types_data)) - - # Reference lists - data.append(b''.join(reflist_data)) - - # Name list - data.append(b''.join(names)) - - return b''.join(data) - - def write_to_file(self, filename): - with open(filename + '/..namedfork/rsrc', 'wb') as f: - f.write(self.to_data()) - - def __len__(self): - return len(self.types) - - def __getitem__(self, key): - return self.types[key] - - def __iter__(self): - for res_type, items in self.types.items(): - for item in items: - yield item - - def __repr__(self): - output = [] - for item in self: - output.append(repr(item)) - return 'ResourceFork([%s])' % ', '.join(output) - - def add(self, res): - if res.res_type in self.types: - self.types[res.res_type].append(res) - else: - self.types[res.res_type] = [res] - - def remove(self, res): - self.types[res.res_type].remove(res) diff --git a/node_modules/dmg-builder/vendor/ds_store/__init__.py b/node_modules/dmg-builder/vendor/ds_store/__init__.py deleted file mode 100644 index a6b8121..0000000 --- a/node_modules/dmg-builder/vendor/ds_store/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .store import DSStore, DSStoreEntry - -__all__ = ['DSStore', 'DSStoreEntry'] diff --git a/node_modules/dmg-builder/vendor/ds_store/buddy.py b/node_modules/dmg-builder/vendor/ds_store/buddy.py deleted file mode 100644 index 320768c..0000000 --- a/node_modules/dmg-builder/vendor/ds_store/buddy.py +++ /dev/null @@ -1,478 +0,0 @@ -# -*- coding: utf-8 -*- -import os -import bisect -import struct -import binascii - -try: - {}.iterkeys - iterkeys = lambda x: x.iterkeys() -except AttributeError: - iterkeys = lambda x: x.keys() -try: - unicode -except NameError: - unicode = str - -class BuddyError(Exception): - pass - -class Block(object): - def __init__(self, allocator, offset, size): - self._allocator = allocator - self._offset = offset - self._size = size - self._value = bytearray(allocator.read(offset, size)) - self._pos = 0 - self._dirty = False - - def __len__(self): - return self._size - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._dirty: - self.flush() - - def flush(self): - if self._dirty: - self._dirty = False - self._allocator.write(self._offset, self._value) - - def invalidate(self): - self._dirty = False - - def zero_fill(self): - len = self._size - self._pos - zeroes = b'\0' * len - self._value[self._pos:self._size] = zeroes - self._dirty = True - - def tell(self): - return self._pos - - def seek(self, pos, whence=os.SEEK_SET): - if whence == os.SEEK_CUR: - pos += self._pos - elif whence == os.SEEK_END: - pos = self._size - pos - - if pos < 0 or pos > self._size: - raise ValueError('Seek out of range in Block instance') - - self._pos = pos - - def read(self, size_or_format): - if isinstance(size_or_format, (str, unicode, bytes)): - size = struct.calcsize(size_or_format) - fmt = size_or_format - else: - size = size_or_format - fmt = None - - if self._size - self._pos < size: - raise BuddyError('Unable to read %lu bytes in block' % size) - - data = self._value[self._pos:self._pos + size] - self._pos += size - - if fmt is not None: - if isinstance(data, bytearray): - return struct.unpack_from(fmt, bytes(data)) - else: - return struct.unpack(fmt, data) - else: - return data - - def write(self, data_or_format, *args): - if len(args): - data = struct.pack(data_or_format, *args) - else: - data = data_or_format - - if self._pos + len(data) > self._size: - raise ValueError('Attempt to write past end of Block') - - self._value[self._pos:self._pos + len(data)] = data - self._pos += len(data) - - self._dirty = True - - def insert(self, data_or_format, *args): - if len(args): - data = struct.pack(data_or_format, *args) - else: - data = data_or_format - - del self._value[-len(data):] - self._value[self._pos:self._pos] = data - self._pos += len(data) - - self._dirty = True - - def delete(self, size): - if self._pos + size > self._size: - raise ValueError('Attempt to delete past end of Block') - del self._value[self._pos:self._pos + size] - self._value += b'\0' * size - self._dirty = True - - def __str__(self): - return binascii.b2a_hex(self._value) - -class Allocator(object): - def __init__(self, the_file): - self._file = the_file - self._dirty = False - - self._file.seek(0) - - # Read the header - magic1, magic2, offset, size, offset2, self._unknown1 \ - = self.read(-4, '>I4sIII16s') - - if magic2 != b'Bud1' or magic1 != 1: - raise BuddyError('Not a buddy file') - - if offset != offset2: - raise BuddyError('Root addresses differ') - - self._root = Block(self, offset, size) - - # Read the block offsets - count, self._unknown2 = self._root.read('>II') - self._offsets = [] - c = (count + 255) & ~255 - while c: - self._offsets += self._root.read('>256I') - c -= 256 - self._offsets = self._offsets[:count] - - # Read the TOC - self._toc = {} - count = self._root.read('>I')[0] - for n in range(count): - nlen = self._root.read('B')[0] - name = bytes(self._root.read(nlen)) - value = self._root.read('>I')[0] - self._toc[name] = value - - # Read the free lists - self._free = [] - for n in range(32): - count = self._root.read('>I') - self._free.append(list(self._root.read('>%uI' % count))) - - @classmethod - def open(cls, file_or_name, mode='r+'): - if isinstance(file_or_name, (str, unicode)): - if not 'b' in mode: - mode = mode[:1] + 'b' + mode[1:] - f = open(file_or_name, mode) - else: - f = file_or_name - - if 'w' in mode: - # Create an empty file in this case - f.truncate() - - # An empty root block needs 1264 bytes: - # - # 0 4 offset count - # 4 4 unknown - # 8 4 root block offset (2048) - # 12 255 * 4 padding (offsets are in multiples of 256) - # 1032 4 toc count (0) - # 1036 228 free list - # total 1264 - - # The free list will contain the following: - # - # 0 5 * 4 no blocks of width less than 5 - # 20 6 * 8 1 block each of widths 5 to 10 - # 68 4 no blocks of width 11 (allocated for the root) - # 72 19 * 8 1 block each of widths 12 to 30 - # 224 4 no blocks of width 31 - # total 228 - # - # (The reason for this layout is that we allocate 2**5 bytes for - # the header, which splits the initial 2GB region into every size - # below 2**31, including *two* blocks of size 2**5, one of which - # we take. The root block itself then needs a block of size - # 2**11. Conveniently, each of these initial blocks will be - # located at offset 2**n where n is its width.) - - # Write the header - header = struct.pack(b'>I4sIII16s', - 1, b'Bud1', - 2048, 1264, 2048, - b'\x00\x00\x10\x0c' - b'\x00\x00\x00\x87' - b'\x00\x00\x20\x0b' - b'\x00\x00\x00\x00') - f.write(header) - f.write(b'\0' * 2016) - - # Write the root block - free_list = [struct.pack(b'>5I', 0, 0, 0, 0, 0)] - for n in range(5, 11): - free_list.append(struct.pack(b'>II', 1, 2**n)) - free_list.append(struct.pack(b'>I', 0)) - for n in range(12, 31): - free_list.append(struct.pack(b'>II', 1, 2**n)) - free_list.append(struct.pack(b'>I', 0)) - - root = b''.join([struct.pack(b'>III', 1, 0, 2048 | 5), - struct.pack(b'>I', 0) * 255, - struct.pack(b'>I', 0)] + free_list) - f.write(root) - - return Allocator(f) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - self.flush() - self._file.close() - - def flush(self): - if self._dirty: - size = self._root_block_size() - self.allocate(size, 0) - with self.get_block(0) as rblk: - self._write_root_block_into(rblk) - - addr = self._offsets[0] - offset = addr & ~0x1f - size = 1 << (addr & 0x1f) - - self._file.seek(0, os.SEEK_SET) - self._file.write(struct.pack(b'>I4sIII16s', - 1, b'Bud1', - offset, size, offset, - self._unknown1)) - - self._dirty = False - - self._file.flush() - - def read(self, offset, size_or_format): - """Read data at `offset', or raise an exception. `size_or_format' - may either be a byte count, in which case we return raw data, - or a format string for `struct.unpack', in which case we - work out the size and unpack the data before returning it.""" - # N.B. There is a fixed offset of four bytes(!) - self._file.seek(offset + 4, os.SEEK_SET) - - if isinstance(size_or_format, (str, unicode)): - size = struct.calcsize(size_or_format) - fmt = size_or_format - else: - size = size_or_format - fmt = None - - ret = self._file.read(size) - if len(ret) < size: - ret += b'\0' * (size - len(ret)) - - if fmt is not None: - if isinstance(ret, bytearray): - ret = struct.unpack_from(fmt, bytes(ret)) - else: - ret = struct.unpack(fmt, ret) - - return ret - - def write(self, offset, data_or_format, *args): - """Write data at `offset', or raise an exception. `data_or_format' - may either be the data to write, or a format string for `struct.pack', - in which case we pack the additional arguments and write the - resulting data.""" - # N.B. There is a fixed offset of four bytes(!) - self._file.seek(offset + 4, os.SEEK_SET) - - if len(args): - data = struct.pack(data_or_format, *args) - else: - data = data_or_format - - self._file.write(data) - - def get_block(self, block): - try: - addr = self._offsets[block] - except IndexError: - return None - - offset = addr & ~0x1f - size = 1 << (addr & 0x1f) - - return Block(self, offset, size) - - def _root_block_size(self): - """Return the number of bytes required by the root block.""" - # Offsets - size = 8 - size += 4 * ((len(self._offsets) + 255) & ~255) - - # TOC - size += 4 - size += sum([5 + len(s) for s in self._toc]) - - # Free list - size += sum([4 + 4 * len(fl) for fl in self._free]) - - return size - - def _write_root_block_into(self, block): - # Offsets - block.write('>II', len(self._offsets), self._unknown2) - block.write('>%uI' % len(self._offsets), *self._offsets) - extra = len(self._offsets) & 255 - if extra: - block.write(b'\0\0\0\0' * (256 - extra)) - - # TOC - keys = list(self._toc.keys()) - keys.sort() - - block.write('>I', len(keys)) - for k in keys: - block.write('B', len(k)) - block.write(k) - block.write('>I', self._toc[k]) - - # Free list - for w, f in enumerate(self._free): - block.write('>I', len(f)) - if len(f): - block.write('>%uI' % len(f), *f) - - def _buddy(self, offset, width): - f = self._free[width] - b = offset ^ (1 << width) - - try: - ndx = f.index(b) - except ValueError: - ndx = None - - return (f, b, ndx) - - def _release(self, offset, width): - # Coalesce - while True: - f,b,ndx = self._buddy(offset, width) - - if ndx is None: - break - - offset &= b - width += 1 - del f[ndx] - - # Add to the list - bisect.insort(f, offset) - - # Mark as dirty - self._dirty = True - - def _alloc(self, width): - w = width - while not self._free[w]: - w += 1 - while w > width: - offset = self._free[w].pop(0) - w -= 1 - self._free[w] = [offset, offset ^ (1 << w)] - self._dirty = True - return self._free[width].pop(0) - - def allocate(self, bytes, block=None): - """Allocate or reallocate a block such that it has space for at least - `bytes' bytes.""" - if block is None: - # Find the first unused block - try: - block = self._offsets.index(0) - except ValueError: - block = len(self._offsets) - self._offsets.append(0) - - # Compute block width - width = max(bytes.bit_length(), 5) - - addr = self._offsets[block] - offset = addr & ~0x1f - - if addr: - blkwidth = addr & 0x1f - if blkwidth == width: - return block - self._release(offset, width) - self._offsets[block] = 0 - - offset = self._alloc(width) - self._offsets[block] = offset | width - return block - - def release(self, block): - addr = self._offsets[block] - - if addr: - width = addr & 0x1f - offset = addr & ~0x1f - self._release(offset, width) - - if block == len(self._offsets): - del self._offsets[block] - else: - self._offsets[block] = 0 - - def __len__(self): - return len(self._toc) - - def __getitem__(self, key): - if not isinstance(key, (str, unicode)): - raise TypeError('Keys must be of string type') - if not isinstance(key, bytes): - key = key.encode('latin_1') - return self._toc[key] - - def __setitem__(self, key, value): - if not isinstance(key, (str, unicode)): - raise TypeError('Keys must be of string type') - if not isinstance(key, bytes): - key = key.encode('latin_1') - self._toc[key] = value - self._dirty = True - - def __delitem__(self, key): - if not isinstance(key, (str, unicode)): - raise TypeError('Keys must be of string type') - if not isinstance(key, bytes): - key = key.encode('latin_1') - del self._toc[key] - self._dirty = True - - def iterkeys(self): - return iterkeys(self._toc) - - def keys(self): - return iterkeys(self._toc) - - def __iter__(self): - return iterkeys(self._toc) - - def __contains__(self, key): - return key in self._toc - diff --git a/node_modules/dmg-builder/vendor/ds_store/store.py b/node_modules/dmg-builder/vendor/ds_store/store.py deleted file mode 100644 index b6f805b..0000000 --- a/node_modules/dmg-builder/vendor/ds_store/store.py +++ /dev/null @@ -1,1251 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -from __future__ import print_function -from __future__ import division - -import binascii -import struct -import biplist -import mac_alias - -try: - next -except NameError: - next = lambda x: x.next() -try: - unicode -except NameError: - unicode = str - -from . import buddy - -class ILocCodec(object): - @staticmethod - def encode(point): - return struct.pack(b'>IIII', point[0], point[1], - 0xffffffff, 0xffff0000) - - @staticmethod - def decode(bytesData): - if isinstance(bytesData, bytearray): - x, y = struct.unpack_from(b'>II', bytes(bytesData[:8])) - else: - x, y = struct.unpack(b'>II', bytesData[:8]) - return (x, y) - -class PlistCodec(object): - @staticmethod - def encode(plist): - return biplist.writePlistToString(plist) - - @staticmethod - def decode(bytes): - return biplist.readPlistFromString(bytes) - -class BookmarkCodec(object): - @staticmethod - def encode(bmk): - return bmk.to_bytes() - - @staticmethod - def decode(bytes): - return mac_alias.Bookmark.from_bytes(bytes) - -# This list tells the code how to decode particular kinds of entry in the -# .DS_Store file. This is really a convenience, and we currently only -# support a tiny subset of the possible entry types. -codecs = { - b'Iloc': ILocCodec, - b'bwsp': PlistCodec, - b'lsvp': PlistCodec, - b'lsvP': PlistCodec, - b'icvp': PlistCodec, - b'pBBk': BookmarkCodec - } - -class DSStoreEntry(object): - """Holds the data from an entry in a ``.DS_Store`` file. Note that this is - not meant to represent the entry itself---i.e. if you change the type - or value, your changes will *not* be reflected in the underlying file. - - If you want to make a change, you should either use the :class:`DSStore` - object's :meth:`DSStore.insert` method (which will replace a key if it - already exists), or the mapping access mode for :class:`DSStore` (often - simpler anyway). - """ - def __init__(self, filename, code, typecode, value=None): - if str != bytes and type(filename) == bytes: - filename = filename.decode('utf-8') - - if not isinstance(code, bytes): - code = code.encode('latin_1') - - self.filename = filename - self.code = code - self.type = typecode - self.value = value - - @classmethod - def read(cls, block): - """Read a ``.DS_Store`` entry from the containing Block""" - # First read the filename - nlen = block.read(b'>I')[0] - filename = block.read(2 * nlen).decode('utf-16be') - - # Next, read the code and type - code, typecode = block.read(b'>4s4s') - - # Finally, read the data - if typecode == b'bool': - value = block.read(b'>?')[0] - elif typecode == b'long' or typecode == b'shor': - value = block.read(b'>I')[0] - elif typecode == b'blob': - vlen = block.read(b'>I')[0] - value = block.read(vlen) - - codec = codecs.get(code, None) - if codec: - value = codec.decode(value) - typecode = codec - elif typecode == b'ustr': - vlen = block.read(b'>I')[0] - value = block.read(2 * vlen).decode('utf-16be') - elif typecode == b'type': - value = block.read(b'>4s')[0] - elif typecode == b'comp' or typecode == b'dutc': - value = block.read(b'>Q')[0] - else: - raise ValueError('Unknown type code "%s"' % typecode) - - return DSStoreEntry(filename, code, typecode, value) - - def __lt__(self, other): - if not isinstance(other, DSStoreEntry): - raise TypeError('Can only compare against other DSStoreEntry objects') - sfl = self.filename.lower() - ofl = other.filename.lower() - return (sfl < ofl - or (self.filename == other.filename - and self.code < other.code)) - - def __le__(self, other): - if not isinstance(other, DSStoreEntry): - raise TypeError('Can only compare against other DSStoreEntry objects') - sfl = self.filename.lower() - ofl = other.filename.lower() - return (sfl < ofl - or (sfl == ofl - and self.code <= other.code)) - - def __eq__(self, other): - if not isinstance(other, DSStoreEntry): - raise TypeError('Can only compare against other DSStoreEntry objects') - sfl = self.filename.lower() - ofl = other.filename.lower() - return (sfl == ofl - and self.code == other.code) - - def __ne__(self, other): - if not isinstance(other, DSStoreEntry): - raise TypeError('Can only compare against other DSStoreEntry objects') - sfl = self.filename.lower() - ofl = other.filename.lower() - return (sfl != ofl - or self.code != other.code) - - def __gt__(self, other): - if not isinstance(other, DSStoreEntry): - raise TypeError('Can only compare against other DSStoreEntry objects') - sfl = self.filename.lower() - ofl = other.filename.lower() - - selfCode = self.code - if str != bytes and type(selfCode) is bytes: - selfCode = selfCode.decode('utf-8') - otherCode = other.code - if str != bytes and type(otherCode) is bytes: - otherCode = otherCode.decode('utf-8') - - return (sfl > ofl or (sfl == ofl and selfCode > otherCode)) - - def __ge__(self, other): - if not isinstance(other, DSStoreEntry): - raise TypeError('Can only compare against other DSStoreEntry objects') - sfl = self.filename.lower() - ofl = other.filename.lower() - return (sfl > ofl - or (sfl == ofl - and self.code >= other.code)) - - def __cmp__(self, other): - if not isinstance(other, DSStoreEntry): - raise TypeError('Can only compare against other DSStoreEntry objects') - r = cmp(self.filename.lower(), other.filename.lower()) - if r: - return r - return cmp(self.code, other.code) - - def byte_length(self): - """Compute the length of this entry, in bytes""" - utf16 = self.filename.encode('utf-16be') - l = 4 + len(utf16) + 8 - - if isinstance(self.type, unicode): - entry_type = self.type.encode('latin_1') - value = self.value - elif isinstance(self.type, (bytes, str)): - entry_type = self.type - value = self.value - else: - entry_type = b'blob' - value = self.type.encode(self.value) - - if entry_type == b'bool': - l += 1 - elif entry_type == b'long' or entry_type == b'shor': - l += 4 - elif entry_type == b'blob': - l += 4 + len(value) - elif entry_type == b'ustr': - utf16 = value.encode('utf-16be') - l += 4 + len(utf16) - elif entry_type == b'type': - l += 4 - elif entry_type == b'comp' or entry_type == b'dutc': - l += 8 - else: - raise ValueError('Unknown type code "%s"' % entry_type) - - return l - - def write(self, block, insert=False): - """Write this entry to the specified Block""" - if insert: - w = block.insert - else: - w = block.write - - if isinstance(self.type, unicode): - entry_type = self.type.encode('latin_1') - value = self.value - elif isinstance(self.type, (bytes, str)): - entry_type = self.type - value = self.value - else: - entry_type = b'blob' - value = self.type.encode(self.value) - - utf16 = self.filename.encode('utf-16be') - w(b'>I', len(utf16) // 2) - w(utf16) - w(b'>4s4s', self.code, entry_type) - - if entry_type == b'bool': - w(b'>?', value) - elif entry_type == b'long' or entry_type == b'shor': - w(b'>I', value) - elif entry_type == b'blob': - w(b'>I', len(value)) - w(value) - elif entry_type == b'ustr': - utf16 = value.encode('utf-16be') - w(b'>I', len(utf16) // 2) - w(utf16) - elif entry_type == b'type': - if isinstance(value, unicode): - value = value.encode('latin_1') - w(b'>4s', value) - elif entry_type == b'comp' or entry_type == b'dutc': - w(b'>Q', value) - else: - raise ValueError('Unknown type code "%s"' % entry_type) - - def __repr__(self): - return '<%s %s>' % (self.filename, self.code) - -class DSStore(object): - """Python interface to a ``.DS_Store`` file. Works by manipulating the file - on the disk---so this code will work with ``.DS_Store`` files for *very* - large directories. - - A :class:`DSStore` object can be used as if it was a mapping, e.g.:: - - d['foobar.dat']['Iloc'] - - will fetch the "Iloc" record for "foobar.dat", or raise :class:`KeyError` if - there is no such record. If used in this manner, the :class:`DSStore` object - will return (type, value) tuples, unless the type is "blob" and the module - knows how to decode it. - - Currently, we know how to decode "Iloc", "bwsp", "lsvp", "lsvP" and "icvp" - blobs. "Iloc" decodes to an (x, y) tuple, while the others are all decoded - using ``biplist``. - - Assignment also works, e.g.:: - - d['foobar.dat']['note'] = ('ustr', u'Hello World!') - - as does deletion with ``del``:: - - del d['foobar.dat']['note'] - - This is usually going to be the most convenient interface, though - occasionally (for instance when creating a new ``.DS_Store`` file) you - may wish to drop down to using :class:`DSStoreEntry` objects directly.""" - def __init__(self, store): - self._store = store - self._superblk = self._store['DSDB'] - with self._get_block(self._superblk) as s: - self._rootnode, self._levels, self._records, \ - self._nodes, self._page_size = s.read(b'>IIIII') - self._min_usage = 2 * self._page_size // 3 - self._dirty = False - - @classmethod - def open(cls, file_or_name, mode='r+', initial_entries=None): - """Open a ``.DS_Store`` file; pass either a Python file object, or a - filename in the ``file_or_name`` argument and a file access mode in - the ``mode`` argument. If you are creating a new file using the "w" - or "w+" modes, you may also specify a list of entries with which - to initialise the file.""" - store = buddy.Allocator.open(file_or_name, mode) - - if mode == 'w' or mode == 'w+': - superblk = store.allocate(20) - store['DSDB'] = superblk - page_size = 4096 - - if not initial_entries: - root = store.allocate(page_size) - - with store.get_block(root) as rootblk: - rootblk.zero_fill() - - with store.get_block(superblk) as s: - s.write(b'>IIIII', root, 0, 0, 1, page_size) - else: - # Make sure they're in sorted order - initial_entries = list(initial_entries) - initial_entries.sort() - - # Construct the tree - current_level = initial_entries - next_level = [] - levels = [] - ptr_size = 0 - node_count = 0 - while True: - total = 8 - nodes = [] - node = [] - for e in current_level: - new_total = total + ptr_size + e.byte_length() - if new_total > page_size: - nodes.append(node) - next_level.append(e) - total = 8 - node = [] - else: - total = new_total - node.append(e) - if node: - nodes.append(node) - - node_count += len(nodes) - levels.append(nodes) - - if len(nodes) == 1: - break - - current_level = next_level - next_level = [] - ptr_size = 4 - - # Allocate nodes - ptrs = [store.allocate(page_size) for n in range(node_count)] - - # Generate nodes - pointers = [] - prev_pointers = None - for level in levels: - ppndx = 0 - lptrs = ptrs[-len(level):] - del ptrs[-len(level):] - for node in level: - ndx = lptrs.pop(0) - if prev_pointers is None: - with store.get_block(ndx) as block: - block.write(b'>II', 0, len(node)) - for e in node: - e.write(block) - else: - next_node = prev_pointers[ppndx + len(node)] - node_ptrs = prev_pointers[ppndx:ppndx+len(node)] - - with store.get_block(ndx) as block: - block.write(b'>II', next_node, len(node)) - for ptr, e in zip(node_ptrs, node): - block.write(b'>I', ptr) - e.write(block) - - pointers.append(ndx) - prev_pointers = pointers - pointers = [] - - root = prev_pointers[0] - - with store.get_block(superblk) as s: - s.write(b'>IIIII', root, len(levels), len(initial_entries), - node_count, page_size) - - return DSStore(store) - - def _get_block(self, number): - return self._store.get_block(number) - - def flush(self): - """Flush any dirty data back to the file.""" - if self._dirty: - self._dirty = False - - with self._get_block(self._superblk) as s: - s.write(b'>IIIII', self._rootnode, self._levels, self._records, - self._nodes, self._page_size) - self._store.flush() - - def close(self): - """Flush dirty data and close the underlying file.""" - self.flush() - self._store.close() - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - # Internal B-Tree nodes look like this: - # - # [ next | count | (ptr0 | rec0) | (ptr1 | rec1) ... (ptrN | recN) ] - - # Leaf nodes look like this: - # - # [ 0 | count | rec0 | rec1 ... recN ] - - # Iterate over the tree, starting at `node' - def _traverse(self, node): - if node is None: - node = self._rootnode - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - if next_node: - for n in range(count): - ptr = block.read(b'>I')[0] - for e in self._traverse(ptr): - yield e - e = DSStoreEntry.read(block) - yield e - for e in self._traverse(next_node): - yield e - else: - for n in range(count): - e = DSStoreEntry.read(block) - yield e - - # Display the data in `node' - def _dump_node(self, node): - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - print('next: %u\ncount: %u\n' % (next_node, count)) - for n in range(count): - if next_node: - ptr = block.read(b'>I')[0] - print('%8u ' % ptr, end=' ') - else: - print(' ', end=' ') - e = DSStoreEntry.read(block) - print(e, ' (%u)' % e.byte_length()) - print('used: %u' % block.tell()) - - # Display the data in the super block - def _dump_super(self): - print('root: %u\nlevels: %u\nrecords: %u\nnodes: %u\npage-size: %u' \ - % (self._rootnode, self._levels, self._records, - self._nodes, self._page_size)) - - # Splits entries across two blocks, returning one pivot - # - # Tries to balance the block usage across the two as best it can - def _split2(self, blocks, entries, pointers, before, internal): - left_block = blocks[0] - right_block = blocks[1] - - count = len(entries) - - # Find the feasible splits - best_split = None - best_diff = None - total = before[count] - - if 8 + total <= self._page_size: - # We can use a *single* node for this - best_split = count - else: - # Split into two nodes - for n in range(1, count - 1): - left_size = 8 + before[n] - right_size = 8 + total - before[n + 1] - - if left_size > self._page_size: - break - if right_size > self._page_size: - continue - - diff = abs(left_size - right_size) - - if best_split is None or diff < best_diff: - best_split = n - best_diff = diff - - if best_split is None: - return None - - # Write the nodes - left_block.seek(0) - if internal: - next_node = pointers[best_split] - else: - next_node = 0 - left_block.write(b'>II', next_node, best_split) - - for n in range(best_split): - if internal: - left_block.write(b'>I', pointers[n]) - entries[n].write(left_block) - - left_block.zero_fill() - - if best_split == count: - return [] - - right_block.seek(0) - if internal: - next_node = pointers[count] - else: - next_node = 0 - right_block.write(b'>II', next_node, count - best_split - 1) - - for n in range(best_split + 1, count): - if internal: - right_block.write(b'>I', pointers[n]) - entries[n].write(right_block) - - right_block.zero_fill() - - pivot = entries[best_split] - - return [pivot] - - def _split(self, node, entry, right_ptr=0): - self._nodes += 1 - self._dirty = True - new_right = self._store.allocate(self._page_size) - with self._get_block(node) as block, \ - self._get_block(new_right) as right_block: - - # First, measure and extract all the elements - entry_size = entry.byte_length() - entry_pos = None - next_node, count = block.read(b'>II') - if next_node: - entry_size += 4 - pointers = [] - entries = [] - before = [] - total = 0 - for n in range(count): - pos = block.tell() - if next_node: - ptr = block.read(b'>I')[0] - pointers.append(ptr) - e = DSStoreEntry.read(block) - if e > entry: - entry_pos = n - entries.append(entry) - pointers.append(right_ptr) - before.append(total) - total += entry_size - entries.append(e) - before.append(total) - total += block.tell() - pos - before.append(total) - if next_node: - pointers.append(next_node) - - pivot = self._split2([block, right_block], - entries, pointers, before, - bool(next_node))[0] - - self._records += 1 - self._nodes += 1 - self._dirty = True - - return (pivot, new_right) - - # Allocate a new root node containing the element `pivot' and the pointers - # `left' and `right' - def _new_root(self, left, pivot, right): - new_root = self._store.allocate(self._page_size) - with self._get_block(new_root) as block: - block.write(b'>III', right, 1, left) - pivot.write(block) - self._rootnode = new_root - self._levels += 1 - self._nodes += 1 - self._dirty = True - - # Insert an entry into an inner node; `path' is the path from the root - # to `node', not including `node' itself. `right_ptr' is the new node - # pointer (inserted to the RIGHT of `entry') - def _insert_inner(self, path, node, entry, right_ptr): - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - insert_pos = None - insert_ndx = None - n = 0 - while n < count: - pos = block.tell() - ptr = block.read(b'>I')[0] - e = DSStoreEntry.read(block) - if e == entry: - if n == count - 1: - right_ptr = next_node - next_node = ptr - block_seek(pos) - else: - right_ptr = block.read(b'>I')[0] - block.seek(pos + 4) - insert_pos = pos - insert_ndx = n - block.delete(e.byte_length() + 4) - count -= 1 - self._records += 1 - self._dirty = True - continue - elif insert_pos is None and e > entry: - insert_pos = pos - insert_ndx = n - n += 1 - if insert_pos is None: - insert_pos = block.tell() - insert_ndx = count - remaining = self._page_size - block.tell() - - if remaining < entry.byte_length() + 4: - pivot, new_right = self._split(node, entry, right_ptr) - if path: - self._insert_inner(path[:-1], path[-1], pivot, new_right) - else: - self._new_root(node, pivot, new_right) - else: - if insert_ndx == count: - block.seek(insert_pos) - block.write(b'>I', next_node) - entry.write(block) - next_node = right_ptr - else: - block.seek(insert_pos + 4) - entry.write(block, True) - block.insert('>I', right_ptr) - block.seek(0) - count += 1 - block.write(b'>II', next_node, count) - self._records += 1 - self._dirty = True - - # Insert `entry' into the leaf node `node' - def _insert_leaf(self, path, node, entry): - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - insert_pos = None - insert_ndx = None - n = 0 - while n < count: - pos = block.tell() - e = DSStoreEntry.read(block) - if e == entry: - insert_pos = pos - insert_ndx = n - block.seek(pos) - block.delete(e.byte_length()) - count -= 1 - self._records += 1 - self._dirty = True - continue - elif insert_pos is None and e > entry: - insert_pos = pos - insert_ndx = n - n += 1 - if insert_pos is None: - insert_pos = block.tell() - insert_ndx = count - remaining = self._page_size - block.tell() - - if remaining < entry.byte_length(): - pivot, new_right = self._split(node, entry) - if path: - self._insert_inner(path[:-1], path[-1], pivot, new_right) - else: - self._new_root(node, pivot, new_right) - else: - block.seek(insert_pos) - entry.write(block, True) - block.seek(0) - count += 1 - block.write(b'>II', next_node, count) - self._records += 1 - self._dirty = True - - def insert(self, entry): - """Insert ``entry`` (which should be a :class:`DSStoreEntry`) - into the B-Tree.""" - path = [] - node = self._rootnode - while True: - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - if next_node: - for n in range(count): - ptr = block.read(b'>I')[0] - e = DSStoreEntry.read(block) - if entry < e: - next_node = ptr - break - elif entry == e: - # If we find an existing entry the same, replace it - self._insert_inner(path, node, entry, None) - return - path.append(node) - node = next_node - else: - self._insert_leaf(path, node, entry) - return - - # Return usage information for the specified `node' - def _block_usage(self, node): - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - - for n in range(count): - if next_node: - ptr = block.read(b'>I')[0] - e = DSStoreEntry.read(block) - - used = block.tell() - - return (count, used) - - # Splits entries across three blocks, returning two pivots - def _split3(self, blocks, entries, pointers, before, internal): - count = len(entries) - - # Find the feasible splits - best_split = None - best_diff = None - total = before[count] - for n in range(1, count - 3): - left_size = 8 + before[n] - remaining = 16 + total - before[n + 1] - - if left_size > self._page_size: - break - if remaining > 2 * self._page_size: - continue - - for m in range(n + 2, count - 1): - mid_size = 8 + before[m] - before[n + 1] - right_size = 8 + total - before[m + 1] - - if mid_size > self._page_size: - break - if right_size > self._page_size: - continue - - diff = abs(left_size - mid_size) * abs(right_size - mid_size) - - if best_split is None or diff < best_diff: - best_split = (n, m, count) - best_diff = diff - - if best_split is None: - return None - - # Write the nodes - prev_split = -1 - for block, split in zip(blocks, best_split): - block.seek(0) - if internal: - next_node = pointers[split] - else: - next_node = 0 - block.write(b'>II', next_node, split) - - for n in range(prev_split + 1, split): - if internal: - block.write(b'>I', pointers[n]) - entries[n].write(block) - - block.zero_fill() - - prev_split = split - - return (entries[best_split[0]], entries[best_split[1]]) - - # Extract all of the entries from the specified list of `blocks', - # separating them by the specified `pivots'. Also computes the - # amount of space used before each entry. - def _extract(self, blocks, pivots): - pointers = [] - entries = [] - before = [] - total = 0 - ppivots = pivots + [None] - for b,p in zip(blocks, ppivots): - b.seek(0) - next_node, count = b.read(b'>II') - for n in range(count): - pos = b.tell() - if next_node: - ptr = b.read(b'>I')[0] - pointers.append(ptr) - e = DSStoreEntry.read(b) - entries.append(e) - before.append(total) - total += b.tell() - pos - if next_node: - pointers.append(next_node) - if p: - entries.append(p) - before.append(total) - total += p.byte_length() - if next_node: - total += 4 - before.append(total) - - return (entries, pointers, before) - - # Rebalance the specified `node', whose path from the root is `path'. - def _rebalance(self, path, node): - # Can't rebalance the root - if not path: - return - - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - - with self._get_block(path[-1]) as parent: - # Find the left and right siblings and respective pivots - parent_next, parent_count = parent.read(b'>II') - left_pos = None - left_node = None - left_pivot = None - node_pos = None - right_pos = None - right_node = None - right_pivot = None - prev_e = prev_ptr = prev_pos = None - for n in range(parent_count): - pos = parent.tell() - ptr = parent.read(b'>I')[0] - e = DSStoreEntry.read(parent) - - if ptr == node: - node_pos = pos - right_pivot = e - left_pos = prev_pos - left_pivot = prev_e - left_node = prev_ptr - elif prev_ptr == node: - right_node = ptr - right_pos = pos - break - - prev_e = e - prev_ptr = ptr - prev_pos = pos - - if parent_next == node: - node_pos = parent.tell() - left_pos = prev_pos - left_pivot = prev_e - left_node = prev_ptr - elif right_node is None: - right_node = parent_next - right_pos = parent.tell() - - parent_used = parent.tell() - - if left_node and right_node: - with self._get_block(left_node) as left, \ - self._get_block(right_node) as right: - blocks = [left, block, right] - pivots = [left_pivot, right_pivot] - - entries, pointers, before = self._extract(blocks, pivots) - - # If there's a chance that we could use two pages instead - # of three, go for it - pivots = self._split2(blocks, entries, pointers, - before, bool(next_node)) - if pivots is None: - ptrs = [left_node, node, right_node] - pivots = self._split3(blocks, entries, pointers, - before, bool(next_node)) - else: - if pivots: - ptrs = [left_node, node] - else: - ptrs = [left_node] - self._store.release(node) - self._nodes -= 1 - node = left_node - self._store.release(right_node) - self._nodes -= 1 - self._dirty = True - - # Remove the pivots from the parent - with self._get_block(path[-1]) as parent: - if right_node == parent_next: - parent.seek(left_pos) - parent.delete(right_pos - left_pos) - parent_next = left_node - else: - parent.seek(left_pos + 4) - parent.delete(right_pos - left_pos) - parent.seek(0) - parent_count -= 2 - parent.write(b'>II', parent_next, parent_count) - self._records -= 2 - - # Replace with those in pivots - for e,rp in zip(pivots, ptrs[1:]): - self._insert_inner(path[:-1], path[-1], e, rp) - elif left_node: - with self._get_block(left_node) as left: - blocks = [left, block] - pivots = [left_pivot] - - entries, pointers, before = self._extract(blocks, pivots) - - pivots = self._split2(blocks, entries, pointers, - before, bool(next_node)) - - # Remove the pivot from the parent - with self._get_block(path[-1]) as parent: - if node == parent_next: - parent.seek(left_pos) - parent.delete(node_pos - left_pos) - parent_next = left_node - else: - parent.seek(left_pos + 4) - parent.delete(node_pos - left_pos) - parent.seek(0) - parent_count -= 1 - parent.write(b'>II', parent_next, parent_count) - self._records -= 1 - - # Replace the pivot - if pivots: - self._insert_inner(path[:-1], path[-1], pivots[0], node) - elif right_node: - with self._get_block(right_node) as right: - blocks = [block, right] - pivots = [right_pivot] - - entries, pointers, before = self._extract(blocks, pivots) - - pivots = self._split2(blocks, entries, pointers, - before, bool(next_node)) - - # Remove the pivot from the parent - with self._get_block(path[-1]) as parent: - if right_node == parent_next: - parent.seek(pos) - parent.delete(right_pos - node_pos) - parent_next = node - else: - parent.seek(pos + 4) - parent.delete(right_pos - node_pos) - parent.seek(0) - parent_count -= 1 - parent.write(b'>II', parent_next, parent_count) - self._records -= 1 - - # Replace the pivot - if pivots: - self._insert_inner(path[:-1], path[-1], pivots[0], - right_node) - - if not path and not parent_count: - self._store.release(path[-1]) - self._nodes -= 1 - self._dirty = True - self._rootnode = node - else: - count, used = self._block_usage(path[-1]) - - if used < self._page_size // 2: - self._rebalance(path[:-1], path[-1]) - - # Delete from the leaf node `node'. `filename_lc' has already been - # lower-cased. - def _delete_leaf(self, node, filename_lc, code): - found = False - - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - - for n in range(count): - pos = block.tell() - e = DSStoreEntry.read(block) - if e.filename.lower() == filename_lc \ - and (code is None or e.code == code): - block.seek(pos) - block.delete(e.byte_length()) - found = True - - # This does not affect the loop; THIS IS NOT A BUG - count -= 1 - - self._records -= 1 - self._dirty = True - - if found: - used = block.tell() - - block.seek(0) - block.write(b'>II', next_node, count) - - return used < self._page_size // 2 - else: - return False - - # Remove the largest entry from the subtree starting at `node' (with - # path from root `path'). Returns a tuple (rebalance, entry) where - # rebalance is either None if no rebalancing is required, or a - # (path, node) tuple giving the details of the node to rebalance. - def _take_largest(self, path, node): - path = list(path) - rebalance = None - while True: - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - - if next_node: - path.append(node) - node = next_node - continue - - for n in range(count): - pos = block.tell() - e = DSStoreEntry.read(block) - - count -= 1 - block.seek(0) - block.write(b'>II', next_node, count) - - if pos < self._page_size // 2: - rebalance = (path, node) - break - - return rebalance, e - - # Delete an entry from an inner node, `node' - def _delete_inner(self, path, node, filename_lc, code): - rebalance = False - - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - - for n in range(count): - pos = block.tell() - ptr = block.read(b'>I')[0] - e = DSStoreEntry.read(block) - if e.filename.lower() == filename_lc \ - and (code is None or e.code == code): - # Take the largest from the left subtree - rebalance, largest = self._take_largest(path, ptr) - - # Delete this entry - if n == count - 1: - right_ptr = next_node - next_node = ptr - block.seek(pos) - else: - right_ptr = block.read(b'>I')[0] - block.seek(pos + 4) - - block.delete(e.byte_length() + 4) - - count -= 1 - block.seek(0) - block.write(b'>II', next_node, count) - - self._records -= 1 - self._dirty = True - - break - - # Replace the pivot value - self._insert_inner(path, node, largest, right_ptr) - - # Rebalance from the node we stole from - if rebalance: - self._rebalance(rebalance[0], rebalance[1]) - return True - return False - - def delete(self, filename, code): - """Delete an item, identified by ``filename`` and ``code`` - from the B-Tree.""" - if isinstance(filename, DSStoreEntry): - code = filename.code - filename = filename.filename - - # If we're deleting *every* node for "filename", we must recurse - if code is None: - ###TODO: Fix this so we can do bulk deletes - raise ValueError('You must delete items individually. Sorry') - - # Otherwise, we're deleting *one* specific node - filename_lc = filename.lower() - path = [] - node = self._rootnode - while True: - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - if next_node: - for n in range(count): - ptr = block.read(b'>I')[0] - e = DSStoreEntry.read(block) - e_lc = e.filename.lower() - if filename_lc < e_lc \ - or (filename_lc == e_lc and code < e.code): - next_node = ptr - break - elif filename_lc == e_lc and code == e.code: - self._delete_inner(path, node, filename_lc, code) - return - path.append(node) - node = next_node - else: - if self._delete_leaf(node, filename_lc, code): - self._rebalance(path, node) - return - - # Find implementation - def _find(self, node, filename_lc, code=None): - if not isinstance(code, bytes): - code = code.encode('latin_1') - with self._get_block(node) as block: - next_node, count = block.read(b'>II') - if next_node: - for n in range(count): - ptr = block.read(b'>I')[0] - e = DSStoreEntry.read(block) - if filename_lc < e.filename.lower(): - for e in self._find(ptr, filename_lc, code): - yield e - return - elif filename_lc == e.filename.lower(): - if code is None or (code and code < e.code): - for e in self._find(ptr, filename_lc, code): - yield e - if code is None or code == e.code: - yield e - elif code < e.code: - return - for e in self._find(next_node, filename_lc, code): - yield e - else: - for n in range(count): - e = DSStoreEntry.read(block) - if filename_lc == e.filename.lower(): - if code is None or code == e.code: - yield e - elif code < e.code: - return - - def find(self, filename, code=None): - """Returns a generator that will iterate over matching entries in - the B-Tree.""" - if isinstance(filename, DSStoreEntry): - code = filename.code - filename = filename.filename - - filename_lc = filename.lower() - - return self._find(self._rootnode, filename_lc, code) - - def __len__(self): - return self._records - - def __iter__(self): - return self._traverse(self._rootnode) - - class Partial(object): - """This is used to implement indexing.""" - def __init__(self, store, filename): - self._store = store - self._filename = filename - - def __getitem__(self, code): - if code is None: - raise KeyError('no such key - [%s][None]' % self._filename) - - if not isinstance(code, bytes): - code = code.encode('latin_1') - - try: - item = next(self._store.find(self._filename, code)) - except StopIteration: - raise KeyError('no such key - [%s][%s]' % (self._filename, - code)) - - if not isinstance(item.type, (bytes, str, unicode)): - return item.value - - return (item.type, item.value) - - def __setitem__(self, code, value): - if code is None: - raise KeyError('bad key - [%s][None]' % self._filename) - - if not isinstance(code, bytes): - code = code.encode('latin_1') - - codec = codecs.get(code, None) - if codec: - entry_type = codec - entry_value = value - else: - entry_type = value[0] - entry_value = value[1] - - self._store.insert(DSStoreEntry(self._filename, code, - entry_type, entry_value)) - - def __delitem__(self, code): - if code is None: - raise KeyError('no such key - [%s][None]' % self._filename) - - self._store.delete(self._filename, code) - - def __iter__(self): - for item in self._store.find(self._filename): - yield item - - def __getitem__(self, filename): - return self.Partial(self, filename) - diff --git a/node_modules/dmg-builder/vendor/mac_alias/__init__.py b/node_modules/dmg-builder/vendor/mac_alias/__init__.py deleted file mode 100644 index 7eb3141..0000000 --- a/node_modules/dmg-builder/vendor/mac_alias/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -from .alias import * -from .bookmark import * - -__all__ = [ 'ALIAS_KIND_FILE', 'ALIAS_KIND_FOLDER', - 'ALIAS_HFS_VOLUME_SIGNATURE', - 'ALIAS_FIXED_DISK', 'ALIAS_NETWORK_DISK', 'ALIAS_400KB_FLOPPY_DISK', - 'ALIAS_800KB_FLOPPY_DISK', 'ALIAS_1_44MB_FLOPPY_DISK', - 'ALIAS_EJECTABLE_DISK', - 'ALIAS_NO_CNID', - 'kBookmarkPath', 'kBookmarkCNIDPath', 'kBookmarkFileProperties', - 'kBookmarkFileName', 'kBookmarkFileID', 'kBookmarkFileCreationDate', - 'kBookmarkTOCPath', 'kBookmarkVolumePath', - 'kBookmarkVolumeURL', 'kBookmarkVolumeName', 'kBookmarkVolumeUUID', - 'kBookmarkVolumeSize', 'kBookmarkVolumeCreationDate', - 'kBookmarkVolumeProperties', 'kBookmarkContainingFolder', - 'kBookmarkUserName', 'kBookmarkUID', 'kBookmarkWasFileReference', - 'kBookmarkCreationOptions', 'kBookmarkURLLengths', - 'kBookmarkSecurityExtension', - 'AppleShareInfo', - 'VolumeInfo', - 'TargetInfo', - 'Alias', - 'Bookmark', - 'Data', - 'URL' ] - - diff --git a/node_modules/dmg-builder/vendor/mac_alias/alias.py b/node_modules/dmg-builder/vendor/mac_alias/alias.py deleted file mode 100644 index 512d222..0000000 --- a/node_modules/dmg-builder/vendor/mac_alias/alias.py +++ /dev/null @@ -1,607 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -from __future__ import division - -import struct -import datetime -import io -import re -import os -import os.path -import stat -import sys - -if sys.platform == 'darwin': - from . import osx - -try: - long -except NameError: - long = int - -from .utils import * - -ALIAS_KIND_FILE = 0 -ALIAS_KIND_FOLDER = 1 - -ALIAS_HFS_VOLUME_SIGNATURE = b'H+' - -ALIAS_FIXED_DISK = 0 -ALIAS_NETWORK_DISK = 1 -ALIAS_400KB_FLOPPY_DISK = 2 -ALIAS_800KB_FLOPPY_DISK = 3 -ALIAS_1_44MB_FLOPPY_DISK = 4 -ALIAS_EJECTABLE_DISK = 5 - -ALIAS_NO_CNID = 0xffffffff - -def encode_utf8(s): - if isinstance(s, bytes): - return s - return s.encode('utf-8') - -def decode_utf8(s): - if isinstance(s, bytes): - return s.decode('utf-8') - return s - -class AppleShareInfo (object): - def __init__(self, zone=None, server=None, user=None): - #: The AppleShare zone - self.zone = zone - #: The AFP server - self.server = server - #: The username - self.user = user - - def __repr__(self): - return 'AppleShareInfo(%r,%r,%r)' % (self.zone, self.server, self.user) - -class VolumeInfo (object): - def __init__(self, name, creation_date, fs_type, disk_type, - attribute_flags, fs_id, appleshare_info=None, - driver_name=None, posix_path=None, disk_image_alias=None, - dialup_info=None, network_mount_info=None): - #: The name of the volume on which the target resides - self.name = name - - #: The creation date of the target's volume - self.creation_date = creation_date - - #: The filesystem type (a two character code, e.g. ``b'H+'`` for HFS+) - self.fs_type = fs_type - - #: The type of disk; should be one of - #: - #: * ALIAS_FIXED_DISK - #: * ALIAS_NETWORK_DISK - #: * ALIAS_400KB_FLOPPY_DISK - #: * ALIAS_800KB_FLOPPY_DISK - #: * ALIAS_1_44MB_FLOPPY_DISK - #: * ALIAS_EJECTABLE_DISK - self.disk_type = disk_type - - #: Filesystem attribute flags (from HFS volume header) - self.attribute_flags = attribute_flags - - #: Filesystem identifier - self.fs_id = fs_id - - #: AppleShare information (for automatic remounting of network shares) - #: *(optional)* - self.appleshare_info = appleshare_info - - #: Driver name (*probably* contains a disk driver name on older Macs) - #: *(optional)* - self.driver_name = driver_name - - #: POSIX path of the mount point of the target's volume - #: *(optional)* - self.posix_path = posix_path - - #: :class:`Alias` object pointing at the disk image on which the - #: target's volume resides *(optional)* - self.disk_image_alias = disk_image_alias - - #: Dialup information (for automatic establishment of dialup connections) - self.dialup_info = dialup_info - - #: Network mount information (for automatic remounting) - self.network_mount_info = network_mount_info - - def __repr__(self): - args = ['name', 'creation_date', 'fs_type', 'disk_type', - 'attribute_flags', 'fs_id'] - values = [] - for a in args: - v = getattr(self, a) - values.append(repr(v)) - - kwargs = ['appleshare_info', 'driver_name', 'posix_path', - 'disk_image_alias', 'dialup_info', 'network_mount_info'] - for a in kwargs: - v = getattr(self, a) - if v is not None: - values.append('%s=%r' % (a, v)) - return 'VolumeInfo(%s)' % ','.join(values) - -class TargetInfo (object): - def __init__(self, kind, filename, folder_cnid, cnid, creation_date, - creator_code, type_code, levels_from=-1, levels_to=-1, - folder_name=None, cnid_path=None, carbon_path=None, - posix_path=None, user_home_prefix_len=None): - #: Either ALIAS_KIND_FILE or ALIAS_KIND_FOLDER - self.kind = kind - - #: The filename of the target - self.filename = filename - - #: The CNID (Catalog Node ID) of the target's containing folder; - #: CNIDs are similar to but different than traditional UNIX inode - #: numbers - self.folder_cnid = folder_cnid - - #: The CNID (Catalog Node ID) of the target - self.cnid = cnid - - #: The target's *creation* date. - self.creation_date = creation_date - - #: The target's Mac creator code (a four-character binary string) - self.creator_code = creator_code - - #: The target's Mac type code (a four-character binary string) - self.type_code = type_code - - #: The depth of the alias? Always seems to be -1 on OS X. - self.levels_from = levels_from - - #: The depth of the target? Always seems to be -1 on OS X. - self.levels_to = levels_to - - #: The (POSIX) name of the target's containing folder. *(optional)* - self.folder_name = folder_name - - #: The path from the volume root as a sequence of CNIDs. *(optional)* - self.cnid_path = cnid_path - - #: The Carbon path of the target *(optional)* - self.carbon_path = carbon_path - - #: The POSIX path of the target relative to the volume root. Note - #: that this may or may not have a leading '/' character, but it is - #: always relative to the containing volume. *(optional)* - self.posix_path = posix_path - - #: If the path points into a user's home folder, the number of folders - #: deep that we go before we get to that home folder. *(optional)* - self.user_home_prefix_len = user_home_prefix_len - - def __repr__(self): - args = ['kind', 'filename', 'folder_cnid', 'cnid', 'creation_date', - 'creator_code', 'type_code'] - values = [] - for a in args: - v = getattr(self, a) - values.append(repr(v)) - - if self.levels_from != -1: - values.append('levels_from=%r' % self.levels_from) - if self.levels_to != -1: - values.append('levels_to=%r' % self.levels_to) - - kwargs = ['folder_name', 'cnid_path', 'carbon_path', - 'posix_path', 'user_home_prefix_len'] - for a in kwargs: - v = getattr(self, a) - values.append('%s=%r' % (a, v)) - - return 'TargetInfo(%s)' % ','.join(values) - -TAG_CARBON_FOLDER_NAME = 0 -TAG_CNID_PATH = 1 -TAG_CARBON_PATH = 2 -TAG_APPLESHARE_ZONE = 3 -TAG_APPLESHARE_SERVER_NAME = 4 -TAG_APPLESHARE_USERNAME = 5 -TAG_DRIVER_NAME = 6 -TAG_NETWORK_MOUNT_INFO = 9 -TAG_DIALUP_INFO = 10 -TAG_UNICODE_FILENAME = 14 -TAG_UNICODE_VOLUME_NAME = 15 -TAG_HIGH_RES_VOLUME_CREATION_DATE = 16 -TAG_HIGH_RES_CREATION_DATE = 17 -TAG_POSIX_PATH = 18 -TAG_POSIX_PATH_TO_MOUNTPOINT = 19 -TAG_RECURSIVE_ALIAS_OF_DISK_IMAGE = 20 -TAG_USER_HOME_LENGTH_PREFIX = 21 - -class Alias (object): - def __init__(self, appinfo=b'\0\0\0\0', version=2, volume=None, - target=None, extra=[]): - """Construct a new :class:`Alias` object with the specified - contents.""" - - #: Application specific information (four byte byte-string) - self.appinfo = appinfo - - #: Version (we support only version 2) - self.version = version - - #: A :class:`VolumeInfo` object describing the target's volume - self.volume = volume - - #: A :class:`TargetInfo` object describing the target - self.target = target - - #: A list of extra `(tag, value)` pairs - self.extra = list(extra) - - @classmethod - def _from_fd(cls, b): - appinfo, recsize, version = struct.unpack(b'>4shh', b.read(8)) - - if recsize < 150: - raise ValueError('Incorrect alias length') - - if version != 2: - raise ValueError('Unsupported alias version %u' % version) - - kind, volname, voldate, fstype, disktype, \ - folder_cnid, filename, cnid, crdate, creator_code, type_code, \ - levels_from, levels_to, volattrs, volfsid, reserved = \ - struct.unpack(b'>h28pI2shI64pII4s4shhI2s10s', b.read(142)) - - voldate = mac_epoch + datetime.timedelta(seconds=voldate) - crdate = mac_epoch + datetime.timedelta(seconds=crdate) - - alias = Alias() - alias.appinfo = appinfo - - alias.volume = VolumeInfo (volname.replace('/',':'), - voldate, fstype, disktype, - volattrs, volfsid) - alias.target = TargetInfo (kind, filename.replace('/',':'), - folder_cnid, cnid, - crdate, creator_code, type_code) - alias.target.levels_from = levels_from - alias.target.levels_to = levels_to - - tag = struct.unpack(b'>h', b.read(2))[0] - - while tag != -1: - length = struct.unpack(b'>h', b.read(2))[0] - value = b.read(length) - if length & 1: - b.read(1) - - if tag == TAG_CARBON_FOLDER_NAME: - alias.target.folder_name = value.replace('/',':') - elif tag == TAG_CNID_PATH: - alias.target.cnid_path = struct.unpack(b'>%uI' % (length // 4), - value) - elif tag == TAG_CARBON_PATH: - alias.target.carbon_path = value - elif tag == TAG_APPLESHARE_ZONE: - if alias.volume.appleshare_info is None: - alias.volume.appleshare_info = AppleShareInfo() - alias.volume.appleshare_info.zone = value - elif tag == TAG_APPLESHARE_SERVER_NAME: - if alias.volume.appleshare_info is None: - alias.volume.appleshare_info = AppleShareInfo() - alias.volume.appleshare_info.server = value - elif tag == TAG_APPLESHARE_USERNAME: - if alias.volume.appleshare_info is None: - alias.volume.appleshare_info = AppleShareInfo() - alias.volume.appleshare_info.user = value - elif tag == TAG_DRIVER_NAME: - alias.volume.driver_name = value - elif tag == TAG_NETWORK_MOUNT_INFO: - alias.volume.network_mount_info = value - elif tag == TAG_DIALUP_INFO: - alias.volume.dialup_info = value - elif tag == TAG_UNICODE_FILENAME: - alias.target.filename = value[2:].decode('utf-16be') - elif tag == TAG_UNICODE_VOLUME_NAME: - alias.volume.name = value[2:].decode('utf-16be') - elif tag == TAG_HIGH_RES_VOLUME_CREATION_DATE: - seconds = struct.unpack(b'>Q', value)[0] / 65536.0 - alias.volume.creation_date \ - = mac_epoch + datetime.timedelta(seconds=seconds) - elif tag == TAG_HIGH_RES_CREATION_DATE: - seconds = struct.unpack(b'>Q', value)[0] / 65536.0 - alias.target.creation_date \ - = mac_epoch + datetime.timedelta(seconds=seconds) - elif tag == TAG_POSIX_PATH: - alias.target.posix_path = value - elif tag == TAG_POSIX_PATH_TO_MOUNTPOINT: - alias.volume.posix_path = value - elif tag == TAG_RECURSIVE_ALIAS_OF_DISK_IMAGE: - alias.volume.disk_image_alias = Alias.from_bytes(value) - elif tag == TAG_USER_HOME_LENGTH_PREFIX: - alias.target.user_home_prefix_len = struct.unpack(b'>h', value)[0] - else: - alias.extra.append((tag, value)) - - tag = struct.unpack(b'>h', b.read(2))[0] - - return alias - - @classmethod - def from_bytes(cls, bytes): - """Construct an :class:`Alias` object given binary Alias data.""" - with io.BytesIO(bytes) as b: - return cls._from_fd(b) - - @classmethod - def for_file(cls, path): - """Create an :class:`Alias` that points at the specified file.""" - if sys.platform != 'darwin': - raise Exception('Not implemented (requires special support)') - - path = encode_utf8(path) - - a = Alias() - - # Find the filesystem - st = osx.statfs(path) - vol_path = st.f_mntonname - - # Grab its attributes - attrs = [osx.ATTR_CMN_CRTIME, - osx.ATTR_VOL_NAME, - 0, 0, 0] - volinfo = osx.getattrlist(vol_path, attrs, 0) - - vol_crtime = volinfo[0] - vol_name = encode_utf8(volinfo[1]) - - # Also grab various attributes of the file - attrs = [(osx.ATTR_CMN_OBJTYPE - | osx.ATTR_CMN_CRTIME - | osx.ATTR_CMN_FNDRINFO - | osx.ATTR_CMN_FILEID - | osx.ATTR_CMN_PARENTID), 0, 0, 0, 0] - info = osx.getattrlist(path, attrs, osx.FSOPT_NOFOLLOW) - - if info[0] == osx.VDIR: - kind = ALIAS_KIND_FOLDER - else: - kind = ALIAS_KIND_FILE - - cnid = info[3] - folder_cnid = info[4] - - dirname, filename = os.path.split(path) - - if dirname == b'' or dirname == b'.': - dirname = os.getcwd() - - foldername = os.path.basename(dirname) - - creation_date = info[1] - - if kind == ALIAS_KIND_FILE: - creator_code = struct.pack(b'I', info[2].fileInfo.fileCreator) - type_code = struct.pack(b'I', info[2].fileInfo.fileType) - else: - creator_code = b'\0\0\0\0' - type_code = b'\0\0\0\0' - - a.target = TargetInfo(kind, filename, folder_cnid, cnid, creation_date, - creator_code, type_code) - a.volume = VolumeInfo(vol_name, vol_crtime, b'H+', - ALIAS_FIXED_DISK, 0, b'\0\0') - - a.target.folder_name = foldername - a.volume.posix_path = vol_path - - rel_path = os.path.relpath(path, vol_path) - - # Leave off the initial '/' if vol_path is '/' (no idea why) - if vol_path == b'/': - a.target.posix_path = rel_path - else: - a.target.posix_path = b'/' + rel_path - - # Construct the Carbon and CNID paths - carbon_path = [] - cnid_path = [] - head, tail = os.path.split(rel_path) - if not tail: - head, tail = os.path.split(head) - while head or tail: - if head: - attrs = [osx.ATTR_CMN_FILEID, 0, 0, 0, 0] - info = osx.getattrlist(os.path.join(vol_path, head), attrs, 0) - cnid_path.append(info[0]) - carbon_tail = tail.replace(b':',b'/') - carbon_path.insert(0, carbon_tail) - head, tail = os.path.split(head) - - carbon_path = vol_name + b':' + b':\0'.join(carbon_path) - - a.target.carbon_path = carbon_path - a.target.cnid_path = cnid_path - - return a - - def _to_fd(self, b): - # We'll come back and fix the length when we're done - pos = b.tell() - b.write(struct.pack(b'>4shh', self.appinfo, 0, self.version)) - - carbon_volname = encode_utf8(self.volume.name).replace(b':',b'/') - carbon_filename = encode_utf8(self.target.filename).replace(b':',b'/') - voldate = (self.volume.creation_date - mac_epoch).total_seconds() - crdate = (self.target.creation_date - mac_epoch).total_seconds() - - # NOTE: crdate should be in local time, but that's system dependent - # (so doing so is ridiculous, and nothing could rely on it). - b.write(struct.pack(b'>h28pI2shI64pII4s4shhI2s10s', - self.target.kind, - carbon_volname, int(voldate), - self.volume.fs_type, - self.volume.disk_type, - self.target.folder_cnid, - carbon_filename, - self.target.cnid, - int(crdate), - self.target.creator_code, - self.target.type_code, - self.target.levels_from, - self.target.levels_to, - self.volume.attribute_flags, - self.volume.fs_id, - b'\0'*10)) - - # Excuse the odd order; we're copying Finder - if self.target.folder_name: - carbon_foldername = encode_utf8(self.target.folder_name)\ - .replace(b':',b'/') - b.write(struct.pack(b'>hh', TAG_CARBON_FOLDER_NAME, - len(carbon_foldername))) - b.write(carbon_foldername) - if len(carbon_foldername) & 1: - b.write(b'\0') - - b.write(struct.pack(b'>hhQhhQ', - TAG_HIGH_RES_VOLUME_CREATION_DATE, - 8, long(voldate * 65536), - TAG_HIGH_RES_CREATION_DATE, - 8, long(crdate * 65536))) - - if self.target.cnid_path: - cnid_path = struct.pack(b'>%uI' % len(self.target.cnid_path), - *self.target.cnid_path) - b.write(struct.pack(b'>hh', TAG_CNID_PATH, - len(cnid_path))) - b.write(cnid_path) - - if self.target.carbon_path: - carbon_path=encode_utf8(self.target.carbon_path) - b.write(struct.pack(b'>hh', TAG_CARBON_PATH, - len(carbon_path))) - b.write(carbon_path) - if len(carbon_path) & 1: - b.write(b'\0') - - if self.volume.appleshare_info: - ai = self.volume.appleshare_info - if ai.zone: - b.write(struct.pack(b'>hh', TAG_APPLESHARE_ZONE, - len(ai.zone))) - b.write(ai.zone) - if len(ai.zone) & 1: - b.write(b'\0') - if ai.server: - b.write(struct.pack(b'>hh', TAG_APPLESHARE_SERVER_NAME, - len(ai.server))) - b.write(ai.server) - if len(ai.server) & 1: - b.write(b'\0') - if ai.username: - b.write(struct.pack(b'>hh', TAG_APPLESHARE_USERNAME, - len(ai.username))) - b.write(ai.username) - if len(ai.username) & 1: - b.write(b'\0') - - if self.volume.driver_name: - driver_name = encode_utf8(self.volume.driver_name) - b.write(struct.pack(b'>hh', TAG_DRIVER_NAME, - len(driver_name))) - b.write(driver_name) - if len(driver_name) & 1: - b.write(b'\0') - - if self.volume.network_mount_info: - b.write(struct.pack(b'>hh', TAG_NETWORK_MOUNT_INFO, - len(self.volume.network_mount_info))) - b.write(self.volume.network_mount_info) - if len(self.volume.network_mount_info) & 1: - b.write(b'\0') - - if self.volume.dialup_info: - b.write(struct.pack(b'>hh', TAG_DIALUP_INFO, - len(self.volume.network_mount_info))) - b.write(self.volume.network_mount_info) - if len(self.volume.network_mount_info) & 1: - b.write(b'\0') - - utf16 = decode_utf8(self.target.filename)\ - .replace(':','/').encode('utf-16-be') - b.write(struct.pack(b'>hhh', TAG_UNICODE_FILENAME, - len(utf16) + 2, - len(utf16) // 2)) - b.write(utf16) - - utf16 = decode_utf8(self.volume.name)\ - .replace(':','/').encode('utf-16-be') - b.write(struct.pack(b'>hhh', TAG_UNICODE_VOLUME_NAME, - len(utf16) + 2, - len(utf16) // 2)) - b.write(utf16) - - if self.target.posix_path: - posix_path = encode_utf8(self.target.posix_path) - b.write(struct.pack(b'>hh', TAG_POSIX_PATH, - len(posix_path))) - b.write(posix_path) - if len(posix_path) & 1: - b.write(b'\0') - - if self.volume.posix_path: - posix_path = encode_utf8(self.volume.posix_path) - b.write(struct.pack(b'>hh', TAG_POSIX_PATH_TO_MOUNTPOINT, - len(posix_path))) - b.write(posix_path) - if len(posix_path) & 1: - b.write(b'\0') - - if self.volume.disk_image_alias: - d = self.volume.disk_image_alias.to_bytes() - b.write(struct.pack(b'>hh', TAG_RECURSIVE_ALIAS_OF_DISK_IMAGE, - len(d))) - b.write(d) - if len(d) & 1: - b.write(b'\0') - - if self.target.user_home_prefix_len is not None: - b.write(struct.pack(b'>hhh', TAG_USER_HOME_LENGTH_PREFIX, - 2, self.target.user_home_prefix_len)) - - for t,v in self.extra: - b.write(struct.pack(b'>hh', t, len(v))) - b.write(v) - if len(v) & 1: - b.write(b'\0') - - b.write(struct.pack(b'>hh', -1, 0)) - - blen = b.tell() - pos - b.seek(pos + 4, os.SEEK_SET) - b.write(struct.pack(b'>h', blen)) - - def to_bytes(self): - """Returns the binary representation for this :class:`Alias`.""" - with io.BytesIO() as b: - self._to_fd(b) - return b.getvalue() - - def __str__(self): - return '' % self.target.filename - - def __repr__(self): - values = [] - if self.appinfo != b'\0\0\0\0': - values.append('appinfo=%r' % self.appinfo) - if self.version != 2: - values.append('version=%r' % self.version) - if self.volume is not None: - values.append('volume=%r' % self.volume) - if self.target is not None: - values.append('target=%r' % self.target) - if self.extra: - values.append('extra=%r' % self.extra) - return 'Alias(%s)' % ','.join(values) diff --git a/node_modules/dmg-builder/vendor/mac_alias/bookmark.py b/node_modules/dmg-builder/vendor/mac_alias/bookmark.py deleted file mode 100644 index 0de6b94..0000000 --- a/node_modules/dmg-builder/vendor/mac_alias/bookmark.py +++ /dev/null @@ -1,665 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file implements the Apple "bookmark" format, which is the replacement -# for the old-fashioned alias format. The details of this format were -# reverse engineered; some things are still not entirely clear. -# -from __future__ import unicode_literals, print_function - -import struct -import uuid -import datetime -import os -import sys -import pprint - -try: - from urlparse import urljoin -except ImportError: - from urllib.parse import urljoin - -if sys.platform == 'darwin': - from . import osx - -def iteritems(x): - return x.iteritems() - -try: - unicode -except NameError: - unicode = str - long = int - xrange = range - def iteritems(x): - return x.items() - -from .utils import * - -BMK_DATA_TYPE_MASK = 0xffffff00 -BMK_DATA_SUBTYPE_MASK = 0x000000ff - -BMK_STRING = 0x0100 -BMK_DATA = 0x0200 -BMK_NUMBER = 0x0300 -BMK_DATE = 0x0400 -BMK_BOOLEAN = 0x0500 -BMK_ARRAY = 0x0600 -BMK_DICT = 0x0700 -BMK_UUID = 0x0800 -BMK_URL = 0x0900 -BMK_NULL = 0x0a00 - -BMK_ST_ZERO = 0x0000 -BMK_ST_ONE = 0x0001 - -BMK_BOOLEAN_ST_FALSE = 0x0000 -BMK_BOOLEAN_ST_TRUE = 0x0001 - -# Subtypes for BMK_NUMBER are really CFNumberType values -kCFNumberSInt8Type = 1 -kCFNumberSInt16Type = 2 -kCFNumberSInt32Type = 3 -kCFNumberSInt64Type = 4 -kCFNumberFloat32Type = 5 -kCFNumberFloat64Type = 6 -kCFNumberCharType = 7 -kCFNumberShortType = 8 -kCFNumberIntType = 9 -kCFNumberLongType = 10 -kCFNumberLongLongType = 11 -kCFNumberFloatType = 12 -kCFNumberDoubleType = 13 -kCFNumberCFIndexType = 14 -kCFNumberNSIntegerType = 15 -kCFNumberCGFloatType = 16 - -# Resource property flags (from CFURLPriv.h) -kCFURLResourceIsRegularFile = 0x00000001 -kCFURLResourceIsDirectory = 0x00000002 -kCFURLResourceIsSymbolicLink = 0x00000004 -kCFURLResourceIsVolume = 0x00000008 -kCFURLResourceIsPackage = 0x00000010 -kCFURLResourceIsSystemImmutable = 0x00000020 -kCFURLResourceIsUserImmutable = 0x00000040 -kCFURLResourceIsHidden = 0x00000080 -kCFURLResourceHasHiddenExtension = 0x00000100 -kCFURLResourceIsApplication = 0x00000200 -kCFURLResourceIsCompressed = 0x00000400 -kCFURLResourceIsSystemCompressed = 0x00000400 -kCFURLCanSetHiddenExtension = 0x00000800 -kCFURLResourceIsReadable = 0x00001000 -kCFURLResourceIsWriteable = 0x00002000 -kCFURLResourceIsExecutable = 0x00004000 -kCFURLIsAliasFile = 0x00008000 -kCFURLIsMountTrigger = 0x00010000 - -# Volume property flags (from CFURLPriv.h) -kCFURLVolumeIsLocal = 0x1 # -kCFURLVolumeIsAutomount = 0x2 # -kCFURLVolumeDontBrowse = 0x4 # -kCFURLVolumeIsReadOnly = 0x8 # -kCFURLVolumeIsQuarantined = 0x10 -kCFURLVolumeIsEjectable = 0x20 # -kCFURLVolumeIsRemovable = 0x40 # -kCFURLVolumeIsInternal = 0x80 # -kCFURLVolumeIsExternal = 0x100 # -kCFURLVolumeIsDiskImage = 0x200 # -kCFURLVolumeIsFileVault = 0x400 -kCFURLVolumeIsLocaliDiskMirror = 0x800 -kCFURLVolumeIsiPod = 0x1000 # -kCFURLVolumeIsiDisk = 0x2000 -kCFURLVolumeIsCD = 0x4000 -kCFURLVolumeIsDVD = 0x8000 -kCFURLVolumeIsDeviceFileSystem = 0x10000 -kCFURLVolumeSupportsPersistentIDs = 0x100000000 -kCFURLVolumeSupportsSearchFS = 0x200000000 -kCFURLVolumeSupportsExchange = 0x400000000 -# reserved 0x800000000 -kCFURLVolumeSupportsSymbolicLinks = 0x1000000000 -kCFURLVolumeSupportsDenyModes = 0x2000000000 -kCFURLVolumeSupportsCopyFile = 0x4000000000 -kCFURLVolumeSupportsReadDirAttr = 0x8000000000 -kCFURLVolumeSupportsJournaling = 0x10000000000 -kCFURLVolumeSupportsRename = 0x20000000000 -kCFURLVolumeSupportsFastStatFS = 0x40000000000 -kCFURLVolumeSupportsCaseSensitiveNames = 0x80000000000 -kCFURLVolumeSupportsCasePreservedNames = 0x100000000000 -kCFURLVolumeSupportsFLock = 0x200000000000 -kCFURLVolumeHasNoRootDirectoryTimes = 0x400000000000 -kCFURLVolumeSupportsExtendedSecurity = 0x800000000000 -kCFURLVolumeSupports2TBFileSize = 0x1000000000000 -kCFURLVolumeSupportsHardLinks = 0x2000000000000 -kCFURLVolumeSupportsMandatoryByteRangeLocks = 0x4000000000000 -kCFURLVolumeSupportsPathFromID = 0x8000000000000 -# reserved 0x10000000000000 -kCFURLVolumeIsJournaling = 0x20000000000000 -kCFURLVolumeSupportsSparseFiles = 0x40000000000000 -kCFURLVolumeSupportsZeroRuns = 0x80000000000000 -kCFURLVolumeSupportsVolumeSizes = 0x100000000000000 -kCFURLVolumeSupportsRemoteEvents = 0x200000000000000 -kCFURLVolumeSupportsHiddenFiles = 0x400000000000000 -kCFURLVolumeSupportsDecmpFSCompression = 0x800000000000000 -kCFURLVolumeHas64BitObjectIDs = 0x1000000000000000 -kCFURLVolumePropertyFlagsAll = 0xffffffffffffffff - -BMK_URL_ST_ABSOLUTE = 0x0001 -BMK_URL_ST_RELATIVE = 0x0002 - -# Bookmark keys -# = 0x1003 -kBookmarkPath = 0x1004 # Array of path components -kBookmarkCNIDPath = 0x1005 # Array of CNIDs -kBookmarkFileProperties = 0x1010 # (CFURL rp flags, - # CFURL rp flags asked for, - # 8 bytes NULL) -kBookmarkFileName = 0x1020 -kBookmarkFileID = 0x1030 -kBookmarkFileCreationDate = 0x1040 -# = 0x1054 # ? -# = 0x1055 # ? -# = 0x1056 # ? -# = 0x1101 # ? -# = 0x1102 # ? -kBookmarkTOCPath = 0x2000 # A list of (TOC id, ?) pairs -kBookmarkVolumePath = 0x2002 -kBookmarkVolumeURL = 0x2005 -kBookmarkVolumeName = 0x2010 -kBookmarkVolumeUUID = 0x2011 # Stored (perversely) as a string -kBookmarkVolumeSize = 0x2012 -kBookmarkVolumeCreationDate = 0x2013 -kBookmarkVolumeProperties = 0x2020 # (CFURL vp flags, - # CFURL vp flags asked for, - # 8 bytes NULL) -kBookmarkVolumeIsRoot = 0x2030 # True if volume is FS root -kBookmarkVolumeBookmark = 0x2040 # Embedded bookmark for disk image (TOC id) -kBookmarkVolumeMountPoint = 0x2050 # A URL -# = 0x2070 -kBookmarkContainingFolder = 0xc001 # Index of containing folder in path -kBookmarkUserName = 0xc011 # User that created bookmark -kBookmarkUID = 0xc012 # UID that created bookmark -kBookmarkWasFileReference = 0xd001 # True if the URL was a file reference -kBookmarkCreationOptions = 0xd010 -kBookmarkURLLengths = 0xe003 # See below -# = 0xf017 # Localized name? -# = 0xf022 -kBookmarkSecurityExtension = 0xf080 -# = 0xf081 - -# kBookmarkURLLengths is an array that is set if the URL encoded by the -# bookmark had a base URL; in that case, each entry is the length of the -# base URL in question. Thus a URL -# -# file:///foo/bar/baz blam/blat.html -# -# will result in [3, 2], while the URL -# -# file:///foo bar/baz blam blat.html -# -# would result in [1, 2, 1, 1] - - -class Data (object): - def __init__(self, bytedata=None): - #: The bytes, stored as a byte string - self.bytes = bytes(bytedata) - - def __repr__(self): - return 'Data(%r)' % self.bytes - -class URL (object): - def __init__(self, base, rel=None): - if rel is not None: - #: The base URL, if any (a :class:`URL`) - self.base = base - #: The rest of the URL (a string) - self.relative = rel - else: - self.base = None - self.relative = base - - @property - def absolute(self): - """Return an absolute URL.""" - if self.base is None: - return self.relative - else: - base_abs = self.base.absolute - return urljoin(self.base.absolute, self.relative) - - def __repr__(self): - return 'URL(%r)' % self.absolute - -class Bookmark (object): - def __init__(self, tocs=None): - if tocs is None: - #: The TOCs for this Bookmark - self.tocs = [] - else: - self.tocs = tocs - - @classmethod - def _get_item(cls, data, hdrsize, offset): - offset += hdrsize - if offset > len(data) - 8: - raise ValueError('Offset out of range') - - length,typecode = struct.unpack(b'd', databytes)[0]) - return osx_epoch + secs - elif dtype == BMK_BOOLEAN: - if dsubtype == BMK_BOOLEAN_ST_TRUE: - return True - elif dsubtype == BMK_BOOLEAN_ST_FALSE: - return False - elif dtype == BMK_UUID: - return uuid.UUID(bytes=databytes) - elif dtype == BMK_URL: - if dsubtype == BMK_URL_ST_ABSOLUTE: - return URL(databytes.decode('utf-8')) - elif dsubtype == BMK_URL_ST_RELATIVE: - baseoff,reloff = struct.unpack(b' size: - raise ValueError('Not a bookmark file (header size too large)') - - if size != len(data): - raise ValueError('Not a bookmark file (truncated)') - - tocoffset, = struct.unpack(b' size - hdrsize \ - or size - tocbase < 20: - raise ValueError('TOC offset out of range') - - tocsize,tocmagic,tocid,nexttoc,toccount \ - = struct.unpack(b' -0x80000000 and item < 0x7fffffff: - result = struct.pack(b'd', float(secs.total_seconds())) - elif isinstance(item, uuid.UUID): - result = struct.pack(b' -1: - sz = sz[:nul] - return sz.decode('utf-8') - -def _decode_attrlist_result(buf, attrs, options): - result = [] - - assert len(buf) >= 4 - total_size = uint32_t.from_buffer(buf, 0).value - assert total_size <= len(buf) - - offset = 4 - - # Common attributes - if attrs[0] & ATTR_CMN_RETURNED_ATTRS: - a = attribute_set_t.from_buffer(buf, offset) - result.append(a) - offset += sizeof (attribute_set_t) - if not (options & FSOPT_PACK_INVAL_ATTRS): - attrs = [a.commonattr, a.volattr, a.dirattr, a.fileattr, a.forkattr] - if attrs[0] & ATTR_CMN_NAME: - a = attrreference_t.from_buffer(buf, offset) - ofs = offset + a.attr_dataoffset - name = _decode_utf8_nul(buf[ofs:ofs+a.attr_length]) - offset += sizeof (attrreference_t) - result.append(name) - if attrs[0] & ATTR_CMN_DEVID: - a = dev_t.from_buffer(buf, offset) - offset += sizeof(dev_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_FSID: - a = fsid_t.from_buffer(buf, offset) - offset += sizeof(fsid_t) - result.append(a) - if attrs[0] & ATTR_CMN_OBJTYPE: - a = fsobj_type_t.from_buffer(buf, offset) - offset += sizeof(fsobj_type_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_OBJTAG: - a = fsobj_tag_t.from_buffer(buf, offset) - offset += sizeof(fsobj_tag_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_OBJID: - a = fsobj_id_t.from_buffer(buf, offset) - offset += sizeof(fsobj_id_t) - result.append(a) - if attrs[0] & ATTR_CMN_OBJPERMANENTID: - a = fsobj_id_t.from_buffer(buf, offset) - offset += sizeof(fsobj_id_t) - result.append(a) - if attrs[0] & ATTR_CMN_PAROBJID: - a = fsobj_id_t.from_buffer(buf, offset) - offset += sizeof(fsobj_id_t) - result.append(a) - if attrs[0] & ATTR_CMN_SCRIPT: - a = text_encoding_t.from_buffer(buf, offset) - offset += sizeof(text_encoding_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_CRTIME: - a = timespec.from_buffer(buf, offset) - offset += sizeof(timespec) - result.append(_datetime_from_timespec(a)) - if attrs[0] & ATTR_CMN_MODTIME: - a = timespec.from_buffer(buf, offset) - offset += sizeof(timespec) - result.append(_datetime_from_timespec(a)) - if attrs[0] & ATTR_CMN_CHGTIME: - a = timespec.from_buffer(buf, offset) - offset += sizeof(timespec) - result.append(_datetime_from_timespec(a)) - if attrs[0] & ATTR_CMN_ACCTIME: - a = timespec.from_buffer(buf, offset) - offset += sizeof(timespec) - result.append(_datetime_from_timespec(a)) - if attrs[0] & ATTR_CMN_BKUPTIME: - a = timespec.from_buffer(buf, offset) - offset += sizeof(timespec) - result.append(_datetime_from_timespec(a)) - if attrs[0] & ATTR_CMN_FNDRINFO: - a = FinderInfo.from_buffer(buf, offset) - offset += sizeof(FinderInfo) - result.append(a) - if attrs[0] & ATTR_CMN_OWNERID: - a = uid_t.from_buffer(buf, offset) - offset += sizeof(uid_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_GRPID: - a = gid_t.from_buffer(buf, offset) - offset += sizeof(gid_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_ACCESSMASK: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_FLAGS: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_USERACCESS: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_EXTENDED_SECURITY: - a = attrreference_t.from_buffer(buf, offset) - ofs = offset + a.attr_dataoffset - offset += sizeof(attrreference_t) - ec = uint32_t.from_buffer(buf, ofs + 36).value - class kauth_acl(Structure): - _fields_ = [('acl_entrycount', c_uint), - ('acl_flags', c_uint), - ('acl_ace', kauth_ace * ec)] - class kauth_filesec(Structure): - _fields_ = [('fsec_magic', c_uint), - ('fsec_owner', guid_t), - ('fsec_group', guid_t), - ('fsec_acl', kauth_acl)] - a = kauth_filesec.from_buffer(buf, ofs) - result.append(a) - if attrs[0] & ATTR_CMN_UUID: - result.append(uuid.UUID(bytes=buf[offset:offset+16])) - offset += sizeof(guid_t) - if attrs[0] & ATTR_CMN_GRPUUID: - result.append(uuid.UUID(bytes=buf[offset:offset+16])) - offset += sizeof(guid_t) - if attrs[0] & ATTR_CMN_FILEID: - a = uint64_t.from_buffer(buf, offset) - offset += sizeof(uint64_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_PARENTID: - a = uint64_t.from_buffer(buf, offset) - offset += sizeof(uint64_t) - result.append(a.value) - if attrs[0] & ATTR_CMN_FULLPATH: - a = attrreference_t.from_buffer(buf, offset) - ofs = offset + a.attr_dataoffset - path = _decode_utf8_nul(buf[ofs:ofs+a.attr_length]) - offset += sizeof (attrreference_t) - result.append(path) - if attrs[0] & ATTR_CMN_ADDEDTIME: - a = timespec.from_buffer(buf, offset) - offset += sizeof(timespec) - result.append(_datetime_from_timespec(a)) - - # Volume attributes - if attrs[1] & ATTR_VOL_FSTYPE: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_SIGNATURE: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_SIZE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_SPACEFREE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_SPACEAVAIL: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_MINALLOCATION: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_ALLOCATIONCLUMP: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_IOBLOCKSIZE: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_OBJCOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_FILECOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_DIRCOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_MAXOBJCOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_MOUNTPOINT: - a = attrreference_t.from_buffer(buf, offset) - ofs = offset + a.attr_dataoffset - path = _decode_utf8_nul(buf[ofs:ofs+a.attr_length]) - offset += sizeof (attrreference_t) - result.append(path) - if attrs[1] & ATTR_VOL_NAME: - a = attrreference_t.from_buffer(buf, offset) - ofs = offset + a.attr_dataoffset - name = _decode_utf8_nul(buf[ofs:ofs+a.attr_length]) - offset += sizeof (attrreference_t) - result.append(name) - if attrs[1] & ATTR_VOL_MOUNTFLAGS: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[1] & ATTR_VOL_MOUNTEDDEVICE: - a = attrreference_t.from_buffer(buf, offset) - ofs = offset + a.attr_dataoffset - path = _decode_utf8_nul(buf[ofs:ofs+a.attr_length]) - offset += sizeof (attrreference_t) - result.append(path) - if attrs[1] & ATTR_VOL_ENCODINGSUSED: - a = c_ulonglong.from_buffer(buf, offset) - offset += sizeof(c_ulonglong) - result.append(a.value) - if attrs[1] & ATTR_VOL_CAPABILITIES: - a = vol_capabilities_attr_t.from_buffer(buf, offset) - offset += sizeof(vol_capabilities_attr_t) - result.append(a) - if attrs[1] & ATTR_VOL_UUID: - result.append(uuid.UUID(bytes=buf[offset:offset+16])) - offset += sizeof(uuid_t) - if attrs[1] & ATTR_VOL_ATTRIBUTES: - a = vol_attributes_attr_t.from_buffer(buf, offset) - offset += sizeof(vol_attributes_attr_t) - result.append(a) - - # Directory attributes - if attrs[2] & ATTR_DIR_LINKCOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[2] & ATTR_DIR_ENTRYCOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[2] & ATTR_DIR_MOUNTSTATUS: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - - # File attributes - if attrs[3] & ATTR_FILE_LINKCOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_TOTALSIZE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_ALLOCSIZE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_IOBLOCKSIZE: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_CLUMPSIZE: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_DEVTYPE: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_FILETYPE: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_FORKCOUNT: - a = uint32_t.from_buffer(buf, offset) - offset += sizeof(uint32_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_DATALENGTH: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_DATAALLOCSIZE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_DATAEXTENTS: - a = extentrecord.from_buffer(buf, offset) - offset += sizeof(extentrecord) - result.append(a.value) - if attrs[3] & ATTR_FILE_RSRCLENGTH: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_RSRCALLOCSIZE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[3] & ATTR_FILE_RSRCEXTENTS: - a = extentrecord.from_buffer(buf, offset) - offset += sizeof(extentrecord) - result.append(a.value) - - # Fork attributes - if attrs[4] & ATTR_FORK_TOTALSIZE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - if attrs[4] & ATTR_FORK_ALLOCSIZE: - a = off_t.from_buffer(buf, offset) - offset += sizeof(off_t) - result.append(a.value) - - return result - -# Sadly, ctypes.get_errno() seems not to work -__error = libc.__error -__error.restype = POINTER(c_int) - -def _get_errno(): - return __error().contents.value - -def getattrlist(path, attrs, options): - if not isinstance(path, bytes): - path = path.encode('utf-8') - attrs = list(attrs) - if attrs[1]: - attrs[1] |= ATTR_VOL_INFO - alist = attrlist(bitmapcount=5, - commonattr=attrs[0], - volattr=attrs[1], - dirattr=attrs[2], - fileattr=attrs[3], - forkattr=attrs[4]) - - bufsize = _attrbuf_size(attrs) - buf = create_string_buffer(bufsize) - - ret = _getattrlist(path, byref(alist), buf, bufsize, - options | FSOPT_REPORT_FULLSIZE) - - if ret < 0: - err = _get_errno() - raise OSError(err, os.strerror(err), path) - - return _decode_attrlist_result(buf, attrs, options) - -def fgetattrlist(fd, attrs, options): - if hasattr(fd, 'fileno'): - fd = fd.fileno() - attrs = list(attrs) - if attrs[1]: - attrs[1] |= ATTR_VOL_INFO - alist = attrlist(bitmapcount=5, - commonattr=attrs[0], - volattr=attrs[1], - dirattr=attrs[2], - fileattr=attrs[3], - forkattr=attrs[4]) - - bufsize = _attrbuf_size(attrs) - buf = create_string_buffer(bufsize) - - ret = _fgetattrlist(fd, byref(alist), buf, bufsize, - options | FSOPT_REPORT_FULLSIZE) - - if ret < 0: - err = _get_errno() - raise OSError(err, os.strerror(err)) - - return _decode_attrlist_result(buf, attrs, options) - -def statfs(path): - if not isinstance(path, bytes): - path = path.encode('utf-8') - result = struct_statfs() - ret = _statfs(path, byref(result)) - if ret < 0: - err = _get_errno() - raise OSError(err, os.strerror(err), path) - return result - -def fstatfs(fd): - if hasattr(fd, 'fileno'): - fd = fd.fileno() - result = struct_statfs() - ret = _fstatfs(fd, byref(result)) - if ret < 0: - err = _get_errno() - raise OSError(err, os.strerror(err)) - return result diff --git a/node_modules/dmg-builder/vendor/mac_alias/utils.py b/node_modules/dmg-builder/vendor/mac_alias/utils.py deleted file mode 100644 index 6a7d0a1..0000000 --- a/node_modules/dmg-builder/vendor/mac_alias/utils.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -ZERO = datetime.timedelta(0) -class UTC (datetime.tzinfo): - def utcoffset(self, dt): - return ZERO - def dst(self, dt): - return ZERO - def tzname(self, dt): - return 'UTC' - -utc = UTC() -mac_epoch = datetime.datetime(1904,1,1,0,0,0,0,utc) -unix_epoch = datetime.datetime(1970,1,1,0,0,0,0,utc) -osx_epoch = datetime.datetime(2001,1,1,0,0,0,0,utc) diff --git a/node_modules/dot-prop/index.js b/node_modules/dot-prop/index.js deleted file mode 100644 index 15282bb..0000000 --- a/node_modules/dot-prop/index.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; -const isObj = require('is-obj'); - -function getPathSegments(path) { - const pathArr = path.split('.'); - const parts = []; - - for (let i = 0; i < pathArr.length; i++) { - let p = pathArr[i]; - - while (p[p.length - 1] === '\\' && pathArr[i + 1] !== undefined) { - p = p.slice(0, -1) + '.'; - p += pathArr[++i]; - } - - parts.push(p); - } - - return parts; -} - -module.exports = { - get(obj, path, value) { - if (!isObj(obj) || typeof path !== 'string') { - return value === undefined ? obj : value; - } - - const pathArr = getPathSegments(path); - - for (let i = 0; i < pathArr.length; i++) { - if (!Object.prototype.propertyIsEnumerable.call(obj, pathArr[i])) { - return value; - } - - obj = obj[pathArr[i]]; - - if (obj === undefined || obj === null) { - // `obj` is either `undefined` or `null` so we want to stop the loop, and - // if this is not the last bit of the path, and - // if it did't return `undefined` - // it would return `null` if `obj` is `null` - // but we want `get({foo: null}, 'foo.bar')` to equal `undefined`, or the supplied value, not `null` - if (i !== pathArr.length - 1) { - return value; - } - - break; - } - } - - return obj; - }, - - set(obj, path, value) { - if (!isObj(obj) || typeof path !== 'string') { - return obj; - } - - const root = obj; - const pathArr = getPathSegments(path); - - for (let i = 0; i < pathArr.length; i++) { - const p = pathArr[i]; - - if (!isObj(obj[p])) { - obj[p] = {}; - } - - if (i === pathArr.length - 1) { - obj[p] = value; - } - - obj = obj[p]; - } - - return root; - }, - - delete(obj, path) { - if (!isObj(obj) || typeof path !== 'string') { - return; - } - - const pathArr = getPathSegments(path); - - for (let i = 0; i < pathArr.length; i++) { - const p = pathArr[i]; - - if (i === pathArr.length - 1) { - delete obj[p]; - return; - } - - obj = obj[p]; - - if (!isObj(obj)) { - return; - } - } - }, - - has(obj, path) { - if (!isObj(obj) || typeof path !== 'string') { - return false; - } - - const pathArr = getPathSegments(path); - - for (let i = 0; i < pathArr.length; i++) { - if (isObj(obj)) { - if (!(pathArr[i] in obj)) { - return false; - } - - obj = obj[pathArr[i]]; - } else { - return false; - } - } - - return true; - } -}; diff --git a/node_modules/dot-prop/license b/node_modules/dot-prop/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/dot-prop/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/dot-prop/package.json b/node_modules/dot-prop/package.json deleted file mode 100644 index 0153bc8..0000000 --- a/node_modules/dot-prop/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "dot-prop@^4.1.0", - "_id": "dot-prop@4.2.0", - "_inBundle": false, - "_integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "_location": "/dot-prop", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "dot-prop@^4.1.0", - "name": "dot-prop", - "escapedName": "dot-prop", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/configstore" - ], - "_resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "_shasum": "1f19e0c2e1aa0e32797c49799f2837ac6af69c57", - "_spec": "dot-prop@^4.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/configstore", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/dot-prop/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-obj": "^1.0.0" - }, - "deprecated": false, - "description": "Get, set, or delete a property from a nested object using a dot path", - "devDependencies": { - "ava": "*", - "matcha": "^0.7.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/dot-prop#readme", - "keywords": [ - "obj", - "object", - "prop", - "property", - "dot", - "path", - "get", - "set", - "delete", - "del", - "access", - "notation", - "dotty" - ], - "license": "MIT", - "name": "dot-prop", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/dot-prop.git" - }, - "scripts": { - "bench": "matcha bench.js", - "test": "xo && ava" - }, - "version": "4.2.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/dot-prop/readme.md b/node_modules/dot-prop/readme.md deleted file mode 100644 index fab3b7a..0000000 --- a/node_modules/dot-prop/readme.md +++ /dev/null @@ -1,103 +0,0 @@ -# dot-prop [![Build Status](https://travis-ci.org/sindresorhus/dot-prop.svg?branch=master)](https://travis-ci.org/sindresorhus/dot-prop) - -> Get, set, or delete a property from a nested object using a dot path - - -## Install - -``` -$ npm install --save dot-prop -``` - - -## Usage - -```js -const dotProp = require('dot-prop'); - -// getter -dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar'); -//=> 'unicorn' - -dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep'); -//=> undefined - -dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value'); -//=> 'default value' - -dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot'); -//=> 'unicorn' - -// setter -const obj = {foo: {bar: 'a'}}; -dotProp.set(obj, 'foo.bar', 'b'); -console.log(obj); -//=> {foo: {bar: 'b'}} - -const foo = dotProp.set({}, 'foo.bar', 'c'); -console.log(foo); -//=> {foo: {bar: 'c'}} - -dotProp.set(obj, 'foo.baz', 'x'); -console.log(obj); -//=> {foo: {bar: 'b', baz: 'x'}} - -// has -dotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar'); -//=> true - -// deleter -const obj = {foo: {bar: 'a'}}; -dotProp.delete(obj, 'foo.bar'); -console.log(obj); -//=> {foo: {}} - -obj.foo.bar = {x: 'y', y: 'x'}; -dotProp.delete(obj, 'foo.bar.x'); -console.log(obj); -//=> {foo: {bar: {y: 'x'}}} -``` - - -## API - -### get(obj, path, [defaultValue]) - -### set(obj, path, value) - -Returns the object. - -### has(obj, path) - -### delete(obj, path) - -#### obj - -Type: `Object` - -Object to get, set, or delete the `path` value. - -#### path - -Type: `string` - -Path of the property in the object, using `.` to separate each nested key. - -Use `\\.` if you have a `.` in the key. - -#### value - -Type: `any` - -Value to set at `path`. - -#### defaultValue - -Type: `any` - -Default value. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/dotenv-expand/.npmignore b/node_modules/dotenv-expand/.npmignore deleted file mode 100644 index 8278783..0000000 --- a/node_modules/dotenv-expand/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -coverage/ -examples/ -test/ -.editorconfig -.travis.yml -Contributing.md diff --git a/node_modules/dotenv-expand/CONTRIBUTING.md b/node_modules/dotenv-expand/CONTRIBUTING.md deleted file mode 100644 index 91a304e..0000000 --- a/node_modules/dotenv-expand/CONTRIBUTING.md +++ /dev/null @@ -1,26 +0,0 @@ -# Contributing - -1. Fork it -2. `npm install` -3. Create your feature branch (`git checkout -b my-new-feature`) -4. Commit your changes (`git commit -am 'Added some feature'`) -5. `npm test` -6. Push to the branch (`git push origin my-new-feature`) -7. Create new Pull Request - -## Testing - -We use [lab](https://github.com/hapijs/lab) and [should](https://github.com/shouldjs/should.js) to write BDD test. Run our test suite with this command: - -``` -npm test -``` - -## Code Style - -We use [standard](https://www.npmjs.com/package/standard) and [editorconfig](http://editorconfig.org) to maintain code style and best practices. Please make sure your PR adheres to the guides by running: - -``` -npm run lint -``` - diff --git a/node_modules/dotenv-expand/LICENSE b/node_modules/dotenv-expand/LICENSE deleted file mode 100644 index 615b117..0000000 --- a/node_modules/dotenv-expand/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2016, Scott Motte -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/node_modules/dotenv-expand/README.md b/node_modules/dotenv-expand/README.md deleted file mode 100644 index f0ed760..0000000 --- a/node_modules/dotenv-expand/README.md +++ /dev/null @@ -1,40 +0,0 @@ -[![Donate](http://www.opensourcecitizen.org/badge)](http://www.opensourcecitizen.org/project?url=github.com/motdotla/dotenv-expand) - -If you found this library useful, donate some CPU cycles to this project by clicking above. Thank you! 😇 - -# dotenv-expand - -dotenv-expand - -Dotenv-expand adds variable expansion on top of -[dotenv](http://github.com/motdotla/dotenv). If you find yourself needing to -expand environment variables already existing on your machine, then -dotenv-expand is your tool. - -[![BuildStatus](https://img.shields.io/travis/motdotla/dotenv-expand/master.svg?style=flat-square)](https://travis-ci.org/motdotla/dotenv-expand) -[![NPM version](https://img.shields.io/npm/v/dotenv-expand.svg?style=flat-square)](https://www.npmjs.com/package/dotenv-expand) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) - -## Install - -```bash -npm install dotenv --save -npm install dotenv-expand --save -``` - -## Usage - -As early as possible in your application, require dotenv and dotenv-expand, and -wrap dotenv-expand around dotenv. - -```js -var dotenv = require('dotenv') -var dotenvExpand = require('dotenv-expand') - -var myEnv = dotenv.config() -dotenvExpand(myEnv) -``` - -See [test/.env](./test/.env) for examples of variable expansion in your `.env` -file. - diff --git a/node_modules/dotenv-expand/dotenv-expand.png b/node_modules/dotenv-expand/dotenv-expand.png deleted file mode 100644 index 7335bb3..0000000 Binary files a/node_modules/dotenv-expand/dotenv-expand.png and /dev/null differ diff --git a/node_modules/dotenv-expand/index.d.ts b/node_modules/dotenv-expand/index.d.ts deleted file mode 100644 index 5cf42ee..0000000 --- a/node_modules/dotenv-expand/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export = dotenv_expand; - -interface DotenvResult { - error?: Error; - parsed?: { - [name: string]: string; - }; -} - -declare function dotenv_expand(config: DotenvResult): DotenvResult; - -declare namespace dotenv_expand { - const prototype: { - }; -} diff --git a/node_modules/dotenv-expand/lib/main.js b/node_modules/dotenv-expand/lib/main.js deleted file mode 100644 index c9c18b1..0000000 --- a/node_modules/dotenv-expand/lib/main.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict' - -var dotenvExpand = function (config) { - var interpolate = function (env) { - var matches = env.match(/\$([a-zA-Z0-9_]+)|\${([a-zA-Z0-9_]+)}/g) || [] - - matches.forEach(function (match) { - var key = match.replace(/\$|{|}/g, '') - - // process.env value 'wins' over .env file's value - var variable = process.env[key] || config.parsed[key] || '' - - // Resolve recursive interpolations - variable = interpolate(variable) - - env = env.replace(match, variable) - }) - - return env - } - - for (var configKey in config.parsed) { - var value = process.env[configKey] || config.parsed[configKey] - - if (config.parsed[configKey].substring(0, 2) === '\\$') { - config.parsed[configKey] = value.substring(1) - } else if (config.parsed[configKey].indexOf('\\$') > 0) { - config.parsed[configKey] = value.replace(/\\\$/g, '$') - } else { - config.parsed[configKey] = interpolate(value) - } - } - - for (var processKey in config.parsed) { - process.env[processKey] = config.parsed[processKey] - } - - return config -} - -module.exports = dotenvExpand diff --git a/node_modules/dotenv-expand/package.json b/node_modules/dotenv-expand/package.json deleted file mode 100644 index 29fe16b..0000000 --- a/node_modules/dotenv-expand/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "_from": "dotenv-expand@^4.2.0", - "_id": "dotenv-expand@4.2.0", - "_inBundle": false, - "_integrity": "sha1-3vHxyl1gWdJKdm5YeULCEQbOEnU=", - "_location": "/dotenv-expand", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "dotenv-expand@^4.2.0", - "name": "dotenv-expand", - "escapedName": "dotenv-expand", - "rawSpec": "^4.2.0", - "saveSpec": null, - "fetchSpec": "^4.2.0" - }, - "_requiredBy": [ - "/read-config-file" - ], - "_resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-4.2.0.tgz", - "_shasum": "def1f1ca5d6059d24a766e587942c21106ce1275", - "_spec": "dotenv-expand@^4.2.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/read-config-file", - "author": { - "name": "motdotla" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Expand environment variables using dotenv", - "devDependencies": { - "dotenv": "^4.0.0", - "lab": "^13.0.1", - "should": "^11.2.1", - "standard": "^9.0.2" - }, - "keywords": [ - "dotenv", - "expand", - "variables" - ], - "license": "BSD-2-Clause", - "main": "lib/main.js", - "name": "dotenv-expand", - "scripts": { - "lint": "standard", - "posttest": "npm run lint", - "test": "lab test/* --coverage" - }, - "types": "./index.d.ts", - "version": "4.2.0" -} diff --git a/node_modules/dotenv/CHANGELOG.md b/node_modules/dotenv/CHANGELOG.md deleted file mode 100644 index 2d7df42..0000000 --- a/node_modules/dotenv/CHANGELOG.md +++ /dev/null @@ -1,117 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## [Unreleased] - -## [6.2.0] - 2018-12-03 - -### Added - -- Support preload configuration via environment variables ([#351](https://github.com/motdotla/dotenv/issues/351)) - -## [6.1.0] - 2018-10-08 - -### Added - -- `debug` option for `config` and `parse` methods will turn on logging - -## [6.0.0] - 2018-06-02 - -### Changed - -- *Breaking:* drop support for Node v4 ([#304](https://github.com/motdotla/dotenv/pull/304)) - -## [5.0.0] - 2018-01-29 - -### Added - -- Testing against Node v8 and v9 -- Documentation on trim behavior of values -- Documentation on how to use with `import` - -### Changed - -- *Breaking*: default `path` is now `path.resolve(process.cwd(), '.env')` -- *Breaking*: does not write over keys already in `process.env` if the key has a falsy value -- using `const` and `let` instead of `var` - -### Removed - -- Testing against Node v7 - - -## [4.0.0] - 2016-12-23 -### Changed - -- Return Object with parsed content or error instead of false ([#165](https://github.com/motdotla/dotenv/pull/165)). - - -### Removed - -- `verbose` option removed in favor of returning result. - - -## [3.0.0] - 2016-12-20 -### Added - -- `verbose` option will log any error messages. Off by default. -- parses email addresses correctly -- allow importing config method directly in ES6 - -### Changed - -- Suppress error messages by default ([#154](https://github.com/motdotla/dotenv/pull/154)) -- Ignoring more files for NPM to make package download smaller - -### Fixed - -- False positive test due to case-sensitive variable ([#124](https://github.com/motdotla/dotenv/pull/124)) - -### Removed - -- `silent` option removed in favor of `verbose` - -## [2.0.0] - 2016-01-20 -### Added -- CHANGELOG to ["make it easier for users and contributors to see precisely what notable changes have been made between each release"](http://keepachangelog.com/). Linked to from README -- LICENSE to be more explicit about what was defined in `package.json`. Linked to from README -- Testing nodejs v4 on travis-ci -- added examples of how to use dotenv in different ways -- return parsed object on success rather than boolean true - -### Changed -- README has shorter description not referencing ruby gem since we don't have or want feature parity - -### Removed -- Variable expansion and escaping so environment variables are encouraged to be fully orthogonal - -## [1.2.0] - 2015-06-20 -### Added -- Preload hook to require dotenv without including it in your code - -### Changed -- clarified license to be "BSD-2-Clause" in `package.json` - -### Fixed -- retain spaces in string vars - -## [1.1.0] - 2015-03-31 -### Added -- Silent option to silence `console.log` when `.env` missing - -## [1.0.0] - 2015-03-13 -### Removed -- support for multiple `.env` files. should always use one `.env` file for the current environment - -[Unreleased]: https://github.com/motdotla/dotenv/compare/v6.2.0...HEAD -[6.2.0]: https://github.com/motdotla/dotenv/compare/v6.1.0...v6.2.0 -[6.1.0]: https://github.com/motdotla/dotenv/compare/v6.0.0...v6.1.0 -[6.0.0]: https://github.com/motdotla/dotenv/compare/v5.0.0...v6.0.0 -[5.0.0]: https://github.com/motdotla/dotenv/compare/v4.0.0...v5.0.0 -[4.0.0]: https://github.com/motdotla/dotenv/compare/v3.0.0...v4.0.0 -[3.0.0]: https://github.com/motdotla/dotenv/compare/v2.0.0...v3.0.0 -[2.0.0]: https://github.com/motdotla/dotenv/compare/v1.2.0...v2.0.0 -[1.2.0]: https://github.com/motdotla/dotenv/compare/v1.1.0...v1.2.0 -[1.1.0]: https://github.com/motdotla/dotenv/compare/v1.0.0...v1.1.0 -[1.0.0]: https://github.com/motdotla/dotenv/compare/v0.4.0...v1.0.0 diff --git a/node_modules/dotenv/LICENSE b/node_modules/dotenv/LICENSE deleted file mode 100644 index c430ad8..0000000 --- a/node_modules/dotenv/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015, Scott Motte -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/dotenv/README.md b/node_modules/dotenv/README.md deleted file mode 100644 index cb4148b..0000000 --- a/node_modules/dotenv/README.md +++ /dev/null @@ -1,295 +0,0 @@ -# dotenv - -dotenv - -Dotenv is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](http://12factor.net/config) methodology. - -[![BuildStatus](https://img.shields.io/travis/motdotla/dotenv/master.svg?style=flat-square)](https://travis-ci.org/motdotla/dotenv) -[![Build status](https://ci.appveyor.com/api/projects/status/github/motdotla/dotenv?svg=true)](https://ci.appveyor.com/project/motdotla/dotenv/branch/master) -[![NPM version](https://img.shields.io/npm/v/dotenv.svg?style=flat-square)](https://www.npmjs.com/package/dotenv) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) -[![Coverage Status](https://img.shields.io/coveralls/motdotla/dotenv/master.svg?style=flat-square)](https://coveralls.io/github/motdotla/dotenv?branch=coverall-intergration) - -## Install - -```bash -# with npm -npm install dotenv - -# or with Yarn -yarn add dotenv -``` - -## Usage - -As early as possible in your application, require and configure dotenv. - -```javascript -require('dotenv').config() -``` - -Create a `.env` file in the root directory of your project. Add -environment-specific variables on new lines in the form of `NAME=VALUE`. -For example: - -```dosini -DB_HOST=localhost -DB_USER=root -DB_PASS=s1mpl3 -``` - -That's it. - -`process.env` now has the keys and values you defined in your `.env` file. - -```javascript -const db = require('db') -db.connect({ - host: process.env.DB_HOST, - username: process.env.DB_USER, - password: process.env.DB_PASS -}) -``` - -### Preload - -You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#cli_r_require_module) to preload dotenv. By doing this, you do not need to require and load dotenv in your application code. This is the preferred approach when using `import` instead of `require`. - -```bash -$ node -r dotenv/config your_script.js -``` - -The configuration options below are supported as command line arguments in the format `dotenv_config_

<%= user.name %>

-<% } %> -``` - -Try EJS online at: https://ionicabizau.github.io/ejs-playground/. - -## Usage - -```javascript -let template = ejs.compile(str, options); -template(data); -// => Rendered HTML string - -ejs.render(str, data, options); -// => Rendered HTML string - -ejs.renderFile(filename, data, options, function(err, str){ - // str => Rendered HTML string -}); -``` - -It is also possible to use `ejs.render(dataAndOptions);` where you pass -everything in a single object. In that case, you'll end up with local variables -for all the passed options. However, be aware that your code could break if we -add an option with the same name as one of your data object's properties. -Therefore, we do not recommend using this shortcut. - -## Options - - - `cache` Compiled functions are cached, requires `filename` - - `filename` The name of the file being rendered. Not required if you - are using `renderFile()`. Used by `cache` to key caches, and for includes. - - `root` Set project root for includes with an absolute path (/file.ejs). - - `context` Function execution context - - `compileDebug` When `false` no debug instrumentation is compiled - - `client` When `true`, compiles a function that can be rendered - in the browser without needing to load the EJS Runtime - ([ejs.min.js](https://github.com/mde/ejs/releases/latest)). - - `delimiter` Character to use with angle brackets for open/close - - `debug` Output generated function body - - `strict` When set to `true`, generated function is in strict mode - - `_with` Whether or not to use `with() {}` constructs. If `false` - then the locals will be stored in the `locals` object. Set to `false` in strict mode. - - `localsName` Name to use for the object storing local variables when not using - `with` Defaults to `locals` - - `rmWhitespace` Remove all safe-to-remove whitespace, including leading - and trailing whitespace. It also enables a safer version of `-%>` line - slurping for all scriptlet tags (it does not strip new lines of tags in - the middle of a line). - - `escape` The escaping function used with `<%=` construct. It is - used in rendering and is `.toString()`ed in the generation of client functions. - (By default escapes XML). - - `outputFunctionName` Set to a string (e.g., 'echo' or 'print') for a function to print - output inside scriptlet tags. - - `async` When `true`, EJS will use an async function for rendering. (Depends - on async/await support in the JS runtime. - -This project uses [JSDoc](http://usejsdoc.org/). For the full public API -documentation, clone the repository and run `npm run doc`. This will run JSDoc -with the proper options and output the documentation to `out/`. If you want -the both the public & private API docs, run `npm run devdoc` instead. - -## Tags - - - `<%` 'Scriptlet' tag, for control-flow, no output - - `<%_` 'Whitespace Slurping' Scriptlet tag, strips all whitespace before it - - `<%=` Outputs the value into the template (escaped) - - `<%-` Outputs the unescaped value into the template - - `<%#` Comment tag, no execution, no output - - `<%%` Outputs a literal '<%' - - `%%>` Outputs a literal '%>' - - `%>` Plain ending tag - - `-%>` Trim-mode ('newline slurp') tag, trims following newline - - `_%>` 'Whitespace Slurping' ending tag, removes all whitespace after it - -For the full syntax documentation, please see [docs/syntax.md](https://github.com/mde/ejs/blob/master/docs/syntax.md). - -## Includes - -Includes either have to be an absolute path, or, if not, are assumed as -relative to the template with the `include` call. For example if you are -including `./views/user/show.ejs` from `./views/users.ejs` you would -use `<%- include('user/show') %>`. - -You must specify the `filename` option for the template with the `include` -call unless you are using `renderFile()`. - -You'll likely want to use the raw output tag (`<%-`) with your include to avoid -double-escaping the HTML output. - -```html -
    - <% users.forEach(function(user){ %> - <%- include('user/show', {user: user}) %> - <% }); %> -
-``` - -Includes are inserted at runtime, so you can use variables for the path in the -`include` call (for example `<%- include(somePath) %>`). Variables in your -top-level data object are available to all your includes, but local variables -need to be passed down. - -NOTE: Include preprocessor directives (`<% include user/show %>`) are -still supported. - -## Custom delimiters - -Custom delimiters can be applied on a per-template basis, or globally: - -```javascript -let ejs = require('ejs'), - users = ['geddy', 'neil', 'alex']; - -// Just one template -ejs.render('', {users: users}, {delimiter: '?'}); -// => 'geddy | neil | alex' - -// Or globally -ejs.delimiter = '$'; -ejs.render('<$= users.join(" | "); $>', {users: users}); -// => 'geddy | neil | alex' -``` - -## Caching - -EJS ships with a basic in-process cache for caching the intermediate JavaScript -functions used to render templates. It's easy to plug in LRU caching using -Node's `lru-cache` library: - -```javascript -let ejs = require('ejs'), - LRU = require('lru-cache'); -ejs.cache = LRU(100); // LRU cache with 100-item limit -``` - -If you want to clear the EJS cache, call `ejs.clearCache`. If you're using the -LRU cache and need a different limit, simple reset `ejs.cache` to a new instance -of the LRU. - -## Custom file loader - -The default file loader is `fs.readFileSync`, if you want to customize it, you can set ejs.fileLoader. - -```javascript -let ejs = require('ejs'); -let myFileLoad = function (filePath) { - return 'myFileLoad: ' + fs.readFileSync(filePath); -}; - -ejs.fileLoader = myFileLoad; -``` - -With this feature, you can preprocess the template before reading it. - -## Layouts - -EJS does not specifically support blocks, but layouts can be implemented by -including headers and footers, like so: - - -```html -<%- include('header') -%> -

- Title -

-

- My page -

-<%- include('footer') -%> -``` - -## Client-side support - -Go to the [Latest Release](https://github.com/mde/ejs/releases/latest), download -`./ejs.js` or `./ejs.min.js`. Alternately, you can compile it yourself by cloning -the repository and running `jake build` (or `$(npm bin)/jake build` if jake is -not installed globally). - -Include one of these files on your page, and `ejs` should be available globally. - -### Example - -```html -
- - -``` - -### Caveats - -Most of EJS will work as expected; however, there are a few things to note: - -1. Obviously, since you do not have access to the filesystem, `ejs.renderFile()` won't work. -2. For the same reason, `include`s do not work unless you use an `include callback`. Here is an example: - ```javascript - let str = "Hello <%= include('file', {person: 'John'}); %>", - fn = ejs.compile(str, {client: true}); - - fn(data, null, function(path, d){ // include callback - // path -> 'file' - // d -> {person: 'John'} - // Put your code here - // Return the contents of file as a string - }); // returns rendered string - ``` - -### IDE Integration with Syntax Highlighting - -VSCode:Javascript EJS by *DigitalBrainstem* - -## Related projects - -There are a number of implementations of EJS: - - * TJ's implementation, the v1 of this library: https://github.com/tj/ejs - * Jupiter Consulting's EJS: http://www.embeddedjs.com/ - * EJS Embedded JavaScript Framework on Google Code: https://code.google.com/p/embeddedjavascript/ - * Sam Stephenson's Ruby implementation: https://rubygems.org/gems/ejs - * Erubis, an ERB implementation which also runs JavaScript: http://www.kuwata-lab.com/erubis/users-guide.04.html#lang-javascript - * DigitalBrainstem EJS Language support: https://github.com/Digitalbrainstem/ejs-grammar - -## License - -Licensed under the Apache License, Version 2.0 -() - -- - - -EJS Embedded JavaScript templates copyright 2112 -mde@fleegix.org. diff --git a/node_modules/ejs/ejs.js b/node_modules/ejs/ejs.js deleted file mode 100644 index 1852147..0000000 --- a/node_modules/ejs/ejs.js +++ /dev/null @@ -1,1571 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ejs = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o - * @author Tiancheng "Timothy" Gu - * @project EJS - * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} - */ - -/** - * EJS internal functions. - * - * Technically this "module" lies in the same file as {@link module:ejs}, for - * the sake of organization all the private functions re grouped into this - * module. - * - * @module ejs-internal - * @private - */ - -/** - * Embedded JavaScript templating engine. - * - * @module ejs - * @public - */ - -var fs = require('fs'); -var path = require('path'); -var utils = require('./utils'); - -var scopeOptionWarned = false; -var _VERSION_STRING = require('../package.json').version; -var _DEFAULT_DELIMITER = '%'; -var _DEFAULT_LOCALS_NAME = 'locals'; -var _NAME = 'ejs'; -var _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)'; -var _OPTS_PASSABLE_WITH_DATA = ['delimiter', 'scope', 'context', 'debug', 'compileDebug', - 'client', '_with', 'rmWhitespace', 'strict', 'filename', 'async']; -// We don't allow 'cache' option to be passed in the data obj for -// the normal `render` call, but this is where Express 2 & 3 put it -// so we make an exception for `renderFile` -var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat('cache'); -var _BOM = /^\uFEFF/; - -/** - * EJS template function cache. This can be a LRU object from lru-cache NPM - * module. By default, it is {@link module:utils.cache}, a simple in-process - * cache that grows continuously. - * - * @type {Cache} - */ - -exports.cache = utils.cache; - -/** - * Custom file loader. Useful for template preprocessing or restricting access - * to a certain part of the filesystem. - * - * @type {fileLoader} - */ - -exports.fileLoader = fs.readFileSync; - -/** - * Name of the object containing the locals. - * - * This variable is overridden by {@link Options}`.localsName` if it is not - * `undefined`. - * - * @type {String} - * @public - */ - -exports.localsName = _DEFAULT_LOCALS_NAME; - -/** - * Promise implementation -- defaults to the native implementation if available - * This is mostly just for testability - * - * @type {Function} - * @public - */ - -exports.promiseImpl = (new Function('return this;'))().Promise; - -/** - * Get the path to the included file from the parent file path and the - * specified path. - * - * @param {String} name specified path - * @param {String} filename parent file path - * @param {Boolean} isDir parent file path whether is directory - * @return {String} - */ -exports.resolveInclude = function(name, filename, isDir) { - var dirname = path.dirname; - var extname = path.extname; - var resolve = path.resolve; - var includePath = resolve(isDir ? filename : dirname(filename), name); - var ext = extname(name); - if (!ext) { - includePath += '.ejs'; - } - return includePath; -}; - -/** - * Get the path to the included file by Options - * - * @param {String} path specified path - * @param {Options} options compilation options - * @return {String} - */ -function getIncludePath(path, options) { - var includePath; - var filePath; - var views = options.views; - - // Abs path - if (path.charAt(0) == '/') { - includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true); - } - // Relative paths - else { - // Look relative to a passed filename first - if (options.filename) { - filePath = exports.resolveInclude(path, options.filename); - if (fs.existsSync(filePath)) { - includePath = filePath; - } - } - // Then look in any views directories - if (!includePath) { - if (Array.isArray(views) && views.some(function (v) { - filePath = exports.resolveInclude(path, v, true); - return fs.existsSync(filePath); - })) { - includePath = filePath; - } - } - if (!includePath) { - throw new Error('Could not find the include file "' + - options.escapeFunction(path) + '"'); - } - } - return includePath; -} - -/** - * Get the template from a string or a file, either compiled on-the-fly or - * read from cache (if enabled), and cache the template if needed. - * - * If `template` is not set, the file specified in `options.filename` will be - * read. - * - * If `options.cache` is true, this function reads the file from - * `options.filename` so it must be set prior to calling this function. - * - * @memberof module:ejs-internal - * @param {Options} options compilation options - * @param {String} [template] template source - * @return {(TemplateFunction|ClientFunction)} - * Depending on the value of `options.client`, either type might be returned. - * @static - */ - -function handleCache(options, template) { - var func; - var filename = options.filename; - var hasTemplate = arguments.length > 1; - - if (options.cache) { - if (!filename) { - throw new Error('cache option requires a filename'); - } - func = exports.cache.get(filename); - if (func) { - return func; - } - if (!hasTemplate) { - template = fileLoader(filename).toString().replace(_BOM, ''); - } - } - else if (!hasTemplate) { - // istanbul ignore if: should not happen at all - if (!filename) { - throw new Error('Internal EJS error: no file name or template ' - + 'provided'); - } - template = fileLoader(filename).toString().replace(_BOM, ''); - } - func = exports.compile(template, options); - if (options.cache) { - exports.cache.set(filename, func); - } - return func; -} - -/** - * Try calling handleCache with the given options and data and call the - * callback with the result. If an error occurs, call the callback with - * the error. Used by renderFile(). - * - * @memberof module:ejs-internal - * @param {Options} options compilation options - * @param {Object} data template data - * @param {RenderFileCallback} cb callback - * @static - */ - -function tryHandleCache(options, data, cb) { - var result; - if (!cb) { - if (typeof exports.promiseImpl == 'function') { - return new exports.promiseImpl(function (resolve, reject) { - try { - result = handleCache(options)(data); - resolve(result); - } - catch (err) { - reject(err); - } - }); - } - else { - throw new Error('Please provide a callback function'); - } - } - else { - try { - result = handleCache(options)(data); - } - catch (err) { - return cb(err); - } - - cb(null, result); - } -} - -/** - * fileLoader is independent - * - * @param {String} filePath ejs file path. - * @return {String} The contents of the specified file. - * @static - */ - -function fileLoader(filePath){ - return exports.fileLoader(filePath); -} - -/** - * Get the template function. - * - * If `options.cache` is `true`, then the template is cached. - * - * @memberof module:ejs-internal - * @param {String} path path for the specified file - * @param {Options} options compilation options - * @return {(TemplateFunction|ClientFunction)} - * Depending on the value of `options.client`, either type might be returned - * @static - */ - -function includeFile(path, options) { - var opts = utils.shallowCopy({}, options); - opts.filename = getIncludePath(path, opts); - return handleCache(opts); -} - -/** - * Get the JavaScript source of an included file. - * - * @memberof module:ejs-internal - * @param {String} path path for the specified file - * @param {Options} options compilation options - * @return {Object} - * @static - */ - -function includeSource(path, options) { - var opts = utils.shallowCopy({}, options); - var includePath; - var template; - includePath = getIncludePath(path, opts); - template = fileLoader(includePath).toString().replace(_BOM, ''); - opts.filename = includePath; - var templ = new Template(template, opts); - templ.generateSource(); - return { - source: templ.source, - filename: includePath, - template: template - }; -} - -/** - * Re-throw the given `err` in context to the `str` of ejs, `filename`, and - * `lineno`. - * - * @implements RethrowCallback - * @memberof module:ejs-internal - * @param {Error} err Error object - * @param {String} str EJS source - * @param {String} filename file name of the EJS file - * @param {String} lineno line number of the error - * @static - */ - -function rethrow(err, str, flnm, lineno, esc){ - var lines = str.split('\n'); - var start = Math.max(lineno - 3, 0); - var end = Math.min(lines.length, lineno + 3); - var filename = esc(flnm); // eslint-disable-line - // Error context - var context = lines.slice(start, end).map(function (line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' >> ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'ejs') + ':' - + lineno + '\n' - + context + '\n\n' - + err.message; - - throw err; -} - -function stripSemi(str){ - return str.replace(/;(\s*$)/, '$1'); -} - -/** - * Compile the given `str` of ejs into a template function. - * - * @param {String} template EJS template - * - * @param {Options} opts compilation options - * - * @return {(TemplateFunction|ClientFunction)} - * Depending on the value of `opts.client`, either type might be returned. - * Note that the return type of the function also depends on the value of `opts.async`. - * @public - */ - -exports.compile = function compile(template, opts) { - var templ; - - // v1 compat - // 'scope' is 'context' - // FIXME: Remove this in a future version - if (opts && opts.scope) { - if (!scopeOptionWarned){ - console.warn('`scope` option is deprecated and will be removed in EJS 3'); - scopeOptionWarned = true; - } - if (!opts.context) { - opts.context = opts.scope; - } - delete opts.scope; - } - templ = new Template(template, opts); - return templ.compile(); -}; - -/** - * Render the given `template` of ejs. - * - * If you would like to include options but not data, you need to explicitly - * call this function with `data` being an empty object or `null`. - * - * @param {String} template EJS template - * @param {Object} [data={}] template data - * @param {Options} [opts={}] compilation and rendering options - * @return {(String|Promise)} - * Return value type depends on `opts.async`. - * @public - */ - -exports.render = function (template, d, o) { - var data = d || {}; - var opts = o || {}; - - // No options object -- if there are optiony names - // in the data, copy them to options - if (arguments.length == 2) { - utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA); - } - - return handleCache(opts, template)(data); -}; - -/** - * Render an EJS file at the given `path` and callback `cb(err, str)`. - * - * If you would like to include options but not data, you need to explicitly - * call this function with `data` being an empty object or `null`. - * - * @param {String} path path to the EJS file - * @param {Object} [data={}] template data - * @param {Options} [opts={}] compilation and rendering options - * @param {RenderFileCallback} cb callback - * @public - */ - -exports.renderFile = function () { - var args = Array.prototype.slice.call(arguments); - var filename = args.shift(); - var cb; - var opts = {filename: filename}; - var data; - var viewOpts; - - // Do we have a callback? - if (typeof arguments[arguments.length - 1] == 'function') { - cb = args.pop(); - } - // Do we have data/opts? - if (args.length) { - // Should always have data obj - data = args.shift(); - // Normal passed opts (data obj + opts obj) - if (args.length) { - // Use shallowCopy so we don't pollute passed in opts obj with new vals - utils.shallowCopy(opts, args.pop()); - } - // Special casing for Express (settings + opts-in-data) - else { - // Express 3 and 4 - if (data.settings) { - // Pull a few things from known locations - if (data.settings.views) { - opts.views = data.settings.views; - } - if (data.settings['view cache']) { - opts.cache = true; - } - // Undocumented after Express 2, but still usable, esp. for - // items that are unsafe to be passed along with data, like `root` - viewOpts = data.settings['view options']; - if (viewOpts) { - utils.shallowCopy(opts, viewOpts); - } - } - // Express 2 and lower, values set in app.locals, or people who just - // want to pass options in their data. NOTE: These values will override - // anything previously set in settings or settings['view options'] - utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS); - } - opts.filename = filename; - } - else { - data = {}; - } - - return tryHandleCache(opts, data, cb); -}; - -/** - * Clear intermediate JavaScript cache. Calls {@link Cache#reset}. - * @public - */ - -exports.clearCache = function () { - exports.cache.reset(); -}; - -function Template(text, opts) { - opts = opts || {}; - var options = {}; - this.templateText = text; - this.mode = null; - this.truncate = false; - this.currentLine = 1; - this.source = ''; - this.dependencies = []; - options.client = opts.client || false; - options.escapeFunction = opts.escape || utils.escapeXML; - options.compileDebug = opts.compileDebug !== false; - options.debug = !!opts.debug; - options.filename = opts.filename; - options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER; - options.strict = opts.strict || false; - options.context = opts.context; - options.cache = opts.cache || false; - options.rmWhitespace = opts.rmWhitespace; - options.root = opts.root; - options.outputFunctionName = opts.outputFunctionName; - options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME; - options.views = opts.views; - options.async = opts.async; - - if (options.strict) { - options._with = false; - } - else { - options._with = typeof opts._with != 'undefined' ? opts._with : true; - } - - this.opts = options; - - this.regex = this.createRegex(); -} - -Template.modes = { - EVAL: 'eval', - ESCAPED: 'escaped', - RAW: 'raw', - COMMENT: 'comment', - LITERAL: 'literal' -}; - -Template.prototype = { - createRegex: function () { - var str = _REGEX_STRING; - var delim = utils.escapeRegExpChars(this.opts.delimiter); - str = str.replace(/%/g, delim); - return new RegExp(str); - }, - - compile: function () { - var src; - var fn; - var opts = this.opts; - var prepended = ''; - var appended = ''; - var escapeFn = opts.escapeFunction; - var asyncCtor; - - if (!this.source) { - this.generateSource(); - prepended += ' var __output = [], __append = __output.push.bind(__output);' + '\n'; - if (opts.outputFunctionName) { - prepended += ' var ' + opts.outputFunctionName + ' = __append;' + '\n'; - } - if (opts._with !== false) { - prepended += ' with (' + opts.localsName + ' || {}) {' + '\n'; - appended += ' }' + '\n'; - } - appended += ' return __output.join("");' + '\n'; - this.source = prepended + this.source + appended; - } - - if (opts.compileDebug) { - src = 'var __line = 1' + '\n' - + ' , __lines = ' + JSON.stringify(this.templateText) + '\n' - + ' , __filename = ' + (opts.filename ? - JSON.stringify(opts.filename) : 'undefined') + ';' + '\n' - + 'try {' + '\n' - + this.source - + '} catch (e) {' + '\n' - + ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\n' - + '}' + '\n'; - } - else { - src = this.source; - } - - if (opts.client) { - src = 'escapeFn = escapeFn || ' + escapeFn.toString() + ';' + '\n' + src; - if (opts.compileDebug) { - src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\n' + src; - } - } - - if (opts.strict) { - src = '"use strict";\n' + src; - } - if (opts.debug) { - console.log(src); - } - - try { - if (opts.async) { - // Have to use generated function for this, since in envs without support, - // it breaks in parsing - try { - asyncCtor = (new Function('return (async function(){}).constructor;'))(); - } - catch(e) { - if (e instanceof SyntaxError) { - throw new Error('This environment does not support async/await'); - } - else { - throw e; - } - } - } - else { - asyncCtor = Function; - } - fn = new asyncCtor(opts.localsName + ', escapeFn, include, rethrow', src); - } - catch(e) { - // istanbul ignore else - if (e instanceof SyntaxError) { - if (opts.filename) { - e.message += ' in ' + opts.filename; - } - e.message += ' while compiling ejs\n\n'; - e.message += 'If the above error is not helpful, you may want to try EJS-Lint:\n'; - e.message += 'https://github.com/RyanZim/EJS-Lint'; - if (!e.async) { - e.message += '\n'; - e.message += 'Or, if you meant to create an async function, pass async: true as an option.'; - } - } - throw e; - } - - if (opts.client) { - fn.dependencies = this.dependencies; - return fn; - } - - // Return a callable function which will execute the function - // created by the source-code, with the passed data as locals - // Adds a local `include` function which allows full recursive include - var returnedFn = function (data) { - var include = function (path, includeData) { - var d = utils.shallowCopy({}, data); - if (includeData) { - d = utils.shallowCopy(d, includeData); - } - return includeFile(path, opts)(d); - }; - return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]); - }; - returnedFn.dependencies = this.dependencies; - return returnedFn; - }, - - generateSource: function () { - var opts = this.opts; - - if (opts.rmWhitespace) { - // Have to use two separate replace here as `^` and `$` operators don't - // work well with `\r`. - this.templateText = - this.templateText.replace(/\r/g, '').replace(/^\s+|\s+$/gm, ''); - } - - // Slurp spaces and tabs before <%_ and after _%> - this.templateText = - this.templateText.replace(/[ \t]*<%_/gm, '<%_').replace(/_%>[ \t]*/gm, '_%>'); - - var self = this; - var matches = this.parseTemplateText(); - var d = this.opts.delimiter; - - if (matches && matches.length) { - matches.forEach(function (line, index) { - var opening; - var closing; - var include; - var includeOpts; - var includeObj; - var includeSrc; - // If this is an opening tag, check for closing tags - // FIXME: May end up with some false positives here - // Better to store modes as k/v with '<' + delimiter as key - // Then this can simply check against the map - if ( line.indexOf('<' + d) === 0 // If it is a tag - && line.indexOf('<' + d + d) !== 0) { // and is not escaped - closing = matches[index + 2]; - if (!(closing == d + '>' || closing == '-' + d + '>' || closing == '_' + d + '>')) { - throw new Error('Could not find matching close tag for "' + line + '".'); - } - } - // HACK: backward-compat `include` preprocessor directives - if ((include = line.match(/^\s*include\s+(\S+)/))) { - opening = matches[index - 1]; - // Must be in EVAL or RAW mode - if (opening && (opening == '<' + d || opening == '<' + d + '-' || opening == '<' + d + '_')) { - includeOpts = utils.shallowCopy({}, self.opts); - includeObj = includeSource(include[1], includeOpts); - if (self.opts.compileDebug) { - includeSrc = - ' ; (function(){' + '\n' - + ' var __line = 1' + '\n' - + ' , __lines = ' + JSON.stringify(includeObj.template) + '\n' - + ' , __filename = ' + JSON.stringify(includeObj.filename) + ';' + '\n' - + ' try {' + '\n' - + includeObj.source - + ' } catch (e) {' + '\n' - + ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\n' - + ' }' + '\n' - + ' ; }).call(this)' + '\n'; - }else{ - includeSrc = ' ; (function(){' + '\n' + includeObj.source + - ' ; }).call(this)' + '\n'; - } - self.source += includeSrc; - self.dependencies.push(exports.resolveInclude(include[1], - includeOpts.filename)); - return; - } - } - self.scanLine(line); - }); - } - - }, - - parseTemplateText: function () { - var str = this.templateText; - var pat = this.regex; - var result = pat.exec(str); - var arr = []; - var firstPos; - - while (result) { - firstPos = result.index; - - if (firstPos !== 0) { - arr.push(str.substring(0, firstPos)); - str = str.slice(firstPos); - } - - arr.push(result[0]); - str = str.slice(result[0].length); - result = pat.exec(str); - } - - if (str) { - arr.push(str); - } - - return arr; - }, - - _addOutput: function (line) { - if (this.truncate) { - // Only replace single leading linebreak in the line after - // -%> tag -- this is the single, trailing linebreak - // after the tag that the truncation mode replaces - // Handle Win / Unix / old Mac linebreaks -- do the \r\n - // combo first in the regex-or - line = line.replace(/^(?:\r\n|\r|\n)/, ''); - this.truncate = false; - } - else if (this.opts.rmWhitespace) { - // rmWhitespace has already removed trailing spaces, just need - // to remove linebreaks - line = line.replace(/^\n/, ''); - } - if (!line) { - return line; - } - - // Preserve literal slashes - line = line.replace(/\\/g, '\\\\'); - - // Convert linebreaks - line = line.replace(/\n/g, '\\n'); - line = line.replace(/\r/g, '\\r'); - - // Escape double-quotes - // - this will be the delimiter during execution - line = line.replace(/"/g, '\\"'); - this.source += ' ; __append("' + line + '")' + '\n'; - }, - - scanLine: function (line) { - var self = this; - var d = this.opts.delimiter; - var newLineCount = 0; - - newLineCount = (line.split('\n').length - 1); - - switch (line) { - case '<' + d: - case '<' + d + '_': - this.mode = Template.modes.EVAL; - break; - case '<' + d + '=': - this.mode = Template.modes.ESCAPED; - break; - case '<' + d + '-': - this.mode = Template.modes.RAW; - break; - case '<' + d + '#': - this.mode = Template.modes.COMMENT; - break; - case '<' + d + d: - this.mode = Template.modes.LITERAL; - this.source += ' ; __append("' + line.replace('<' + d + d, '<' + d) + '")' + '\n'; - break; - case d + d + '>': - this.mode = Template.modes.LITERAL; - this.source += ' ; __append("' + line.replace(d + d + '>', d + '>') + '")' + '\n'; - break; - case d + '>': - case '-' + d + '>': - case '_' + d + '>': - if (this.mode == Template.modes.LITERAL) { - this._addOutput(line); - } - - this.mode = null; - this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0; - break; - default: - // In script mode, depends on type of tag - if (this.mode) { - // If '//' is found without a line break, add a line break. - switch (this.mode) { - case Template.modes.EVAL: - case Template.modes.ESCAPED: - case Template.modes.RAW: - if (line.lastIndexOf('//') > line.lastIndexOf('\n')) { - line += '\n'; - } - } - switch (this.mode) { - // Just executing code - case Template.modes.EVAL: - this.source += ' ; ' + line + '\n'; - break; - // Exec, esc, and output - case Template.modes.ESCAPED: - this.source += ' ; __append(escapeFn(' + stripSemi(line) + '))' + '\n'; - break; - // Exec and output - case Template.modes.RAW: - this.source += ' ; __append(' + stripSemi(line) + ')' + '\n'; - break; - case Template.modes.COMMENT: - // Do nothing - break; - // Literal <%% mode, append as raw output - case Template.modes.LITERAL: - this._addOutput(line); - break; - } - } - // In string mode, just add the output - else { - this._addOutput(line); - } - } - - if (self.opts.compileDebug && newLineCount) { - this.currentLine += newLineCount; - this.source += ' ; __line = ' + this.currentLine + '\n'; - } - } -}; - -/** - * Escape characters reserved in XML. - * - * This is simply an export of {@link module:utils.escapeXML}. - * - * If `markup` is `undefined` or `null`, the empty string is returned. - * - * @param {String} markup Input string - * @return {String} Escaped string - * @public - * @func - * */ -exports.escapeXML = utils.escapeXML; - -/** - * Express.js support. - * - * This is an alias for {@link module:ejs.renderFile}, in order to support - * Express.js out-of-the-box. - * - * @func - */ - -exports.__express = exports.renderFile; - -// Add require support -/* istanbul ignore else */ -if (require.extensions) { - require.extensions['.ejs'] = function (module, flnm) { - var filename = flnm || /* istanbul ignore next */ module.filename; - var options = { - filename: filename, - client: true - }; - var template = fileLoader(filename).toString(); - var fn = exports.compile(template, options); - module._compile('module.exports = ' + fn.toString() + ';', filename); - }; -} - -/** - * Version of EJS. - * - * @readonly - * @type {String} - * @public - */ - -exports.VERSION = _VERSION_STRING; - -/** - * Name for detection of EJS. - * - * @readonly - * @type {String} - * @public - */ - -exports.name = _NAME; - -/* istanbul ignore if */ -if (typeof window != 'undefined') { - window.ejs = exports; -} - -},{"../package.json":6,"./utils":2,"fs":3,"path":4}],2:[function(require,module,exports){ -/* - * EJS Embedded JavaScript templates - * Copyright 2112 Matthew Eernisse (mde@fleegix.org) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * -*/ - -/** - * Private utility functions - * @module utils - * @private - */ - -'use strict'; - -var regExpChars = /[|\\{}()[\]^$+*?.]/g; - -/** - * Escape characters reserved in regular expressions. - * - * If `string` is `undefined` or `null`, the empty string is returned. - * - * @param {String} string Input string - * @return {String} Escaped string - * @static - * @private - */ -exports.escapeRegExpChars = function (string) { - // istanbul ignore if - if (!string) { - return ''; - } - return String(string).replace(regExpChars, '\\$&'); -}; - -var _ENCODE_HTML_RULES = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; -var _MATCH_HTML = /[&<>'"]/g; - -function encode_char(c) { - return _ENCODE_HTML_RULES[c] || c; -} - -/** - * Stringified version of constants used by {@link module:utils.escapeXML}. - * - * It is used in the process of generating {@link ClientFunction}s. - * - * @readonly - * @type {String} - */ - -var escapeFuncStr = - 'var _ENCODE_HTML_RULES = {\n' -+ ' "&": "&"\n' -+ ' , "<": "<"\n' -+ ' , ">": ">"\n' -+ ' , \'"\': """\n' -+ ' , "\'": "'"\n' -+ ' }\n' -+ ' , _MATCH_HTML = /[&<>\'"]/g;\n' -+ 'function encode_char(c) {\n' -+ ' return _ENCODE_HTML_RULES[c] || c;\n' -+ '};\n'; - -/** - * Escape characters reserved in XML. - * - * If `markup` is `undefined` or `null`, the empty string is returned. - * - * @implements {EscapeCallback} - * @param {String} markup Input string - * @return {String} Escaped string - * @static - * @private - */ - -exports.escapeXML = function (markup) { - return markup == undefined - ? '' - : String(markup) - .replace(_MATCH_HTML, encode_char); -}; -exports.escapeXML.toString = function () { - return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr; -}; - -/** - * Naive copy of properties from one object to another. - * Does not recurse into non-scalar properties - * Does not check to see if the property has a value before copying - * - * @param {Object} to Destination object - * @param {Object} from Source object - * @return {Object} Destination object - * @static - * @private - */ -exports.shallowCopy = function (to, from) { - from = from || {}; - for (var p in from) { - to[p] = from[p]; - } - return to; -}; - -/** - * Naive copy of a list of key names, from one object to another. - * Only copies property if it is actually defined - * Does not recurse into non-scalar properties - * - * @param {Object} to Destination object - * @param {Object} from Source object - * @param {Array} list List of properties to copy - * @return {Object} Destination object - * @static - * @private - */ -exports.shallowCopyFromList = function (to, from, list) { - for (var i = 0; i < list.length; i++) { - var p = list[i]; - if (typeof from[p] != 'undefined') { - to[p] = from[p]; - } - } - return to; -}; - -/** - * Simple in-process cache implementation. Does not implement limits of any - * sort. - * - * @implements Cache - * @static - * @private - */ -exports.cache = { - _data: {}, - set: function (key, val) { - this._data[key] = val; - }, - get: function (key) { - return this._data[key]; - }, - reset: function () { - this._data = {}; - } -}; - -},{}],3:[function(require,module,exports){ - -},{}],4:[function(require,module,exports){ -(function (process){ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":5}],5:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],6:[function(require,module,exports){ -module.exports={ - "name": "ejs", - "description": "Embedded JavaScript templates", - "keywords": [ - "template", - "engine", - "ejs" - ], - "version": "2.6.0", - "author": "Matthew Eernisse (http://fleegix.org)", - "contributors": [ - "Timothy Gu (https://timothygu.github.io)" - ], - "license": "Apache-2.0", - "main": "./lib/ejs.js", - "repository": { - "type": "git", - "url": "git://github.com/mde/ejs.git" - }, - "bugs": "https://github.com/mde/ejs/issues", - "homepage": "https://github.com/mde/ejs", - "dependencies": {}, - "devDependencies": { - "browserify": "^13.1.1", - "eslint": "^4.14.0", - "git-directory-deploy": "^1.5.1", - "istanbul": "~0.4.3", - "jake": "^8.0.16", - "jsdoc": "^3.4.0", - "lru-cache": "^4.0.1", - "mocha": "^5.0.5", - "uglify-js": "^3.3.16" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "jake test", - "lint": "eslint \"**/*.js\" Jakefile", - "coverage": "istanbul cover node_modules/mocha/bin/_mocha", - "doc": "jake doc", - "devdoc": "jake doc[dev]" - } -} - -},{}]},{},[1])(1) -}); diff --git a/node_modules/ejs/ejs.min.js b/node_modules/ejs/ejs.min.js deleted file mode 100644 index 199c2a9..0000000 --- a/node_modules/ejs/ejs.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ejs=f()}})(function(){var define,module,exports;return function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o1;if(options.cache){if(!filename){throw new Error("cache option requires a filename")}func=exports.cache.get(filename);if(func){return func}if(!hasTemplate){template=fileLoader(filename).toString().replace(_BOM,"")}}else if(!hasTemplate){if(!filename){throw new Error("Internal EJS error: no file name or template "+"provided")}template=fileLoader(filename).toString().replace(_BOM,"")}func=exports.compile(template,options);if(options.cache){exports.cache.set(filename,func)}return func}function tryHandleCache(options,data,cb){var result;if(!cb){if(typeof exports.promiseImpl=="function"){return new exports.promiseImpl(function(resolve,reject){try{result=handleCache(options)(data);resolve(result)}catch(err){reject(err)}})}else{throw new Error("Please provide a callback function")}}else{try{result=handleCache(options)(data)}catch(err){return cb(err)}cb(null,result)}}function fileLoader(filePath){return exports.fileLoader(filePath)}function includeFile(path,options){var opts=utils.shallowCopy({},options);opts.filename=getIncludePath(path,opts);return handleCache(opts)}function includeSource(path,options){var opts=utils.shallowCopy({},options);var includePath;var template;includePath=getIncludePath(path,opts);template=fileLoader(includePath).toString().replace(_BOM,"");opts.filename=includePath;var templ=new Template(template,opts);templ.generateSource();return{source:templ.source,filename:includePath,template:template}}function rethrow(err,str,flnm,lineno,esc){var lines=str.split("\n");var start=Math.max(lineno-3,0);var end=Math.min(lines.length,lineno+3);var filename=esc(flnm);var context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" >> ":" ")+curr+"| "+line}).join("\n");err.path=filename;err.message=(filename||"ejs")+":"+lineno+"\n"+context+"\n\n"+err.message;throw err}function stripSemi(str){return str.replace(/;(\s*$)/,"$1")}exports.compile=function compile(template,opts){var templ;if(opts&&opts.scope){if(!scopeOptionWarned){console.warn("`scope` option is deprecated and will be removed in EJS 3");scopeOptionWarned=true}if(!opts.context){opts.context=opts.scope}delete opts.scope}templ=new Template(template,opts);return templ.compile()};exports.render=function(template,d,o){var data=d||{};var opts=o||{};if(arguments.length==2){utils.shallowCopyFromList(opts,data,_OPTS_PASSABLE_WITH_DATA)}return handleCache(opts,template)(data)};exports.renderFile=function(){var args=Array.prototype.slice.call(arguments);var filename=args.shift();var cb;var opts={filename:filename};var data;var viewOpts;if(typeof arguments[arguments.length-1]=="function"){cb=args.pop()}if(args.length){data=args.shift();if(args.length){utils.shallowCopy(opts,args.pop())}else{if(data.settings){if(data.settings.views){opts.views=data.settings.views}if(data.settings["view cache"]){opts.cache=true}viewOpts=data.settings["view options"];if(viewOpts){utils.shallowCopy(opts,viewOpts)}}utils.shallowCopyFromList(opts,data,_OPTS_PASSABLE_WITH_DATA_EXPRESS)}opts.filename=filename}else{data={}}return tryHandleCache(opts,data,cb)};exports.clearCache=function(){exports.cache.reset()};function Template(text,opts){opts=opts||{};var options={};this.templateText=text;this.mode=null;this.truncate=false;this.currentLine=1;this.source="";this.dependencies=[];options.client=opts.client||false;options.escapeFunction=opts.escape||utils.escapeXML;options.compileDebug=opts.compileDebug!==false;options.debug=!!opts.debug;options.filename=opts.filename;options.delimiter=opts.delimiter||exports.delimiter||_DEFAULT_DELIMITER;options.strict=opts.strict||false;options.context=opts.context;options.cache=opts.cache||false;options.rmWhitespace=opts.rmWhitespace;options.root=opts.root;options.outputFunctionName=opts.outputFunctionName;options.localsName=opts.localsName||exports.localsName||_DEFAULT_LOCALS_NAME;options.views=opts.views;options.async=opts.async;if(options.strict){options._with=false}else{options._with=typeof opts._with!="undefined"?opts._with:true}this.opts=options;this.regex=this.createRegex()}Template.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};Template.prototype={createRegex:function(){var str=_REGEX_STRING;var delim=utils.escapeRegExpChars(this.opts.delimiter);str=str.replace(/%/g,delim);return new RegExp(str)},compile:function(){var src;var fn;var opts=this.opts;var prepended="";var appended="";var escapeFn=opts.escapeFunction;var asyncCtor;if(!this.source){this.generateSource();prepended+=" var __output = [], __append = __output.push.bind(__output);"+"\n";if(opts.outputFunctionName){prepended+=" var "+opts.outputFunctionName+" = __append;"+"\n"}if(opts._with!==false){prepended+=" with ("+opts.localsName+" || {}) {"+"\n";appended+=" }"+"\n"}appended+=' return __output.join("");'+"\n";this.source=prepended+this.source+appended}if(opts.compileDebug){src="var __line = 1"+"\n"+" , __lines = "+JSON.stringify(this.templateText)+"\n"+" , __filename = "+(opts.filename?JSON.stringify(opts.filename):"undefined")+";"+"\n"+"try {"+"\n"+this.source+"} catch (e) {"+"\n"+" rethrow(e, __lines, __filename, __line, escapeFn);"+"\n"+"}"+"\n"}else{src=this.source}if(opts.client){src="escapeFn = escapeFn || "+escapeFn.toString()+";"+"\n"+src;if(opts.compileDebug){src="rethrow = rethrow || "+rethrow.toString()+";"+"\n"+src}}if(opts.strict){src='"use strict";\n'+src}if(opts.debug){console.log(src)}try{if(opts.async){try{asyncCtor=new Function("return (async function(){}).constructor;")()}catch(e){if(e instanceof SyntaxError){throw new Error("This environment does not support async/await")}else{throw e}}}else{asyncCtor=Function}fn=new asyncCtor(opts.localsName+", escapeFn, include, rethrow",src)}catch(e){if(e instanceof SyntaxError){if(opts.filename){e.message+=" in "+opts.filename}e.message+=" while compiling ejs\n\n";e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n";e.message+="https://github.com/RyanZim/EJS-Lint";if(!e.async){e.message+="\n";e.message+="Or, if you meant to create an async function, pass async: true as an option."}}throw e}if(opts.client){fn.dependencies=this.dependencies;return fn}var returnedFn=function(data){var include=function(path,includeData){var d=utils.shallowCopy({},data);if(includeData){d=utils.shallowCopy(d,includeData)}return includeFile(path,opts)(d)};return fn.apply(opts.context,[data||{},escapeFn,include,rethrow])};returnedFn.dependencies=this.dependencies;return returnedFn},generateSource:function(){var opts=this.opts;if(opts.rmWhitespace){this.templateText=this.templateText.replace(/\r/g,"").replace(/^\s+|\s+$/gm,"")}this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var self=this;var matches=this.parseTemplateText();var d=this.opts.delimiter;if(matches&&matches.length){matches.forEach(function(line,index){var opening;var closing;var include;var includeOpts;var includeObj;var includeSrc;if(line.indexOf("<"+d)===0&&line.indexOf("<"+d+d)!==0){closing=matches[index+2];if(!(closing==d+">"||closing=="-"+d+">"||closing=="_"+d+">")){throw new Error('Could not find matching close tag for "'+line+'".')}}if(include=line.match(/^\s*include\s+(\S+)/)){opening=matches[index-1];if(opening&&(opening=="<"+d||opening=="<"+d+"-"||opening=="<"+d+"_")){includeOpts=utils.shallowCopy({},self.opts);includeObj=includeSource(include[1],includeOpts);if(self.opts.compileDebug){includeSrc=" ; (function(){"+"\n"+" var __line = 1"+"\n"+" , __lines = "+JSON.stringify(includeObj.template)+"\n"+" , __filename = "+JSON.stringify(includeObj.filename)+";"+"\n"+" try {"+"\n"+includeObj.source+" } catch (e) {"+"\n"+" rethrow(e, __lines, __filename, __line, escapeFn);"+"\n"+" }"+"\n"+" ; }).call(this)"+"\n"}else{includeSrc=" ; (function(){"+"\n"+includeObj.source+" ; }).call(this)"+"\n"}self.source+=includeSrc;self.dependencies.push(exports.resolveInclude(include[1],includeOpts.filename));return}}self.scanLine(line)})}},parseTemplateText:function(){var str=this.templateText;var pat=this.regex;var result=pat.exec(str);var arr=[];var firstPos;while(result){firstPos=result.index;if(firstPos!==0){arr.push(str.substring(0,firstPos));str=str.slice(firstPos)}arr.push(result[0]);str=str.slice(result[0].length);result=pat.exec(str)}if(str){arr.push(str)}return arr},_addOutput:function(line){if(this.truncate){line=line.replace(/^(?:\r\n|\r|\n)/,"");this.truncate=false}else if(this.opts.rmWhitespace){line=line.replace(/^\n/,"")}if(!line){return line}line=line.replace(/\\/g,"\\\\");line=line.replace(/\n/g,"\\n");line=line.replace(/\r/g,"\\r");line=line.replace(/"/g,'\\"');this.source+=' ; __append("'+line+'")'+"\n"},scanLine:function(line){var self=this;var d=this.opts.delimiter;var newLineCount=0;newLineCount=line.split("\n").length-1;switch(line){case"<"+d:case"<"+d+"_":this.mode=Template.modes.EVAL;break;case"<"+d+"=":this.mode=Template.modes.ESCAPED;break;case"<"+d+"-":this.mode=Template.modes.RAW;break;case"<"+d+"#":this.mode=Template.modes.COMMENT;break;case"<"+d+d:this.mode=Template.modes.LITERAL;this.source+=' ; __append("'+line.replace("<"+d+d,"<"+d)+'")'+"\n";break;case d+d+">":this.mode=Template.modes.LITERAL;this.source+=' ; __append("'+line.replace(d+d+">",d+">")+'")'+"\n";break;case d+">":case"-"+d+">":case"_"+d+">":if(this.mode==Template.modes.LITERAL){this._addOutput(line)}this.mode=null;this.truncate=line.indexOf("-")===0||line.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case Template.modes.EVAL:case Template.modes.ESCAPED:case Template.modes.RAW:if(line.lastIndexOf("//")>line.lastIndexOf("\n")){line+="\n"}}switch(this.mode){case Template.modes.EVAL:this.source+=" ; "+line+"\n";break;case Template.modes.ESCAPED:this.source+=" ; __append(escapeFn("+stripSemi(line)+"))"+"\n";break;case Template.modes.RAW:this.source+=" ; __append("+stripSemi(line)+")"+"\n";break;case Template.modes.COMMENT:break;case Template.modes.LITERAL:this._addOutput(line);break}}else{this._addOutput(line)}}if(self.opts.compileDebug&&newLineCount){this.currentLine+=newLineCount;this.source+=" ; __line = "+this.currentLine+"\n"}}};exports.escapeXML=utils.escapeXML;exports.__express=exports.renderFile;if(require.extensions){require.extensions[".ejs"]=function(module,flnm){var filename=flnm||module.filename;var options={filename:filename,client:true};var template=fileLoader(filename).toString();var fn=exports.compile(template,options);module._compile("module.exports = "+fn.toString()+";",filename)}}exports.VERSION=_VERSION_STRING;exports.name=_NAME;if(typeof window!="undefined"){window.ejs=exports}},{"../package.json":6,"./utils":2,fs:3,path:4}],2:[function(require,module,exports){"use strict";var regExpChars=/[|\\{}()[\]^$+*?.]/g;exports.escapeRegExpChars=function(string){if(!string){return""}return String(string).replace(regExpChars,"\\$&")};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"};var _MATCH_HTML=/[&<>'"]/g;function encode_char(c){return _ENCODE_HTML_RULES[c]||c}var escapeFuncStr="var _ENCODE_HTML_RULES = {\n"+' "&": "&"\n'+' , "<": "<"\n'+' , ">": ">"\n'+' , \'"\': """\n'+' , "\'": "'"\n'+" }\n"+" , _MATCH_HTML = /[&<>'\"]/g;\n"+"function encode_char(c) {\n"+" return _ENCODE_HTML_RULES[c] || c;\n"+"};\n";exports.escapeXML=function(markup){return markup==undefined?"":String(markup).replace(_MATCH_HTML,encode_char)};exports.escapeXML.toString=function(){return Function.prototype.toString.call(this)+";\n"+escapeFuncStr};exports.shallowCopy=function(to,from){from=from||{};for(var p in from){to[p]=from[p]}return to};exports.shallowCopyFromList=function(to,from,list){for(var i=0;i=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){for(var i=1;i (http://fleegix.org)",contributors:["Timothy Gu (https://timothygu.github.io)"],license:"Apache-2.0",main:"./lib/ejs.js",repository:{type:"git",url:"git://github.com/mde/ejs.git"},bugs:"https://github.com/mde/ejs/issues",homepage:"https://github.com/mde/ejs",dependencies:{},devDependencies:{browserify:"^13.1.1",eslint:"^4.14.0","git-directory-deploy":"^1.5.1",istanbul:"~0.4.3",jake:"^8.0.16",jsdoc:"^3.4.0","lru-cache":"^4.0.1",mocha:"^5.0.5","uglify-js":"^3.3.16"},engines:{node:">=0.10.0"},scripts:{test:"jake test",lint:'eslint "**/*.js" Jakefile',coverage:"istanbul cover node_modules/mocha/bin/_mocha",doc:"jake doc",devdoc:"jake doc[dev]"}}},{}]},{},[1])(1)}); diff --git a/node_modules/ejs/lib/ejs.js b/node_modules/ejs/lib/ejs.js deleted file mode 100755 index f5be325..0000000 --- a/node_modules/ejs/lib/ejs.js +++ /dev/null @@ -1,939 +0,0 @@ -/* - * EJS Embedded JavaScript templates - * Copyright 2112 Matthew Eernisse (mde@fleegix.org) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * -*/ - -'use strict'; - -/** - * @file Embedded JavaScript templating engine. {@link http://ejs.co} - * @author Matthew Eernisse - * @author Tiancheng "Timothy" Gu - * @project EJS - * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} - */ - -/** - * EJS internal functions. - * - * Technically this "module" lies in the same file as {@link module:ejs}, for - * the sake of organization all the private functions re grouped into this - * module. - * - * @module ejs-internal - * @private - */ - -/** - * Embedded JavaScript templating engine. - * - * @module ejs - * @public - */ - -var fs = require('fs'); -var path = require('path'); -var utils = require('./utils'); - -var scopeOptionWarned = false; -var _VERSION_STRING = require('../package.json').version; -var _DEFAULT_DELIMITER = '%'; -var _DEFAULT_LOCALS_NAME = 'locals'; -var _NAME = 'ejs'; -var _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)'; -var _OPTS_PASSABLE_WITH_DATA = ['delimiter', 'scope', 'context', 'debug', 'compileDebug', - 'client', '_with', 'rmWhitespace', 'strict', 'filename', 'async']; -// We don't allow 'cache' option to be passed in the data obj for -// the normal `render` call, but this is where Express 2 & 3 put it -// so we make an exception for `renderFile` -var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat('cache'); -var _BOM = /^\uFEFF/; - -/** - * EJS template function cache. This can be a LRU object from lru-cache NPM - * module. By default, it is {@link module:utils.cache}, a simple in-process - * cache that grows continuously. - * - * @type {Cache} - */ - -exports.cache = utils.cache; - -/** - * Custom file loader. Useful for template preprocessing or restricting access - * to a certain part of the filesystem. - * - * @type {fileLoader} - */ - -exports.fileLoader = fs.readFileSync; - -/** - * Name of the object containing the locals. - * - * This variable is overridden by {@link Options}`.localsName` if it is not - * `undefined`. - * - * @type {String} - * @public - */ - -exports.localsName = _DEFAULT_LOCALS_NAME; - -/** - * Promise implementation -- defaults to the native implementation if available - * This is mostly just for testability - * - * @type {Function} - * @public - */ - -exports.promiseImpl = (new Function('return this;'))().Promise; - -/** - * Get the path to the included file from the parent file path and the - * specified path. - * - * @param {String} name specified path - * @param {String} filename parent file path - * @param {Boolean} isDir parent file path whether is directory - * @return {String} - */ -exports.resolveInclude = function(name, filename, isDir) { - var dirname = path.dirname; - var extname = path.extname; - var resolve = path.resolve; - var includePath = resolve(isDir ? filename : dirname(filename), name); - var ext = extname(name); - if (!ext) { - includePath += '.ejs'; - } - return includePath; -}; - -/** - * Get the path to the included file by Options - * - * @param {String} path specified path - * @param {Options} options compilation options - * @return {String} - */ -function getIncludePath(path, options) { - var includePath; - var filePath; - var views = options.views; - - // Abs path - if (path.charAt(0) == '/') { - includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true); - } - // Relative paths - else { - // Look relative to a passed filename first - if (options.filename) { - filePath = exports.resolveInclude(path, options.filename); - if (fs.existsSync(filePath)) { - includePath = filePath; - } - } - // Then look in any views directories - if (!includePath) { - if (Array.isArray(views) && views.some(function (v) { - filePath = exports.resolveInclude(path, v, true); - return fs.existsSync(filePath); - })) { - includePath = filePath; - } - } - if (!includePath) { - throw new Error('Could not find the include file "' + - options.escapeFunction(path) + '"'); - } - } - return includePath; -} - -/** - * Get the template from a string or a file, either compiled on-the-fly or - * read from cache (if enabled), and cache the template if needed. - * - * If `template` is not set, the file specified in `options.filename` will be - * read. - * - * If `options.cache` is true, this function reads the file from - * `options.filename` so it must be set prior to calling this function. - * - * @memberof module:ejs-internal - * @param {Options} options compilation options - * @param {String} [template] template source - * @return {(TemplateFunction|ClientFunction)} - * Depending on the value of `options.client`, either type might be returned. - * @static - */ - -function handleCache(options, template) { - var func; - var filename = options.filename; - var hasTemplate = arguments.length > 1; - - if (options.cache) { - if (!filename) { - throw new Error('cache option requires a filename'); - } - func = exports.cache.get(filename); - if (func) { - return func; - } - if (!hasTemplate) { - template = fileLoader(filename).toString().replace(_BOM, ''); - } - } - else if (!hasTemplate) { - // istanbul ignore if: should not happen at all - if (!filename) { - throw new Error('Internal EJS error: no file name or template ' - + 'provided'); - } - template = fileLoader(filename).toString().replace(_BOM, ''); - } - func = exports.compile(template, options); - if (options.cache) { - exports.cache.set(filename, func); - } - return func; -} - -/** - * Try calling handleCache with the given options and data and call the - * callback with the result. If an error occurs, call the callback with - * the error. Used by renderFile(). - * - * @memberof module:ejs-internal - * @param {Options} options compilation options - * @param {Object} data template data - * @param {RenderFileCallback} cb callback - * @static - */ - -function tryHandleCache(options, data, cb) { - var result; - if (!cb) { - if (typeof exports.promiseImpl == 'function') { - return new exports.promiseImpl(function (resolve, reject) { - try { - result = handleCache(options)(data); - resolve(result); - } - catch (err) { - reject(err); - } - }); - } - else { - throw new Error('Please provide a callback function'); - } - } - else { - try { - result = handleCache(options)(data); - } - catch (err) { - return cb(err); - } - - cb(null, result); - } -} - -/** - * fileLoader is independent - * - * @param {String} filePath ejs file path. - * @return {String} The contents of the specified file. - * @static - */ - -function fileLoader(filePath){ - return exports.fileLoader(filePath); -} - -/** - * Get the template function. - * - * If `options.cache` is `true`, then the template is cached. - * - * @memberof module:ejs-internal - * @param {String} path path for the specified file - * @param {Options} options compilation options - * @return {(TemplateFunction|ClientFunction)} - * Depending on the value of `options.client`, either type might be returned - * @static - */ - -function includeFile(path, options) { - var opts = utils.shallowCopy({}, options); - opts.filename = getIncludePath(path, opts); - return handleCache(opts); -} - -/** - * Get the JavaScript source of an included file. - * - * @memberof module:ejs-internal - * @param {String} path path for the specified file - * @param {Options} options compilation options - * @return {Object} - * @static - */ - -function includeSource(path, options) { - var opts = utils.shallowCopy({}, options); - var includePath; - var template; - includePath = getIncludePath(path, opts); - template = fileLoader(includePath).toString().replace(_BOM, ''); - opts.filename = includePath; - var templ = new Template(template, opts); - templ.generateSource(); - return { - source: templ.source, - filename: includePath, - template: template - }; -} - -/** - * Re-throw the given `err` in context to the `str` of ejs, `filename`, and - * `lineno`. - * - * @implements RethrowCallback - * @memberof module:ejs-internal - * @param {Error} err Error object - * @param {String} str EJS source - * @param {String} filename file name of the EJS file - * @param {String} lineno line number of the error - * @static - */ - -function rethrow(err, str, flnm, lineno, esc){ - var lines = str.split('\n'); - var start = Math.max(lineno - 3, 0); - var end = Math.min(lines.length, lineno + 3); - var filename = esc(flnm); // eslint-disable-line - // Error context - var context = lines.slice(start, end).map(function (line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' >> ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'ejs') + ':' - + lineno + '\n' - + context + '\n\n' - + err.message; - - throw err; -} - -function stripSemi(str){ - return str.replace(/;(\s*$)/, '$1'); -} - -/** - * Compile the given `str` of ejs into a template function. - * - * @param {String} template EJS template - * - * @param {Options} opts compilation options - * - * @return {(TemplateFunction|ClientFunction)} - * Depending on the value of `opts.client`, either type might be returned. - * Note that the return type of the function also depends on the value of `opts.async`. - * @public - */ - -exports.compile = function compile(template, opts) { - var templ; - - // v1 compat - // 'scope' is 'context' - // FIXME: Remove this in a future version - if (opts && opts.scope) { - if (!scopeOptionWarned){ - console.warn('`scope` option is deprecated and will be removed in EJS 3'); - scopeOptionWarned = true; - } - if (!opts.context) { - opts.context = opts.scope; - } - delete opts.scope; - } - templ = new Template(template, opts); - return templ.compile(); -}; - -/** - * Render the given `template` of ejs. - * - * If you would like to include options but not data, you need to explicitly - * call this function with `data` being an empty object or `null`. - * - * @param {String} template EJS template - * @param {Object} [data={}] template data - * @param {Options} [opts={}] compilation and rendering options - * @return {(String|Promise)} - * Return value type depends on `opts.async`. - * @public - */ - -exports.render = function (template, d, o) { - var data = d || {}; - var opts = o || {}; - - // No options object -- if there are optiony names - // in the data, copy them to options - if (arguments.length == 2) { - utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA); - } - - return handleCache(opts, template)(data); -}; - -/** - * Render an EJS file at the given `path` and callback `cb(err, str)`. - * - * If you would like to include options but not data, you need to explicitly - * call this function with `data` being an empty object or `null`. - * - * @param {String} path path to the EJS file - * @param {Object} [data={}] template data - * @param {Options} [opts={}] compilation and rendering options - * @param {RenderFileCallback} cb callback - * @public - */ - -exports.renderFile = function () { - var args = Array.prototype.slice.call(arguments); - var filename = args.shift(); - var cb; - var opts = {filename: filename}; - var data; - var viewOpts; - - // Do we have a callback? - if (typeof arguments[arguments.length - 1] == 'function') { - cb = args.pop(); - } - // Do we have data/opts? - if (args.length) { - // Should always have data obj - data = args.shift(); - // Normal passed opts (data obj + opts obj) - if (args.length) { - // Use shallowCopy so we don't pollute passed in opts obj with new vals - utils.shallowCopy(opts, args.pop()); - } - // Special casing for Express (settings + opts-in-data) - else { - // Express 3 and 4 - if (data.settings) { - // Pull a few things from known locations - if (data.settings.views) { - opts.views = data.settings.views; - } - if (data.settings['view cache']) { - opts.cache = true; - } - // Undocumented after Express 2, but still usable, esp. for - // items that are unsafe to be passed along with data, like `root` - viewOpts = data.settings['view options']; - if (viewOpts) { - utils.shallowCopy(opts, viewOpts); - } - } - // Express 2 and lower, values set in app.locals, or people who just - // want to pass options in their data. NOTE: These values will override - // anything previously set in settings or settings['view options'] - utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS); - } - opts.filename = filename; - } - else { - data = {}; - } - - return tryHandleCache(opts, data, cb); -}; - -/** - * Clear intermediate JavaScript cache. Calls {@link Cache#reset}. - * @public - */ - -exports.clearCache = function () { - exports.cache.reset(); -}; - -function Template(text, opts) { - opts = opts || {}; - var options = {}; - this.templateText = text; - this.mode = null; - this.truncate = false; - this.currentLine = 1; - this.source = ''; - this.dependencies = []; - options.client = opts.client || false; - options.escapeFunction = opts.escape || utils.escapeXML; - options.compileDebug = opts.compileDebug !== false; - options.debug = !!opts.debug; - options.filename = opts.filename; - options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER; - options.strict = opts.strict || false; - options.context = opts.context; - options.cache = opts.cache || false; - options.rmWhitespace = opts.rmWhitespace; - options.root = opts.root; - options.outputFunctionName = opts.outputFunctionName; - options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME; - options.views = opts.views; - options.async = opts.async; - - if (options.strict) { - options._with = false; - } - else { - options._with = typeof opts._with != 'undefined' ? opts._with : true; - } - - this.opts = options; - - this.regex = this.createRegex(); -} - -Template.modes = { - EVAL: 'eval', - ESCAPED: 'escaped', - RAW: 'raw', - COMMENT: 'comment', - LITERAL: 'literal' -}; - -Template.prototype = { - createRegex: function () { - var str = _REGEX_STRING; - var delim = utils.escapeRegExpChars(this.opts.delimiter); - str = str.replace(/%/g, delim); - return new RegExp(str); - }, - - compile: function () { - var src; - var fn; - var opts = this.opts; - var prepended = ''; - var appended = ''; - var escapeFn = opts.escapeFunction; - var asyncCtor; - - if (!this.source) { - this.generateSource(); - prepended += ' var __output = [], __append = __output.push.bind(__output);' + '\n'; - if (opts.outputFunctionName) { - prepended += ' var ' + opts.outputFunctionName + ' = __append;' + '\n'; - } - if (opts._with !== false) { - prepended += ' with (' + opts.localsName + ' || {}) {' + '\n'; - appended += ' }' + '\n'; - } - appended += ' return __output.join("");' + '\n'; - this.source = prepended + this.source + appended; - } - - if (opts.compileDebug) { - src = 'var __line = 1' + '\n' - + ' , __lines = ' + JSON.stringify(this.templateText) + '\n' - + ' , __filename = ' + (opts.filename ? - JSON.stringify(opts.filename) : 'undefined') + ';' + '\n' - + 'try {' + '\n' - + this.source - + '} catch (e) {' + '\n' - + ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\n' - + '}' + '\n'; - } - else { - src = this.source; - } - - if (opts.client) { - src = 'escapeFn = escapeFn || ' + escapeFn.toString() + ';' + '\n' + src; - if (opts.compileDebug) { - src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\n' + src; - } - } - - if (opts.strict) { - src = '"use strict";\n' + src; - } - if (opts.debug) { - console.log(src); - } - - try { - if (opts.async) { - // Have to use generated function for this, since in envs without support, - // it breaks in parsing - try { - asyncCtor = (new Function('return (async function(){}).constructor;'))(); - } - catch(e) { - if (e instanceof SyntaxError) { - throw new Error('This environment does not support async/await'); - } - else { - throw e; - } - } - } - else { - asyncCtor = Function; - } - fn = new asyncCtor(opts.localsName + ', escapeFn, include, rethrow', src); - } - catch(e) { - // istanbul ignore else - if (e instanceof SyntaxError) { - if (opts.filename) { - e.message += ' in ' + opts.filename; - } - e.message += ' while compiling ejs\n\n'; - e.message += 'If the above error is not helpful, you may want to try EJS-Lint:\n'; - e.message += 'https://github.com/RyanZim/EJS-Lint'; - if (!e.async) { - e.message += '\n'; - e.message += 'Or, if you meant to create an async function, pass async: true as an option.'; - } - } - throw e; - } - - if (opts.client) { - fn.dependencies = this.dependencies; - return fn; - } - - // Return a callable function which will execute the function - // created by the source-code, with the passed data as locals - // Adds a local `include` function which allows full recursive include - var returnedFn = function (data) { - var include = function (path, includeData) { - var d = utils.shallowCopy({}, data); - if (includeData) { - d = utils.shallowCopy(d, includeData); - } - return includeFile(path, opts)(d); - }; - return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]); - }; - returnedFn.dependencies = this.dependencies; - return returnedFn; - }, - - generateSource: function () { - var opts = this.opts; - - if (opts.rmWhitespace) { - // Have to use two separate replace here as `^` and `$` operators don't - // work well with `\r`. - this.templateText = - this.templateText.replace(/\r/g, '').replace(/^\s+|\s+$/gm, ''); - } - - // Slurp spaces and tabs before <%_ and after _%> - this.templateText = - this.templateText.replace(/[ \t]*<%_/gm, '<%_').replace(/_%>[ \t]*/gm, '_%>'); - - var self = this; - var matches = this.parseTemplateText(); - var d = this.opts.delimiter; - - if (matches && matches.length) { - matches.forEach(function (line, index) { - var opening; - var closing; - var include; - var includeOpts; - var includeObj; - var includeSrc; - // If this is an opening tag, check for closing tags - // FIXME: May end up with some false positives here - // Better to store modes as k/v with '<' + delimiter as key - // Then this can simply check against the map - if ( line.indexOf('<' + d) === 0 // If it is a tag - && line.indexOf('<' + d + d) !== 0) { // and is not escaped - closing = matches[index + 2]; - if (!(closing == d + '>' || closing == '-' + d + '>' || closing == '_' + d + '>')) { - throw new Error('Could not find matching close tag for "' + line + '".'); - } - } - // HACK: backward-compat `include` preprocessor directives - if ((include = line.match(/^\s*include\s+(\S+)/))) { - opening = matches[index - 1]; - // Must be in EVAL or RAW mode - if (opening && (opening == '<' + d || opening == '<' + d + '-' || opening == '<' + d + '_')) { - includeOpts = utils.shallowCopy({}, self.opts); - includeObj = includeSource(include[1], includeOpts); - if (self.opts.compileDebug) { - includeSrc = - ' ; (function(){' + '\n' - + ' var __line = 1' + '\n' - + ' , __lines = ' + JSON.stringify(includeObj.template) + '\n' - + ' , __filename = ' + JSON.stringify(includeObj.filename) + ';' + '\n' - + ' try {' + '\n' - + includeObj.source - + ' } catch (e) {' + '\n' - + ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\n' - + ' }' + '\n' - + ' ; }).call(this)' + '\n'; - }else{ - includeSrc = ' ; (function(){' + '\n' + includeObj.source + - ' ; }).call(this)' + '\n'; - } - self.source += includeSrc; - self.dependencies.push(exports.resolveInclude(include[1], - includeOpts.filename)); - return; - } - } - self.scanLine(line); - }); - } - - }, - - parseTemplateText: function () { - var str = this.templateText; - var pat = this.regex; - var result = pat.exec(str); - var arr = []; - var firstPos; - - while (result) { - firstPos = result.index; - - if (firstPos !== 0) { - arr.push(str.substring(0, firstPos)); - str = str.slice(firstPos); - } - - arr.push(result[0]); - str = str.slice(result[0].length); - result = pat.exec(str); - } - - if (str) { - arr.push(str); - } - - return arr; - }, - - _addOutput: function (line) { - if (this.truncate) { - // Only replace single leading linebreak in the line after - // -%> tag -- this is the single, trailing linebreak - // after the tag that the truncation mode replaces - // Handle Win / Unix / old Mac linebreaks -- do the \r\n - // combo first in the regex-or - line = line.replace(/^(?:\r\n|\r|\n)/, ''); - this.truncate = false; - } - else if (this.opts.rmWhitespace) { - // rmWhitespace has already removed trailing spaces, just need - // to remove linebreaks - line = line.replace(/^\n/, ''); - } - if (!line) { - return line; - } - - // Preserve literal slashes - line = line.replace(/\\/g, '\\\\'); - - // Convert linebreaks - line = line.replace(/\n/g, '\\n'); - line = line.replace(/\r/g, '\\r'); - - // Escape double-quotes - // - this will be the delimiter during execution - line = line.replace(/"/g, '\\"'); - this.source += ' ; __append("' + line + '")' + '\n'; - }, - - scanLine: function (line) { - var self = this; - var d = this.opts.delimiter; - var newLineCount = 0; - - newLineCount = (line.split('\n').length - 1); - - switch (line) { - case '<' + d: - case '<' + d + '_': - this.mode = Template.modes.EVAL; - break; - case '<' + d + '=': - this.mode = Template.modes.ESCAPED; - break; - case '<' + d + '-': - this.mode = Template.modes.RAW; - break; - case '<' + d + '#': - this.mode = Template.modes.COMMENT; - break; - case '<' + d + d: - this.mode = Template.modes.LITERAL; - this.source += ' ; __append("' + line.replace('<' + d + d, '<' + d) + '")' + '\n'; - break; - case d + d + '>': - this.mode = Template.modes.LITERAL; - this.source += ' ; __append("' + line.replace(d + d + '>', d + '>') + '")' + '\n'; - break; - case d + '>': - case '-' + d + '>': - case '_' + d + '>': - if (this.mode == Template.modes.LITERAL) { - this._addOutput(line); - } - - this.mode = null; - this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0; - break; - default: - // In script mode, depends on type of tag - if (this.mode) { - // If '//' is found without a line break, add a line break. - switch (this.mode) { - case Template.modes.EVAL: - case Template.modes.ESCAPED: - case Template.modes.RAW: - if (line.lastIndexOf('//') > line.lastIndexOf('\n')) { - line += '\n'; - } - } - switch (this.mode) { - // Just executing code - case Template.modes.EVAL: - this.source += ' ; ' + line + '\n'; - break; - // Exec, esc, and output - case Template.modes.ESCAPED: - this.source += ' ; __append(escapeFn(' + stripSemi(line) + '))' + '\n'; - break; - // Exec and output - case Template.modes.RAW: - this.source += ' ; __append(' + stripSemi(line) + ')' + '\n'; - break; - case Template.modes.COMMENT: - // Do nothing - break; - // Literal <%% mode, append as raw output - case Template.modes.LITERAL: - this._addOutput(line); - break; - } - } - // In string mode, just add the output - else { - this._addOutput(line); - } - } - - if (self.opts.compileDebug && newLineCount) { - this.currentLine += newLineCount; - this.source += ' ; __line = ' + this.currentLine + '\n'; - } - } -}; - -/** - * Escape characters reserved in XML. - * - * This is simply an export of {@link module:utils.escapeXML}. - * - * If `markup` is `undefined` or `null`, the empty string is returned. - * - * @param {String} markup Input string - * @return {String} Escaped string - * @public - * @func - * */ -exports.escapeXML = utils.escapeXML; - -/** - * Express.js support. - * - * This is an alias for {@link module:ejs.renderFile}, in order to support - * Express.js out-of-the-box. - * - * @func - */ - -exports.__express = exports.renderFile; - -// Add require support -/* istanbul ignore else */ -if (require.extensions) { - require.extensions['.ejs'] = function (module, flnm) { - var filename = flnm || /* istanbul ignore next */ module.filename; - var options = { - filename: filename, - client: true - }; - var template = fileLoader(filename).toString(); - var fn = exports.compile(template, options); - module._compile('module.exports = ' + fn.toString() + ';', filename); - }; -} - -/** - * Version of EJS. - * - * @readonly - * @type {String} - * @public - */ - -exports.VERSION = _VERSION_STRING; - -/** - * Name for detection of EJS. - * - * @readonly - * @type {String} - * @public - */ - -exports.name = _NAME; - -/* istanbul ignore if */ -if (typeof window != 'undefined') { - window.ejs = exports; -} diff --git a/node_modules/ejs/lib/utils.js b/node_modules/ejs/lib/utils.js deleted file mode 100644 index 2abaaf5..0000000 --- a/node_modules/ejs/lib/utils.js +++ /dev/null @@ -1,164 +0,0 @@ -/* - * EJS Embedded JavaScript templates - * Copyright 2112 Matthew Eernisse (mde@fleegix.org) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * -*/ - -/** - * Private utility functions - * @module utils - * @private - */ - -'use strict'; - -var regExpChars = /[|\\{}()[\]^$+*?.]/g; - -/** - * Escape characters reserved in regular expressions. - * - * If `string` is `undefined` or `null`, the empty string is returned. - * - * @param {String} string Input string - * @return {String} Escaped string - * @static - * @private - */ -exports.escapeRegExpChars = function (string) { - // istanbul ignore if - if (!string) { - return ''; - } - return String(string).replace(regExpChars, '\\$&'); -}; - -var _ENCODE_HTML_RULES = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; -var _MATCH_HTML = /[&<>'"]/g; - -function encode_char(c) { - return _ENCODE_HTML_RULES[c] || c; -} - -/** - * Stringified version of constants used by {@link module:utils.escapeXML}. - * - * It is used in the process of generating {@link ClientFunction}s. - * - * @readonly - * @type {String} - */ - -var escapeFuncStr = - 'var _ENCODE_HTML_RULES = {\n' -+ ' "&": "&"\n' -+ ' , "<": "<"\n' -+ ' , ">": ">"\n' -+ ' , \'"\': """\n' -+ ' , "\'": "'"\n' -+ ' }\n' -+ ' , _MATCH_HTML = /[&<>\'"]/g;\n' -+ 'function encode_char(c) {\n' -+ ' return _ENCODE_HTML_RULES[c] || c;\n' -+ '};\n'; - -/** - * Escape characters reserved in XML. - * - * If `markup` is `undefined` or `null`, the empty string is returned. - * - * @implements {EscapeCallback} - * @param {String} markup Input string - * @return {String} Escaped string - * @static - * @private - */ - -exports.escapeXML = function (markup) { - return markup == undefined - ? '' - : String(markup) - .replace(_MATCH_HTML, encode_char); -}; -exports.escapeXML.toString = function () { - return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr; -}; - -/** - * Naive copy of properties from one object to another. - * Does not recurse into non-scalar properties - * Does not check to see if the property has a value before copying - * - * @param {Object} to Destination object - * @param {Object} from Source object - * @return {Object} Destination object - * @static - * @private - */ -exports.shallowCopy = function (to, from) { - from = from || {}; - for (var p in from) { - to[p] = from[p]; - } - return to; -}; - -/** - * Naive copy of a list of key names, from one object to another. - * Only copies property if it is actually defined - * Does not recurse into non-scalar properties - * - * @param {Object} to Destination object - * @param {Object} from Source object - * @param {Array} list List of properties to copy - * @return {Object} Destination object - * @static - * @private - */ -exports.shallowCopyFromList = function (to, from, list) { - for (var i = 0; i < list.length; i++) { - var p = list[i]; - if (typeof from[p] != 'undefined') { - to[p] = from[p]; - } - } - return to; -}; - -/** - * Simple in-process cache implementation. Does not implement limits of any - * sort. - * - * @implements Cache - * @static - * @private - */ -exports.cache = { - _data: {}, - set: function (key, val) { - this._data[key] = val; - }, - get: function (key) { - return this._data[key]; - }, - reset: function () { - this._data = {}; - } -}; diff --git a/node_modules/ejs/package.json b/node_modules/ejs/package.json deleted file mode 100644 index 7577a2a..0000000 --- a/node_modules/ejs/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "ejs@^2.6.1", - "_id": "ejs@2.6.1", - "_inBundle": false, - "_integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==", - "_location": "/ejs", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ejs@^2.6.1", - "name": "ejs", - "escapedName": "ejs", - "rawSpec": "^2.6.1", - "saveSpec": null, - "fetchSpec": "^2.6.1" - }, - "_requiredBy": [ - "/app-builder-lib" - ], - "_resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.1.tgz", - "_shasum": "498ec0d495655abc6f23cd61868d926464071aa0", - "_spec": "ejs@^2.6.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "author": { - "name": "Matthew Eernisse", - "email": "mde@fleegix.org", - "url": "http://fleegix.org" - }, - "bugs": { - "url": "https://github.com/mde/ejs/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Timothy Gu", - "email": "timothygu99@gmail.com", - "url": "https://timothygu.github.io" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Embedded JavaScript templates", - "devDependencies": { - "browserify": "^13.1.1", - "eslint": "^4.14.0", - "git-directory-deploy": "^1.5.1", - "istanbul": "~0.4.3", - "jake": "^8.0.16", - "jsdoc": "^3.4.0", - "lru-cache": "^4.0.1", - "mocha": "^5.0.5", - "uglify-js": "^3.3.16" - }, - "engines": { - "node": ">=0.10.0" - }, - "homepage": "https://github.com/mde/ejs", - "keywords": [ - "template", - "engine", - "ejs" - ], - "license": "Apache-2.0", - "main": "./lib/ejs.js", - "name": "ejs", - "repository": { - "type": "git", - "url": "git://github.com/mde/ejs.git" - }, - "scripts": { - "coverage": "istanbul cover node_modules/mocha/bin/_mocha", - "devdoc": "jake doc[dev]", - "doc": "jake doc", - "lint": "eslint \"**/*.js\" Jakefile", - "test": "jake test" - }, - "version": "2.6.1" -} diff --git a/node_modules/electron-builder/README.md b/node_modules/electron-builder/README.md deleted file mode 100644 index d244642..0000000 --- a/node_modules/electron-builder/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# electron-builder [![npm version](https://img.shields.io/npm/v/electron-builder.svg?label=latest)](https://yarn.pm/electron-builder) [![downloads per month](https://img.shields.io/npm/dm/electron-builder.svg)](https://yarn.pm/electron-builder) [![donate](https://img.shields.io/badge/Donate-Donorbox-green.svg)](https://www.electron.build/donate) -A complete solution to package and build a ready for distribution [Electron](https://electronjs.org), [Proton Native](https://proton-native.js.org/) or [Muon](https://github.com/brave/muon) app for macOS, Windows and Linux with “auto update” support out of the box. - -See documentation on [electron.build](https://www.electron.build). - -* NPM packages management: - * [Native application dependencies](https://electron.atom.io/docs/tutorial/using-native-node-modules/) compilation (including [Yarn](http://yarnpkg.com/) support). - * Development dependencies are never included. You don't need to ignore them explicitly. - * [Two package.json structure](https://www.electron.build/tutorials/two-package-structure) is supported, but you are not forced to use it even if you have native production dependencies. -* [Code Signing](https://www.electron.build/code-signing) on a CI server or development machine. -* [Auto Update](https://www.electron.build/auto-update) ready application packaging. -* Numerous target formats: - * All platforms: `7z`, `zip`, `tar.xz`, `tar.7z`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir` (unpacked directory). - * [macOS](https://www.electron.build/configuration/mac): `dmg`, `pkg`, `mas`. - * [Linux](https://www.electron.build/configuration/linux): [AppImage](http://appimage.org), [snap](http://snapcraft.io), debian package (`deb`), `rpm`, `freebsd`, `pacman`, `p5p`, `apk`. - * [Windows](https://www.electron.build/configuration/win): `nsis` (Installer), `nsis-web` (Web installer), `portable` (portable app without installation), AppX (Windows Store), MSI, Squirrel.Windows. -* [Publishing artifacts](https://www.electron.build/configuration/publish) to GitHub Releases, Amazon S3, DigitalOcean Spaces and Bintray. -* Advanced building: - * Pack in a distributable format [already packaged app](https://www.electron.build/#pack-only-in-a-distributable-format). - * Separate [build steps](https://github.com/electron-userland/electron-builder/issues/1102#issuecomment-271845854). - * Build and publish in parallel, using hard links on CI server to reduce IO and disk space usage. - * [electron-compile](https://github.com/electron/electron-compile) support (compile for release-time on the fly on build). -* [Docker](https://www.electron.build/multi-platform-build#docker) images to build Electron app for Linux or Windows on any platform. -* [Proton Native](https://www.electron.build/configuration/configuration/#proton-native) and [Muon](https://github.com/brave/muon) support. -* Downloads all required tools files on demand automatically (e.g. to code sign windows application, to make AppX), no need to setup. - -| Question | Answer | -|----------|-------| -| “I want to configure electron-builder” | [See options](https://electron.build/configuration/configuration) | -| “I have a question” | [Open an issue](https://github.com/electron-userland/electron-builder/issues) or [join the chat](https://slackin.electron.build) | -| “I found a bug” | [Open an issue](https://github.com/electron-userland/electron-builder/issues/new) | -| “I want to support development” | [Donate](https://www.electron.build/donate) | - -Real project example — [onshape-desktop-shell](https://github.com/develar/onshape-desktop-shell). - -## Installation -[Yarn](http://yarnpkg.com/) is [strongly](https://github.com/electron-userland/electron-builder/issues/1147#issuecomment-276284477) recommended instead of npm. - -`yarn add electron-builder --dev` - -## Quick Setup Guide - -[electron-webpack-quick-start](https://github.com/electron-userland/electron-webpack-quick-start) is a recommended way to create a new Electron application. See [Boilerplates](https://www.electron.build/#boilerplates). - -1. Specify the standard fields in the application `package.json` — [name](https://electron.build/configuration/configuration#Metadata-name), `description`, `version` and [author](https://docs.npmjs.com/files/package.json#people-fields-author-contributors). - -2. Specify the [build](https://electron.build/configuration/configuration#build) configuration in the `package.json` as follows: - ```json - "build": { - "appId": "your.id", - "mac": { - "category": "your.app.category.type" - } - } - ``` - See [all options](https://www.electron.build/configuration/configuration). Option [files](https://www.electron.build/configuration/contents#files) to indicate which files should be packed in the final application, including the entry file, maybe required. - -3. Add [icons](https://www.electron.build/icons). - -4. Add the [scripts](https://docs.npmjs.com/cli/run-script) key to the development `package.json`: - ```json - "scripts": { - "pack": "electron-builder --dir", - "dist": "electron-builder" - } - ``` - Then you can run `yarn dist` (to package in a distributable format (e.g. dmg, windows installer, deb package)) or `yarn pack` (only generates the package directory without really packaging it. This is useful for testing purposes). - - To ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps"` to your `package.json`. - -5. If you have native addons of your own that are part of the application (not as a dependency), set [nodeGypRebuild](https://www.electron.build/configuration/configuration#Configuration-nodeGypRebuild) to `true`. - -Please note that everything is packaged into an asar archive [by default](https://electron.build/configuration/configuration#Configuration-asar). - -For an app that will be shipped to production, you should sign your application. See [Where to buy code signing certificates](https://www.electron.build/code-signing#where-to-buy-code-signing-certificate). - -## Donate - -We do this open source work in our free time. If you'd like us to invest more time on it, please [donate](https://www.electron.build/donate). Donation can be used to increase some issue priority. - -## Sponsors - -WorkFlowy -Tidepool diff --git a/node_modules/electron-builder/out/builder.d.ts b/node_modules/electron-builder/out/builder.d.ts deleted file mode 100644 index 286a793..0000000 --- a/node_modules/electron-builder/out/builder.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Arch } from "builder-util"; -import { PackagerOptions, Platform } from "app-builder-lib"; -import { PublishOptions } from "electron-publish"; -export interface CliOptions extends PackagerOptions, PublishOptions { - arch?: string; - x64?: boolean; - ia32?: boolean; - armv7l?: boolean; - arm64?: boolean; - dir?: boolean; - platform?: string; -} -/** @private */ -export declare function coerceTypes(host: any): any; -export declare function createTargets(platforms: Array, type?: string | null, arch?: string | null): Map>>; -export declare function build(rawOptions?: CliOptions): Promise>; diff --git a/node_modules/electron-builder/out/builder.js b/node_modules/electron-builder/out/builder.js deleted file mode 100644 index a7bf6bc..0000000 --- a/node_modules/electron-builder/out/builder.js +++ /dev/null @@ -1,358 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.normalizeOptions = normalizeOptions; -exports.coerceTypes = coerceTypes; -exports.createTargets = createTargets; -exports.build = build; -exports.configureBuildCommand = configureBuildCommand; - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} - -function _appBuilderLib() { - const data = require("app-builder-lib"); - - _appBuilderLib = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @internal */ -function normalizeOptions(args) { - if (args.extraMetadata != null) { - throw new (_builderUtil().InvalidConfigurationError)("Please specify extraMetadata under config field"); - } - - if (args.targets != null) { - return args; - } - - if (args.draft != null || args.prerelease != null) { - _builderUtil().log.warn({ - solution: "set releaseType (http://electron.build/configuration/publish#GithubOptions-releaseType) in the GitHub publish options" - }, "--draft and --prerelease is deprecated"); - } - - let targets = new Map(); - - function processTargets(platform, types) { - function commonArch(currentIfNotSpecified) { - if (platform === _appBuilderLib().Platform.MAC) { - return args.x64 || currentIfNotSpecified ? [_builderUtil().Arch.x64] : []; - } - - const result = Array(); - - if (args.x64) { - result.push(_builderUtil().Arch.x64); - } - - if (args.armv7l) { - result.push(_builderUtil().Arch.armv7l); - } - - if (args.arm64) { - result.push(_builderUtil().Arch.arm64); - } - - if (args.ia32) { - result.push(_builderUtil().Arch.ia32); - } - - return result.length === 0 && currentIfNotSpecified ? [(0, _builderUtil().archFromString)(process.arch)] : result; - } - - if (args.platform != null) { - throw new (_builderUtil().InvalidConfigurationError)(`--platform cannot be used if --${platform.buildConfigurationKey} is passed`); - } - - if (args.arch != null) { - throw new (_builderUtil().InvalidConfigurationError)(`--arch cannot be used if --${platform.buildConfigurationKey} is passed`); - } - - let archToType = targets.get(platform); - - if (archToType == null) { - archToType = new Map(); - targets.set(platform, archToType); - } - - if (types.length === 0) { - const defaultTargetValue = args.dir ? [_appBuilderLib().DIR_TARGET] : []; - - for (const arch of commonArch(args.dir === true)) { - archToType.set(arch, defaultTargetValue); - } - - return; - } - - for (const type of types) { - const suffixPos = type.lastIndexOf(":"); - - if (suffixPos > 0) { - (0, _builderUtil().addValue)(archToType, (0, _builderUtil().archFromString)(type.substring(suffixPos + 1)), type.substring(0, suffixPos)); - } else { - for (const arch of commonArch(true)) { - (0, _builderUtil().addValue)(archToType, arch, type); - } - } - } - } - - if (args.mac != null) { - processTargets(_appBuilderLib().Platform.MAC, args.mac); - } - - if (args.linux != null) { - processTargets(_appBuilderLib().Platform.LINUX, args.linux); - } - - if (args.win != null) { - processTargets(_appBuilderLib().Platform.WINDOWS, args.win); - } - - if (targets.size === 0) { - if (args.platform == null && args.arch == null) { - processTargets(_appBuilderLib().Platform.current(), []); - } else { - targets = createTargets(normalizePlatforms(args.platform), args.dir ? _appBuilderLib().DIR_TARGET : null, args.arch); - } - } - - const result = Object.assign({}, args); - result.targets = targets; - delete result.dir; - delete result.mac; - delete result.linux; - delete result.win; - delete result.platform; - delete result.arch; - const r = result; - delete r.m; - delete r.o; - delete r.l; - delete r.w; - delete r.windows; - delete r.macos; - delete r.$0; - delete r._; - delete r.version; - delete r.help; - delete r.c; - delete r.p; - delete r.pd; - delete result.ia32; - delete result.x64; - delete result.armv7l; - delete result.arm64; - let config = result.config; // config is array when combining dot-notation values with a config file value - // https://github.com/electron-userland/electron-builder/issues/2016 - - if (Array.isArray(config)) { - const newConfig = {}; - - for (const configItem of config) { - if (typeof configItem === "object") { - (0, _builderUtil().deepAssign)(newConfig, configItem); - } else if (typeof configItem === "string") { - newConfig.extends = configItem; - } - } - - config = newConfig; - result.config = newConfig; - } - - if (config != null && typeof config !== "string") { - if (config.extraMetadata != null) { - coerceTypes(config.extraMetadata); - } - - if (config.mac != null) { - // ability to disable code sign using -c.mac.identity=null - coerceValue(config.mac, "identity"); - } - } - - if ("project" in r && !("projectDir" in result)) { - result.projectDir = r.project; - } - - delete r.project; - return result; -} - -function coerceValue(host, key) { - const value = host[key]; - - if (value === "true") { - host[key] = true; - } else if (value === "false") { - host[key] = false; - } else if (value === "null") { - host[key] = null; - } else if (key === "version" && typeof value === "number") { - host[key] = value.toString(); - } else if (value != null && typeof value === "object") { - coerceTypes(value); - } -} -/** @private */ - - -function coerceTypes(host) { - for (const key of Object.getOwnPropertyNames(host)) { - coerceValue(host, key); - } - - return host; -} - -function createTargets(platforms, type, arch) { - const targets = new Map(); - - for (const platform of platforms) { - const archs = platform === _appBuilderLib().Platform.MAC ? [_builderUtil().Arch.x64] : arch === "all" ? [_builderUtil().Arch.x64, _builderUtil().Arch.ia32] : [(0, _builderUtil().archFromString)(arch == null ? process.arch : arch)]; - const archToType = new Map(); - targets.set(platform, archToType); - - for (const arch of archs) { - archToType.set(arch, type == null ? [] : [type]); - } - } - - return targets; -} - -function build(rawOptions) { - const buildOptions = normalizeOptions(rawOptions || {}); - return (0, _appBuilderLib().build)(buildOptions, new (_appBuilderLib().Packager)(buildOptions)); -} -/** - * @private - * @internal - */ - - -function configureBuildCommand(yargs) { - const publishGroup = "Publishing:"; - const buildGroup = "Building:"; - const deprecated = "Deprecated:"; - return yargs.option("mac", { - group: buildGroup, - alias: ["m", "o", "macos"], - description: `Build for macOS, accepts target list (see ${_chalk().default.underline("https://goo.gl/5uHuzj")}).`, - type: "array" - }).option("linux", { - group: buildGroup, - alias: "l", - description: `Build for Linux, accepts target list (see ${_chalk().default.underline("https://goo.gl/4vwQad")})`, - type: "array" - }).option("win", { - group: buildGroup, - alias: ["w", "windows"], - description: `Build for Windows, accepts target list (see ${_chalk().default.underline("https://goo.gl/jYsTEJ")})`, - type: "array" - }).option("x64", { - group: buildGroup, - description: "Build for x64", - type: "boolean" - }).option("ia32", { - group: buildGroup, - description: "Build for ia32", - type: "boolean" - }).option("armv7l", { - group: buildGroup, - description: "Build for armv7l", - type: "boolean" - }).option("arm64", { - group: buildGroup, - description: "Build for arm64", - type: "boolean" - }).option("dir", { - group: buildGroup, - description: "Build unpacked dir. Useful to test.", - type: "boolean" - }).option("publish", { - group: publishGroup, - alias: "p", - description: `Publish artifacts, see ${_chalk().default.underline("https://goo.gl/tSFycD")}`, - choices: ["onTag", "onTagOrDraft", "always", "never", undefined] - }).option("draft", { - group: deprecated, - description: "Please set releaseType in the GitHub publish options instead", - type: "boolean", - default: undefined - }).option("prerelease", { - group: deprecated, - description: "Please set releaseType in the GitHub publish options instead", - type: "boolean", - default: undefined - }).option("platform", { - group: deprecated, - description: "The target platform (preferred to use --mac, --win or --linux)", - choices: ["mac", "win", "linux", "darwin", "win32", "all", undefined] - }).option("arch", { - group: deprecated, - description: "The target arch (preferred to use --x64 or --ia32)", - choices: (0, _builderUtil().getArchCliNames)().concat("all", undefined) - }).option("prepackaged", { - alias: ["pd"], - group: buildGroup, - description: "The path to prepackaged app (to pack in a distributable format)" - }).option("projectDir", { - alias: ["project"], - group: buildGroup, - description: "The path to project directory. Defaults to current working directory." - }).option("config", { - alias: ["c"], - group: buildGroup, - description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`), see " + _chalk().default.underline("https://goo.gl/YFRJOM") - }).group(["help", "version"], "Other:").example("electron-builder -mwl", "build for macOS, Windows and Linux").example("electron-builder --linux deb tar.xz", "build deb and tar.xz for Linux").example("electron-builder --win --ia32", "build for Windows ia32").example("electron-builder -c.extraMetadata.foo=bar", "set package.json property `foo` to `bar`").example("electron-builder --config.nsis.unicode=false", "configure unicode options for NSIS"); -} - -function normalizePlatforms(rawPlatforms) { - const platforms = rawPlatforms == null || Array.isArray(rawPlatforms) ? rawPlatforms : [rawPlatforms]; - - if (platforms == null || platforms.length === 0) { - return [_appBuilderLib().Platform.fromString(process.platform)]; - } else if (platforms[0] === "all") { - if (process.platform === _appBuilderLib().Platform.MAC.nodeName) { - return [_appBuilderLib().Platform.MAC, _appBuilderLib().Platform.LINUX, _appBuilderLib().Platform.WINDOWS]; - } else if (process.platform === _appBuilderLib().Platform.LINUX.nodeName) { - // macOS code sign works only on macOS - return [_appBuilderLib().Platform.LINUX, _appBuilderLib().Platform.WINDOWS]; - } else { - return [_appBuilderLib().Platform.WINDOWS]; - } - } else { - return platforms.map(it => it instanceof _appBuilderLib().Platform ? it : _appBuilderLib().Platform.fromString(it)); - } -} -// __ts-babel@6.0.4 -//# sourceMappingURL=builder.js.map \ No newline at end of file diff --git a/node_modules/electron-builder/out/builder.js.map b/node_modules/electron-builder/out/builder.js.map deleted file mode 100644 index 565761f..0000000 --- a/node_modules/electron-builder/out/builder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/builder.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAoBA;AACM,SAAU,gBAAV,CAA2B,IAA3B,EAA2C;AAC/C,MAAK,IAAY,CAAC,aAAb,IAA8B,IAAnC,EAAyC;AACvC,UAAM,KAAI,wCAAJ,EAA8B,iDAA9B,CAAN;AACD;;AAED,MAAI,IAAI,CAAC,OAAL,IAAgB,IAApB,EAA0B;AACxB,WAAO,IAAP;AACD;;AAED,MAAK,IAAY,CAAC,KAAb,IAAsB,IAAtB,IAA+B,IAAY,CAAC,UAAb,IAA2B,IAA/D,EAAqE;AACnE,uBAAI,IAAJ,CAAS;AAAC,MAAA,QAAQ,EAAE;AAAX,KAAT,EAA8I,wCAA9I;AACD;;AAED,MAAI,OAAO,GAAG,IAAI,GAAJ,EAAd;;AAEA,WAAS,cAAT,CAAwB,QAAxB,EAA4C,KAA5C,EAAgE;AAC9D,aAAS,UAAT,CAAoB,qBAApB,EAAkD;AAChD,UAAI,QAAQ,KAAK,0BAAS,GAA1B,EAA+B;AAC7B,eAAO,IAAI,CAAC,GAAL,IAAY,qBAAZ,GAAoC,CAAC,oBAAK,GAAN,CAApC,GAAiD,EAAxD;AACD;;AAED,YAAM,MAAM,GAAG,KAAK,EAApB;;AACA,UAAI,IAAI,CAAC,GAAT,EAAc;AACZ,QAAA,MAAM,CAAC,IAAP,CAAY,oBAAK,GAAjB;AACD;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ACA,aAAO,CAAC,0BAAS,KAAV,EAAiB,0BAAS,OAA1B,CAAP;AACD,KAHI,MAIA;AACH,aAAO,CAAC,0BAAS,OAAV,CAAP;AACD;AACF,GAXI,MAYA;AACH,WAAO,SAAS,CAAC,GAAV,CAAc,EAAE,IAAI,EAAE,YAAY,yBAAd,GAAyB,EAAzB,GAA8B,0BAAS,UAAT,CAAoB,EAApB,CAAlD,CAAP;AACD;AACF,C","sourcesContent":["import { addValue, Arch, archFromString, deepAssign, getArchCliNames, InvalidConfigurationError, log } from \"builder-util\"\nimport chalk from \"chalk\"\nimport { build as _build, Configuration, DIR_TARGET, Packager, PackagerOptions, Platform } from \"app-builder-lib\"\nimport { PublishOptions } from \"electron-publish\"\n\n/** @internal */\nexport interface BuildOptions extends PackagerOptions, PublishOptions {\n}\n\nexport interface CliOptions extends PackagerOptions, PublishOptions {\n arch?: string\n\n x64?: boolean\n ia32?: boolean\n armv7l?: boolean\n arm64?: boolean\n\n dir?: boolean\n\n platform?: string\n}\n\n/** @internal */\nexport function normalizeOptions(args: CliOptions): BuildOptions {\n if ((args as any).extraMetadata != null) {\n throw new InvalidConfigurationError(\"Please specify extraMetadata under config field\")\n }\n\n if (args.targets != null) {\n return args\n }\n\n if ((args as any).draft != null || (args as any).prerelease != null) {\n log.warn({solution: \"set releaseType (http://electron.build/configuration/publish#GithubOptions-releaseType) in the GitHub publish options\"}, \"--draft and --prerelease is deprecated\")\n }\n\n let targets = new Map>>()\n\n function processTargets(platform: Platform, types: Array) {\n function commonArch(currentIfNotSpecified: boolean): Array {\n if (platform === Platform.MAC) {\n return args.x64 || currentIfNotSpecified ? [Arch.x64] : []\n }\n\n const result = Array()\n if (args.x64) {\n result.push(Arch.x64)\n }\n if (args.armv7l) {\n result.push(Arch.armv7l)\n }\n if (args.arm64) {\n result.push(Arch.arm64)\n }\n if (args.ia32) {\n result.push(Arch.ia32)\n }\n\n return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result\n }\n\n if (args.platform != null) {\n throw new InvalidConfigurationError(`--platform cannot be used if --${platform.buildConfigurationKey} is passed`)\n }\n if (args.arch != null) {\n throw new InvalidConfigurationError(`--arch cannot be used if --${platform.buildConfigurationKey} is passed`)\n }\n\n let archToType = targets.get(platform)\n if (archToType == null) {\n archToType = new Map>()\n targets.set(platform, archToType)\n }\n\n if (types.length === 0) {\n const defaultTargetValue = args.dir ? [DIR_TARGET] : []\n for (const arch of commonArch(args.dir === true)) {\n archToType.set(arch, defaultTargetValue)\n }\n return\n }\n\n for (const type of types) {\n const suffixPos = type.lastIndexOf(\":\")\n if (suffixPos > 0) {\n addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos))\n }\n else {\n for (const arch of commonArch(true)) {\n addValue(archToType, arch, type)\n }\n }\n }\n }\n\n if (args.mac != null) {\n processTargets(Platform.MAC, args.mac)\n }\n\n if (args.linux != null) {\n processTargets(Platform.LINUX, args.linux)\n }\n\n if (args.win != null) {\n processTargets(Platform.WINDOWS, args.win)\n }\n\n if (targets.size === 0) {\n if (args.platform == null && args.arch == null) {\n processTargets(Platform.current(), [])\n }\n else {\n targets = createTargets(normalizePlatforms(args.platform), args.dir ? DIR_TARGET : null, args.arch)\n }\n }\n\n const result = {...args}\n result.targets = targets\n\n delete result.dir\n delete result.mac\n delete result.linux\n delete result.win\n delete result.platform\n delete result.arch\n\n const r = result as any\n delete r.m\n delete r.o\n delete r.l\n delete r.w\n delete r.windows\n delete r.macos\n delete r.$0\n delete r._\n delete r.version\n delete r.help\n delete r.c\n delete r.p\n delete r.pd\n\n delete result.ia32\n delete result.x64\n delete result.armv7l\n delete result.arm64\n\n let config = result.config\n\n // config is array when combining dot-notation values with a config file value\n // https://github.com/electron-userland/electron-builder/issues/2016\n if (Array.isArray(config)) {\n const newConfig: Configuration = {}\n for (const configItem of config) {\n if (typeof configItem === \"object\") {\n deepAssign(newConfig, configItem)\n }\n else if (typeof configItem === \"string\") {\n newConfig.extends = configItem\n }\n }\n\n config = newConfig\n result.config = newConfig\n }\n\n if (config != null && typeof config !== \"string\") {\n if (config.extraMetadata != null) {\n coerceTypes(config.extraMetadata)\n }\n if (config.mac != null) {\n // ability to disable code sign using -c.mac.identity=null\n coerceValue(config.mac, \"identity\")\n }\n }\n\n if (\"project\" in r && !(\"projectDir\" in result)) {\n result.projectDir = r.project\n }\n delete r.project\n\n return result as BuildOptions\n}\n\nfunction coerceValue(host: any, key: string): void {\n const value = host[key]\n if (value === \"true\") {\n host[key] = true\n }\n else if (value === \"false\") {\n host[key] = false\n }\n else if (value === \"null\") {\n host[key] = null\n }\n else if (key === \"version\" && typeof value === \"number\") {\n host[key] = value.toString()\n }\n else if (value != null && typeof value === \"object\") {\n coerceTypes(value)\n }\n}\n\n/** @private */\nexport function coerceTypes(host: any): any {\n for (const key of Object.getOwnPropertyNames(host)) {\n coerceValue(host, key)\n }\n return host\n}\n\nexport function createTargets(platforms: Array, type?: string | null, arch?: string | null): Map>> {\n const targets = new Map>>()\n for (const platform of platforms) {\n const archs = platform === Platform.MAC ? [Arch.x64] : (arch === \"all\" ? [Arch.x64, Arch.ia32] : [archFromString(arch == null ? process.arch : arch)])\n const archToType = new Map>()\n targets.set(platform, archToType)\n\n for (const arch of archs) {\n archToType.set(arch, type == null ? [] : [type])\n }\n }\n return targets\n}\n\nexport function build(rawOptions?: CliOptions): Promise> {\n const buildOptions = normalizeOptions(rawOptions || {})\n return _build(buildOptions, new Packager(buildOptions))\n}\n\n/**\n * @private\n * @internal\n */\nexport function configureBuildCommand(yargs: yargs.Yargs): yargs.Yargs {\n const publishGroup = \"Publishing:\"\n const buildGroup = \"Building:\"\n const deprecated = \"Deprecated:\"\n\n return yargs\n .option(\"mac\", {\n group: buildGroup,\n alias: [\"m\", \"o\", \"macos\"],\n description: `Build for macOS, accepts target list (see ${chalk.underline(\"https://goo.gl/5uHuzj\")}).`,\n type: \"array\",\n })\n .option(\"linux\", {\n group: buildGroup,\n alias: \"l\",\n description: `Build for Linux, accepts target list (see ${chalk.underline(\"https://goo.gl/4vwQad\")})`,\n type: \"array\",\n })\n .option(\"win\", {\n group: buildGroup,\n alias: [\"w\", \"windows\"],\n description: `Build for Windows, accepts target list (see ${chalk.underline(\"https://goo.gl/jYsTEJ\")})`,\n type: \"array\",\n })\n .option(\"x64\", {\n group: buildGroup,\n description: \"Build for x64\",\n type: \"boolean\",\n })\n .option(\"ia32\", {\n group: buildGroup,\n description: \"Build for ia32\",\n type: \"boolean\",\n })\n .option(\"armv7l\", {\n group: buildGroup,\n description: \"Build for armv7l\",\n type: \"boolean\",\n })\n .option(\"arm64\", {\n group: buildGroup,\n description: \"Build for arm64\",\n type: \"boolean\",\n })\n .option(\"dir\", {\n group: buildGroup,\n description: \"Build unpacked dir. Useful to test.\",\n type: \"boolean\",\n })\n .option(\"publish\", {\n group: publishGroup,\n alias: \"p\",\n description: `Publish artifacts, see ${chalk.underline(\"https://goo.gl/tSFycD\")}`,\n choices: [\"onTag\", \"onTagOrDraft\", \"always\", \"never\", undefined as any],\n })\n .option(\"draft\", {\n group: deprecated,\n description: \"Please set releaseType in the GitHub publish options instead\",\n type: \"boolean\",\n default: undefined,\n })\n .option(\"prerelease\", {\n group: deprecated,\n description: \"Please set releaseType in the GitHub publish options instead\",\n type: \"boolean\",\n default: undefined,\n })\n .option(\"platform\", {\n group: deprecated,\n description: \"The target platform (preferred to use --mac, --win or --linux)\",\n choices: [\"mac\", \"win\", \"linux\", \"darwin\", \"win32\", \"all\", undefined as any],\n })\n .option(\"arch\", {\n group: deprecated,\n description: \"The target arch (preferred to use --x64 or --ia32)\",\n choices: getArchCliNames().concat(\"all\", undefined as any),\n })\n .option(\"prepackaged\", {\n alias: [\"pd\"],\n group: buildGroup,\n description: \"The path to prepackaged app (to pack in a distributable format)\",\n })\n .option(\"projectDir\", {\n alias: [\"project\"],\n group: buildGroup,\n description: \"The path to project directory. Defaults to current working directory.\",\n })\n .option(\"config\", {\n alias: [\"c\"],\n group: buildGroup,\n description: \"The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`), see \" + chalk.underline(\"https://goo.gl/YFRJOM\"),\n })\n .group([\"help\", \"version\"], \"Other:\")\n .example(\"electron-builder -mwl\", \"build for macOS, Windows and Linux\")\n .example(\"electron-builder --linux deb tar.xz\", \"build deb and tar.xz for Linux\")\n .example(\"electron-builder --win --ia32\", \"build for Windows ia32\")\n .example(\"electron-builder -c.extraMetadata.foo=bar\", \"set package.json property `foo` to `bar`\")\n .example(\"electron-builder --config.nsis.unicode=false\", \"configure unicode options for NSIS\")\n}\n\nfunction normalizePlatforms(rawPlatforms: Array | string | Platform | null | undefined): Array {\n const platforms = rawPlatforms == null || Array.isArray(rawPlatforms) ? (rawPlatforms as Array) : [rawPlatforms]\n if (platforms as any == null || platforms.length === 0) {\n return [Platform.fromString(process.platform)]\n }\n else if (platforms[0] === \"all\") {\n if (process.platform === Platform.MAC.nodeName) {\n return [Platform.MAC, Platform.LINUX, Platform.WINDOWS]\n }\n else if (process.platform === Platform.LINUX.nodeName) {\n // macOS code sign works only on macOS\n return [Platform.LINUX, Platform.WINDOWS]\n }\n else {\n return [Platform.WINDOWS]\n }\n }\n else {\n return platforms.map(it => it instanceof Platform ? it : Platform.fromString(it!))\n }\n}"],"sourceRoot":""} diff --git a/node_modules/electron-builder/out/cli/cli.d.ts b/node_modules/electron-builder/out/cli/cli.d.ts deleted file mode 100644 index 237deca..0000000 --- a/node_modules/electron-builder/out/cli/cli.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env node -export {}; diff --git a/node_modules/electron-builder/out/cli/cli.js b/node_modules/electron-builder/out/cli/cli.js deleted file mode 100755 index 193a482..0000000 --- a/node_modules/electron-builder/out/cli/cli.js +++ /dev/null @@ -1,218 +0,0 @@ -#! /usr/bin/env node -"use strict"; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} - -function _electronVersion() { - const data = require("app-builder-lib/out/electron/electronVersion"); - - _electronVersion = function () { - return data; - }; - - return data; -} - -function _yarn() { - const data = require("app-builder-lib/out/util/yarn"); - - _yarn = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _isCi() { - const data = _interopRequireDefault(require("is-ci")); - - _isCi = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _readConfigFile() { - const data = require("read-config-file"); - - _readConfigFile = function () { - return data; - }; - - return data; -} - -function _updateNotifier() { - const data = _interopRequireDefault(require("update-notifier")); - - _updateNotifier = function () { - return data; - }; - - return data; -} - -function _yargs() { - const data = _interopRequireDefault(require("yargs")); - - _yargs = function () { - return data; - }; - - return data; -} - -function _builder() { - const data = require("../builder"); - - _builder = function () { - return data; - }; - - return data; -} - -function _createSelfSignedCert() { - const data = require("./create-self-signed-cert"); - - _createSelfSignedCert = function () { - return data; - }; - - return data; -} - -function _installAppDeps() { - const data = require("./install-app-deps"); - - _installAppDeps = function () { - return data; - }; - - return data; -} - -function _start() { - const data = require("./start"); - - _start = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// tslint:disable:no-unused-expression -_yargs().default.command(["build", "*"], "Build", _builder().configureBuildCommand, wrap(_builder().build)).command("install-app-deps", "Install app deps", _installAppDeps().configureInstallAppDepsCommand, wrap(_installAppDeps().installAppDeps)).command("node-gyp-rebuild", "Rebuild own native code", _installAppDeps().configureInstallAppDepsCommand -/* yes, args the same as for install app deps */ -, wrap(rebuildAppNativeCode)).command("create-self-signed-cert", "Create self-signed code signing cert for Windows apps", yargs => yargs.option("publisher", { - alias: ["p"], - type: "string", - requiresArg: true, - description: "The publisher name" -}).demandOption("publisher"), wrap(argv => (0, _createSelfSignedCert().createSelfSignedCert)(argv.publisher))).command("start", "Run application in a development mode using electron-webpack", yargs => yargs, wrap(() => (0, _start().start)())).help().epilog(`See ${_chalk().default.underline("https://electron.build")} for more documentation.`).strict().recommendCommands().argv; - -function wrap(task) { - return args => { - checkIsOutdated(); - (0, _readConfigFile().loadEnv)(path.join(process.cwd(), "electron-builder.env")).then(() => task(args)).catch(error => { - process.exitCode = 1; // https://github.com/electron-userland/electron-builder/issues/2940 - - process.on("exit", () => process.exitCode = 1); - console.error(_chalk().default.red(error instanceof _builderUtil().InvalidConfigurationError ? error.message : (error.stack || error).toString())); - }); - }; -} - -function checkIsOutdated() { - if (_isCi().default || process.env.NO_UPDATE_NOTIFIER != null) { - return; - } - - (0, _fsExtraP().readJson)(path.join(__dirname, "..", "..", "package.json")).then(it => { - if (it.version === "0.0.0-semantic-release") { - return; - } - - const notifier = (0, _updateNotifier().default)({ - pkg: it - }); - - if (notifier.update != null) { - notifier.notify({ - message: `Update available ${_chalk().default.dim(notifier.update.current)}${_chalk().default.reset(" → ")}${_chalk().default.green(notifier.update.latest)} \nRun ${_chalk().default.cyan("yarn upgrade electron-builder")} to update` - }); - } - }).catch(e => _builderUtil().log.warn({ - error: e - }, "cannot check updates")); -} - -function rebuildAppNativeCode(_x) { - return _rebuildAppNativeCode.apply(this, arguments); -} function _rebuildAppNativeCode() { - _rebuildAppNativeCode = (0, _bluebirdLst().coroutine)(function* (args) { - const projectDir = process.cwd(); - - _builderUtil().log.info({ - platform: args.platform, - arch: args.arch - }, "executing node-gyp rebuild"); // this script must be used only for electron - - - yield (0, _builderUtil().exec)(process.platform === "win32" ? "node-gyp.cmd" : "node-gyp", ["rebuild"], { - env: (0, _yarn().getGypEnv)({ - version: yield (0, _electronVersion().getElectronVersion)(projectDir), - useCustomDist: true - }, args.platform, args.arch, true) - }); - }); - return _rebuildAppNativeCode.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/node_modules/electron-builder/out/cli/cli.js.map b/node_modules/electron-builder/out/cli/cli.js.map deleted file mode 100644 index 061b2ed..0000000 --- a/node_modules/electron-builder/out/cli/cli.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEA;AACA,iBACG,OADH,CACW,CAAC,OAAD,EAAU,GAAV,CADX,EAC2B,OAD3B,EACoC,gCADpC,EAC2D,IAAI,CAAC,gBAAD,CAD/D,EAEG,OAFH,CAEW,kBAFX,EAE+B,kBAF/B,EAEmD,gDAFnD,EAEmF,IAAI,CAAC,gC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AG,EAAE,uBAAU;AAAC,QAAA,OAAO,QAAQ,2CAAmB,UAAnB,CAAhB;AAAgD,QAAA,aAAa,EAAE;AAA/D,OAAV,EAAgF,IAAI,CAAC,QAArF,EAA+F,IAAI,CAAC,IAApG,EAA0G,IAA1G;AAD6E,KAA9E,CAAN;AAGD,G","sourcesContent":["#! /usr/bin/env node\n\nimport { exec, InvalidConfigurationError, log } from \"builder-util\"\nimport chalk from \"chalk\"\nimport { getElectronVersion } from \"app-builder-lib/out/electron/electronVersion\"\nimport { getGypEnv } from \"app-builder-lib/out/util/yarn\"\nimport { readJson } from \"fs-extra-p\"\nimport isCi from \"is-ci\"\nimport * as path from \"path\"\nimport { loadEnv } from \"read-config-file\"\nimport updateNotifier from \"update-notifier\"\nimport yargs from \"yargs\"\nimport { build, configureBuildCommand } from \"../builder\"\nimport { createSelfSignedCert } from \"./create-self-signed-cert\"\nimport { configureInstallAppDepsCommand, installAppDeps } from \"./install-app-deps\"\nimport { start } from \"./start\"\n\n// tslint:disable:no-unused-expression\nyargs\n .command([\"build\", \"*\"], \"Build\", configureBuildCommand, wrap(build))\n .command(\"install-app-deps\", \"Install app deps\", configureInstallAppDepsCommand, wrap(installAppDeps))\n .command(\"node-gyp-rebuild\", \"Rebuild own native code\", configureInstallAppDepsCommand /* yes, args the same as for install app deps */, wrap(rebuildAppNativeCode))\n .command(\"create-self-signed-cert\", \"Create self-signed code signing cert for Windows apps\",\n yargs => yargs\n .option(\"publisher\", {\n alias: [\"p\"],\n type: \"string\",\n requiresArg: true,\n description: \"The publisher name\",\n })\n .demandOption(\"publisher\"),\n wrap(argv => createSelfSignedCert(argv.publisher)))\n .command(\"start\", \"Run application in a development mode using electron-webpack\",\n yargs => yargs,\n wrap(() => start()))\n .help()\n .epilog(`See ${chalk.underline(\"https://electron.build\")} for more documentation.`)\n .strict()\n .recommendCommands()\n .argv\n\nfunction wrap(task: (args: any) => Promise) {\n return (args: any) => {\n checkIsOutdated()\n loadEnv(path.join(process.cwd(), \"electron-builder.env\"))\n .then(() => task(args))\n .catch(error => {\n process.exitCode = 1\n // https://github.com/electron-userland/electron-builder/issues/2940\n process.on(\"exit\", () => process.exitCode = 1)\n\n console.error(chalk.red(error instanceof InvalidConfigurationError ? error.message : (error.stack || error).toString()))\n })\n }\n}\n\nfunction checkIsOutdated() {\n if (isCi || process.env.NO_UPDATE_NOTIFIER != null) {\n return\n }\n\n readJson(path.join(__dirname, \"..\", \"..\", \"package.json\"))\n .then(it => {\n if (it.version === \"0.0.0-semantic-release\") {\n return\n }\n\n const notifier = updateNotifier({pkg: it})\n if (notifier.update != null) {\n notifier.notify({\n message: `Update available ${chalk.dim(notifier.update.current)}${chalk.reset(\" → \")}${chalk.green(notifier.update.latest)} \\nRun ${chalk.cyan(\"yarn upgrade electron-builder\")} to update`\n })\n }\n })\n .catch(e => log.warn({error: e}, \"cannot check updates\"))\n}\n\nasync function rebuildAppNativeCode(args: any) {\n const projectDir = process.cwd()\n log.info({platform: args.platform, arch: args.arch}, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n await exec(process.platform === \"win32\" ? \"node-gyp.cmd\" : \"node-gyp\", [\"rebuild\"], {\n env: getGypEnv({version: await getElectronVersion(projectDir), useCustomDist: true}, args.platform, args.arch, true),\n })\n}"],"sourceRoot":""} diff --git a/node_modules/electron-builder/out/cli/create-self-signed-cert.d.ts b/node_modules/electron-builder/out/cli/create-self-signed-cert.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/electron-builder/out/cli/create-self-signed-cert.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/electron-builder/out/cli/create-self-signed-cert.js b/node_modules/electron-builder/out/cli/create-self-signed-cert.js deleted file mode 100644 index f72ca9d..0000000 --- a/node_modules/electron-builder/out/cli/create-self-signed-cert.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createSelfSignedCert = createSelfSignedCert; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _fs() { - const data = require("builder-util/out/fs"); - - _fs = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} - -function _windowsCodeSign() { - const data = require("app-builder-lib/out/codeSign/windowsCodeSign"); - - _windowsCodeSign = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _sanitizeFilename() { - const data = _interopRequireDefault(require("sanitize-filename")); - - _sanitizeFilename = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @internal */ -function createSelfSignedCert(_x) { - return _createSelfSignedCert.apply(this, arguments); -} - -function _createSelfSignedCert() { - _createSelfSignedCert = (0, _bluebirdLst().coroutine)(function* (publisher) { - const tmpDir = new (_builderUtil().TmpDir)("create-self-signed-cert"); - const targetDir = process.cwd(); - const tempPrefix = path.join((yield tmpDir.getTempDir({ - prefix: "self-signed-cert-creator" - })), (0, _sanitizeFilename().default)(publisher)); - const cer = `${tempPrefix}.cer`; - const pvk = `${tempPrefix}.pvk`; - - _builderUtil().log.info(_chalk().default.bold('When asked to enter a password ("Create Private Key Password"), please select "None".')); - - try { - yield (0, _fsExtraP().ensureDir)(path.dirname(tempPrefix)); - const vendorPath = path.join((yield (0, _windowsCodeSign().getSignVendorPath)()), "windows-10", process.arch); - yield (0, _builderUtil().exec)(path.join(vendorPath, "makecert.exe"), ["-r", "-h", "0", "-n", `CN=${quoteString(publisher)}`, "-eku", "1.3.6.1.5.5.7.3.3", "-pe", "-sv", pvk, cer]); - const pfx = path.join(targetDir, `${(0, _sanitizeFilename().default)(publisher)}.pfx`); - yield (0, _fs().unlinkIfExists)(pfx); - yield (0, _builderUtil().exec)(path.join(vendorPath, "pvk2pfx.exe"), ["-pvk", pvk, "-spc", cer, "-pfx", pfx]); - - _builderUtil().log.info({ - file: pfx - }, `created. Please see https://electron.build/code-signing how to use it to sign.`); - - const certLocation = "Cert:\\LocalMachine\\TrustedPeople"; - - _builderUtil().log.info({ - file: pfx, - certLocation - }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`); - - yield (0, _builderUtil().spawn)("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", ""]); - } finally { - yield tmpDir.cleanup(); - } - }); - return _createSelfSignedCert.apply(this, arguments); -} - -function quoteString(s) { - if (!s.includes(",") && !s.includes('"')) { - return s; - } - - return `"${s.replace(/"/g, '\\"')}"`; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=create-self-signed-cert.js.map \ No newline at end of file diff --git a/node_modules/electron-builder/out/cli/create-self-signed-cert.js.map b/node_modules/electron-builder/out/cli/create-self-signed-cert.js.map deleted file mode 100644 index ada9761..0000000 --- a/node_modules/electron-builder/out/cli/create-self-signed-cert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/cli/create-self-signed-cert.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;A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,MAAD,EAAS,GAAT,EAAc,MAAd,EAAsB,GAAtB,EAA2B,MAA3B,EAAmC,GAAnC,CAA3C,CAAN;;AACA,yBAAI,IAAJ,CAAS;AAAC,QAAA,IAAI,EAAE;AAAP,OAAT,EAAsB,gFAAtB;;AAEA,YAAM,YAAY,GAAG,oCAArB;;AACA,yBAAI,IAAJ,CAAS;AAAC,QAAA,IAAI,EAAE,GAAP;AAAY,QAAA;AAAZ,OAAT,EAAoC,gGAApC;;AACA,YAAM,0BAAM,gBAAN,EAAwB,CAAC,YAAD,EAAe,iBAAf,EAAkC,UAAlC,EAA8C,uBAA9C,EAAuE,WAAvE,EAAoF,IAAI,GAAG,GAA3F,EAAgG,oBAAhG,EAAsH,EAAtH,CAAxB,CAAN;AACD,KAdD,SAeQ;AACN,YAAM,MAAM,CAAC,OAAP,EAAN;AACD;AACF,G;;;;AAED,SAAS,WAAT,CAAqB,CAArB,EAA8B;AAC5B,MAAI,CAAC,CAAC,CAAC,QAAF,CAAW,GAAX,CAAD,IAAoB,CAAC,CAAC,CAAC,QAAF,CAAW,GAAX,CAAzB,EAA0C;AACxC,WAAO,CAAP;AACD;;AAED,SAAO,IAAI,CAAC,CAAC,OAAF,CAAU,IAAV,EAAgB,KAAhB,CAAsB,GAAjC;AACD,C","sourcesContent":["import { exec, log, spawn, TmpDir } from \"builder-util\"\nimport { unlinkIfExists } from \"builder-util/out/fs\"\nimport chalk from \"chalk\"\nimport { getSignVendorPath } from \"app-builder-lib/out/codeSign/windowsCodeSign\"\nimport { ensureDir } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport sanitizeFileName from \"sanitize-filename\"\n\n/** @internal */\nexport async function createSelfSignedCert(publisher: string) {\n const tmpDir = new TmpDir(\"create-self-signed-cert\")\n const targetDir = process.cwd()\n const tempPrefix = path.join(await tmpDir.getTempDir({prefix: \"self-signed-cert-creator\"}), sanitizeFileName(publisher))\n const cer = `${tempPrefix}.cer`\n const pvk = `${tempPrefix}.pvk`\n\n log.info(chalk.bold('When asked to enter a password (\"Create Private Key Password\"), please select \"None\".'))\n\n try {\n await ensureDir(path.dirname(tempPrefix))\n const vendorPath = path.join(await getSignVendorPath(), \"windows-10\", process.arch)\n await exec(path.join(vendorPath, \"makecert.exe\"),\n [\"-r\", \"-h\", \"0\", \"-n\", `CN=${quoteString(publisher)}`, \"-eku\", \"1.3.6.1.5.5.7.3.3\", \"-pe\", \"-sv\", pvk, cer])\n\n const pfx = path.join(targetDir, `${sanitizeFileName(publisher)}.pfx`)\n await unlinkIfExists(pfx)\n await exec(path.join(vendorPath, \"pvk2pfx.exe\"), [\"-pvk\", pvk, \"-spc\", cer, \"-pfx\", pfx])\n log.info({file: pfx}, `created. Please see https://electron.build/code-signing how to use it to sign.`)\n\n const certLocation = \"Cert:\\\\LocalMachine\\\\TrustedPeople\"\n log.info({file: pfx, certLocation}, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`)\n await spawn(\"powershell.exe\", [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Import-PfxCertificate\", \"-FilePath\", `\"${pfx}\"`, \"-CertStoreLocation\", \"\"])\n }\n finally {\n await tmpDir.cleanup()\n }\n}\n\nfunction quoteString(s: string): string {\n if (!s.includes(\",\") && !s.includes('\"')) {\n return s\n }\n\n return `\"${s.replace(/\"/g, '\\\\\"')}\"`\n}"],"sourceRoot":""} diff --git a/node_modules/electron-builder/out/cli/install-app-deps.d.ts b/node_modules/electron-builder/out/cli/install-app-deps.d.ts deleted file mode 100644 index 237deca..0000000 --- a/node_modules/electron-builder/out/cli/install-app-deps.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env node -export {}; diff --git a/node_modules/electron-builder/out/cli/install-app-deps.js b/node_modules/electron-builder/out/cli/install-app-deps.js deleted file mode 100755 index e3419e5..0000000 --- a/node_modules/electron-builder/out/cli/install-app-deps.js +++ /dev/null @@ -1,189 +0,0 @@ -#! /usr/bin/env node -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.configureInstallAppDepsCommand = configureInstallAppDepsCommand; -exports.installAppDeps = installAppDeps; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _promise() { - const data = require("builder-util/out/promise"); - - _promise = function () { - return data; - }; - - return data; -} - -function _config() { - const data = require("app-builder-lib/out/util/config"); - - _config = function () { - return data; - }; - - return data; -} - -function _electronVersion() { - const data = require("app-builder-lib/out/electron/electronVersion"); - - _electronVersion = function () { - return data; - }; - - return data; -} - -function _packageDependencies() { - const data = require("app-builder-lib/out/util/packageDependencies"); - - _packageDependencies = function () { - return data; - }; - - return data; -} - -function _yarn() { - const data = require("app-builder-lib/out/util/yarn"); - - _yarn = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -function _readConfigFile() { - const data = require("read-config-file"); - - _readConfigFile = function () { - return data; - }; - - return data; -} - -function _yargs() { - const data = _interopRequireDefault(require("yargs")); - - _yargs = function () { - return data; - }; - - return data; -} - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/** @internal */ -function configureInstallAppDepsCommand(yargs) { - // https://github.com/yargs/yargs/issues/760 - // demandOption is required to be set - return yargs.option("platform", { - choices: ["linux", "darwin", "win32"], - default: process.platform, - description: "The target platform" - }).option("arch", { - choices: (0, _builderUtil().getArchCliNames)().concat("all"), - default: process.arch === "arm" ? "armv7l" : process.arch, - description: "The target arch" - }); -} -/** @internal */ - - -function installAppDeps(_x) { - return _installAppDeps.apply(this, arguments); -} - -function _installAppDeps() { - _installAppDeps = (0, _bluebirdLst().coroutine)(function* (args) { - try { - _builderUtil().log.info({ - version: "20.38.4" - }, "electron-builder"); - } catch (e) { - // error in dev mode without babel - if (!(e instanceof ReferenceError)) { - throw e; - } - } - - const projectDir = process.cwd(); - const packageMetadata = new (_lazyVal().Lazy)(() => (0, _readConfigFile().orNullIfFileNotExist)((0, _fsExtraP().readJson)(path.join(projectDir, "package.json")))); - const config = yield (0, _config().getConfig)(projectDir, null, null, packageMetadata); - const muonVersion = config.muonVersion; - const results = yield Promise.all([(0, _config().computeDefaultAppDirectory)(projectDir, (0, _builderUtil().use)(config.directories, it => it.app)), muonVersion == null ? (0, _electronVersion().getElectronVersion)(projectDir, config, packageMetadata) : Promise.resolve(muonVersion)]); // if two package.json — force full install (user wants to install/update app deps in addition to dev) - - yield (0, _yarn().installOrRebuild)(config, results[0], { - frameworkInfo: { - version: results[1], - useCustomDist: muonVersion == null - }, - platform: args.platform, - arch: args.arch, - productionDeps: (0, _packageDependencies().createLazyProductionDeps)(results[0]) - }, results[0] !== projectDir); - }); - return _installAppDeps.apply(this, arguments); -} - -function main() { - return installAppDeps(configureInstallAppDepsCommand(_yargs().default).argv); -} - -if (process.mainModule === module) { - _builderUtil().log.warn("please use as subcommand: electron-builder install-app-deps"); - - main().catch(_promise().printErrorAndExit); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=install-app-deps.js.map \ No newline at end of file diff --git a/node_modules/electron-builder/out/cli/install-app-deps.js.map b/node_modules/electron-builder/out/cli/install-app-deps.js.map deleted file mode 100644 index 4f019fe..0000000 --- a/node_modules/electron-builder/out/cli/install-app-deps.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/cli/install-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I,GACD,KADH,CACS,4BADT;AAED,C","sourcesContent":["#! /usr/bin/env node\n\nimport { log, use, getArchCliNames } from \"builder-util\"\nimport { printErrorAndExit } from \"builder-util/out/promise\"\nimport { computeDefaultAppDirectory, getConfig } from \"app-builder-lib/out/util/config\"\nimport { getElectronVersion } from \"app-builder-lib/out/electron/electronVersion\"\nimport { createLazyProductionDeps } from \"app-builder-lib/out/util/packageDependencies\"\nimport { installOrRebuild } from \"app-builder-lib/out/util/yarn\"\nimport { readJson } from \"fs-extra-p\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { orNullIfFileNotExist } from \"read-config-file\"\nimport yargs from \"yargs\"\n\ndeclare const PACKAGE_VERSION: string\n\n/** @internal */\nexport function configureInstallAppDepsCommand(yargs: yargs.Yargs): yargs.Yargs {\n // https://github.com/yargs/yargs/issues/760\n // demandOption is required to be set\n return yargs\n .option(\"platform\", {\n choices: [\"linux\", \"darwin\", \"win32\"],\n default: process.platform,\n description: \"The target platform\",\n })\n .option(\"arch\", {\n choices: getArchCliNames().concat(\"all\"),\n default: process.arch === \"arm\" ? \"armv7l\" : process.arch,\n description: \"The target arch\",\n })\n}\n\n/** @internal */\nexport async function installAppDeps(args: any) {\n try {\n log.info({version: PACKAGE_VERSION}, \"electron-builder\")\n }\n catch (e) {\n // error in dev mode without babel\n if (!(e instanceof ReferenceError)) {\n throw e\n }\n }\n\n const projectDir = process.cwd()\n const packageMetadata = new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, \"package.json\"))))\n const config = await getConfig(projectDir, null, null, packageMetadata)\n const muonVersion = config.muonVersion\n const results = await Promise.all([\n computeDefaultAppDirectory(projectDir, use(config.directories, it => it!.app)),\n muonVersion == null ? getElectronVersion(projectDir, config, packageMetadata) : Promise.resolve(muonVersion),\n ])\n\n // if two package.json — force full install (user wants to install/update app deps in addition to dev)\n await installOrRebuild(config, results[0], {\n frameworkInfo: {version: results[1], useCustomDist: muonVersion == null},\n platform: args.platform,\n arch: args.arch,\n productionDeps: createLazyProductionDeps(results[0]),\n }, results[0] !== projectDir)\n}\n\nfunction main() {\n return installAppDeps(configureInstallAppDepsCommand(yargs).argv)\n}\n\nif (process.mainModule === module) {\n log.warn(\"please use as subcommand: electron-builder install-app-deps\")\n main()\n .catch(printErrorAndExit)\n}"],"sourceRoot":""} diff --git a/node_modules/electron-builder/out/cli/start.d.ts b/node_modules/electron-builder/out/cli/start.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/electron-builder/out/cli/start.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/electron-builder/out/cli/start.js b/node_modules/electron-builder/out/cli/start.js deleted file mode 100644 index 441d430..0000000 --- a/node_modules/electron-builder/out/cli/start.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.start = start; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -/** @internal */ -function start() { - return _start.apply(this, arguments); -} function _start() { - _start = (0, _bluebirdLst().coroutine)(function* () { - require("electron-webpack/dev-runner"); - }); - return _start.apply(this, arguments); -} -// __ts-babel@6.0.4 -//# sourceMappingURL=start.js.map \ No newline at end of file diff --git a/node_modules/electron-builder/out/cli/start.js.map b/node_modules/electron-builder/out/cli/start.js.map deleted file mode 100644 index d72253b..0000000 --- a/node_modules/electron-builder/out/cli/start.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/cli/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;SACsB,K;;;;;;yCAAf,aAAoB;AACzB,IAAA,OAAO,CAAC,6BAAD,CAAP;AACD,G","sourcesContent":["/** @internal */\nexport async function start() {\n require(\"electron-webpack/dev-runner\")\n}"],"sourceRoot":""} diff --git a/node_modules/electron-builder/out/index.d.ts b/node_modules/electron-builder/out/index.d.ts deleted file mode 100644 index 49ae7d1..0000000 --- a/node_modules/electron-builder/out/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { getArchSuffix, Arch, archFromString } from "builder-util"; -export { build, CliOptions, createTargets } from "./builder"; -export { TargetConfiguration, Platform, Target, DIR_TARGET, BeforeBuildContext, SourceRepositoryInfo, TargetSpecificOptions, TargetConfigType, DEFAULT_TARGET, CompressionLevel, MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, PkgOptions, DmgContent, DmgWindow, PlatformSpecificBuildOptions, AsarOptions, FileSet, LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions, Configuration, AfterPackContext, MetadataDirectories, Protocol, ReleaseInfo, ElectronDownloadOptions, SnapOptions, CommonWindowsInstallerConfiguration, FileAssociation, MsiOptions, AppXOptions, WindowsConfiguration, Packager, BuildResult, PackagerOptions, ArtifactCreated, ArtifactBuildStarted, NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions, SquirrelWindowsOptions, WindowsSignOptions, CustomWindowsSignTaskConfiguration, WindowsSignTaskConfiguration, CustomWindowsSign, FileCodeSigningInfo, CertificateFromStoreInfo, Metadata, AuthorMetadata, RepositoryInfo, AppInfo, UploadTask, PublishManager, PublishOptions, ProgressInfo } from "app-builder-lib"; -export { buildForge, ForgeOptions } from "app-builder-lib"; -export { CancellationToken } from "builder-util-runtime"; diff --git a/node_modules/electron-builder/out/index.js b/node_modules/electron-builder/out/index.js deleted file mode 100644 index 8be05e8..0000000 --- a/node_modules/electron-builder/out/index.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "getArchSuffix", { - enumerable: true, - get: function () { - return _builderUtil().getArchSuffix; - } -}); -Object.defineProperty(exports, "Arch", { - enumerable: true, - get: function () { - return _builderUtil().Arch; - } -}); -Object.defineProperty(exports, "archFromString", { - enumerable: true, - get: function () { - return _builderUtil().archFromString; - } -}); -Object.defineProperty(exports, "build", { - enumerable: true, - get: function () { - return _builder().build; - } -}); -Object.defineProperty(exports, "createTargets", { - enumerable: true, - get: function () { - return _builder().createTargets; - } -}); -Object.defineProperty(exports, "Platform", { - enumerable: true, - get: function () { - return _appBuilderLib().Platform; - } -}); -Object.defineProperty(exports, "Target", { - enumerable: true, - get: function () { - return _appBuilderLib().Target; - } -}); -Object.defineProperty(exports, "DIR_TARGET", { - enumerable: true, - get: function () { - return _appBuilderLib().DIR_TARGET; - } -}); -Object.defineProperty(exports, "DEFAULT_TARGET", { - enumerable: true, - get: function () { - return _appBuilderLib().DEFAULT_TARGET; - } -}); -Object.defineProperty(exports, "Packager", { - enumerable: true, - get: function () { - return _appBuilderLib().Packager; - } -}); -Object.defineProperty(exports, "AppInfo", { - enumerable: true, - get: function () { - return _appBuilderLib().AppInfo; - } -}); -Object.defineProperty(exports, "PublishManager", { - enumerable: true, - get: function () { - return _appBuilderLib().PublishManager; - } -}); -Object.defineProperty(exports, "buildForge", { - enumerable: true, - get: function () { - return _appBuilderLib().buildForge; - } -}); -Object.defineProperty(exports, "CancellationToken", { - enumerable: true, - get: function () { - return _builderUtilRuntime().CancellationToken; - } -}); - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builder() { - const data = require("./builder"); - - _builder = function () { - return data; - }; - - return data; -} - -function _appBuilderLib() { - const data = require("app-builder-lib"); - - _appBuilderLib = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/electron-builder/out/index.js.map b/node_modules/electron-builder/out/index.js.map deleted file mode 100644 index 9078f63..0000000 --- a/node_modules/electron-builder/out/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAcA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export { getArchSuffix, Arch, archFromString } from \"builder-util\"\nexport { build, CliOptions, createTargets } from \"./builder\"\nexport {\n TargetConfiguration, Platform, Target, DIR_TARGET, BeforeBuildContext, SourceRepositoryInfo, TargetSpecificOptions, TargetConfigType, DEFAULT_TARGET, CompressionLevel,\n MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, PkgOptions, DmgContent, DmgWindow,\n PlatformSpecificBuildOptions, AsarOptions, FileSet,\n LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions,\n Configuration, AfterPackContext, MetadataDirectories, Protocol, ReleaseInfo, ElectronDownloadOptions,\n SnapOptions, CommonWindowsInstallerConfiguration, FileAssociation, MsiOptions, AppXOptions, WindowsConfiguration,\n Packager, BuildResult, PackagerOptions, ArtifactCreated, ArtifactBuildStarted,\n NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions, SquirrelWindowsOptions,\n WindowsSignOptions, CustomWindowsSignTaskConfiguration, WindowsSignTaskConfiguration, CustomWindowsSign, FileCodeSigningInfo, CertificateFromStoreInfo,\n Metadata, AuthorMetadata, RepositoryInfo, AppInfo,\n UploadTask, PublishManager, PublishOptions, ProgressInfo\n} from \"app-builder-lib\"\nexport { buildForge, ForgeOptions } from \"app-builder-lib\"\nexport { CancellationToken } from \"builder-util-runtime\"\n"],"sourceRoot":""} diff --git a/node_modules/electron-builder/package.json b/node_modules/electron-builder/package.json deleted file mode 100644 index 9cc77c9..0000000 --- a/node_modules/electron-builder/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_from": "electron-builder@^20.38.4", - "_id": "electron-builder@20.38.4", - "_inBundle": false, - "_integrity": "sha512-WHOr3Rz2wktxV5TqmRL6woO9/wrIZeRfJPSEXOhgfgLskE5Sp2Aer0zAF7lHNqXuG6JhU+0I9IYFAxa73MTs9w==", - "_location": "/electron-builder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "electron-builder@^20.38.4", - "name": "electron-builder", - "escapedName": "electron-builder", - "rawSpec": "^20.38.4", - "saveSpec": null, - "fetchSpec": "^20.38.4" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-20.38.4.tgz", - "_shasum": "67727529ffb87e7fdd78b3a84ea0d6c22bf04ec2", - "_spec": "electron-builder@^20.38.4", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", - "author": { - "name": "Vladimir Krivosheev" - }, - "bin": { - "electron-builder": "./out/cli/cli.js", - "build": "./out/cli/cli.js", - "install-app-deps": "./out/cli/install-app-deps.js" - }, - "bugs": { - "url": "https://github.com/electron-userland/electron-builder/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Stefan Judis" - } - ], - "dependencies": { - "app-builder-lib": "20.38.4", - "bluebird-lst": "^1.0.6", - "builder-util": "9.6.1", - "builder-util-runtime": "8.1.0", - "chalk": "^2.4.1", - "dmg-builder": "6.5.3", - "fs-extra-p": "^7.0.0", - "is-ci": "^2.0.0", - "lazy-val": "^1.0.3", - "read-config-file": "3.2.0", - "sanitize-filename": "^1.6.1", - "update-notifier": "^2.5.0", - "yargs": "^12.0.5" - }, - "deprecated": false, - "description": "A complete solution to package and build a ready for distribution Electron app for MacOS, Windows and Linux with “auto update” support out of the box", - "engines": { - "node": ">=8.12.0" - }, - "files": [ - "out" - ], - "homepage": "https://github.com/electron-userland/electron-builder", - "keywords": [ - "electron", - "builder", - "build", - "installer", - "install", - "packager", - "pack", - "nsis", - "app", - "dmg", - "pkg", - "msi", - "exe", - "setup", - "Windows", - "OS X", - "MacOS", - "Mac", - "appx", - "snap", - "portable" - ], - "license": "MIT", - "main": "out/index.js", - "name": "electron-builder", - "publishConfig": { - "tag": "next" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/electron-userland/electron-builder.git" - }, - "typings": "./out/index.d.ts", - "version": "20.38.4", - "yargs": { - "camel-case-expansion": false - } -} diff --git a/node_modules/electron-dl/package.json b/node_modules/electron-dl/package.json index 8507a4d..c21bf9a 100644 --- a/node_modules/electron-dl/package.json +++ b/node_modules/electron-dl/package.json @@ -1,27 +1,31 @@ { - "_from": "electron-dl", + "_args": [ + [ + "electron-dl@1.12.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "electron-dl@1.12.0", "_id": "electron-dl@1.12.0", "_inBundle": false, "_integrity": "sha512-UMc2CL45Ybpvu66LDPYzwmDRmYK4Ivz+wdnTM0eXcNMztvQwhixAk2UPme1c7McqG8bAlKEkQpZn3epmQy4EWg==", "_location": "/electron-dl", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "electron-dl", + "raw": "electron-dl@1.12.0", "name": "electron-dl", "escapedName": "electron-dl", - "rawSpec": "", + "rawSpec": "1.12.0", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "1.12.0" }, "_requiredBy": [ - "#USER", "/" ], "_resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-1.12.0.tgz", - "_shasum": "328c7f12d3e458ed4ddc773d8ffc28d59ab35d2e", - "_spec": "electron-dl", + "_spec": "1.12.0", "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", @@ -31,13 +35,11 @@ "bugs": { "url": "https://github.com/sindresorhus/electron-dl/issues" }, - "bundleDependencies": false, "dependencies": { "ext-name": "^5.0.0", "pupa": "^1.0.0", "unused-filename": "^1.0.0" }, - "deprecated": false, "description": "Simplified file downloads for your Electron app", "devDependencies": { "ava": "^0.25.0", diff --git a/node_modules/electron-download/package.json b/node_modules/electron-download/package.json index 856dd73..7f33b41 100644 --- a/node_modules/electron-download/package.json +++ b/node_modules/electron-download/package.json @@ -1,27 +1,34 @@ { - "_from": "electron-download@^4.1.0", + "_args": [ + [ + "electron-download@4.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "electron-download@4.1.1", "_id": "electron-download@4.1.1", "_inBundle": false, "_integrity": "sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg==", "_location": "/electron-download", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "electron-download@^4.1.0", + "raw": "electron-download@4.1.1", "name": "electron-download", "escapedName": "electron-download", - "rawSpec": "^4.1.0", + "rawSpec": "4.1.1", "saveSpec": null, - "fetchSpec": "^4.1.0" + "fetchSpec": "4.1.1" }, "_requiredBy": [ - "/electron" + "/electron", + "/electron-packager" ], "_resolved": "https://registry.npmjs.org/electron-download/-/electron-download-4.1.1.tgz", - "_shasum": "02e69556705cc456e520f9e035556ed5a015ebe8", - "_spec": "electron-download@^4.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron", + "_spec": "4.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "max ogden" }, @@ -31,7 +38,6 @@ "bugs": { "url": "https://github.com/electron-userland/electron-download/issues" }, - "bundleDependencies": false, "dependencies": { "debug": "^3.0.0", "env-paths": "^1.0.0", @@ -43,7 +49,6 @@ "semver": "^5.4.1", "sumchecker": "^2.0.2" }, - "deprecated": false, "description": "download electron prebuilt binary zips from github releases", "devDependencies": { "eslint": "^4.4.1", diff --git a/node_modules/electron-osx-sign/node_modules/debug/package.json b/node_modules/electron-osx-sign/node_modules/debug/package.json index da9be81..2351bc6 100644 --- a/node_modules/electron-osx-sign/node_modules/debug/package.json +++ b/node_modules/electron-osx-sign/node_modules/debug/package.json @@ -1,27 +1,33 @@ { - "_from": "debug@^2.6.8", + "_args": [ + [ + "debug@2.6.9", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "debug@2.6.9", "_id": "debug@2.6.9", "_inBundle": false, "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "_location": "/electron-osx-sign/debug", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "debug@^2.6.8", + "raw": "debug@2.6.9", "name": "debug", "escapedName": "debug", - "rawSpec": "^2.6.8", + "rawSpec": "2.6.9", "saveSpec": null, - "fetchSpec": "^2.6.8" + "fetchSpec": "2.6.9" }, "_requiredBy": [ "/electron-osx-sign" ], "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f", - "_spec": "debug@^2.6.8", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-osx-sign", + "_spec": "2.6.9", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/visionmedia/debug/issues" }, - "bundleDependencies": false, "component": { "scripts": { "debug/index.js": "browser.js", @@ -51,7 +56,6 @@ "dependencies": { "ms": "2.0.0" }, - "deprecated": false, "description": "small debugging utility", "devDependencies": { "browserify": "9.0.3", diff --git a/node_modules/electron-osx-sign/node_modules/ms/package.json b/node_modules/electron-osx-sign/node_modules/ms/package.json index 6c05737..bbcd0ef 100644 --- a/node_modules/electron-osx-sign/node_modules/ms/package.json +++ b/node_modules/electron-osx-sign/node_modules/ms/package.json @@ -1,4 +1,11 @@ { + "_args": [ + [ + "ms@2.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, "_from": "ms@2.0.0", "_id": "ms@2.0.0", "_inBundle": false, @@ -19,14 +26,11 @@ "/electron-osx-sign/debug" ], "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8", - "_spec": "ms@2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-osx-sign/node_modules/debug", + "_spec": "2.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/zeit/ms/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Tiny milisecond conversion utility", "devDependencies": { "eslint": "3.19.0", diff --git a/node_modules/electron-osx-sign/package.json b/node_modules/electron-osx-sign/package.json index f18c981..a7c7a98 100644 --- a/node_modules/electron-osx-sign/package.json +++ b/node_modules/electron-osx-sign/package.json @@ -1,4 +1,11 @@ { + "_args": [ + [ + "electron-osx-sign@0.4.11", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, "_from": "electron-osx-sign@0.4.11", "_id": "electron-osx-sign@0.4.11", "_inBundle": false, @@ -16,12 +23,11 @@ "fetchSpec": "0.4.11" }, "_requiredBy": [ - "/app-builder-lib" + "/electron-packager" ], "_resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.11.tgz", - "_shasum": "8377732fe7b207969f264b67582ee47029ce092f", - "_spec": "electron-osx-sign@0.4.11", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", + "_spec": "0.4.11", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "sethlu" }, @@ -32,7 +38,6 @@ "bugs": { "url": "https://github.com/electron-userland/electron-osx-sign/issues" }, - "bundleDependencies": false, "dependencies": { "bluebird": "^3.5.0", "compare-version": "^0.1.2", @@ -41,7 +46,6 @@ "minimist": "^1.2.0", "plist": "^3.0.1" }, - "deprecated": false, "description": "Codesign Electron macOS apps", "devDependencies": { "electron-download": "^4.1.0", diff --git a/node_modules/electron-publish/out/BintrayPublisher.d.ts b/node_modules/electron-publish/out/BintrayPublisher.d.ts deleted file mode 100755 index 24e82aa..0000000 --- a/node_modules/electron-publish/out/BintrayPublisher.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import { Arch } from "builder-util"; -import { BintrayOptions } from "builder-util-runtime"; -import { ClientRequest } from "http"; -import { HttpPublisher, PublishContext, PublishOptions } from "./publisher"; -export declare class BintrayPublisher extends HttpPublisher { - private readonly version; - private readonly options; - private readonly _versionPromise; - private readonly client; - readonly providerName = "Bintray"; - constructor(context: PublishContext, info: BintrayOptions, version: string, options?: PublishOptions); - private init; - protected doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void): Promise; - deleteRelease(isForce?: boolean): Promise; - toString(): string; -} diff --git a/node_modules/electron-publish/out/BintrayPublisher.js b/node_modules/electron-publish/out/BintrayPublisher.js deleted file mode 100755 index 9ae6a3d..0000000 --- a/node_modules/electron-publish/out/BintrayPublisher.js +++ /dev/null @@ -1,204 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BintrayPublisher = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _bintray() { - const data = require("builder-util-runtime/out/bintray"); - - _bintray = function () { - return data; - }; - - return data; -} - -function _nodeHttpExecutor() { - const data = require("builder-util/out/nodeHttpExecutor"); - - _nodeHttpExecutor = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -function _publisher() { - const data = require("./publisher"); - - _publisher = function () { - return data; - }; - - return data; -} - -class BintrayPublisher extends _publisher().HttpPublisher { - constructor(context, info, version, options = {}) { - super(context); - this.version = version; - this.options = options; - this._versionPromise = new (_lazyVal().Lazy)(() => this.init()); - this.providerName = "Bintray"; - let token = info.token; - - if ((0, _builderUtil().isEmptyOrSpaces)(token)) { - token = process.env.BT_TOKEN; - - if ((0, _builderUtil().isEmptyOrSpaces)(token)) { - throw new (_builderUtil().InvalidConfigurationError)(`Bintray token is not set, neither programmatically, nor using env "BT_TOKEN" (see https://www.electron.build/configuration/publish#bintrayoptions)`); - } - - token = token.trim(); - - if (!(0, _builderUtil().isTokenCharValid)(token)) { - throw new (_builderUtil().InvalidConfigurationError)(`Bintray token (${JSON.stringify(token)}) contains invalid characters, please check env "BT_TOKEN"`); - } - } - - this.client = new (_bintray().BintrayClient)(info, _nodeHttpExecutor().httpExecutor, this.context.cancellationToken, token); - } - - init() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - try { - return yield _this.client.getVersion(_this.version); - } catch (e) { - if (e instanceof _builderUtilRuntime().HttpError && e.statusCode === 404) { - if (_this.options.publish !== "onTagOrDraft") { - _builderUtil().log.info({ - version: _this.version - }, "version doesn't exist, creating one"); - - return _this.client.createVersion(_this.version); - } else { - _builderUtil().log.notice({ - reason: "version doesn't exist", - version: _this.version - }, "skipped publishing"); - } - } - - throw e; - } - })(); - } - - doUpload(fileName, arch, dataLength, requestProcessor) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const version = yield _this2._versionPromise.value; - - if (version == null) { - _builderUtil().log.notice({ - file: fileName, - reason: "version doesn't exist and is not created", - version: _this2.version - }, "skipped publishing"); - - return; - } - - const options = { - hostname: "api.bintray.com", - path: `/content/${_this2.client.owner}/${_this2.client.repo}/${_this2.client.packageName}/${encodeURI(`${version.name}/${fileName}`)}`, - method: "PUT", - headers: { - "Content-Length": dataLength, - "X-Bintray-Override": "1", - "X-Bintray-Publish": "1", - "X-Bintray-Debian-Architecture": (0, _builderUtil().toLinuxArchString)(arch) - } - }; - - if (_this2.client.distribution != null) { - options.headers["X-Bintray-Debian-Distribution"] = _this2.client.distribution; - } - - if (_this2.client.component != null) { - options.headers["X-Bintray-Debian-Component"] = _this2.client.component; - } - - for (let attemptNumber = 0;; attemptNumber++) { - try { - return yield _nodeHttpExecutor().httpExecutor.doApiRequest((0, _builderUtilRuntime().configureRequestOptions)(options, _this2.client.auth), _this2.context.cancellationToken, requestProcessor); - } catch (e) { - if (attemptNumber < 3 && (e instanceof _builderUtilRuntime().HttpError && e.statusCode === 502 || e.code === "EPIPE")) { - continue; - } - - throw e; - } - } - })(); - } //noinspection JSUnusedGlobalSymbols - - - deleteRelease(isForce = false) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (!isForce && !_this3._versionPromise.hasValue) { - return; - } - - const version = yield _this3._versionPromise.value; - - if (version != null) { - yield _this3.client.deleteVersion(version.name); - } - })(); - } - - toString() { - return `Bintray (user: ${this.client.user || this.client.owner}, owner: ${this.client.owner}, package: ${this.client.packageName}, repository: ${this.client.repo}, version: ${this.version})`; - } - -} exports.BintrayPublisher = BintrayPublisher; -// __ts-babel@6.0.4 -//# sourceMappingURL=BintrayPublisher.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/BintrayPublisher.js.map b/node_modules/electron-publish/out/BintrayPublisher.js.map deleted file mode 100755 index 16b7dda..0000000 --- a/node_modules/electron-publish/out/BintrayPublisher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/BintrayPublisher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,gBAAP,SAAgC,0BAAhC,CAA6C;AAOjD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ationError, isEmptyOrSpaces, isTokenCharValid, log, toLinuxArchString } from \"builder-util\"\nimport { BintrayOptions, configureRequestOptions, HttpError } from \"builder-util-runtime\"\nimport { BintrayClient, Version } from \"builder-util-runtime/out/bintray\"\nimport { httpExecutor } from \"builder-util/out/nodeHttpExecutor\"\nimport { ClientRequest, RequestOptions } from \"http\"\nimport { Lazy } from \"lazy-val\"\nimport { HttpPublisher, PublishContext, PublishOptions } from \"./publisher\"\n\nexport class BintrayPublisher extends HttpPublisher {\n private readonly _versionPromise = new Lazy(() => this.init())\n\n private readonly client: BintrayClient\n\n readonly providerName = \"Bintray\"\n\n constructor(context: PublishContext, info: BintrayOptions, private readonly version: string, private readonly options: PublishOptions = {}) {\n super(context)\n\n let token = info.token\n if (isEmptyOrSpaces(token)) {\n token = process.env.BT_TOKEN\n if (isEmptyOrSpaces(token)) {\n throw new InvalidConfigurationError(`Bintray token is not set, neither programmatically, nor using env \"BT_TOKEN\" (see https://www.electron.build/configuration/publish#bintrayoptions)`)\n }\n\n token = token.trim()\n\n if (!isTokenCharValid(token)) {\n throw new InvalidConfigurationError(`Bintray token (${JSON.stringify(token)}) contains invalid characters, please check env \"BT_TOKEN\"`)\n }\n }\n\n this.client = new BintrayClient(info, httpExecutor, this.context.cancellationToken, token)\n }\n\n private async init(): Promise {\n try {\n return await this.client.getVersion(this.version)\n }\n catch (e) {\n if (e instanceof HttpError && e.statusCode === 404) {\n if (this.options.publish !== \"onTagOrDraft\") {\n log.info({version: this.version}, \"version doesn't exist, creating one\")\n return this.client.createVersion(this.version)\n }\n else {\n log.notice({reason: \"version doesn't exist\", version: this.version}, \"skipped publishing\")\n }\n }\n\n throw e\n }\n }\n\n protected async doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void) {\n const version = await this._versionPromise.value\n if (version == null) {\n log.notice({file: fileName, reason: \"version doesn't exist and is not created\", version: this.version}, \"skipped publishing\")\n return\n }\n\n const options: RequestOptions = {\n hostname: \"api.bintray.com\",\n path: `/content/${this.client.owner}/${this.client.repo}/${this.client.packageName}/${encodeURI(`${version.name}/${fileName}`)}`,\n method: \"PUT\",\n headers: {\n \"Content-Length\": dataLength,\n \"X-Bintray-Override\": \"1\",\n \"X-Bintray-Publish\": \"1\",\n \"X-Bintray-Debian-Architecture\": toLinuxArchString(arch)\n }\n }\n\n if (this.client.distribution != null) {\n options.headers!![\"X-Bintray-Debian-Distribution\"] = this.client.distribution\n }\n\n if (this.client.component != null) {\n options.headers!![\"X-Bintray-Debian-Component\"] = this.client.component\n }\n\n for (let attemptNumber = 0; ; attemptNumber++) {\n try {\n return await httpExecutor.doApiRequest(configureRequestOptions(options, this.client.auth), this.context.cancellationToken, requestProcessor)\n }\n catch (e) {\n if (attemptNumber < 3 && ((e instanceof HttpError && e.statusCode === 502) || e.code === \"EPIPE\")) {\n continue\n }\n\n throw e\n }\n }\n }\n\n //noinspection JSUnusedGlobalSymbols\n async deleteRelease(isForce = false): Promise {\n if (!isForce && !this._versionPromise.hasValue) {\n return\n }\n\n const version = (await this._versionPromise.value)\n if (version != null) {\n await this.client.deleteVersion(version.name)\n }\n }\n\n toString() {\n return `Bintray (user: ${this.client.user || this.client.owner}, owner: ${this.client.owner}, package: ${this.client.packageName}, repository: ${this.client.repo}, version: ${this.version})`\n }\n}"],"sourceRoot":""} diff --git a/node_modules/electron-publish/out/gitHubPublisher.d.ts b/node_modules/electron-publish/out/gitHubPublisher.d.ts deleted file mode 100755 index 9c6139b..0000000 --- a/node_modules/electron-publish/out/gitHubPublisher.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// -import { Arch } from "builder-util"; -import { GithubOptions } from "builder-util-runtime"; -import { ClientRequest } from "http"; -import { Lazy } from "lazy-val"; -import { HttpPublisher, PublishContext, PublishOptions } from "./publisher"; -export interface Release { - id: number; - tag_name: string; - draft: boolean; - prerelease: boolean; - published_at: string; - upload_url: string; -} -export declare class GitHubPublisher extends HttpPublisher { - private readonly info; - private readonly version; - private readonly options; - private readonly tag; - readonly _release: Lazy; - private readonly token; - readonly providerName = "GitHub"; - private readonly releaseType; - private releaseLogFields; - constructor(context: PublishContext, info: GithubOptions, version: string, options?: PublishOptions); - private getOrCreateRelease; - private overwriteArtifact; - protected doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void): Promise; - private createRelease; - getRelease(): Promise; - deleteRelease(): Promise; - private githubRequest; - toString(): string; -} diff --git a/node_modules/electron-publish/out/gitHubPublisher.js b/node_modules/electron-publish/out/gitHubPublisher.js deleted file mode 100755 index 340f497..0000000 --- a/node_modules/electron-publish/out/gitHubPublisher.js +++ /dev/null @@ -1,364 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.GitHubPublisher = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _nodeHttpExecutor() { - const data = require("builder-util/out/nodeHttpExecutor"); - - _nodeHttpExecutor = function () { - return data; - }; - - return data; -} - -function _lazyVal() { - const data = require("lazy-val"); - - _lazyVal = function () { - return data; - }; - - return data; -} - -function _mime() { - const data = _interopRequireDefault(require("mime")); - - _mime = function () { - return data; - }; - - return data; -} - -function _url() { - const data = require("url"); - - _url = function () { - return data; - }; - - return data; -} - -function _publisher() { - const data = require("./publisher"); - - _publisher = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -class GitHubPublisher extends _publisher().HttpPublisher { - constructor(context, info, version, options = {}) { - super(context, true); - this.info = info; - this.version = version; - this.options = options; - this._release = new (_lazyVal().Lazy)(() => this.token === "__test__" ? Promise.resolve(null) : this.getOrCreateRelease()); - this.providerName = "GitHub"; - this.releaseLogFields = null; - let token = info.token; - - if ((0, _builderUtil().isEmptyOrSpaces)(token)) { - token = process.env.GH_TOKEN || process.env.GITHUB_TOKEN; - - if ((0, _builderUtil().isEmptyOrSpaces)(token)) { - throw new (_builderUtil().InvalidConfigurationError)(`GitHub Personal Access Token is not set, neither programmatically, nor using env "GH_TOKEN"`); - } - - token = token.trim(); - - if (!(0, _builderUtil().isTokenCharValid)(token)) { - throw new (_builderUtil().InvalidConfigurationError)(`GitHub Personal Access Token (${JSON.stringify(token)}) contains invalid characters, please check env "GH_TOKEN"`); - } - } - - this.token = token; - - if (version.startsWith("v")) { - throw new (_builderUtil().InvalidConfigurationError)(`Version must not starts with "v": ${version}`); - } - - this.tag = info.vPrefixedTagName === false ? version : `v${version}`; - - if ((0, _builderUtil().isEnvTrue)(process.env.EP_DRAFT)) { - this.releaseType = "draft"; - - _builderUtil().log.info({ - reason: "env EP_DRAFT is set to true" - }, "GitHub provider release type is set to draft"); - } else if ((0, _builderUtil().isEnvTrue)(process.env.EP_PRE_RELEASE) || (0, _builderUtil().isEnvTrue)(process.env.EP_PRELEASE) - /* https://github.com/electron-userland/electron-builder/issues/2878 */ - ) { - this.releaseType = "prerelease"; - - _builderUtil().log.info({ - reason: "env EP_PRE_RELEASE is set to true" - }, "GitHub provider release type is set to prerelease"); - } else if (info.releaseType != null) { - this.releaseType = info.releaseType; - } else if (options.prerelease) { - this.releaseType = "prerelease"; - } else { - this.releaseType = options.draft === false ? "release" : "draft"; - } - } - - getOrCreateRelease() { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const logFields = { - tag: _this.tag, - version: _this.version - }; // we don't use "Get a release by tag name" because "tag name" means existing git tag, but we draft release and don't create git tag - - const releases = yield _this.githubRequest(`/repos/${_this.info.owner}/${_this.info.repo}/releases`, _this.token); - - for (const release of releases) { - if (!(release.tag_name === _this.tag || release.tag_name === _this.version)) { - continue; - } - - if (release.draft) { - return release; - } // https://github.com/electron-userland/electron-builder/issues/1197 - // https://electron-builder.slack.com/archives/general/p1485961449000202 - // https://github.com/electron-userland/electron-builder/issues/2072 - - - if (_this.releaseType === "draft") { - _this.releaseLogFields = Object.assign({ - reason: "existing type not compatible with publishing type" - }, logFields, { - existingType: release.prerelease ? "pre-release" : "release", - publishingType: _this.releaseType - }); - - _builderUtil().log.warn(_this.releaseLogFields, "GitHub release not created"); - - return null; - } // https://github.com/electron-userland/electron-builder/issues/1133 - // https://github.com/electron-userland/electron-builder/issues/2074 - // if release created < 2 hours — allow to upload - - - const publishedAt = release.published_at == null ? null : Date.parse(release.published_at); - - if (publishedAt != null && Date.now() - publishedAt > 2 * 3600 * 1000) { - // https://github.com/electron-userland/electron-builder/issues/1183#issuecomment-275867187 - _this.releaseLogFields = Object.assign({ - reason: "existing release published more than 2 hours ago" - }, logFields, { - date: new Date(publishedAt).toString() - }); - - _builderUtil().log.warn(_this.releaseLogFields, "GitHub release not created"); - - return null; - } - - return release; - } // https://github.com/electron-userland/electron-builder/issues/1835 - - - if (_this.options.publish === "always" || (0, _publisher().getCiTag)() != null) { - _builderUtil().log.info(Object.assign({ - reason: "release doesn't exist" - }, logFields), `creating GitHub release`); - - return _this.createRelease(); - } - - _this.releaseLogFields = Object.assign({ - reason: "release doesn't exist and not created because \"publish\" is not \"always\" and build is not on tag" - }, logFields); - return null; - })(); - } - - overwriteArtifact(fileName, release) { - var _this2 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - // delete old artifact and re-upload - _builderUtil().log.notice({ - file: fileName, - reason: "already exists on GitHub" - }, "overwrite published file"); - - const assets = yield _this2.githubRequest(`/repos/${_this2.info.owner}/${_this2.info.repo}/releases/${release.id}/assets`, _this2.token, null); - - for (const asset of assets) { - if (asset.name === fileName) { - yield _this2.githubRequest(`/repos/${_this2.info.owner}/${_this2.info.repo}/releases/assets/${asset.id}`, _this2.token, null, "DELETE"); - return; - } - } - - _builderUtil().log.debug({ - file: fileName, - reason: "not found on GitHub" - }, "trying to upload again"); - })(); - } - - doUpload(fileName, arch, dataLength, requestProcessor) { - var _this3 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const release = yield _this3._release.value; - - if (release == null) { - _builderUtil().log.warn(Object.assign({ - file: fileName - }, _this3.releaseLogFields), "skipped publishing"); - - return; - } - - const parsedUrl = (0, _url().parse)(release.upload_url.substring(0, release.upload_url.indexOf("{")) + "?name=" + fileName); - let attemptNumber = 0; - - for (let i = 0; i < 3; i++) { - try { - return yield _nodeHttpExecutor().httpExecutor.doApiRequest((0, _builderUtilRuntime().configureRequestOptions)({ - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "POST", - headers: { - accept: "application/vnd.github.v3+json", - "Content-Type": _mime().default.getType(fileName) || "application/octet-stream", - "Content-Length": dataLength - } - }, _this3.token), _this3.context.cancellationToken, requestProcessor); - } catch (e) { - if (e instanceof _builderUtilRuntime().HttpError && e.statusCode === 422 && e.description != null && e.description.errors != null && e.description.errors[0].code === "already_exists") { - yield _this3.overwriteArtifact(fileName, release); - continue; - } - - if (!(attemptNumber++ < 3 && (e instanceof _builderUtilRuntime().HttpError || e.code === "EPIPE" || e.code === "ECONNRESET"))) { - throw e; - } - } - } - })(); - } - - createRelease() { - return this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token, { - tag_name: this.tag, - name: this.version, - draft: this.releaseType === "draft", - prerelease: this.releaseType === "prerelease" - }); - } // test only - //noinspection JSUnusedGlobalSymbols - - - getRelease() { - var _this4 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - return _this4.githubRequest(`/repos/${_this4.info.owner}/${_this4.info.repo}/releases/${(yield _this4._release.value).id}`, _this4.token); - })(); - } //noinspection JSUnusedGlobalSymbols - - - deleteRelease() { - var _this5 = this; - - return (0, _bluebirdLst().coroutine)(function* () { - if (!_this5._release.hasValue) { - return; - } - - const release = yield _this5._release.value; - - for (let i = 0; i < 3; i++) { - try { - return yield _this5.githubRequest(`/repos/${_this5.info.owner}/${_this5.info.repo}/releases/${release.id}`, _this5.token, null, "DELETE"); - } catch (e) { - if (e instanceof _builderUtilRuntime().HttpError) { - if (e.statusCode === 404) { - _builderUtil().log.warn({ - releaseId: release.id, - reason: "doesn't exist" - }, "cannot delete release"); - - return; - } else if (e.statusCode === 405 || e.statusCode === 502) { - continue; - } - } - - throw e; - } - } - - _builderUtil().log.warn({ - releaseId: release.id - }, "cannot delete release"); - })(); - } - - githubRequest(path, token, data = null, method) { - // host can contains port, but node http doesn't support host as url does - const baseUrl = (0, _url().parse)(`https://${this.info.host || "api.github.com"}`); - return (0, _builderUtilRuntime().parseJson)(_nodeHttpExecutor().httpExecutor.request((0, _builderUtilRuntime().configureRequestOptions)({ - hostname: baseUrl.hostname, - port: baseUrl.port, - path: this.info.host != null && this.info.host !== "github.com" ? `/api/v3${path.startsWith("/") ? path : `/${path}`}` : path, - headers: { - accept: "application/vnd.github.v3+json" - } - }, token, method), this.context.cancellationToken, data)); - } - - toString() { - return `Github (owner: ${this.info.owner}, project: ${this.info.repo}, version: ${this.version})`; - } - -} exports.GitHubPublisher = GitHubPublisher; -// __ts-babel@6.0.4 -//# sourceMappingURL=gitHubPublisher.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/gitHubPublisher.js.map b/node_modules/electron-publish/out/gitHubPublisher.js.map deleted file mode 100755 index 70a3c52..0000000 --- a/node_modules/electron-publish/out/gitHubPublisher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/gitHubPublisher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA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CAArB,EAKE,KAAK,OAAL,CAAa,iBALf,EAKkC,IALlC,CAAV,CAAP;AAMD;;AAED,EAAA,QAAQ,GAAA;AACN,WAAO,kBAAkB,KAAK,IAAL,CAAU,KAAK,cAAc,KAAK,IAAL,CAAU,IAAI,cAAc,KAAK,OAAO,GAA9F;AACD;;AAnO+C,C","sourcesContent":["import { Arch, InvalidConfigurationError, isEmptyOrSpaces, isEnvTrue, isTokenCharValid, log } from \"builder-util\"\nimport { configureRequestOptions, GithubOptions, HttpError, parseJson } from \"builder-util-runtime\"\nimport { Fields } from \"builder-util/out/log\"\nimport { httpExecutor } from \"builder-util/out/nodeHttpExecutor\"\nimport { ClientRequest } from \"http\"\nimport { Lazy } from \"lazy-val\"\nimport mime from \"mime\"\nimport { parse as parseUrl } from \"url\"\nimport { getCiTag, HttpPublisher, PublishContext, PublishOptions } from \"./publisher\"\n\nexport interface Release {\n id: number\n tag_name: string\n\n draft: boolean\n prerelease: boolean\n\n published_at: string\n\n upload_url: string\n}\n\ninterface Asset {\n id: number\n name: string\n}\n\nexport class GitHubPublisher extends HttpPublisher {\n private readonly tag: string\n readonly _release = new Lazy(() => this.token === \"__test__\" ? Promise.resolve(null as any) : this.getOrCreateRelease())\n\n private readonly token: string\n\n readonly providerName = \"GitHub\"\n\n private readonly releaseType: \"draft\" | \"prerelease\" | \"release\"\n\n private releaseLogFields: Fields | null = null\n\n constructor(context: PublishContext, private readonly info: GithubOptions, private readonly version: string, private readonly options: PublishOptions = {}) {\n super(context, true)\n\n let token = info.token\n if (isEmptyOrSpaces(token)) {\n token = process.env.GH_TOKEN || process.env.GITHUB_TOKEN\n if (isEmptyOrSpaces(token)) {\n throw new InvalidConfigurationError(`GitHub Personal Access Token is not set, neither programmatically, nor using env \"GH_TOKEN\"`)\n }\n\n token = token.trim()\n\n if (!isTokenCharValid(token)) {\n throw new InvalidConfigurationError(`GitHub Personal Access Token (${JSON.stringify(token)}) contains invalid characters, please check env \"GH_TOKEN\"`)\n }\n }\n\n this.token = token!\n\n if (version.startsWith(\"v\")) {\n throw new InvalidConfigurationError(`Version must not starts with \"v\": ${version}`)\n }\n\n this.tag = info.vPrefixedTagName === false ? version : `v${version}`\n\n if (isEnvTrue(process.env.EP_DRAFT)) {\n this.releaseType = \"draft\"\n log.info({reason: \"env EP_DRAFT is set to true\"}, \"GitHub provider release type is set to draft\")\n }\n else if (isEnvTrue(process.env.EP_PRE_RELEASE) || isEnvTrue(process.env.EP_PRELEASE) /* https://github.com/electron-userland/electron-builder/issues/2878 */) {\n this.releaseType = \"prerelease\"\n log.info({reason: \"env EP_PRE_RELEASE is set to true\"}, \"GitHub provider release type is set to prerelease\")\n }\n else if (info.releaseType != null) {\n this.releaseType = info.releaseType\n }\n else if ((options as any).prerelease) {\n this.releaseType = \"prerelease\"\n }\n else {\n this.releaseType = (options as any).draft === false ? \"release\" : \"draft\"\n }\n }\n\n private async getOrCreateRelease(): Promise {\n const logFields = {\n tag: this.tag,\n version: this.version,\n }\n\n // we don't use \"Get a release by tag name\" because \"tag name\" means existing git tag, but we draft release and don't create git tag\n const releases = await this.githubRequest>(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token)\n for (const release of releases) {\n if (!(release.tag_name === this.tag || release.tag_name === this.version)) {\n continue\n }\n\n if (release.draft) {\n return release\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1197\n // https://electron-builder.slack.com/archives/general/p1485961449000202\n // https://github.com/electron-userland/electron-builder/issues/2072\n if (this.releaseType === \"draft\") {\n this.releaseLogFields = {\n reason: \"existing type not compatible with publishing type\",\n ...logFields,\n existingType: release.prerelease ? \"pre-release\" : \"release\",\n publishingType: this.releaseType,\n }\n log.warn(this.releaseLogFields, \"GitHub release not created\")\n return null\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1133\n // https://github.com/electron-userland/electron-builder/issues/2074\n // if release created < 2 hours — allow to upload\n const publishedAt = release.published_at == null ? null : Date.parse(release.published_at)\n if (publishedAt != null && (Date.now() - publishedAt) > (2 * 3600 * 1000)) {\n // https://github.com/electron-userland/electron-builder/issues/1183#issuecomment-275867187\n this.releaseLogFields = {\n reason: \"existing release published more than 2 hours ago\",\n ...logFields,\n date: new Date(publishedAt).toString(),\n }\n log.warn(this.releaseLogFields, \"GitHub release not created\")\n return null\n }\n return release\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1835\n if (this.options.publish === \"always\" || getCiTag() != null) {\n log.info({\n reason: \"release doesn't exist\",\n ...logFields,\n }, `creating GitHub release`)\n return this.createRelease()\n }\n\n this.releaseLogFields = {\n reason: \"release doesn't exist and not created because \\\"publish\\\" is not \\\"always\\\" and build is not on tag\",\n ...logFields,\n }\n return null\n }\n\n private async overwriteArtifact(fileName: string, release: Release) {\n // delete old artifact and re-upload\n log.notice({file: fileName, reason: \"already exists on GitHub\"}, \"overwrite published file\")\n\n const assets = await this.githubRequest>(`/repos/${this.info.owner}/${this.info.repo}/releases/${release.id}/assets`, this.token, null)\n for (const asset of assets) {\n if (asset!.name === fileName) {\n await this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/assets/${asset!.id}`, this.token, null, \"DELETE\")\n return\n }\n }\n\n log.debug({file: fileName, reason: \"not found on GitHub\"}, \"trying to upload again\")\n }\n\n protected async doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void): Promise {\n const release = await this._release.value\n if (release == null) {\n log.warn({file: fileName, ...this.releaseLogFields}, \"skipped publishing\")\n return\n }\n\n const parsedUrl = parseUrl(release.upload_url.substring(0, release.upload_url.indexOf(\"{\")) + \"?name=\" + fileName)\n let attemptNumber = 0\n for (let i = 0; i < 3; i++) {\n try {\n return await httpExecutor.doApiRequest(configureRequestOptions({\n hostname: parsedUrl.hostname,\n path: parsedUrl.path,\n method: \"POST\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"Content-Type\": mime.getType(fileName) || \"application/octet-stream\",\n \"Content-Length\": dataLength\n }\n }, this.token), this.context.cancellationToken, requestProcessor)\n }\n catch (e) {\n if (e instanceof HttpError && e.statusCode === 422 && e.description != null && e.description.errors != null && e.description.errors[0].code === \"already_exists\") {\n await this.overwriteArtifact(fileName, release)\n continue\n }\n\n if (!(attemptNumber++ < 3 && (e instanceof HttpError || (e.code === \"EPIPE\" || e.code === \"ECONNRESET\")))) {\n throw e\n }\n }\n }\n }\n\n private createRelease() {\n return this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token, {\n tag_name: this.tag,\n name: this.version,\n draft: this.releaseType === \"draft\",\n prerelease: this.releaseType === \"prerelease\",\n })\n }\n\n // test only\n //noinspection JSUnusedGlobalSymbols\n async getRelease(): Promise {\n return this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/${(await this._release.value)!.id}`, this.token)\n }\n\n //noinspection JSUnusedGlobalSymbols\n async deleteRelease(): Promise {\n if (!this._release.hasValue) {\n return\n }\n\n const release = await this._release.value\n for (let i = 0; i < 3; i++) {\n try {\n return await this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/${release.id}`, this.token, null, \"DELETE\")\n }\n catch (e) {\n if (e instanceof HttpError) {\n if (e.statusCode === 404) {\n log.warn({releaseId: release.id, reason: \"doesn't exist\"}, \"cannot delete release\")\n return\n }\n else if (e.statusCode === 405 || e.statusCode === 502) {\n continue\n }\n }\n\n throw e\n }\n }\n\n log.warn({releaseId: release.id}, \"cannot delete release\")\n }\n\n private githubRequest(path: string, token: string | null, data: {[name: string]: any; } | null = null, method?: \"GET\" | \"DELETE\" | \"PUT\"): Promise {\n // host can contains port, but node http doesn't support host as url does\n const baseUrl = parseUrl(`https://${this.info.host || \"api.github.com\"}`)\n return parseJson(httpExecutor.request(configureRequestOptions({\n hostname: baseUrl.hostname,\n port: baseUrl.port as any,\n path: (this.info.host != null && this.info.host !== \"github.com\") ? `/api/v3${path.startsWith(\"/\") ? path : `/${path}`}` : path,\n headers: {accept: \"application/vnd.github.v3+json\"}\n }, token, method), this.context.cancellationToken, data))\n }\n\n toString() {\n return `Github (owner: ${this.info.owner}, project: ${this.info.repo}, version: ${this.version})`\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/electron-publish/out/multiProgress.d.ts b/node_modules/electron-publish/out/multiProgress.d.ts deleted file mode 100755 index ae2d061..0000000 --- a/node_modules/electron-publish/out/multiProgress.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ProgressBar } from "./progress"; -export declare class MultiProgress { - private readonly stream; - private cursor; - private totalLines; - private isLogListenerAdded; - private barCount; - createBar(format: string, options: any): ProgressBar; - private allocateLines; - private moveCursor; - terminate(): void; -} diff --git a/node_modules/electron-publish/out/multiProgress.js b/node_modules/electron-publish/out/multiProgress.js deleted file mode 100755 index 83da943..0000000 --- a/node_modules/electron-publish/out/multiProgress.js +++ /dev/null @@ -1,115 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.MultiProgress = void 0; - -function _log() { - const data = require("builder-util/out/log"); - - _log = function () { - return data; - }; - - return data; -} - -function _progress() { - const data = require("./progress"); - - _progress = function () { - return data; - }; - - return data; -} - -class MultiProgress { - constructor() { - this.stream = process.stdout; - this.cursor = 0; - this.totalLines = 0; - this.isLogListenerAdded = false; - this.barCount = 0; - } - - createBar(format, options) { - options.stream = this.stream; // tslint:disable:no-this-assignment - - const manager = this; - - class MultiProgressBar extends _progress().ProgressBar { - constructor(format, options) { - super(format, options); - this.index = -1; - } - - render() { - if (this.index === -1) { - this.index = manager.totalLines; - manager.allocateLines(1); - } else { - manager.moveCursor(this.index); - } - - super.render(); - - if (!manager.isLogListenerAdded) { - manager.isLogListenerAdded = true; - (0, _log().setPrinter)(message => { - let newLineCount = 0; - let newLineIndex = message.indexOf("\n"); - - while (newLineIndex > -1) { - newLineCount++; - newLineIndex = message.indexOf("\n", ++newLineIndex); - } - - manager.allocateLines(newLineCount + 1); - manager.stream.write(message); - }); - } - } - - terminate() { - manager.barCount--; - - if (manager.barCount === 0 && manager.totalLines > 0) { - manager.allocateLines(1); - manager.totalLines = 0; - manager.cursor = 0; - (0, _log().setPrinter)(null); - manager.isLogListenerAdded = false; - } - } - - } - - const bar = new MultiProgressBar(format, options); - this.barCount++; - return bar; - } - - allocateLines(count) { - this.stream.moveCursor(0, this.totalLines - 1); // if cursor pointed to previous line where \n is already printed, another \n is ignored, so, we can simply print it - - this.stream.write("\n"); - this.totalLines += count; - this.cursor = this.totalLines - 1; - } - - moveCursor(index) { - this.stream.moveCursor(0, index - this.cursor); - this.cursor = index; - } - - terminate() { - this.moveCursor(this.totalLines); - this.stream.clearLine(); - this.stream.cursorTo(0); - } - -} exports.MultiProgress = MultiProgress; -// __ts-babel@6.0.4 -//# sourceMappingURL=multiProgress.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/multiProgress.js.map b/node_modules/electron-publish/out/multiProgress.js.map deleted file mode 100755 index 09d8ab6..0000000 --- a/node_modules/electron-publish/out/multiProgress.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/multiProgress.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,aAAP,CAAoB;AAA1B,EAAA,WAAA,GAAA;AACmB,SAAA,MAAA,GAAS,OAAO,CAAC,MAAjB;AACT,SAAA,MAAA,GAAS,CAAT;AAEA,SAAA,UAAA,GAAa,CAAb;AAEA,SAAA,kBAAA,GAAqB,KAArB;AAEA,SAAA,QAAA,GAAW,CAAX;AA4ET;;AA1EC,EAAA,SAAS,CAAC,MAAD,EAAiB,OAAjB,EAA6B;AACpC,IAAA,OAAO,CAAC,MAAR,GAAiB,KAAK,MAAtB,CADoC,CAGpC;;AACA,UAAM,OAAO,GAAG,IAAhB;;AACA,UAAM,gBAAN,SAA+B,uBAA/B,CAA0C;AAGxC,MAAA,WAAA,CAAY,MAAZ,EAA4B,OAA5B,EAAwC;AACtC,cAAM,MAAN,EAAc,OA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,QAAL;AACA,WAAO,GAAP;AACD;;AAEO,EAAA,aAAa,CAAC,KAAD,EAAc;AACjC,SAAK,MAAL,CAAY,UAAZ,CAAuB,CAAvB,EAA0B,KAAK,UAAL,GAAkB,CAA5C,EADiC,CAEjC;;AACA,SAAK,MAAL,CAAY,KAAZ,CAAkB,IAAlB;AACA,SAAK,UAAL,IAAmB,KAAnB;AACA,SAAK,MAAL,GAAc,KAAK,UAAL,GAAkB,CAAhC;AACD;;AAEO,EAAA,UAAU,CAAC,KAAD,EAAc;AAC9B,SAAK,MAAL,CAAY,UAAZ,CAAuB,CAAvB,EAA0B,KAAK,GAAG,KAAK,MAAvC;AACA,SAAK,MAAL,GAAc,KAAd;AACD;;AAED,EAAA,SAAS,GAAA;AACP,SAAK,UAAL,CAAgB,KAAK,UAArB;AACA,SAAK,MAAL,CAAY,SAAZ;AACA,SAAK,MAAL,CAAY,QAAZ,CAAqB,CAArB;AACD;;AAnFuB,C","sourcesContent":["import { setPrinter } from \"builder-util/out/log\"\nimport { ProgressBar } from \"./progress\"\n\nexport class MultiProgress {\n private readonly stream = process.stdout as any\n private cursor = 0\n\n private totalLines = 0\n\n private isLogListenerAdded = false\n\n private barCount = 0\n\n createBar(format: string, options: any): ProgressBar {\n options.stream = this.stream\n\n // tslint:disable:no-this-assignment\n const manager = this\n class MultiProgressBar extends ProgressBar {\n private index = -1\n\n constructor(format: string, options: any) {\n super(format, options)\n }\n\n render() {\n if (this.index === -1) {\n this.index = manager.totalLines\n manager.allocateLines(1)\n }\n else {\n manager.moveCursor(this.index)\n }\n\n super.render()\n\n if (!manager.isLogListenerAdded) {\n manager.isLogListenerAdded = true\n setPrinter(message => {\n let newLineCount = 0\n let newLineIndex = message.indexOf(\"\\n\")\n while (newLineIndex > -1) {\n newLineCount++\n newLineIndex = message.indexOf(\"\\n\", ++newLineIndex)\n }\n\n manager.allocateLines(newLineCount + 1)\n manager.stream.write(message)\n })\n }\n }\n\n terminate() {\n manager.barCount--\n if (manager.barCount === 0 && manager.totalLines > 0) {\n manager.allocateLines(1)\n manager.totalLines = 0\n manager.cursor = 0\n setPrinter(null)\n manager.isLogListenerAdded = false\n }\n }\n }\n\n const bar = new MultiProgressBar(format, options)\n this.barCount++\n return bar\n }\n\n private allocateLines(count: number) {\n this.stream.moveCursor(0, this.totalLines - 1)\n // if cursor pointed to previous line where \\n is already printed, another \\n is ignored, so, we can simply print it\n this.stream.write(\"\\n\")\n this.totalLines += count\n this.cursor = this.totalLines - 1\n }\n\n private moveCursor(index: number) {\n this.stream.moveCursor(0, index - this.cursor)\n this.cursor = index\n }\n\n terminate() {\n this.moveCursor(this.totalLines)\n this.stream.clearLine()\n this.stream.cursorTo(0)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/electron-publish/out/progress.d.ts b/node_modules/electron-publish/out/progress.d.ts deleted file mode 100755 index 28d61e2..0000000 --- a/node_modules/electron-publish/out/progress.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ -export declare abstract class ProgressBar { - private readonly format; - private stream; - private current; - total: number; - private width; - private chars; - private tokens; - private lastDraw; - private start; - private complete; - /** - * Initialize a `ProgressBar` with the given `fmt` string and `options` or`total`. - * - * Options: - * - `curr` current completed index - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stderr - * - `head` head character defaulting to complete character - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 - * - `callback` optional function to call when the progress bar completes - * - `clear` will clear the progress bar upon termination - * - * Tokens: - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - `:rate` rate of ticks per second - */ - constructor(format: string, options?: any); - /** - * "tick" the progress bar with optional `len` and optional `tokens`. - */ - tick(delta: number): void; - currentAmount: number; - render(): void; - /** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - */ - update(ratio: number): void; - /** - * "interrupt" the progress bar and write a message above it. - */ - interrupt(message: string): void; - abstract terminate(): void; -} -export declare class ProgressCallback { - private readonly progressBar; - private start; - private nextUpdate; - constructor(progressBar: ProgressBar); - update(transferred: number, total: number): void; -} diff --git a/node_modules/electron-publish/out/progress.js b/node_modules/electron-publish/out/progress.js deleted file mode 100755 index 45182b7..0000000 --- a/node_modules/electron-publish/out/progress.js +++ /dev/null @@ -1,186 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ProgressCallback = exports.ProgressBar = void 0; - -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ -class ProgressBar { - /** - * Initialize a `ProgressBar` with the given `fmt` string and `options` or`total`. - * - * Options: - * - `curr` current completed index - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stderr - * - `head` head character defaulting to complete character - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 - * - `callback` optional function to call when the progress bar completes - * - `clear` will clear the progress bar upon termination - * - * Tokens: - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - `:rate` rate of ticks per second - */ - constructor(format, options = {}) { - this.format = format; - this.current = 0; - this.total = 0; - this.tokens = null; - this.lastDraw = ""; - this.start = 0; - this.complete = false; - this.stream = options.stream || process.stderr; - this.total = options.total; - this.width = options.width || this.total; - this.chars = { - complete: options.complete || "=", - incomplete: options.incomplete || "-", - head: options.head || options.complete || "=" - }; - } - /** - * "tick" the progress bar with optional `len` and optional `tokens`. - */ - - - tick(delta) { - this.currentAmount = this.current + delta; - } - - set currentAmount(value) { - this.current = value; - - if (this.complete) { - return; - } - - this.render(); - - if (this.current >= this.total) { - this.complete = true; - this.terminate(); - } - } - - render() { - // start time for eta - if (this.start === 0) { - this.start = Date.now(); - } - - const ratio = Math.min(Math.max(this.current / this.total, 0), 1); - const percent = ratio * 100; - const elapsed = Date.now() - this.start; - const eta = percent === 100 ? 0 : elapsed * (this.total / this.current - 1); - const rate = this.current / (elapsed / 1000); - /* populate the bar template with percentages and timestamps */ - - let str = this.format.replace(":current", this.current.toString()).replace(":total", this.total.toString()).replace(":elapsed", isNaN(elapsed) ? "0.0" : (elapsed / 1000).toFixed(1)).replace(":eta", isNaN(eta) || !isFinite(eta) ? "0.0" : (eta / 1000).toFixed(1)).replace(":percent", percent.toFixed(0) + "%").replace(":rate", Math.round(rate).toString()); // compute the available space (non-zero) for the bar - - let availableSpace = Math.max(0, this.stream.columns - str.replace(":bar", "").length); - - if (availableSpace && process.platform === "win32") { - availableSpace -= 1; - } - - const width = Math.min(this.width, availableSpace); - const completeLength = Math.round(width * ratio); - let complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete); - const incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete); - /* add head to the complete string */ - - if (completeLength > 0) { - complete = complete.slice(0, -1) + this.chars.head; - } - /* fill in the actual progress bar */ - - - str = str.replace(":bar", complete + incomplete); - /* replace the extra tokens */ - - if (this.tokens != null) { - for (const key of Object.keys(this.tokens)) { - str = str.replace(`:${key}`, this.tokens[key]); - } - } - - if (this.lastDraw !== str) { - this.stream.cursorTo(0); - this.stream.write(str); - this.stream.clearLine(1); - this.lastDraw = str; - } - } - /** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - */ - - - update(ratio) { - const goal = Math.floor(ratio * this.total); - const delta = goal - this.current; - this.tick(delta); - } - /** - * "interrupt" the progress bar and write a message above it. - */ - - - interrupt(message) { - // clear the current line - const stream = this.stream; - stream.clearLine(); // move the cursor to the start of the line - - stream.cursorTo(0); // write the message text - - stream.write(message); // terminate the line after writing the message - - stream.write("\n"); // re-display the progress bar with its lastDraw - - stream.write(this.lastDraw); - } - -} - -exports.ProgressBar = ProgressBar; - -class ProgressCallback { - constructor(progressBar) { - this.progressBar = progressBar; - this.start = Date.now(); - this.nextUpdate = this.start + 1000; - } - - update(transferred, total) { - const now = Date.now(); - - if (now >= this.nextUpdate || transferred >= total) { - this.nextUpdate = now + 1000; - this.progressBar.total = total; - this.progressBar.currentAmount = transferred; - } - } - -} exports.ProgressCallback = ProgressCallback; -// __ts-babel@6.0.4 -//# sourceMappingURL=progress.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/progress.js.map b/node_modules/electron-publish/out/progress.js.map deleted file mode 100755 index 1a86c3d..0000000 --- a/node_modules/electron-publish/out/progress.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/progress.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAMM,MAAgB,WAAhB,CAA2B;AAe/B;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,EAAA,WAAA,CAA6B,MAA7B,EAA6C,OAAA,GAAe,EAA5D,EAA8D;AAAjC,SAAA,MAAA,GAAA,MAAA;AApCrB,SAAA,OAAA,GAAU,CAAV;AACR,SAAA,KAAA,GAAQ,CAAR;AAIQ,SAAA,MAAA,GAAc,IAAd;AACA,SAAA,QAAA,GAAW,EAAX;AAEA,SAAA,KAAA,GAAQ,CAAR;AAEA,SAAA,QAAA,GAAW,KAAX;AA2BN,SAAK,MAAL,GAAc,OAAO,CAAC,MAAR,IAAkB,OAAO,CAAC,MAAxC;AAEA,SAAK,KAAL,GAAa,OAAO,CAAC,KAArB;AACA,SAAK,KAAL,GAAa,O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,MAAM,CAAC,KAAP,CAAa,OAAb,EAPuB,CAQvB;;AACA,IAAA,MAAM,CAAC,KAAP,CAAa,IAAb,EATuB,CAUvB;;AACA,IAAA,MAAM,CAAC,KAAP,CAAa,KAAK,QAAlB;AACD;;AA/J8B;;;;AAoK3B,MAAO,gBAAP,CAAuB;AAI3B,EAAA,WAAA,CAA6B,WAA7B,EAAqD;AAAxB,SAAA,WAAA,GAAA,WAAA;AAHrB,SAAA,KAAA,GAAQ,IAAI,CAAC,GAAL,EAAR;AACA,SAAA,UAAA,GAAa,KAAK,KAAL,GAAa,IAA1B;AAGP;;AAED,EAAA,MAAM,CAAC,WAAD,EAAsB,KAAtB,EAAmC;AACvC,UAAM,GAAG,GAAG,IAAI,CAAC,GAAL,EAAZ;;AACA,QAAI,GAAG,IAAI,KAAK,UAAZ,IAA0B,WAAW,IAAI,KAA7C,EAAoD;AAClD,WAAK,UAAL,GAAkB,GAAG,GAAG,IAAxB;AAEA,WAAK,WAAL,CAAiB,KAAjB,GAAyB,KAAzB;AACA,WAAK,WAAL,CAAiB,aAAjB,GAAiC,WAAjC;AACD;AACF;;AAf0B,C","sourcesContent":["/*!\n * node-progress\n * Copyright(c) 2011 TJ Holowaychuk \n * MIT Licensed\n */\n\nexport abstract class ProgressBar {\n private stream: any\n\n private current = 0\n total = 0\n private width: number\n\n private chars: any\n private tokens: any = null\n private lastDraw = \"\"\n\n private start = 0\n\n private complete = false\n\n /**\n * Initialize a `ProgressBar` with the given `fmt` string and `options` or`total`.\n *\n * Options:\n * - `curr` current completed index\n * - `total` total number of ticks to complete\n * - `width` the displayed width of the progress bar defaulting to total\n * - `stream` the output stream defaulting to stderr\n * - `head` head character defaulting to complete character\n * - `complete` completion character defaulting to \"=\"\n * - `incomplete` incomplete character defaulting to \"-\"\n * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16\n * - `callback` optional function to call when the progress bar completes\n * - `clear` will clear the progress bar upon termination\n *\n * Tokens:\n * - `:bar` the progress bar itself\n * - `:current` current tick number\n * - `:total` total ticks\n * - `:elapsed` time elapsed in seconds\n * - `:percent` completion percentage\n * - `:eta` eta in seconds\n * - `:rate` rate of ticks per second\n */\n constructor(private readonly format: string, options: any = {}) {\n this.stream = options.stream || process.stderr\n\n this.total = options.total\n this.width = options.width || this.total\n this.chars = {\n complete: options.complete || \"=\",\n incomplete: options.incomplete || \"-\",\n head: options.head || (options.complete || \"=\")\n }\n }\n\n /**\n * \"tick\" the progress bar with optional `len` and optional `tokens`.\n */\n tick(delta: number) {\n this.currentAmount = this.current + delta\n }\n\n set currentAmount(value: number) {\n this.current = value\n\n if (this.complete) {\n return\n }\n\n this.render()\n\n if (this.current >= this.total) {\n this.complete = true\n this.terminate()\n }\n }\n\n render() {\n // start time for eta\n if (this.start === 0) {\n this.start = Date.now()\n }\n\n const ratio = Math.min(Math.max(this.current / this.total, 0), 1)\n\n const percent = ratio * 100\n const elapsed = Date.now() - this.start\n const eta = percent === 100 ? 0 : (elapsed * (this.total / this.current - 1))\n const rate = this.current / (elapsed / 1000)\n\n /* populate the bar template with percentages and timestamps */\n let str = this.format\n .replace(\":current\", this.current.toString())\n .replace(\":total\", this.total.toString())\n .replace(\":elapsed\", isNaN(elapsed) ? \"0.0\" : (elapsed / 1000).toFixed(1))\n .replace(\":eta\", (isNaN(eta) || !isFinite(eta)) ? \"0.0\" : (eta / 1000).toFixed(1))\n .replace(\":percent\", percent.toFixed(0) + \"%\")\n .replace(\":rate\", Math.round(rate).toString())\n\n // compute the available space (non-zero) for the bar\n let availableSpace = Math.max(0, this.stream.columns - str.replace(\":bar\", \"\").length)\n if (availableSpace && process.platform === \"win32\") {\n availableSpace -= 1\n }\n\n const width = Math.min(this.width, availableSpace)\n const completeLength = Math.round(width * ratio)\n let complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete)\n const incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete)\n\n /* add head to the complete string */\n if (completeLength > 0) {\n complete = complete.slice(0, -1) + this.chars.head\n }\n\n /* fill in the actual progress bar */\n str = str.replace(\":bar\", complete + incomplete)\n\n /* replace the extra tokens */\n if (this.tokens != null) {\n for (const key of Object.keys(this.tokens)) {\n str = str.replace(`:${key}`, this.tokens[key])\n }\n }\n\n if (this.lastDraw !== str) {\n this.stream.cursorTo(0)\n this.stream.write(str)\n this.stream.clearLine(1)\n this.lastDraw = str\n }\n }\n\n /**\n * \"update\" the progress bar to represent an exact percentage.\n * The ratio (between 0 and 1) specified will be multiplied by `total` and\n * floored, representing the closest available \"tick.\" For example, if a\n * progress bar has a length of 3 and `update(0.5)` is called, the progress\n * will be set to 1.\n *\n * A ratio of 0.5 will attempt to set the progress to halfway.\n */\n update(ratio: number) {\n const goal = Math.floor(ratio * this.total)\n const delta = goal - this.current\n this.tick(delta)\n }\n\n /**\n * \"interrupt\" the progress bar and write a message above it.\n */\n interrupt(message: string) {\n // clear the current line\n const stream = this.stream\n stream.clearLine()\n // move the cursor to the start of the line\n stream.cursorTo(0)\n // write the message text\n stream.write(message)\n // terminate the line after writing the message\n stream.write(\"\\n\")\n // re-display the progress bar with its lastDraw\n stream.write(this.lastDraw)\n }\n\n abstract terminate(): void\n}\n\nexport class ProgressCallback {\n private start = Date.now()\n private nextUpdate = this.start + 1000\n\n constructor(private readonly progressBar: ProgressBar) {\n }\n\n update(transferred: number, total: number) {\n const now = Date.now()\n if (now >= this.nextUpdate || transferred >= total) {\n this.nextUpdate = now + 1000\n\n this.progressBar.total = total\n this.progressBar.currentAmount = transferred\n }\n }\n}"],"sourceRoot":""} diff --git a/node_modules/electron-publish/out/publisher.d.ts b/node_modules/electron-publish/out/publisher.d.ts deleted file mode 100755 index eae35bd..0000000 --- a/node_modules/electron-publish/out/publisher.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/// -import { Arch } from "builder-util"; -import { CancellationToken } from "builder-util-runtime"; -import { Stats } from "fs-extra-p"; -import { ClientRequest } from "http"; -import { MultiProgress } from "./multiProgress"; -import { ProgressBar } from "./progress"; -export declare type PublishPolicy = "onTag" | "onTagOrDraft" | "always" | "never"; -export { ProgressCallback } from "./progress"; -export interface PublishOptions { - publish?: PublishPolicy | null; -} -export interface PublishContext { - readonly cancellationToken: CancellationToken; - readonly progress: MultiProgress | null; -} -export interface UploadTask { - file: string; - fileContent?: Buffer | null; - arch: Arch | null; - safeArtifactName?: string | null; -} -export declare abstract class Publisher { - protected readonly context: PublishContext; - protected constructor(context: PublishContext); - abstract readonly providerName: string; - abstract upload(task: UploadTask): Promise; - protected createProgressBar(fileName: string, size: number): ProgressBar | null; - protected createReadStreamAndProgressBar(file: string, fileStat: Stats, progressBar: ProgressBar | null, reject: (error: Error) => void): NodeJS.ReadableStream; - abstract toString(): string; -} -export declare abstract class HttpPublisher extends Publisher { - protected readonly context: PublishContext; - private readonly useSafeArtifactName; - constructor(context: PublishContext, useSafeArtifactName?: boolean); - upload(task: UploadTask): Promise; - protected abstract doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void, file?: string): Promise; -} -export declare function getCiTag(): string | null; diff --git a/node_modules/electron-publish/out/publisher.js b/node_modules/electron-publish/out/publisher.js deleted file mode 100755 index d166a2f..0000000 --- a/node_modules/electron-publish/out/publisher.js +++ /dev/null @@ -1,173 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getCiTag = getCiTag; -Object.defineProperty(exports, "ProgressCallback", { - enumerable: true, - get: function () { - return _progress().ProgressCallback; - } -}); -exports.HttpPublisher = exports.Publisher = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _builderUtilRuntime() { - const data = require("builder-util-runtime"); - - _builderUtilRuntime = function () { - return data; - }; - - return data; -} - -function _log() { - const data = require("builder-util/out/log"); - - _log = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var _path = require("path"); - -function _progress() { - const data = require("./progress"); - - _progress = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const progressBarOptions = { - incomplete: " ", - width: 20 -}; - -class Publisher { - constructor(context) { - this.context = context; - } - - createProgressBar(fileName, size) { - _builderUtil().log.info({ - file: fileName, - provider: this.providerName - }, "uploading"); - - if (this.context.progress == null || size < 512 * 1024) { - return null; - } - - return this.context.progress.createBar(`${" ".repeat(_log().PADDING + 2)}[:bar] :percent :etas | ${_chalk().default.green(fileName)} to ${this.providerName}`, Object.assign({ - total: size - }, progressBarOptions)); - } - - createReadStreamAndProgressBar(file, fileStat, progressBar, reject) { - const fileInputStream = (0, _fsExtraP().createReadStream)(file); - fileInputStream.on("error", reject); - - if (progressBar == null) { - return fileInputStream; - } else { - const progressStream = new (_builderUtilRuntime().ProgressCallbackTransform)(fileStat.size, this.context.cancellationToken, it => progressBar.tick(it.delta)); - progressStream.on("error", reject); - return fileInputStream.pipe(progressStream); - } - } - -} - -exports.Publisher = Publisher; - -class HttpPublisher extends Publisher { - constructor(context, useSafeArtifactName = false) { - super(context); - this.context = context; - this.useSafeArtifactName = useSafeArtifactName; - } - - upload(task) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const fileName = (_this.useSafeArtifactName ? task.safeArtifactName : null) || (0, _path.basename)(task.file); - - if (task.fileContent != null) { - yield _this.doUpload(fileName, task.arch || _builderUtil().Arch.x64, task.fileContent.length, it => it.end(task.fileContent)); - return; - } - - const fileStat = yield (0, _fsExtraP().stat)(task.file); - - const progressBar = _this.createProgressBar(fileName, fileStat.size); - - yield _this.doUpload(fileName, task.arch || _builderUtil().Arch.x64, fileStat.size, (request, reject) => { - if (progressBar != null) { - // reset (because can be called several times (several attempts) - progressBar.update(0); - } - - return _this.createReadStreamAndProgressBar(task.file, fileStat, progressBar, reject).pipe(request); - }, task.file); - })(); - } - -} - -exports.HttpPublisher = HttpPublisher; - -function getCiTag() { - const tag = process.env.TRAVIS_TAG || process.env.APPVEYOR_REPO_TAG_NAME || process.env.CIRCLE_TAG || process.env.BITRISE_GIT_TAG || process.env.CI_BUILD_TAG; - return tag != null && tag.length > 0 ? tag : null; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=publisher.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/publisher.js.map b/node_modules/electron-publish/out/publisher.js.map deleted file mode 100755 index d046d1f..0000000 --- a/node_modules/electron-publish/out/publisher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/publisher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAWA,MAAM,kBAAkB,GAAG;AACzB,EAAA,UAAU,EAAE,GADa;AAEzB,EAAA,KAAK,EAAE;AAFkB,CAA3B;;AAaM,MAAgB,SAAhB,CAAyB;AAC7B,EAAA,WAAA,CAAyC,OAAzC,EAAgE;AAAvB,SAAA,OAAA,GAAA,OAAA;AACxC;;AAMS,EAAA,iBAAiB,CAAC,QAAD,EAAmB,IAAnB,EAA+B;AACxD,uBAAI,IAAJ,CAAS;AAAC,MAAA,IAAI,EAAE,QAAP;AAAiB,MAAA,QAAQ,EAAE,KAAK;AAAhC,KAAT,EAAwD,WAAxD;;AACA,QAAI,KAAK,OAAL,CAAa,QAAb,IAAyB,IAAzB,IAAiC,IAAI,GAAI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C,IAA7C;AACD,C","sourcesContent":["import { Arch, log } from \"builder-util\"\nimport { CancellationToken, ProgressCallbackTransform } from \"builder-util-runtime\"\nimport { PADDING } from \"builder-util/out/log\"\nimport chalk from \"chalk\"\nimport { createReadStream, stat, Stats } from \"fs-extra-p\"\nimport { ClientRequest } from \"http\"\nimport { basename } from \"path\"\nimport { MultiProgress } from \"./multiProgress\"\nimport { ProgressBar } from \"./progress\"\n\nexport type PublishPolicy = \"onTag\" | \"onTagOrDraft\" | \"always\" | \"never\"\n\nexport { ProgressCallback } from \"./progress\"\n\nexport interface PublishOptions {\n publish?: PublishPolicy | null\n}\n\nexport interface PublishContext {\n readonly cancellationToken: CancellationToken\n readonly progress: MultiProgress | null\n}\n\nconst progressBarOptions = {\n incomplete: \" \",\n width: 20,\n}\n\nexport interface UploadTask {\n file: string\n fileContent?: Buffer | null\n\n arch: Arch | null\n safeArtifactName?: string | null\n}\n\nexport abstract class Publisher {\n protected constructor(protected readonly context: PublishContext) {\n }\n\n abstract get providerName(): string\n\n abstract upload(task: UploadTask): Promise\n\n protected createProgressBar(fileName: string, size: number): ProgressBar | null {\n log.info({file: fileName, provider: this.providerName}, \"uploading\")\n if (this.context.progress == null || size < (512 * 1024)) {\n return null\n }\n return this.context.progress.createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent :etas | ${chalk.green(fileName)} to ${this.providerName}`, {total: size, ...progressBarOptions})\n }\n\n protected createReadStreamAndProgressBar(file: string, fileStat: Stats, progressBar: ProgressBar | null, reject: (error: Error) => void): NodeJS.ReadableStream {\n const fileInputStream = createReadStream(file)\n fileInputStream.on(\"error\", reject)\n\n if (progressBar == null) {\n return fileInputStream\n }\n else {\n const progressStream = new ProgressCallbackTransform(fileStat.size, this.context.cancellationToken, it => progressBar.tick(it.delta))\n progressStream.on(\"error\", reject)\n return fileInputStream.pipe(progressStream)\n }\n }\n\n abstract toString(): string\n}\n\nexport abstract class HttpPublisher extends Publisher {\n constructor(protected readonly context: PublishContext, private readonly useSafeArtifactName = false) {\n super(context)\n }\n\n async upload(task: UploadTask): Promise {\n const fileName = (this.useSafeArtifactName ? task.safeArtifactName : null) || basename(task.file)\n\n if (task.fileContent != null) {\n await this.doUpload(fileName, task.arch || Arch.x64, task.fileContent.length, it => it.end(task.fileContent))\n return\n }\n\n const fileStat = await stat(task.file)\n\n const progressBar = this.createProgressBar(fileName, fileStat.size)\n await this.doUpload(fileName, task.arch || Arch.x64, fileStat.size, (request, reject) => {\n if (progressBar != null) {\n // reset (because can be called several times (several attempts)\n progressBar.update(0)\n }\n return this.createReadStreamAndProgressBar(task.file, fileStat, progressBar, reject).pipe(request)\n }, task.file)\n }\n\n protected abstract doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void, file?: string): Promise\n}\n\nexport function getCiTag() {\n const tag = process.env.TRAVIS_TAG || process.env.APPVEYOR_REPO_TAG_NAME || process.env.CIRCLE_TAG || process.env.BITRISE_GIT_TAG || process.env.CI_BUILD_TAG\n return tag != null && tag.length > 0 ? tag : null\n}"],"sourceRoot":""} diff --git a/node_modules/electron-publish/out/s3/BaseS3Publisher.d.ts b/node_modules/electron-publish/out/s3/BaseS3Publisher.d.ts deleted file mode 100755 index 739e041..0000000 --- a/node_modules/electron-publish/out/s3/BaseS3Publisher.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { BaseS3Options } from "builder-util-runtime"; -import { PublishContext, Publisher, UploadTask } from "../publisher"; -export declare abstract class BaseS3Publisher extends Publisher { - private options; - protected constructor(context: PublishContext, options: BaseS3Options); - protected abstract getBucketName(): string; - protected configureS3Options(args: Array): void; - upload(task: UploadTask): Promise; - toString(): string; -} diff --git a/node_modules/electron-publish/out/s3/BaseS3Publisher.js b/node_modules/electron-publish/out/s3/BaseS3Publisher.js deleted file mode 100755 index b86b94b..0000000 --- a/node_modules/electron-publish/out/s3/BaseS3Publisher.js +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BaseS3Publisher = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _publisher() { - const data = require("../publisher"); - - _publisher = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -class BaseS3Publisher extends _publisher().Publisher { - constructor(context, options) { - super(context); - this.options = options; - } - - configureS3Options(args) { - // if explicitly set to null, do not add - if (this.options.acl !== null) { - args.push("--acl", this.options.acl || "public-read"); - } - } // http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html - - - upload(task) { - var _this = this; - - return (0, _bluebirdLst().coroutine)(function* () { - const fileName = path.basename(task.file); - const cancellationToken = _this.context.cancellationToken; - const target = (_this.options.path == null ? "" : `${_this.options.path}/`) + fileName; - const args = ["publish-s3", "--bucket", _this.getBucketName(), "--key", target, "--file", task.file]; - - _this.configureS3Options(args); - - if (process.env.__TEST_S3_PUBLISHER__ != null) { - const testFile = path.join(process.env.__TEST_S3_PUBLISHER__, target); - yield (0, _fsExtraP().ensureDir)(path.dirname(testFile)); - yield (0, _fsExtraP().symlink)(task.file, testFile); - return; - } // https://github.com/aws/aws-sdk-go/issues/279 - - - _this.createProgressBar(fileName, -1); // if (progressBar != null) { - // const callback = new ProgressCallback(progressBar) - // uploader.on("progress", () => { - // if (!cancellationToken.cancelled) { - // callback.update(uploader.loaded, uploader.contentLength) - // } - // }) - // } - - - return yield cancellationToken.createPromise((resolve, reject, onCancel) => { - (0, _builderUtil().executeAppBuilder)(args, process => { - onCancel(() => { - process.kill("SIGINT"); - }); - }).then(() => { - try { - _builderUtil().log.debug({ - provider: _this.providerName, - file: fileName, - bucket: _this.getBucketName() - }, "uploaded"); - } finally { - resolve(); - } - }).catch(reject); - }); - })(); - } - - toString() { - return `${this.providerName} (bucket: ${this.getBucketName()})`; - } - -} exports.BaseS3Publisher = BaseS3Publisher; -// __ts-babel@6.0.4 -//# sourceMappingURL=BaseS3Publisher.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/s3/BaseS3Publisher.js.map b/node_modules/electron-publish/out/s3/BaseS3Publisher.js.map deleted file mode 100755 index 2c836e5..0000000 --- a/node_modules/electron-publish/out/s3/BaseS3Publisher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/s3/BaseS3Publisher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;AAEM,MAAgB,eAAhB,SAAwC,sBAAxC,CAAiD;AACrD,EAAA,WAAA,CAAsB,OAAtB,EAAuD,OAAvD,EAA6E;AAC3E,UAAM,OAAN;AADqD,SAAA,OAAA,GAAA,OAAA;AAEtD;;AAIS,EAAA,kBAAkB,CAAC,IAAD,EAAoB;AAC9C;AACA,QAAI,KAAK,OAAL,CAAa,GAAb,KAAqB,IAAzB,EAA+B;AAC7B,MAAA,IAAI,CAAC,IAAL,CAAU,OAAV,EAAmB,KAAK,OAAL,CAAa,GAAb,IAAoB,aAAvC;AACD;AACF,GAZoD,CAcrD;;;AACM,EAAA,MAAN,CAAa,IAAb,EAA6B;AAAA;;AAAA;AAC3B,YAAM,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I,CAAC,YAAhB;AAA8B,cAAA,IAAI,EAAE,QAApC;AAA8C,cAAA,MAAM,EAAE,KAAI,CAAC,aAAL;AAAtD,aAAV,EAAuF,UAAvF;AACD,WAFD,SAGQ;AACN,YAAA,OAAO;AACR;AACF,SAZH,EAaG,KAbH,CAaS,MAbT;AAcD,OAfY,CAAb;AA3B2B;AA2C5B;;AAED,EAAA,QAAQ,GAAA;AACN,WAAO,GAAG,KAAK,YAAY,aAAa,KAAK,aAAL,EAAoB,GAA5D;AACD;;AA9DoD,C","sourcesContent":["import { log, executeAppBuilder } from \"builder-util\"\nimport { BaseS3Options } from \"builder-util-runtime\"\nimport { PublishContext, Publisher, UploadTask } from \"../publisher\"\nimport { ensureDir, symlink } from \"fs-extra-p\"\nimport * as path from \"path\"\n\nexport abstract class BaseS3Publisher extends Publisher {\n protected constructor(context: PublishContext, private options: BaseS3Options) {\n super(context)\n }\n\n protected abstract getBucketName(): string\n\n protected configureS3Options(args: Array) {\n // if explicitly set to null, do not add\n if (this.options.acl !== null) {\n args.push(\"--acl\", this.options.acl || \"public-read\")\n }\n }\n\n // http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html\n async upload(task: UploadTask): Promise {\n const fileName = path.basename(task.file)\n const cancellationToken = this.context.cancellationToken\n\n const target = (this.options.path == null ? \"\" : `${this.options.path}/`) + fileName\n\n const args = [\"publish-s3\", \"--bucket\", this.getBucketName(), \"--key\", target, \"--file\", task.file]\n this.configureS3Options(args)\n\n if (process.env.__TEST_S3_PUBLISHER__ != null) {\n const testFile = path.join(process.env.__TEST_S3_PUBLISHER__!, target)\n await ensureDir(path.dirname(testFile))\n await symlink(task.file, testFile)\n return\n }\n\n // https://github.com/aws/aws-sdk-go/issues/279\n this.createProgressBar(fileName, -1)\n // if (progressBar != null) {\n // const callback = new ProgressCallback(progressBar)\n // uploader.on(\"progress\", () => {\n // if (!cancellationToken.cancelled) {\n // callback.update(uploader.loaded, uploader.contentLength)\n // }\n // })\n // }\n\n return await cancellationToken.createPromise((resolve, reject, onCancel) => {\n executeAppBuilder(args, process => {\n onCancel(() => {\n process.kill(\"SIGINT\")\n })\n })\n .then(() => {\n try {\n log.debug({provider: this.providerName, file: fileName, bucket: this.getBucketName()}, \"uploaded\")\n }\n finally {\n resolve()\n }\n })\n .catch(reject)\n })\n }\n\n toString() {\n return `${this.providerName} (bucket: ${this.getBucketName()})`\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/electron-publish/out/s3/s3Publisher.d.ts b/node_modules/electron-publish/out/s3/s3Publisher.d.ts deleted file mode 100755 index 95260cc..0000000 --- a/node_modules/electron-publish/out/s3/s3Publisher.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { S3Options } from "builder-util-runtime"; -import { PublishContext } from "../publisher"; -import { BaseS3Publisher } from "./BaseS3Publisher"; -export default class S3Publisher extends BaseS3Publisher { - private readonly info; - readonly providerName = "S3"; - constructor(context: PublishContext, info: S3Options); - static checkAndResolveOptions(options: S3Options, channelFromAppVersion: string | null, errorIfCannot: boolean): Promise; - protected getBucketName(): string; - protected configureS3Options(args: Array): void; - toString(): string; -} diff --git a/node_modules/electron-publish/out/s3/s3Publisher.js b/node_modules/electron-publish/out/s3/s3Publisher.js deleted file mode 100755 index 244139b..0000000 --- a/node_modules/electron-publish/out/s3/s3Publisher.js +++ /dev/null @@ -1,113 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _BaseS3Publisher() { - const data = require("./BaseS3Publisher"); - - _BaseS3Publisher = function () { - return data; - }; - - return data; -} - -class S3Publisher extends _BaseS3Publisher().BaseS3Publisher { - constructor(context, info) { - super(context, info); - this.info = info; - this.providerName = "S3"; - } - - static checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) { - return (0, _bluebirdLst().coroutine)(function* () { - const bucket = options.bucket; - - if (bucket == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Please specify "bucket" for "s3" publish provider`); - } - - if (options.endpoint == null && bucket.includes(".") && options.region == null) { - // on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region. - try { - options.region = yield (0, _builderUtil().executeAppBuilder)(["get-bucket-location", "--bucket", bucket]); - } catch (e) { - if (errorIfCannot) { - throw e; - } else { - _builderUtil().log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`); - } - } - } - - if (options.channel == null && channelFromAppVersion != null) { - options.channel = channelFromAppVersion; - } - - if (options.endpoint != null && options.endpoint.endsWith("/")) { - options.endpoint = options.endpoint.slice(0, -1); - } - })(); - } - - getBucketName() { - return this.info.bucket; - } - - configureS3Options(args) { - super.configureS3Options(args); - - if (this.info.endpoint != null) { - args.push("--endpoint", this.info.endpoint); - } - - if (this.info.region != null) { - args.push("--region", this.info.region); - } - - if (this.info.storageClass != null) { - args.push("--storageClass", this.info.storageClass); - } - - if (this.info.encryption != null) { - args.push("--encryption", this.info.encryption); - } - } - - toString() { - const result = super.toString(); - const endpoint = this.info.endpoint; - - if (endpoint != null) { - return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`; - } - - return result; - } - -} exports.default = S3Publisher; -// __ts-babel@6.0.4 -//# sourceMappingURL=s3Publisher.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/s3/s3Publisher.js.map b/node_modules/electron-publish/out/s3/s3Publisher.js.map deleted file mode 100755 index 2e72301..0000000 --- a/node_modules/electron-publish/out/s3/s3Publisher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/s3/s3Publisher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEc,M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,MAAjB;AACD;;AAES,EAAA,kBAAkB,CAAC,IAAD,EAAoB;AAC9C,UAAM,kBAAN,CAAyB,IAAzB;;AAEA,QAAI,KAAK,IAAL,CAAU,QAAV,IAAsB,IAA1B,EAAgC;AAC9B,MAAA,IAAI,CAAC,IAAL,CAAU,YAAV,EAAwB,KAAK,IAAL,CAAU,QAAlC;AACD;;AACD,QAAI,KAAK,IAAL,CAAU,MAAV,IAAoB,IAAxB,EAA8B;AAC5B,MAAA,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,KAAK,IAAL,CAAU,MAAhC;AACD;;AAED,QAAI,KAAK,IAAL,CAAU,YAAV,IAA0B,IAA9B,EAAoC;AAClC,MAAA,IAAI,CAAC,IAAL,CAAU,gBAAV,EAA4B,KAAK,IAAL,CAAU,YAAtC;AACD;;AACD,QAAI,KAAK,IAAL,CAAU,UAAV,IAAwB,IAA5B,EAAkC;AAChC,MAAA,IAAI,CAAC,IAAL,CAAU,cAAV,EAA0B,KAAK,IAAL,CAAU,UAApC;AACD;AACF;;AAED,EAAA,QAAQ,GAAA;AACN,UAAM,MAAM,GAAG,MAAM,QAAN,EAAf;AACA,UAAM,QAAQ,GAAG,KAAK,IAAL,CAAU,QAA3B;;AACA,QAAI,QAAQ,IAAI,IAAhB,EAAsB;AACpB,aAAO,MAAM,CAAC,SAAP,CAAiB,CAAjB,EAAoB,MAAM,CAAC,MAAP,GAAgB,CAApC,IAAyC,eAAe,QAAQ,GAAvE;AACD;;AACD,WAAO,MAAP;AACD;;AAlEqD,C","sourcesContent":["import { executeAppBuilder, InvalidConfigurationError, log } from \"builder-util\"\nimport { S3Options } from \"builder-util-runtime\"\nimport { PublishContext } from \"../publisher\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class S3Publisher extends BaseS3Publisher {\n readonly providerName = \"S3\"\n\n constructor(context: PublishContext, private readonly info: S3Options) {\n super(context, info)\n }\n\n static async checkAndResolveOptions(options: S3Options, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n const bucket = options.bucket\n if (bucket == null) {\n throw new InvalidConfigurationError(`Please specify \"bucket\" for \"s3\" publish provider`)\n }\n\n if (options.endpoint == null && (bucket.includes(\".\") && options.region == null)) {\n // on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.\n try {\n options.region = await executeAppBuilder([\"get-bucket-location\", \"--bucket\", bucket])\n }\n catch (e) {\n if (errorIfCannot) {\n throw e\n }\n else {\n log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`)\n }\n }\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n\n if (options.endpoint != null && options.endpoint.endsWith(\"/\")) {\n (options as any).endpoint = options.endpoint.slice(0, -1)\n }\n }\n\n protected getBucketName(): string {\n return this.info.bucket!\n }\n\n protected configureS3Options(args: Array): void {\n super.configureS3Options(args)\n\n if (this.info.endpoint != null) {\n args.push(\"--endpoint\", this.info.endpoint)\n }\n if (this.info.region != null) {\n args.push(\"--region\", this.info.region)\n }\n\n if (this.info.storageClass != null) {\n args.push(\"--storageClass\", this.info.storageClass)\n }\n if (this.info.encryption != null) {\n args.push(\"--encryption\", this.info.encryption)\n }\n }\n\n toString() {\n const result = super.toString()\n const endpoint = this.info.endpoint\n if (endpoint != null) {\n return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`\n }\n return result\n }\n}\n"],"sourceRoot":""} diff --git a/node_modules/electron-publish/out/s3/spacesPublisher.d.ts b/node_modules/electron-publish/out/s3/spacesPublisher.d.ts deleted file mode 100755 index 0061316..0000000 --- a/node_modules/electron-publish/out/s3/spacesPublisher.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SpacesOptions } from "builder-util-runtime"; -import { PublishContext } from "../publisher"; -import { BaseS3Publisher } from "./BaseS3Publisher"; -export default class SpacesPublisher extends BaseS3Publisher { - private readonly info; - readonly providerName = "Spaces"; - constructor(context: PublishContext, info: SpacesOptions); - static checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean): Promise; - protected getBucketName(): string; - protected configureS3Options(args: Array): void; -} diff --git a/node_modules/electron-publish/out/s3/spacesPublisher.js b/node_modules/electron-publish/out/s3/spacesPublisher.js deleted file mode 100755 index baca766..0000000 --- a/node_modules/electron-publish/out/s3/spacesPublisher.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _bluebirdLst() { - const data = require("bluebird-lst"); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _builderUtil() { - const data = require("builder-util"); - - _builderUtil = function () { - return data; - }; - - return data; -} - -function _BaseS3Publisher() { - const data = require("./BaseS3Publisher"); - - _BaseS3Publisher = function () { - return data; - }; - - return data; -} - -class SpacesPublisher extends _BaseS3Publisher().BaseS3Publisher { - constructor(context, info) { - super(context, info); - this.info = info; - this.providerName = "Spaces"; - } - - static checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) { - return (0, _bluebirdLst().coroutine)(function* () { - if (options.name == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Please specify "name" for "spaces" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`); - } - - if (options.region == null) { - throw new (_builderUtil().InvalidConfigurationError)(`Please specify "region" for "spaces" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`); - } - - if (options.channel == null && channelFromAppVersion != null) { - options.channel = channelFromAppVersion; - } - })(); - } - - getBucketName() { - return this.info.name; - } - - configureS3Options(args) { - super.configureS3Options(args); - args.push("--endpoint", `${this.info.region}.digitaloceanspaces.com`); - args.push("--region", this.info.region); - const accessKey = process.env.DO_KEY_ID; - const secretKey = process.env.DO_SECRET_KEY; - - if ((0, _builderUtil().isEmptyOrSpaces)(accessKey)) { - throw new (_builderUtil().InvalidConfigurationError)("Please set env DO_KEY_ID (see https://www.electron.build/configuration/publish#spacesoptions)"); - } - - if ((0, _builderUtil().isEmptyOrSpaces)(secretKey)) { - throw new (_builderUtil().InvalidConfigurationError)("Please set env DO_SECRET_KEY (see https://www.electron.build/configuration/publish#spacesoptions)"); - } - - args.push("--accessKey", accessKey); - args.push("--secretKey", secretKey); - } - -} exports.default = SpacesPublisher; -// __ts-babel@6.0.4 -//# sourceMappingURL=spacesPublisher.js.map \ No newline at end of file diff --git a/node_modules/electron-publish/out/s3/spacesPublisher.js.map b/node_modules/electron-publish/out/s3/spacesPublisher.js.map deleted file mode 100755 index 09fc135..0000000 --- a/node_modules/electron-publish/out/s3/spacesPublisher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/s3/spacesPublisher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEc,MAAO,eAAP,SAA+B,kCAA/B,CAA8C;AAG1D,EAAA,WAAA,CAAY,OAAZ,EAAsD,IAAtD,EAAyE;AACvE,UAAM,OAAN,EAAe,IAAf;AADoD,SAAA,IAAA,GAAA,IAAA;AAF7C,SAAA,YAAA,GAAe,QAAf;AAIR;;AAED,SAAa,sBAAb,CAAoC,OAApC,EAA4D,qBAA5D,EAAkG,aAAlG,EAAwH;AAAA;AACtH,UAAI,OAAO,CAAC,IAAR,IAAgB,IAApB,EAA0B;AACxB,cAAM,KAAI,wCAAJ,EAA8B,0HAA9B,CAAN;AACD;;AACD,UAAI,OAAO,CAAC,MAAR,IAAkB,IAAtB,EAA4B;AAC1B,cAAM,KAAI,wCAAJ,EAA8B,4HAA9B,CAAN;AACD;;AAED,UAAI,OAAO,CAAC,OAAR,IAAmB,IAAnB,IAA2B,qBAAqB,IAAI,IAAxD,EAA8D;AAC5D,QAAA,OAAO,CAAC,OAAR,GAAkB,qBAAlB;AACD;AAVqH;AAWvH;;AAES,EAAA,aAAa,GAAA;AACrB,WAAO,KAAK,IAAL,CAAU,IAAjB;AACD;;AAES,EAAA,kBAAkB,CAAC,IAAD,EAAoB;AAC9C,UAAM,kBAAN,CAAyB,IAAzB;AAEA,IAAA,IAAI,CAAC,IAAL,CAAU,YAAV,EAAwB,GAAG,KAAK,IAAL,CAAU,MAAM,yBAA3C;AACA,IAAA,IAAI,CAAC,IAAL,CAAU,UAAV,EAAsB,KAAK,IAAL,CAAU,MAAhC;AAEA,UAAM,SAAS,GAAG,OAAO,CAAC,GAAR,CAAY,SAA9B;AACA,UAAM,SAAS,GAAG,OAAO,CAAC,GAAR,CAAY,aAA9B;;AACA,QAAI,oCAAgB,SAAhB,CAAJ,EAAgC;AAC9B,YAAM,KAAI,wCAAJ,EAA8B,+FAA9B,CAAN;AACD;;AACD,QAAI,oCAAgB,SAAhB,CAAJ,EAAgC;AAC9B,YAAM,KAAI,wCAAJ,EAA8B,mGAA9B,CAAN;AACD;;AACD,IAAA,IAAI,CAAC,IAAL,CAAU,aAAV,EAAyB,SAAzB;AACA,IAAA,IAAI,CAAC,IAAL,CAAU,aAAV,EAAyB,SAAzB;AACD;;AAxCyD,C","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces } from \"builder-util\"\nimport { SpacesOptions } from \"builder-util-runtime\"\nimport { PublishContext } from \"../publisher\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class SpacesPublisher extends BaseS3Publisher {\n readonly providerName = \"Spaces\"\n\n constructor(context: PublishContext, private readonly info: SpacesOptions) {\n super(context, info)\n }\n\n static async checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n if (options.name == null) {\n throw new InvalidConfigurationError(`Please specify \"name\" for \"spaces\" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`)\n }\n if (options.region == null) {\n throw new InvalidConfigurationError(`Please specify \"region\" for \"spaces\" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`)\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n }\n\n protected getBucketName(): string {\n return this.info.name\n }\n\n protected configureS3Options(args: Array): void {\n super.configureS3Options(args)\n\n args.push(\"--endpoint\", `${this.info.region}.digitaloceanspaces.com`)\n args.push(\"--region\", this.info.region)\n\n const accessKey = process.env.DO_KEY_ID\n const secretKey = process.env.DO_SECRET_KEY\n if (isEmptyOrSpaces(accessKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_KEY_ID (see https://www.electron.build/configuration/publish#spacesoptions)\")\n }\n if (isEmptyOrSpaces(secretKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_SECRET_KEY (see https://www.electron.build/configuration/publish#spacesoptions)\")\n }\n args.push(\"--accessKey\", accessKey)\n args.push(\"--secretKey\", secretKey)\n }\n}"],"sourceRoot":""} diff --git a/node_modules/electron-publish/package.json b/node_modules/electron-publish/package.json deleted file mode 100644 index 8c3265d..0000000 --- a/node_modules/electron-publish/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "electron-publish@20.38.3", - "_id": "electron-publish@20.38.3", - "_inBundle": false, - "_integrity": "sha512-Qomq253NT5DfjUZgFSx6p+gheU5YhM6zZ67fTtBZvwyk0v8HwxNXfa8fZT7h+1c3BwEmjusTbmjZRNW/XZBXFA==", - "_location": "/electron-publish", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "electron-publish@20.38.3", - "name": "electron-publish", - "escapedName": "electron-publish", - "rawSpec": "20.38.3", - "saveSpec": null, - "fetchSpec": "20.38.3" - }, - "_requiredBy": [ - "/app-builder-lib" - ], - "_resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-20.38.3.tgz", - "_shasum": "7c162904f728ba2bbf2640bc3620b65ce1061ce3", - "_spec": "electron-publish@20.38.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "author": { - "name": "Vladimir Krivosheev" - }, - "bugs": { - "url": "https://github.com/electron-userland/electron-builder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bluebird-lst": "^1.0.6", - "builder-util": "~9.6.0", - "builder-util-runtime": "^8.1.0", - "chalk": "^2.4.1", - "fs-extra-p": "^7.0.0", - "lazy-val": "^1.0.3", - "mime": "^2.4.0" - }, - "deprecated": false, - "description": "Part of [electron-builder](https://github.com/electron-userland/electron-builder).", - "files": [ - "out" - ], - "homepage": "https://github.com/electron-userland/electron-builder", - "license": "MIT", - "main": "out/publisher.js", - "name": "electron-publish", - "repository": { - "type": "git", - "url": "git+https://github.com/electron-userland/electron-builder.git" - }, - "typings": "./out/publisher.d.ts", - "version": "20.38.3" -} diff --git a/node_modules/electron-publish/readme.md b/node_modules/electron-publish/readme.md deleted file mode 100644 index 25a22a0..0000000 --- a/node_modules/electron-publish/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# electron-publish - -Part of [electron-builder](https://github.com/electron-userland/electron-builder). - -See the [Publishing Artifacts](https://www.electron.build/configuration/publish) for more information. - -Can be used standalone. \ No newline at end of file diff --git a/node_modules/electron/package.json b/node_modules/electron/package.json index 36d0d7d..963652d 100644 --- a/node_modules/electron/package.json +++ b/node_modules/electron/package.json @@ -1,27 +1,32 @@ { - "_from": "electron", + "_args": [ + [ + "electron@4.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "electron@4.0.0", "_id": "electron@4.0.0", "_inBundle": false, "_integrity": "sha512-3XPG/3IXlvnT1oe1K6zEushoD0SKbP8xwdrL10EWGe6k2iOV4hSHqJ8vWnR8yZ7VbSXmBRfomEFDNAo/q/cwKw==", "_location": "/electron", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "electron", + "raw": "electron@4.0.0", "name": "electron", "escapedName": "electron", - "rawSpec": "", + "rawSpec": "4.0.0", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "4.0.0" }, "_requiredBy": [ - "#DEV:/", - "#USER" + "#DEV:/" ], "_resolved": "https://registry.npmjs.org/electron/-/electron-4.0.0.tgz", - "_shasum": "6ccb40cc8bf2d49954dcea73b97ae7ad12ee04b3", - "_spec": "electron", + "_spec": "4.0.0", "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Electron Community" @@ -32,13 +37,11 @@ "bugs": { "url": "https://github.com/electron/electron/issues" }, - "bundleDependencies": false, "dependencies": { "@types/node": "^8.0.24", "electron-download": "^4.1.0", "extract-zip": "^1.0.3" }, - "deprecated": false, "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { "home-path": "^0.1.1", diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json index 4e24d40..1e6a989 100644 --- a/node_modules/end-of-stream/package.json +++ b/node_modules/end-of-stream/package.json @@ -1,27 +1,34 @@ { - "_from": "end-of-stream@^1.1.0", + "_args": [ + [ + "end-of-stream@1.4.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "end-of-stream@1.4.1", "_id": "end-of-stream@1.4.1", "_inBundle": false, "_integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "_location": "/end-of-stream", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "end-of-stream@^1.1.0", + "raw": "end-of-stream@1.4.1", "name": "end-of-stream", "escapedName": "end-of-stream", - "rawSpec": "^1.1.0", + "rawSpec": "1.4.1", "saveSpec": null, - "fetchSpec": "^1.1.0" + "fetchSpec": "1.4.1" }, "_requiredBy": [ - "/pump" + "/pump", + "/tar-fs/pump", + "/tar-stream" ], "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "_shasum": "ed29634d19baba463b6ce6b80a37213eab71ec43", - "_spec": "end-of-stream@^1.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/pump", + "_spec": "1.4.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mathias Buus", "email": "mathiasbuus@gmail.com" @@ -29,11 +36,9 @@ "bugs": { "url": "https://github.com/mafintosh/end-of-stream/issues" }, - "bundleDependencies": false, "dependencies": { "once": "^1.4.0" }, - "deprecated": false, "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", "files": [ "index.js" diff --git a/node_modules/env-paths/package.json b/node_modules/env-paths/package.json index 18e4b71..586474b 100644 --- a/node_modules/env-paths/package.json +++ b/node_modules/env-paths/package.json @@ -1,27 +1,33 @@ { - "_from": "env-paths@^1.0.0", + "_args": [ + [ + "env-paths@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "env-paths@1.0.0", "_id": "env-paths@1.0.0", "_inBundle": false, "_integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=", "_location": "/env-paths", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "env-paths@^1.0.0", + "raw": "env-paths@1.0.0", "name": "env-paths", "escapedName": "env-paths", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/electron-download" ], "_resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz", - "_shasum": "4168133b42bb05c38a35b1ae4397c8298ab369e0", - "_spec": "env-paths@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-download", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/env-paths/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Get paths for storing things like data, config, cache, etc", "devDependencies": { "ava": "*", diff --git a/node_modules/error-ex/package.json b/node_modules/error-ex/package.json index 70978ee..fa3b5fb 100644 --- a/node_modules/error-ex/package.json +++ b/node_modules/error-ex/package.json @@ -1,35 +1,39 @@ { - "_from": "error-ex@^1.2.0", + "_args": [ + [ + "error-ex@1.3.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "error-ex@1.3.2", "_id": "error-ex@1.3.2", "_inBundle": false, "_integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "_location": "/error-ex", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "error-ex@^1.2.0", + "raw": "error-ex@1.3.2", "name": "error-ex", "escapedName": "error-ex", - "rawSpec": "^1.2.0", + "rawSpec": "1.3.2", "saveSpec": null, - "fetchSpec": "^1.2.0" + "fetchSpec": "1.3.2" }, "_requiredBy": [ "/parse-json" ], "_resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "_shasum": "b4ac40648107fdcdcfae242f428bea8a14d4f1bf", - "_spec": "error-ex@^1.2.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/parse-json", + "_spec": "1.3.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/qix-/node-error-ex/issues" }, - "bundleDependencies": false, "dependencies": { "is-arrayish": "^0.2.1" }, - "deprecated": false, "description": "Easy error subclassing and stack customization", "devDependencies": { "coffee-script": "^1.9.3", diff --git a/node_modules/esprima/ChangeLog b/node_modules/esprima/ChangeLog deleted file mode 100644 index fafe1c9..0000000 --- a/node_modules/esprima/ChangeLog +++ /dev/null @@ -1,235 +0,0 @@ -2018-06-17: Version 4.0.1 - - * Fix parsing async get/set in a class (issue 1861, 1875) - * Account for different return statement argument (issue 1829, 1897, 1928) - * Correct the handling of HTML comment when parsing a module (issue 1841) - * Fix incorrect parse async with proto-identifier-shorthand (issue 1847) - * Fix negative column in binary expression (issue 1844) - * Fix incorrect YieldExpression in object methods (issue 1834) - * Various documentation fixes - -2017-06-10: Version 4.0.0 - - * Support ES2017 async function and await expression (issue 1079) - * Support ES2017 trailing commas in function parameters (issue 1550) - * Explicitly distinguish parsing a module vs a script (issue 1576) - * Fix JSX non-empty container (issue 1786) - * Allow JSX element in a yield expression (issue 1765) - * Allow `in` expression in a concise body with a function body (issue 1793) - * Setter function argument must not be a rest parameter (issue 1693) - * Limit strict mode directive to functions with a simple parameter list (issue 1677) - * Prohibit any escape sequence in a reserved word (issue 1612) - * Only permit hex digits in hex escape sequence (issue 1619) - * Prohibit labelled class/generator/function declaration (issue 1484) - * Limit function declaration as if statement clause only in non-strict mode (issue 1657) - * Tolerate missing ) in a with and do-while statement (issue 1481) - -2016-12-22: Version 3.1.3 - - * Support binding patterns as rest element (issue 1681) - * Account for different possible arguments of a yield expression (issue 1469) - -2016-11-24: Version 3.1.2 - - * Ensure that import specifier is more restrictive (issue 1615) - * Fix duplicated JSX tokens (issue 1613) - * Scan template literal in a JSX expression container (issue 1622) - * Improve XHTML entity scanning in JSX (issue 1629) - -2016-10-31: Version 3.1.1 - - * Fix assignment expression problem in an export declaration (issue 1596) - * Fix incorrect tokenization of hex digits (issue 1605) - -2016-10-09: Version 3.1.0 - - * Do not implicitly collect comments when comment attachment is specified (issue 1553) - * Fix incorrect handling of duplicated proto shorthand fields (issue 1485) - * Prohibit initialization in some variants of for statements (issue 1309, 1561) - * Fix incorrect parsing of export specifier (issue 1578) - * Fix ESTree compatibility for assignment pattern (issue 1575) - -2016-09-03: Version 3.0.0 - - * Support ES2016 exponentiation expression (issue 1490) - * Support JSX syntax (issue 1467) - * Use the latest Unicode 8.0 (issue 1475) - * Add the support for syntax node delegate (issue 1435) - * Fix ESTree compatibility on meta property (issue 1338) - * Fix ESTree compatibility on default parameter value (issue 1081) - * Fix ESTree compatibility on try handler (issue 1030) - -2016-08-23: Version 2.7.3 - - * Fix tokenizer confusion with a comment (issue 1493, 1516) - -2016-02-02: Version 2.7.2 - - * Fix out-of-bound error location in an invalid string literal (issue 1457) - * Fix shorthand object destructuring defaults in variable declarations (issue 1459) - -2015-12-10: Version 2.7.1 - - * Do not allow trailing comma in a variable declaration (issue 1360) - * Fix assignment to `let` in non-strict mode (issue 1376) - * Fix missing delegate property in YieldExpression (issue 1407) - -2015-10-22: Version 2.7.0 - - * Fix the handling of semicolon in a break statement (issue 1044) - * Run the test suite with major web browsers (issue 1259, 1317) - * Allow `let` as an identifier in non-strict mode (issue 1289) - * Attach orphaned comments as `innerComments` (issue 1328) - * Add the support for token delegator (issue 1332) - -2015-09-01: Version 2.6.0 - - * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) - * Add sourceType field for Program node (issue 1159) - * Ensure that strict mode reserved word binding throw an error (issue 1171) - * Run the test suite with Node.js and IE 11 on Windows (issue 1294) - * Allow binding pattern with no initializer in a for statement (issue 1301) - -2015-07-31: Version 2.5.0 - - * Run the test suite in a browser environment (issue 1004) - * Ensure a comma between imported default binding and named imports (issue 1046) - * Distinguish `yield` as a keyword vs an identifier (issue 1186) - * Support ES6 meta property `new.target` (issue 1203) - * Fix the syntax node for yield with expression (issue 1223) - * Fix the check of duplicated proto in property names (issue 1225) - * Fix ES6 Unicode escape in identifier name (issue 1229) - * Support ES6 IdentifierStart and IdentifierPart (issue 1232) - * Treat await as a reserved word when parsing as a module (issue 1234) - * Recognize identifier characters from Unicode SMP (issue 1244) - * Ensure that export and import can be followed by a comma (issue 1250) - * Fix yield operator precedence (issue 1262) - -2015-07-01: Version 2.4.1 - - * Fix some cases of comment attachment (issue 1071, 1175) - * Fix the handling of destructuring in function arguments (issue 1193) - * Fix invalid ranges in assignment expression (issue 1201) - -2015-06-26: Version 2.4.0 - - * Support ES6 for-of iteration (issue 1047) - * Support ES6 spread arguments (issue 1169) - * Minimize npm payload (issue 1191) - -2015-06-16: Version 2.3.0 - - * Support ES6 generator (issue 1033) - * Improve parsing of regular expressions with `u` flag (issue 1179) - -2015-04-17: Version 2.2.0 - - * Support ES6 import and export declarations (issue 1000) - * Fix line terminator before arrow not recognized as error (issue 1009) - * Support ES6 destructuring (issue 1045) - * Support ES6 template literal (issue 1074) - * Fix the handling of invalid/incomplete string escape sequences (issue 1106) - * Fix ES3 static member access restriction (issue 1120) - * Support for `super` in ES6 class (issue 1147) - -2015-03-09: Version 2.1.0 - - * Support ES6 class (issue 1001) - * Support ES6 rest parameter (issue 1011) - * Expand the location of property getter, setter, and methods (issue 1029) - * Enable TryStatement transition to a single handler (issue 1031) - * Support ES6 computed property name (issue 1037) - * Tolerate unclosed block comment (issue 1041) - * Support ES6 lexical declaration (issue 1065) - -2015-02-06: Version 2.0.0 - - * Support ES6 arrow function (issue 517) - * Support ES6 Unicode code point escape (issue 521) - * Improve the speed and accuracy of comment attachment (issue 522) - * Support ES6 default parameter (issue 519) - * Support ES6 regular expression flags (issue 557) - * Fix scanning of implicit octal literals (issue 565) - * Fix the handling of automatic semicolon insertion (issue 574) - * Support ES6 method definition (issue 620) - * Support ES6 octal integer literal (issue 621) - * Support ES6 binary integer literal (issue 622) - * Support ES6 object literal property value shorthand (issue 624) - -2015-03-03: Version 1.2.5 - - * Fix scanning of implicit octal literals (issue 565) - -2015-02-05: Version 1.2.4 - - * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) - * Fix the handling of automatic semicolon insertion (issue 574) - -2015-01-18: Version 1.2.3 - - * Fix division by this (issue 616) - -2014-05-18: Version 1.2.2 - - * Fix duplicated tokens when collecting comments (issue 537) - -2014-05-04: Version 1.2.1 - - * Ensure that Program node may still have leading comments (issue 536) - -2014-04-29: Version 1.2.0 - - * Fix semicolon handling for expression statement (issue 462, 533) - * Disallow escaped characters in regular expression flags (issue 503) - * Performance improvement for location tracking (issue 520) - * Improve the speed of comment attachment (issue 522) - -2014-03-26: Version 1.1.1 - - * Fix token handling of forward slash after an array literal (issue 512) - -2014-03-23: Version 1.1.0 - - * Optionally attach comments to the owning syntax nodes (issue 197) - * Simplify binary parsing with stack-based shift reduce (issue 352) - * Always include the raw source of literals (issue 376) - * Add optional input source information (issue 386) - * Tokenizer API for pure lexical scanning (issue 398) - * Improve the web site and its online demos (issue 337, 400, 404) - * Performance improvement for location tracking (issue 417, 424) - * Support HTML comment syntax (issue 451) - * Drop support for legacy browsers (issue 474) - -2013-08-27: Version 1.0.4 - - * Minimize the payload for packages (issue 362) - * Fix missing cases on an empty switch statement (issue 436) - * Support escaped ] in regexp literal character classes (issue 442) - * Tolerate invalid left-hand side expression (issue 130) - -2013-05-17: Version 1.0.3 - - * Variable declaration needs at least one declarator (issue 391) - * Fix benchmark's variance unit conversion (issue 397) - * IE < 9: \v should be treated as vertical tab (issue 405) - * Unary expressions should always have prefix: true (issue 418) - * Catch clause should only accept an identifier (issue 423) - * Tolerate setters without parameter (issue 426) - -2012-11-02: Version 1.0.2 - - Improvement: - - * Fix esvalidate JUnit output upon a syntax error (issue 374) - -2012-10-28: Version 1.0.1 - - Improvements: - - * esvalidate understands shebang in a Unix shell script (issue 361) - * esvalidate treats fatal parsing failure as an error (issue 361) - * Reduce Node.js package via .npmignore (issue 362) - -2012-10-22: Version 1.0.0 - - Initial release. diff --git a/node_modules/esprima/LICENSE.BSD b/node_modules/esprima/LICENSE.BSD deleted file mode 100644 index 7a55160..0000000 --- a/node_modules/esprima/LICENSE.BSD +++ /dev/null @@ -1,21 +0,0 @@ -Copyright JS Foundation and other contributors, https://js.foundation/ - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esprima/README.md b/node_modules/esprima/README.md deleted file mode 100644 index 8fb25e6..0000000 --- a/node_modules/esprima/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) -[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) -[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) -[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) - -**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -parser written in ECMAScript (also popularly known as -[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). -Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/jquery/esprima/contributors). - -### Features - -- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) -- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) -- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) -- Optional tracking of syntax node location (index-based and line-column) -- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) - -### API - -Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. - -A simple example on Node.js REPL: - -```javascript -> var esprima = require('esprima'); -> var program = 'const answer = 42'; - -> esprima.tokenize(program); -[ { type: 'Keyword', value: 'const' }, - { type: 'Identifier', value: 'answer' }, - { type: 'Punctuator', value: '=' }, - { type: 'Numeric', value: '42' } ] - -> esprima.parseScript(program); -{ type: 'Program', - body: - [ { type: 'VariableDeclaration', - declarations: [Object], - kind: 'const' } ], - sourceType: 'script' } -``` - -For more information, please read the [complete documentation](http://esprima.org/doc). \ No newline at end of file diff --git a/node_modules/esprima/bin/esparse.js b/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 45d05fb..0000000 --- a/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true node:true rhino:true */ - -var fs, esprima, fname, forceFile, content, options, syntax; - -if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esparse.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esparse [options] [file.js]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --comment Gather all line and block comments in an array'); - console.log(' --loc Include line-column location info for each syntax node'); - console.log(' --range Include index-based range for each syntax node'); - console.log(' --raw Display the raw value of literals'); - console.log(' --tokens List all tokens in an array'); - console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); - console.log(' -v, --version Shows program version'); - console.log(); - process.exit(1); -} - -options = {}; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - if (typeof fname === 'string') { - console.log('Error: more than one input file.'); - process.exit(1); - } else { - fname = entry; - } - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry === '--comment') { - options.comment = true; - } else if (entry === '--loc') { - options.loc = true; - } else if (entry === '--range') { - options.range = true; - } else if (entry === '--raw') { - options.raw = true; - } else if (entry === '--tokens') { - options.tokens = true; - } else if (entry === '--tolerant') { - options.tolerant = true; - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -function run(content) { - syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); -} - -try { - if (fname && (fname !== '-' || forceFile)) { - run(fs.readFileSync(fname, 'utf-8')); - } else { - var content = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(content); - }); - } -} catch (e) { - console.log('Error: ' + e.message); - process.exit(1); -} diff --git a/node_modules/esprima/bin/esvalidate.js b/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index d49a7e4..0000000 --- a/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true plusplus:true node:true rhino:true */ -/*global phantom:true */ - -var fs, system, esprima, options, fnames, forceFile, count; - -if (typeof esprima === 'undefined') { - // PhantomJS can only require() relative files - if (typeof phantom === 'object') { - fs = require('fs'); - system = require('system'); - esprima = require('./esprima'); - } else if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } - } else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } - } -} - -// Shims to Node.js objects when running under PhantomJS 1.7+. -if (typeof phantom === 'object') { - fs.readFileSync = fs.read; - process = { - argv: [].slice.call(system.args), - exit: phantom.exit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('phantomjs'); -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { - argv: arguments, - exit: quit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('esvalidate.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esvalidate [options] [file.js...]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --format=type Set the report format, plain (default) or junit'); - console.log(' -v, --version Print program version'); - console.log(); - process.exit(1); -} - -options = { - format: 'plain' -}; - -fnames = []; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - fnames.push(entry); - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry.slice(0, 9) === '--format=') { - options.format = entry.slice(9); - if (options.format !== 'plain' && options.format !== 'junit') { - console.log('Error: unknown report format ' + options.format + '.'); - process.exit(1); - } - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -if (fnames.length === 0) { - fnames.push(''); -} - -if (options.format === 'junit') { - console.log(''); - console.log(''); -} - -count = 0; - -function run(fname, content) { - var timestamp, syntax, name; - try { - if (typeof content !== 'string') { - throw content; - } - - if (content[0] === '#' && content[1] === '!') { - content = '//' + content.substr(2, content.length); - } - - timestamp = Date.now(); - syntax = esprima.parse(content, { tolerant: true }); - - if (options.format === 'junit') { - - name = fname; - if (name.lastIndexOf('/') >= 0) { - name = name.slice(name.lastIndexOf('/') + 1); - } - - console.log(''); - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - console.log(' '); - console.log(' ' + - error.message + '(' + name + ':' + error.lineNumber + ')' + - ''); - console.log(' '); - }); - - console.log(''); - - } else if (options.format === 'plain') { - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - msg = fname + ':' + error.lineNumber + ': ' + msg; - console.log(msg); - ++count; - }); - - } - } catch (e) { - ++count; - if (options.format === 'junit') { - console.log(''); - console.log(' '); - console.log(' ' + - e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + - ')'); - console.log(' '); - console.log(''); - } else { - console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, '')); - } - } -} - -fnames.forEach(function (fname) { - var content = ''; - try { - if (fname && (fname !== '-' || forceFile)) { - content = fs.readFileSync(fname, 'utf-8'); - } else { - fname = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(fname, content); - }); - return; - } - } catch (e) { - content = e; - } - run(fname, content); -}); - -process.on('exit', function () { - if (options.format === 'junit') { - console.log(''); - } - - if (count > 0) { - process.exit(1); - } - - if (count === 0 && typeof phantom === 'object') { - process.exit(0); - } -}); diff --git a/node_modules/esprima/dist/esprima.js b/node_modules/esprima/dist/esprima.js deleted file mode 100644 index 2af3eee..0000000 --- a/node_modules/esprima/dist/esprima.js +++ /dev/null @@ -1,6709 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { -/* istanbul ignore next */ - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); -/* istanbul ignore next */ - else if(typeof exports === 'object') - exports["esprima"] = factory(); - else - root["esprima"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/* istanbul ignore if */ -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - /* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - Object.defineProperty(exports, "__esModule", { value: true }); - var comment_handler_1 = __webpack_require__(1); - var jsx_parser_1 = __webpack_require__(3); - var parser_1 = __webpack_require__(8); - var tokenizer_1 = __webpack_require__(15); - function parse(code, options, delegate) { - var commentHandler = null; - var proxyDelegate = function (node, metadata) { - if (delegate) { - delegate(node, metadata); - } - if (commentHandler) { - commentHandler.visit(node, metadata); - } - }; - var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; - var collectComment = false; - if (options) { - collectComment = (typeof options.comment === 'boolean' && options.comment); - var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); - if (collectComment || attachComment) { - commentHandler = new comment_handler_1.CommentHandler(); - commentHandler.attach = attachComment; - options.comment = true; - parserDelegate = proxyDelegate; - } - } - var isModule = false; - if (options && typeof options.sourceType === 'string') { - isModule = (options.sourceType === 'module'); - } - var parser; - if (options && typeof options.jsx === 'boolean' && options.jsx) { - parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); - } - else { - parser = new parser_1.Parser(code, options, parserDelegate); - } - var program = isModule ? parser.parseModule() : parser.parseScript(); - var ast = program; - if (collectComment && commentHandler) { - ast.comments = commentHandler.comments; - } - if (parser.config.tokens) { - ast.tokens = parser.tokens; - } - if (parser.config.tolerant) { - ast.errors = parser.errorHandler.errors; - } - return ast; - } - exports.parse = parse; - function parseModule(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'module'; - return parse(code, parsingOptions, delegate); - } - exports.parseModule = parseModule; - function parseScript(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'script'; - return parse(code, parsingOptions, delegate); - } - exports.parseScript = parseScript; - function tokenize(code, options, delegate) { - var tokenizer = new tokenizer_1.Tokenizer(code, options); - var tokens; - tokens = []; - try { - while (true) { - var token = tokenizer.getNextToken(); - if (!token) { - break; - } - if (delegate) { - token = delegate(token); - } - tokens.push(token); - } - } - catch (e) { - tokenizer.errorHandler.tolerate(e); - } - if (tokenizer.errorHandler.tolerant) { - tokens.errors = tokenizer.errors(); - } - return tokens; - } - exports.tokenize = tokenize; - var syntax_1 = __webpack_require__(2); - exports.Syntax = syntax_1.Syntax; - // Sync with *.json manifests. - exports.version = '4.0.1'; - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - var CommentHandler = (function () { - function CommentHandler() { - this.attach = false; - this.comments = []; - this.stack = []; - this.leading = []; - this.trailing = []; - } - CommentHandler.prototype.insertInnerComments = function (node, metadata) { - // innnerComments for properties empty block - // `function a() {/** comments **\/}` - if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { - var innerComments = []; - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (metadata.end.offset >= entry.start) { - innerComments.unshift(entry.comment); - this.leading.splice(i, 1); - this.trailing.splice(i, 1); - } - } - if (innerComments.length) { - node.innerComments = innerComments; - } - } - }; - CommentHandler.prototype.findTrailingComments = function (metadata) { - var trailingComments = []; - if (this.trailing.length > 0) { - for (var i = this.trailing.length - 1; i >= 0; --i) { - var entry_1 = this.trailing[i]; - if (entry_1.start >= metadata.end.offset) { - trailingComments.unshift(entry_1.comment); - } - } - this.trailing.length = 0; - return trailingComments; - } - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.node.trailingComments) { - var firstComment = entry.node.trailingComments[0]; - if (firstComment && firstComment.range[0] >= metadata.end.offset) { - trailingComments = entry.node.trailingComments; - delete entry.node.trailingComments; - } - } - return trailingComments; - }; - CommentHandler.prototype.findLeadingComments = function (metadata) { - var leadingComments = []; - var target; - while (this.stack.length > 0) { - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.start >= metadata.start.offset) { - target = entry.node; - this.stack.pop(); - } - else { - break; - } - } - if (target) { - var count = target.leadingComments ? target.leadingComments.length : 0; - for (var i = count - 1; i >= 0; --i) { - var comment = target.leadingComments[i]; - if (comment.range[1] <= metadata.start.offset) { - leadingComments.unshift(comment); - target.leadingComments.splice(i, 1); - } - } - if (target.leadingComments && target.leadingComments.length === 0) { - delete target.leadingComments; - } - return leadingComments; - } - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (entry.start <= metadata.start.offset) { - leadingComments.unshift(entry.comment); - this.leading.splice(i, 1); - } - } - return leadingComments; - }; - CommentHandler.prototype.visitNode = function (node, metadata) { - if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { - return; - } - this.insertInnerComments(node, metadata); - var trailingComments = this.findTrailingComments(metadata); - var leadingComments = this.findLeadingComments(metadata); - if (leadingComments.length > 0) { - node.leadingComments = leadingComments; - } - if (trailingComments.length > 0) { - node.trailingComments = trailingComments; - } - this.stack.push({ - node: node, - start: metadata.start.offset - }); - }; - CommentHandler.prototype.visitComment = function (node, metadata) { - var type = (node.type[0] === 'L') ? 'Line' : 'Block'; - var comment = { - type: type, - value: node.value - }; - if (node.range) { - comment.range = node.range; - } - if (node.loc) { - comment.loc = node.loc; - } - this.comments.push(comment); - if (this.attach) { - var entry = { - comment: { - type: type, - value: node.value, - range: [metadata.start.offset, metadata.end.offset] - }, - start: metadata.start.offset - }; - if (node.loc) { - entry.comment.loc = node.loc; - } - node.type = type; - this.leading.push(entry); - this.trailing.push(entry); - } - }; - CommentHandler.prototype.visit = function (node, metadata) { - if (node.type === 'LineComment') { - this.visitComment(node, metadata); - } - else if (node.type === 'BlockComment') { - this.visitComment(node, metadata); - } - else if (this.attach) { - this.visitNode(node, metadata); - } - }; - return CommentHandler; - }()); - exports.CommentHandler = CommentHandler; - - -/***/ }, -/* 2 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForOfStatement: 'ForOfStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchCase: 'SwitchCase', - SwitchStatement: 'SwitchStatement', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; -/* istanbul ignore next */ - var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })(); - Object.defineProperty(exports, "__esModule", { value: true }); - var character_1 = __webpack_require__(4); - var JSXNode = __webpack_require__(5); - var jsx_syntax_1 = __webpack_require__(6); - var Node = __webpack_require__(7); - var parser_1 = __webpack_require__(8); - var token_1 = __webpack_require__(13); - var xhtml_entities_1 = __webpack_require__(14); - token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; - token_1.TokenName[101 /* Text */] = 'JSXText'; - // Fully qualified element name, e.g. returns "svg:path" - function getQualifiedElementName(elementName) { - var qualifiedName; - switch (elementName.type) { - case jsx_syntax_1.JSXSyntax.JSXIdentifier: - var id = elementName; - qualifiedName = id.name; - break; - case jsx_syntax_1.JSXSyntax.JSXNamespacedName: - var ns = elementName; - qualifiedName = getQualifiedElementName(ns.namespace) + ':' + - getQualifiedElementName(ns.name); - break; - case jsx_syntax_1.JSXSyntax.JSXMemberExpression: - var expr = elementName; - qualifiedName = getQualifiedElementName(expr.object) + '.' + - getQualifiedElementName(expr.property); - break; - /* istanbul ignore next */ - default: - break; - } - return qualifiedName; - } - var JSXParser = (function (_super) { - __extends(JSXParser, _super); - function JSXParser(code, options, delegate) { - return _super.call(this, code, options, delegate) || this; - } - JSXParser.prototype.parsePrimaryExpression = function () { - return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); - }; - JSXParser.prototype.startJSX = function () { - // Unwind the scanner before the lookahead token. - this.scanner.index = this.startMarker.index; - this.scanner.lineNumber = this.startMarker.line; - this.scanner.lineStart = this.startMarker.index - this.startMarker.column; - }; - JSXParser.prototype.finishJSX = function () { - // Prime the next lookahead. - this.nextToken(); - }; - JSXParser.prototype.reenterJSX = function () { - this.startJSX(); - this.expectJSX('}'); - // Pop the closing '}' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - }; - JSXParser.prototype.createJSXNode = function () { - this.collectComments(); - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.createJSXChildNode = function () { - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.scanXHTMLEntity = function (quote) { - var result = '&'; - var valid = true; - var terminated = false; - var numeric = false; - var hex = false; - while (!this.scanner.eof() && valid && !terminated) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === quote) { - break; - } - terminated = (ch === ';'); - result += ch; - ++this.scanner.index; - if (!terminated) { - switch (result.length) { - case 2: - // e.g. '{' - numeric = (ch === '#'); - break; - case 3: - if (numeric) { - // e.g. 'A' - hex = (ch === 'x'); - valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); - numeric = numeric && !hex; - } - break; - default: - valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); - valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); - break; - } - } - } - if (valid && terminated && result.length > 2) { - // e.g. 'A' becomes just '#x41' - var str = result.substr(1, result.length - 2); - if (numeric && str.length > 1) { - result = String.fromCharCode(parseInt(str.substr(1), 10)); - } - else if (hex && str.length > 2) { - result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); - } - else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { - result = xhtml_entities_1.XHTMLEntities[str]; - } - } - return result; - }; - // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. - JSXParser.prototype.lexJSX = function () { - var cp = this.scanner.source.charCodeAt(this.scanner.index); - // < > / : = { } - if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { - var value = this.scanner.source[this.scanner.index++]; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index - 1, - end: this.scanner.index - }; - } - // " ' - if (cp === 34 || cp === 39) { - var start = this.scanner.index; - var quote = this.scanner.source[this.scanner.index++]; - var str = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index++]; - if (ch === quote) { - break; - } - else if (ch === '&') { - str += this.scanXHTMLEntity(quote); - } - else { - str += ch; - } - } - return { - type: 8 /* StringLiteral */, - value: str, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ... or . - if (cp === 46) { - var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); - var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); - var value = (n1 === 46 && n2 === 46) ? '...' : '.'; - var start = this.scanner.index; - this.scanner.index += value.length; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ` - if (cp === 96) { - // Only placeholder, since it will be rescanned as a real assignment expression. - return { - type: 10 /* Template */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index, - end: this.scanner.index - }; - } - // Identifer can not contain backslash (char code 92). - if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { - var start = this.scanner.index; - ++this.scanner.index; - while (!this.scanner.eof()) { - var ch = this.scanner.source.charCodeAt(this.scanner.index); - if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { - ++this.scanner.index; - } - else if (ch === 45) { - // Hyphen (char code 45) can be part of an identifier. - ++this.scanner.index; - } - else { - break; - } - } - var id = this.scanner.source.slice(start, this.scanner.index); - return { - type: 100 /* Identifier */, - value: id, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - return this.scanner.lex(); - }; - JSXParser.prototype.nextJSXToken = function () { - this.collectComments(); - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var token = this.lexJSX(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - if (this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.nextJSXText = function () { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var start = this.scanner.index; - var text = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === '{' || ch === '<') { - break; - } - ++this.scanner.index; - text += ch; - if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { - ++this.scanner.lineNumber; - if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { - ++this.scanner.index; - } - this.scanner.lineStart = this.scanner.index; - } - } - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - var token = { - type: 101 /* Text */, - value: text, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - if ((text.length > 0) && this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.peekJSXToken = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.lexJSX(); - this.scanner.restoreState(state); - return next; - }; - // Expect the next JSX token to match the specified punctuator. - // If not, an exception will be thrown. - JSXParser.prototype.expectJSX = function (value) { - var token = this.nextJSXToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next JSX token matches the specified punctuator. - JSXParser.prototype.matchJSX = function (value) { - var next = this.peekJSXToken(); - return next.type === 7 /* Punctuator */ && next.value === value; - }; - JSXParser.prototype.parseJSXIdentifier = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 100 /* Identifier */) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); - }; - JSXParser.prototype.parseJSXElementName = function () { - var node = this.createJSXNode(); - var elementName = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = elementName; - this.expectJSX(':'); - var name_1 = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); - } - else if (this.matchJSX('.')) { - while (this.matchJSX('.')) { - var object = elementName; - this.expectJSX('.'); - var property = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); - } - } - return elementName; - }; - JSXParser.prototype.parseJSXAttributeName = function () { - var node = this.createJSXNode(); - var attributeName; - var identifier = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = identifier; - this.expectJSX(':'); - var name_2 = this.parseJSXIdentifier(); - attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); - } - else { - attributeName = identifier; - } - return attributeName; - }; - JSXParser.prototype.parseJSXStringLiteralAttribute = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 8 /* StringLiteral */) { - this.throwUnexpectedToken(token); - } - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - JSXParser.prototype.parseJSXExpressionAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.finishJSX(); - if (this.match('}')) { - this.tolerateError('JSX attributes must only be assigned a non-empty expression'); - } - var expression = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXAttributeValue = function () { - return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : - this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); - }; - JSXParser.prototype.parseJSXNameValueAttribute = function () { - var node = this.createJSXNode(); - var name = this.parseJSXAttributeName(); - var value = null; - if (this.matchJSX('=')) { - this.expectJSX('='); - value = this.parseJSXAttributeValue(); - } - return this.finalize(node, new JSXNode.JSXAttribute(name, value)); - }; - JSXParser.prototype.parseJSXSpreadAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.expectJSX('...'); - this.finishJSX(); - var argument = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); - }; - JSXParser.prototype.parseJSXAttributes = function () { - var attributes = []; - while (!this.matchJSX('/') && !this.matchJSX('>')) { - var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : - this.parseJSXNameValueAttribute(); - attributes.push(attribute); - } - return attributes; - }; - JSXParser.prototype.parseJSXOpeningElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXBoundaryElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - if (this.matchJSX('/')) { - this.expectJSX('/'); - var name_3 = this.parseJSXElementName(); - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); - } - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXEmptyExpression = function () { - var node = this.createJSXChildNode(); - this.collectComments(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - return this.finalize(node, new JSXNode.JSXEmptyExpression()); - }; - JSXParser.prototype.parseJSXExpressionContainer = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - var expression; - if (this.matchJSX('}')) { - expression = this.parseJSXEmptyExpression(); - this.expectJSX('}'); - } - else { - this.finishJSX(); - expression = this.parseAssignmentExpression(); - this.reenterJSX(); - } - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXChildren = function () { - var children = []; - while (!this.scanner.eof()) { - var node = this.createJSXChildNode(); - var token = this.nextJSXText(); - if (token.start < token.end) { - var raw = this.getTokenRaw(token); - var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); - children.push(child); - } - if (this.scanner.source[this.scanner.index] === '{') { - var container = this.parseJSXExpressionContainer(); - children.push(container); - } - else { - break; - } - } - return children; - }; - JSXParser.prototype.parseComplexJSXElement = function (el) { - var stack = []; - while (!this.scanner.eof()) { - el.children = el.children.concat(this.parseJSXChildren()); - var node = this.createJSXChildNode(); - var element = this.parseJSXBoundaryElement(); - if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { - var opening = element; - if (opening.selfClosing) { - var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); - el.children.push(child); - } - else { - stack.push(el); - el = { node: node, opening: opening, closing: null, children: [] }; - } - } - if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { - el.closing = element; - var open_1 = getQualifiedElementName(el.opening.name); - var close_1 = getQualifiedElementName(el.closing.name); - if (open_1 !== close_1) { - this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); - } - if (stack.length > 0) { - var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); - el = stack[stack.length - 1]; - el.children.push(child); - stack.pop(); - } - else { - break; - } - } - } - return el; - }; - JSXParser.prototype.parseJSXElement = function () { - var node = this.createJSXNode(); - var opening = this.parseJSXOpeningElement(); - var children = []; - var closing = null; - if (!opening.selfClosing) { - var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); - children = el.children; - closing = el.closing; - } - return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); - }; - JSXParser.prototype.parseJSXRoot = function () { - // Pop the opening '<' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - this.startJSX(); - var element = this.parseJSXElement(); - this.finishJSX(); - return element; - }; - JSXParser.prototype.isStartOfExpression = function () { - return _super.prototype.isStartOfExpression.call(this) || this.match('<'); - }; - return JSXParser; - }(parser_1.Parser)); - exports.JSXParser = JSXParser; - - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // See also tools/generate-unicode-regex.js. - var Regex = { - // Unicode v8.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-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uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - // Unicode v8.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\u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\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - exports.Character = { - /* tslint:disable:no-bitwise */ - fromCodePoint: function (cp) { - return (cp < 0x10000) ? String.fromCharCode(cp) : - String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + - String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); - }, - // https://tc39.github.io/ecma262/#sec-white-space - isWhiteSpace: function (cp) { - return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || - (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); - }, - // https://tc39.github.io/ecma262/#sec-line-terminators - isLineTerminator: function (cp) { - return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); - }, - // https://tc39.github.io/ecma262/#sec-names-and-keywords - isIdentifierStart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); - }, - isIdentifierPart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp >= 0x30 && cp <= 0x39) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); - }, - // https://tc39.github.io/ecma262/#sec-literals-numeric-literals - isDecimalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39); // 0..9 - }, - isHexDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39) || - (cp >= 0x41 && cp <= 0x46) || - (cp >= 0x61 && cp <= 0x66); // a..f - }, - isOctalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x37); // 0..7 - } - }; - - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var jsx_syntax_1 = __webpack_require__(6); - /* tslint:disable:max-classes-per-file */ - var JSXClosingElement = (function () { - function JSXClosingElement(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; - this.name = name; - } - return JSXClosingElement; - }()); - exports.JSXClosingElement = JSXClosingElement; - var JSXElement = (function () { - function JSXElement(openingElement, children, closingElement) { - this.type = jsx_syntax_1.JSXSyntax.JSXElement; - this.openingElement = openingElement; - this.children = children; - this.closingElement = closingElement; - } - return JSXElement; - }()); - exports.JSXElement = JSXElement; - var JSXEmptyExpression = (function () { - function JSXEmptyExpression() { - this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; - } - return JSXEmptyExpression; - }()); - exports.JSXEmptyExpression = JSXEmptyExpression; - var JSXExpressionContainer = (function () { - function JSXExpressionContainer(expression) { - this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; - this.expression = expression; - } - return JSXExpressionContainer; - }()); - exports.JSXExpressionContainer = JSXExpressionContainer; - var JSXIdentifier = (function () { - function JSXIdentifier(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; - this.name = name; - } - return JSXIdentifier; - }()); - exports.JSXIdentifier = JSXIdentifier; - var JSXMemberExpression = (function () { - function JSXMemberExpression(object, property) { - this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; - this.object = object; - this.property = property; - } - return JSXMemberExpression; - }()); - exports.JSXMemberExpression = JSXMemberExpression; - var JSXAttribute = (function () { - function JSXAttribute(name, value) { - this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; - this.name = name; - this.value = value; - } - return JSXAttribute; - }()); - exports.JSXAttribute = JSXAttribute; - var JSXNamespacedName = (function () { - function JSXNamespacedName(namespace, name) { - this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; - this.namespace = namespace; - this.name = name; - } - return JSXNamespacedName; - }()); - exports.JSXNamespacedName = JSXNamespacedName; - var JSXOpeningElement = (function () { - function JSXOpeningElement(name, selfClosing, attributes) { - this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; - this.name = name; - this.selfClosing = selfClosing; - this.attributes = attributes; - } - return JSXOpeningElement; - }()); - exports.JSXOpeningElement = JSXOpeningElement; - var JSXSpreadAttribute = (function () { - function JSXSpreadAttribute(argument) { - this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; - this.argument = argument; - } - return JSXSpreadAttribute; - }()); - exports.JSXSpreadAttribute = JSXSpreadAttribute; - var JSXText = (function () { - function JSXText(value, raw) { - this.type = jsx_syntax_1.JSXSyntax.JSXText; - this.value = value; - this.raw = raw; - } - return JSXText; - }()); - exports.JSXText = JSXText; - - -/***/ }, -/* 6 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JSXSyntax = { - JSXAttribute: 'JSXAttribute', - JSXClosingElement: 'JSXClosingElement', - JSXElement: 'JSXElement', - JSXEmptyExpression: 'JSXEmptyExpression', - JSXExpressionContainer: 'JSXExpressionContainer', - JSXIdentifier: 'JSXIdentifier', - JSXMemberExpression: 'JSXMemberExpression', - JSXNamespacedName: 'JSXNamespacedName', - JSXOpeningElement: 'JSXOpeningElement', - JSXSpreadAttribute: 'JSXSpreadAttribute', - JSXText: 'JSXText' - }; - - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - /* tslint:disable:max-classes-per-file */ - var ArrayExpression = (function () { - function ArrayExpression(elements) { - this.type = syntax_1.Syntax.ArrayExpression; - this.elements = elements; - } - return ArrayExpression; - }()); - exports.ArrayExpression = ArrayExpression; - var ArrayPattern = (function () { - function ArrayPattern(elements) { - this.type = syntax_1.Syntax.ArrayPattern; - this.elements = elements; - } - return ArrayPattern; - }()); - exports.ArrayPattern = ArrayPattern; - var ArrowFunctionExpression = (function () { - function ArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = false; - } - return ArrowFunctionExpression; - }()); - exports.ArrowFunctionExpression = ArrowFunctionExpression; - var AssignmentExpression = (function () { - function AssignmentExpression(operator, left, right) { - this.type = syntax_1.Syntax.AssignmentExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return AssignmentExpression; - }()); - exports.AssignmentExpression = AssignmentExpression; - var AssignmentPattern = (function () { - function AssignmentPattern(left, right) { - this.type = syntax_1.Syntax.AssignmentPattern; - this.left = left; - this.right = right; - } - return AssignmentPattern; - }()); - exports.AssignmentPattern = AssignmentPattern; - var AsyncArrowFunctionExpression = (function () { - function AsyncArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = true; - } - return AsyncArrowFunctionExpression; - }()); - exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; - var AsyncFunctionDeclaration = (function () { - function AsyncFunctionDeclaration(id, params, body) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionDeclaration; - }()); - exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; - var AsyncFunctionExpression = (function () { - function AsyncFunctionExpression(id, params, body) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionExpression; - }()); - exports.AsyncFunctionExpression = AsyncFunctionExpression; - var AwaitExpression = (function () { - function AwaitExpression(argument) { - this.type = syntax_1.Syntax.AwaitExpression; - this.argument = argument; - } - return AwaitExpression; - }()); - exports.AwaitExpression = AwaitExpression; - var BinaryExpression = (function () { - function BinaryExpression(operator, left, right) { - var logical = (operator === '||' || operator === '&&'); - this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return BinaryExpression; - }()); - exports.BinaryExpression = BinaryExpression; - var BlockStatement = (function () { - function BlockStatement(body) { - this.type = syntax_1.Syntax.BlockStatement; - this.body = body; - } - return BlockStatement; - }()); - exports.BlockStatement = BlockStatement; - var BreakStatement = (function () { - function BreakStatement(label) { - this.type = syntax_1.Syntax.BreakStatement; - this.label = label; - } - return BreakStatement; - }()); - exports.BreakStatement = BreakStatement; - var CallExpression = (function () { - function CallExpression(callee, args) { - this.type = syntax_1.Syntax.CallExpression; - this.callee = callee; - this.arguments = args; - } - return CallExpression; - }()); - exports.CallExpression = CallExpression; - var CatchClause = (function () { - function CatchClause(param, body) { - this.type = syntax_1.Syntax.CatchClause; - this.param = param; - this.body = body; - } - return CatchClause; - }()); - exports.CatchClause = CatchClause; - var ClassBody = (function () { - function ClassBody(body) { - this.type = syntax_1.Syntax.ClassBody; - this.body = body; - } - return ClassBody; - }()); - exports.ClassBody = ClassBody; - var ClassDeclaration = (function () { - function ClassDeclaration(id, superClass, body) { - this.type = syntax_1.Syntax.ClassDeclaration; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassDeclaration; - }()); - exports.ClassDeclaration = ClassDeclaration; - var ClassExpression = (function () { - function ClassExpression(id, superClass, body) { - this.type = syntax_1.Syntax.ClassExpression; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassExpression; - }()); - exports.ClassExpression = ClassExpression; - var ComputedMemberExpression = (function () { - function ComputedMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = true; - this.object = object; - this.property = property; - } - return ComputedMemberExpression; - }()); - exports.ComputedMemberExpression = ComputedMemberExpression; - var ConditionalExpression = (function () { - function ConditionalExpression(test, consequent, alternate) { - this.type = syntax_1.Syntax.ConditionalExpression; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return ConditionalExpression; - }()); - exports.ConditionalExpression = ConditionalExpression; - var ContinueStatement = (function () { - function ContinueStatement(label) { - this.type = syntax_1.Syntax.ContinueStatement; - this.label = label; - } - return ContinueStatement; - }()); - exports.ContinueStatement = ContinueStatement; - var DebuggerStatement = (function () { - function DebuggerStatement() { - this.type = syntax_1.Syntax.DebuggerStatement; - } - return DebuggerStatement; - }()); - exports.DebuggerStatement = DebuggerStatement; - var Directive = (function () { - function Directive(expression, directive) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - this.directive = directive; - } - return Directive; - }()); - exports.Directive = Directive; - var DoWhileStatement = (function () { - function DoWhileStatement(body, test) { - this.type = syntax_1.Syntax.DoWhileStatement; - this.body = body; - this.test = test; - } - return DoWhileStatement; - }()); - exports.DoWhileStatement = DoWhileStatement; - var EmptyStatement = (function () { - function EmptyStatement() { - this.type = syntax_1.Syntax.EmptyStatement; - } - return EmptyStatement; - }()); - exports.EmptyStatement = EmptyStatement; - var ExportAllDeclaration = (function () { - function ExportAllDeclaration(source) { - this.type = syntax_1.Syntax.ExportAllDeclaration; - this.source = source; - } - return ExportAllDeclaration; - }()); - exports.ExportAllDeclaration = ExportAllDeclaration; - var ExportDefaultDeclaration = (function () { - function ExportDefaultDeclaration(declaration) { - this.type = syntax_1.Syntax.ExportDefaultDeclaration; - this.declaration = declaration; - } - return ExportDefaultDeclaration; - }()); - exports.ExportDefaultDeclaration = ExportDefaultDeclaration; - var ExportNamedDeclaration = (function () { - function ExportNamedDeclaration(declaration, specifiers, source) { - this.type = syntax_1.Syntax.ExportNamedDeclaration; - this.declaration = declaration; - this.specifiers = specifiers; - this.source = source; - } - return ExportNamedDeclaration; - }()); - exports.ExportNamedDeclaration = ExportNamedDeclaration; - var ExportSpecifier = (function () { - function ExportSpecifier(local, exported) { - this.type = syntax_1.Syntax.ExportSpecifier; - this.exported = exported; - this.local = local; - } - return ExportSpecifier; - }()); - exports.ExportSpecifier = ExportSpecifier; - var ExpressionStatement = (function () { - function ExpressionStatement(expression) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - } - return ExpressionStatement; - }()); - exports.ExpressionStatement = ExpressionStatement; - var ForInStatement = (function () { - function ForInStatement(left, right, body) { - this.type = syntax_1.Syntax.ForInStatement; - this.left = left; - this.right = right; - this.body = body; - this.each = false; - } - return ForInStatement; - }()); - exports.ForInStatement = ForInStatement; - var ForOfStatement = (function () { - function ForOfStatement(left, right, body) { - this.type = syntax_1.Syntax.ForOfStatement; - this.left = left; - this.right = right; - this.body = body; - } - return ForOfStatement; - }()); - exports.ForOfStatement = ForOfStatement; - var ForStatement = (function () { - function ForStatement(init, test, update, body) { - this.type = syntax_1.Syntax.ForStatement; - this.init = init; - this.test = test; - this.update = update; - this.body = body; - } - return ForStatement; - }()); - exports.ForStatement = ForStatement; - var FunctionDeclaration = (function () { - function FunctionDeclaration(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionDeclaration; - }()); - exports.FunctionDeclaration = FunctionDeclaration; - var FunctionExpression = (function () { - function FunctionExpression(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionExpression; - }()); - exports.FunctionExpression = FunctionExpression; - var Identifier = (function () { - function Identifier(name) { - this.type = syntax_1.Syntax.Identifier; - this.name = name; - } - return Identifier; - }()); - exports.Identifier = Identifier; - var IfStatement = (function () { - function IfStatement(test, consequent, alternate) { - this.type = syntax_1.Syntax.IfStatement; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return IfStatement; - }()); - exports.IfStatement = IfStatement; - var ImportDeclaration = (function () { - function ImportDeclaration(specifiers, source) { - this.type = syntax_1.Syntax.ImportDeclaration; - this.specifiers = specifiers; - this.source = source; - } - return ImportDeclaration; - }()); - exports.ImportDeclaration = ImportDeclaration; - var ImportDefaultSpecifier = (function () { - function ImportDefaultSpecifier(local) { - this.type = syntax_1.Syntax.ImportDefaultSpecifier; - this.local = local; - } - return ImportDefaultSpecifier; - }()); - exports.ImportDefaultSpecifier = ImportDefaultSpecifier; - var ImportNamespaceSpecifier = (function () { - function ImportNamespaceSpecifier(local) { - this.type = syntax_1.Syntax.ImportNamespaceSpecifier; - this.local = local; - } - return ImportNamespaceSpecifier; - }()); - exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; - var ImportSpecifier = (function () { - function ImportSpecifier(local, imported) { - this.type = syntax_1.Syntax.ImportSpecifier; - this.local = local; - this.imported = imported; - } - return ImportSpecifier; - }()); - exports.ImportSpecifier = ImportSpecifier; - var LabeledStatement = (function () { - function LabeledStatement(label, body) { - this.type = syntax_1.Syntax.LabeledStatement; - this.label = label; - this.body = body; - } - return LabeledStatement; - }()); - exports.LabeledStatement = LabeledStatement; - var Literal = (function () { - function Literal(value, raw) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - } - return Literal; - }()); - exports.Literal = Literal; - var MetaProperty = (function () { - function MetaProperty(meta, property) { - this.type = syntax_1.Syntax.MetaProperty; - this.meta = meta; - this.property = property; - } - return MetaProperty; - }()); - exports.MetaProperty = MetaProperty; - var MethodDefinition = (function () { - function MethodDefinition(key, computed, value, kind, isStatic) { - this.type = syntax_1.Syntax.MethodDefinition; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.static = isStatic; - } - return MethodDefinition; - }()); - exports.MethodDefinition = MethodDefinition; - var Module = (function () { - function Module(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'module'; - } - return Module; - }()); - exports.Module = Module; - var NewExpression = (function () { - function NewExpression(callee, args) { - this.type = syntax_1.Syntax.NewExpression; - this.callee = callee; - this.arguments = args; - } - return NewExpression; - }()); - exports.NewExpression = NewExpression; - var ObjectExpression = (function () { - function ObjectExpression(properties) { - this.type = syntax_1.Syntax.ObjectExpression; - this.properties = properties; - } - return ObjectExpression; - }()); - exports.ObjectExpression = ObjectExpression; - var ObjectPattern = (function () { - function ObjectPattern(properties) { - this.type = syntax_1.Syntax.ObjectPattern; - this.properties = properties; - } - return ObjectPattern; - }()); - exports.ObjectPattern = ObjectPattern; - var Property = (function () { - function Property(kind, key, computed, value, method, shorthand) { - this.type = syntax_1.Syntax.Property; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.method = method; - this.shorthand = shorthand; - } - return Property; - }()); - exports.Property = Property; - var RegexLiteral = (function () { - function RegexLiteral(value, raw, pattern, flags) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - this.regex = { pattern: pattern, flags: flags }; - } - return RegexLiteral; - }()); - exports.RegexLiteral = RegexLiteral; - var RestElement = (function () { - function RestElement(argument) { - this.type = syntax_1.Syntax.RestElement; - this.argument = argument; - } - return RestElement; - }()); - exports.RestElement = RestElement; - var ReturnStatement = (function () { - function ReturnStatement(argument) { - this.type = syntax_1.Syntax.ReturnStatement; - this.argument = argument; - } - return ReturnStatement; - }()); - exports.ReturnStatement = ReturnStatement; - var Script = (function () { - function Script(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'script'; - } - return Script; - }()); - exports.Script = Script; - var SequenceExpression = (function () { - function SequenceExpression(expressions) { - this.type = syntax_1.Syntax.SequenceExpression; - this.expressions = expressions; - } - return SequenceExpression; - }()); - exports.SequenceExpression = SequenceExpression; - var SpreadElement = (function () { - function SpreadElement(argument) { - this.type = syntax_1.Syntax.SpreadElement; - this.argument = argument; - } - return SpreadElement; - }()); - exports.SpreadElement = SpreadElement; - var StaticMemberExpression = (function () { - function StaticMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = false; - this.object = object; - this.property = property; - } - return StaticMemberExpression; - }()); - exports.StaticMemberExpression = StaticMemberExpression; - var Super = (function () { - function Super() { - this.type = syntax_1.Syntax.Super; - } - return Super; - }()); - exports.Super = Super; - var SwitchCase = (function () { - function SwitchCase(test, consequent) { - this.type = syntax_1.Syntax.SwitchCase; - this.test = test; - this.consequent = consequent; - } - return SwitchCase; - }()); - exports.SwitchCase = SwitchCase; - var SwitchStatement = (function () { - function SwitchStatement(discriminant, cases) { - this.type = syntax_1.Syntax.SwitchStatement; - this.discriminant = discriminant; - this.cases = cases; - } - return SwitchStatement; - }()); - exports.SwitchStatement = SwitchStatement; - var TaggedTemplateExpression = (function () { - function TaggedTemplateExpression(tag, quasi) { - this.type = syntax_1.Syntax.TaggedTemplateExpression; - this.tag = tag; - this.quasi = quasi; - } - return TaggedTemplateExpression; - }()); - exports.TaggedTemplateExpression = TaggedTemplateExpression; - var TemplateElement = (function () { - function TemplateElement(value, tail) { - this.type = syntax_1.Syntax.TemplateElement; - this.value = value; - this.tail = tail; - } - return TemplateElement; - }()); - exports.TemplateElement = TemplateElement; - var TemplateLiteral = (function () { - function TemplateLiteral(quasis, expressions) { - this.type = syntax_1.Syntax.TemplateLiteral; - this.quasis = quasis; - this.expressions = expressions; - } - return TemplateLiteral; - }()); - exports.TemplateLiteral = TemplateLiteral; - var ThisExpression = (function () { - function ThisExpression() { - this.type = syntax_1.Syntax.ThisExpression; - } - return ThisExpression; - }()); - exports.ThisExpression = ThisExpression; - var ThrowStatement = (function () { - function ThrowStatement(argument) { - this.type = syntax_1.Syntax.ThrowStatement; - this.argument = argument; - } - return ThrowStatement; - }()); - exports.ThrowStatement = ThrowStatement; - var TryStatement = (function () { - function TryStatement(block, handler, finalizer) { - this.type = syntax_1.Syntax.TryStatement; - this.block = block; - this.handler = handler; - this.finalizer = finalizer; - } - return TryStatement; - }()); - exports.TryStatement = TryStatement; - var UnaryExpression = (function () { - function UnaryExpression(operator, argument) { - this.type = syntax_1.Syntax.UnaryExpression; - this.operator = operator; - this.argument = argument; - this.prefix = true; - } - return UnaryExpression; - }()); - exports.UnaryExpression = UnaryExpression; - var UpdateExpression = (function () { - function UpdateExpression(operator, argument, prefix) { - this.type = syntax_1.Syntax.UpdateExpression; - this.operator = operator; - this.argument = argument; - this.prefix = prefix; - } - return UpdateExpression; - }()); - exports.UpdateExpression = UpdateExpression; - var VariableDeclaration = (function () { - function VariableDeclaration(declarations, kind) { - this.type = syntax_1.Syntax.VariableDeclaration; - this.declarations = declarations; - this.kind = kind; - } - return VariableDeclaration; - }()); - exports.VariableDeclaration = VariableDeclaration; - var VariableDeclarator = (function () { - function VariableDeclarator(id, init) { - this.type = syntax_1.Syntax.VariableDeclarator; - this.id = id; - this.init = init; - } - return VariableDeclarator; - }()); - exports.VariableDeclarator = VariableDeclarator; - var WhileStatement = (function () { - function WhileStatement(test, body) { - this.type = syntax_1.Syntax.WhileStatement; - this.test = test; - this.body = body; - } - return WhileStatement; - }()); - exports.WhileStatement = WhileStatement; - var WithStatement = (function () { - function WithStatement(object, body) { - this.type = syntax_1.Syntax.WithStatement; - this.object = object; - this.body = body; - } - return WithStatement; - }()); - exports.WithStatement = WithStatement; - var YieldExpression = (function () { - function YieldExpression(argument, delegate) { - this.type = syntax_1.Syntax.YieldExpression; - this.argument = argument; - this.delegate = delegate; - } - return YieldExpression; - }()); - exports.YieldExpression = YieldExpression; - - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var error_handler_1 = __webpack_require__(10); - var messages_1 = __webpack_require__(11); - var Node = __webpack_require__(7); - var scanner_1 = __webpack_require__(12); - var syntax_1 = __webpack_require__(2); - var token_1 = __webpack_require__(13); - var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; - var Parser = (function () { - function Parser(code, options, delegate) { - if (options === void 0) { options = {}; } - this.config = { - range: (typeof options.range === 'boolean') && options.range, - loc: (typeof options.loc === 'boolean') && options.loc, - source: null, - tokens: (typeof options.tokens === 'boolean') && options.tokens, - comment: (typeof options.comment === 'boolean') && options.comment, - tolerant: (typeof options.tolerant === 'boolean') && options.tolerant - }; - if (this.config.loc && options.source && options.source !== null) { - this.config.source = String(options.source); - } - this.delegate = delegate; - this.errorHandler = new error_handler_1.ErrorHandler(); - this.errorHandler.tolerant = this.config.tolerant; - this.scanner = new scanner_1.Scanner(code, this.errorHandler); - this.scanner.trackComment = this.config.comment; - this.operatorPrecedence = { - ')': 0, - ';': 0, - ',': 0, - '=': 0, - ']': 0, - '||': 1, - '&&': 2, - '|': 3, - '^': 4, - '&': 5, - '==': 6, - '!=': 6, - '===': 6, - '!==': 6, - '<': 7, - '>': 7, - '<=': 7, - '>=': 7, - '<<': 8, - '>>': 8, - '>>>': 8, - '+': 9, - '-': 9, - '*': 11, - '/': 11, - '%': 11 - }; - this.lookahead = { - type: 2 /* EOF */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: 0, - start: 0, - end: 0 - }; - this.hasLineTerminator = false; - this.context = { - isModule: false, - await: false, - allowIn: true, - allowStrictDirective: true, - allowYield: true, - firstCoverInitializedNameError: null, - isAssignmentTarget: false, - isBindingElement: false, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - labelSet: {}, - strict: false - }; - this.tokens = []; - this.startMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.lastMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.nextToken(); - this.lastMarker = { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - } - Parser.prototype.throwError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - throw this.errorHandler.createError(index, line, column, msg); - }; - Parser.prototype.tolerateError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.scanner.lineNumber; - var column = this.lastMarker.column + 1; - this.errorHandler.tolerateError(index, line, column, msg); - }; - // Throw an exception because of the token. - Parser.prototype.unexpectedTokenError = function (token, message) { - var msg = message || messages_1.Messages.UnexpectedToken; - var value; - if (token) { - if (!message) { - msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : - (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : - (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : - (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : - (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : - messages_1.Messages.UnexpectedToken; - if (token.type === 4 /* Keyword */) { - if (this.scanner.isFutureReservedWord(token.value)) { - msg = messages_1.Messages.UnexpectedReserved; - } - else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { - msg = messages_1.Messages.StrictReservedWord; - } - } - } - value = token.value; - } - else { - value = 'ILLEGAL'; - } - msg = msg.replace('%0', value); - if (token && typeof token.lineNumber === 'number') { - var index = token.start; - var line = token.lineNumber; - var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; - var column = token.start - lastMarkerLineStart + 1; - return this.errorHandler.createError(index, line, column, msg); - } - else { - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - return this.errorHandler.createError(index, line, column, msg); - } - }; - Parser.prototype.throwUnexpectedToken = function (token, message) { - throw this.unexpectedTokenError(token, message); - }; - Parser.prototype.tolerateUnexpectedToken = function (token, message) { - this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); - }; - Parser.prototype.collectComments = function () { - if (!this.config.comment) { - this.scanner.scanComments(); - } - else { - var comments = this.scanner.scanComments(); - if (comments.length > 0 && this.delegate) { - for (var i = 0; i < comments.length; ++i) { - var e = comments[i]; - var node = void 0; - node = { - type: e.multiLine ? 'BlockComment' : 'LineComment', - value: this.scanner.source.slice(e.slice[0], e.slice[1]) - }; - if (this.config.range) { - node.range = e.range; - } - if (this.config.loc) { - node.loc = e.loc; - } - var metadata = { - start: { - line: e.loc.start.line, - column: e.loc.start.column, - offset: e.range[0] - }, - end: { - line: e.loc.end.line, - column: e.loc.end.column, - offset: e.range[1] - } - }; - this.delegate(node, metadata); - } - } - } - }; - // From internal representation to an external structure - Parser.prototype.getTokenRaw = function (token) { - return this.scanner.source.slice(token.start, token.end); - }; - Parser.prototype.convertToken = function (token) { - var t = { - type: token_1.TokenName[token.type], - value: this.getTokenRaw(token) - }; - if (this.config.range) { - t.range = [token.start, token.end]; - } - if (this.config.loc) { - t.loc = { - start: { - line: this.startMarker.line, - column: this.startMarker.column - }, - end: { - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - } - }; - } - if (token.type === 9 /* RegularExpression */) { - var pattern = token.pattern; - var flags = token.flags; - t.regex = { pattern: pattern, flags: flags }; - } - return t; - }; - Parser.prototype.nextToken = function () { - var token = this.lookahead; - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - this.collectComments(); - if (this.scanner.index !== this.startMarker.index) { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - } - var next = this.scanner.lex(); - this.hasLineTerminator = (token.lineNumber !== next.lineNumber); - if (next && this.context.strict && next.type === 3 /* Identifier */) { - if (this.scanner.isStrictModeReservedWord(next.value)) { - next.type = 4 /* Keyword */; - } - } - this.lookahead = next; - if (this.config.tokens && next.type !== 2 /* EOF */) { - this.tokens.push(this.convertToken(next)); - } - return token; - }; - Parser.prototype.nextRegexToken = function () { - this.collectComments(); - var token = this.scanner.scanRegExp(); - if (this.config.tokens) { - // Pop the previous token, '/' or '/=' - // This is added from the lookahead token. - this.tokens.pop(); - this.tokens.push(this.convertToken(token)); - } - // Prime the next lookahead. - this.lookahead = token; - this.nextToken(); - return token; - }; - Parser.prototype.createNode = function () { - return { - index: this.startMarker.index, - line: this.startMarker.line, - column: this.startMarker.column - }; - }; - Parser.prototype.startNode = function (token, lastLineStart) { - if (lastLineStart === void 0) { lastLineStart = 0; } - var column = token.start - token.lineStart; - var line = token.lineNumber; - if (column < 0) { - column += lastLineStart; - line--; - } - return { - index: token.start, - line: line, - column: column - }; - }; - Parser.prototype.finalize = function (marker, node) { - if (this.config.range) { - node.range = [marker.index, this.lastMarker.index]; - } - if (this.config.loc) { - node.loc = { - start: { - line: marker.line, - column: marker.column, - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column - } - }; - if (this.config.source) { - node.loc.source = this.config.source; - } - } - if (this.delegate) { - var metadata = { - start: { - line: marker.line, - column: marker.column, - offset: marker.index - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column, - offset: this.lastMarker.index - } - }; - this.delegate(node, metadata); - } - return node; - }; - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - Parser.prototype.expect = function (value) { - var token = this.nextToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). - Parser.prototype.expectCommaSeparator = function () { - if (this.config.tolerant) { - var token = this.lookahead; - if (token.type === 7 /* Punctuator */ && token.value === ',') { - this.nextToken(); - } - else if (token.type === 7 /* Punctuator */ && token.value === ';') { - this.nextToken(); - this.tolerateUnexpectedToken(token); - } - else { - this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); - } - } - else { - this.expect(','); - } - }; - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - Parser.prototype.expectKeyword = function (keyword) { - var token = this.nextToken(); - if (token.type !== 4 /* Keyword */ || token.value !== keyword) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next token matches the specified punctuator. - Parser.prototype.match = function (value) { - return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; - }; - // Return true if the next token matches the specified keyword - Parser.prototype.matchKeyword = function (keyword) { - return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; - }; - // Return true if the next token matches the specified contextual keyword - // (where an identifier is sometimes a keyword depending on the context) - Parser.prototype.matchContextualKeyword = function (keyword) { - return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; - }; - // Return true if the next token is an assignment operator - Parser.prototype.matchAssign = function () { - if (this.lookahead.type !== 7 /* Punctuator */) { - return false; - } - var op = this.lookahead.value; - return op === '=' || - op === '*=' || - op === '**=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - }; - // Cover grammar support. - // - // When an assignment expression position starts with an left parenthesis, the determination of the type - // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) - // or the first comma. This situation also defers the determination of all the expressions nested in the pair. - // - // There are three productions that can be parsed in a parentheses pair that needs to be determined - // after the outermost pair is closed. They are: - // - // 1. AssignmentExpression - // 2. BindingElements - // 3. AssignmentTargets - // - // In order to avoid exponential backtracking, we use two flags to denote if the production can be - // binding element or assignment target. - // - // The three productions have the relationship: - // - // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression - // - // with a single exception that CoverInitializedName when used directly in an Expression, generates - // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the - // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. - // - // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not - // effect the current flags. This means the production the parser parses is only used as an expression. Therefore - // the CoverInitializedName check is conducted. - // - // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates - // the flags outside of the parser. This means the production the parser parses is used as a part of a potential - // pattern. The CoverInitializedName check is deferred. - Parser.prototype.isolateCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - if (this.context.firstCoverInitializedNameError !== null) { - this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); - } - this.context.isBindingElement = previousIsBindingElement; - this.context.isAssignmentTarget = previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; - return result; - }; - Parser.prototype.inheritCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; - this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; - return result; - }; - Parser.prototype.consumeSemicolon = function () { - if (this.match(';')) { - this.nextToken(); - } - else if (!this.hasLineTerminator) { - if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { - this.throwUnexpectedToken(this.lookahead); - } - this.lastMarker.index = this.startMarker.index; - this.lastMarker.line = this.startMarker.line; - this.lastMarker.column = this.startMarker.column; - } - }; - // https://tc39.github.io/ecma262/#sec-primary-expression - Parser.prototype.parsePrimaryExpression = function () { - var node = this.createNode(); - var expr; - var token, raw; - switch (this.lookahead.type) { - case 3 /* Identifier */: - if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { - this.tolerateUnexpectedToken(this.lookahead); - } - expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); - break; - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - if (this.context.strict && this.lookahead.octal) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 1 /* BooleanLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); - break; - case 5 /* NullLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(null, raw)); - break; - case 10 /* Template */: - expr = this.parseTemplateLiteral(); - break; - case 7 /* Punctuator */: - switch (this.lookahead.value) { - case '(': - this.context.isBindingElement = false; - expr = this.inheritCoverGrammar(this.parseGroupExpression); - break; - case '[': - expr = this.inheritCoverGrammar(this.parseArrayInitializer); - break; - case '{': - expr = this.inheritCoverGrammar(this.parseObjectInitializer); - break; - case '/': - case '/=': - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.scanner.index = this.startMarker.index; - token = this.nextRegexToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - break; - case 4 /* Keyword */: - if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseIdentifierName(); - } - else if (!this.context.strict && this.matchKeyword('let')) { - expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); - } - else { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - if (this.matchKeyword('function')) { - expr = this.parseFunctionExpression(); - } - else if (this.matchKeyword('this')) { - this.nextToken(); - expr = this.finalize(node, new Node.ThisExpression()); - } - else if (this.matchKeyword('class')) { - expr = this.parseClassExpression(); - } - else { - expr = this.throwUnexpectedToken(this.nextToken()); - } - } - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-array-initializer - Parser.prototype.parseSpreadElement = function () { - var node = this.createNode(); - this.expect('...'); - var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); - return this.finalize(node, new Node.SpreadElement(arg)); - }; - Parser.prototype.parseArrayInitializer = function () { - var node = this.createNode(); - var elements = []; - this.expect('['); - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else if (this.match('...')) { - var element = this.parseSpreadElement(); - if (!this.match(']')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.expect(','); - } - elements.push(element); - } - else { - elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayExpression(elements)); - }; - // https://tc39.github.io/ecma262/#sec-object-initializer - Parser.prototype.parsePropertyMethod = function (params) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = params.simple; - var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); - if (this.context.strict && params.firstRestricted) { - this.tolerateUnexpectedToken(params.firstRestricted, params.message); - } - if (this.context.strict && params.stricted) { - this.tolerateUnexpectedToken(params.stricted, params.message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - return body; - }; - Parser.prototype.parsePropertyMethodFunction = function () { - var isGenerator = false; - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - Parser.prototype.parsePropertyMethodAsyncFunction = function () { - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = false; - this.context.await = true; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); - }; - Parser.prototype.parseObjectPropertyKey = function () { - var node = this.createNode(); - var token = this.nextToken(); - var key; - switch (token.type) { - case 8 /* StringLiteral */: - case 6 /* NumericLiteral */: - if (this.context.strict && token.octal) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); - } - var raw = this.getTokenRaw(token); - key = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 3 /* Identifier */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 4 /* Keyword */: - key = this.finalize(node, new Node.Identifier(token.value)); - break; - case 7 /* Punctuator */: - if (token.value === '[') { - key = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.expect(']'); - } - else { - key = this.throwUnexpectedToken(token); - } - break; - default: - key = this.throwUnexpectedToken(token); - } - return key; - }; - Parser.prototype.isPropertyKey = function (key, value) { - return (key.type === syntax_1.Syntax.Identifier && key.name === value) || - (key.type === syntax_1.Syntax.Literal && key.value === value); - }; - Parser.prototype.parseObjectProperty = function (hasProto) { - var node = this.createNode(); - var token = this.lookahead; - var kind; - var key = null; - var value = null; - var computed = false; - var method = false; - var shorthand = false; - var isAsync = false; - if (token.type === 3 /* Identifier */) { - var id = token.value; - this.nextToken(); - computed = this.match('['); - isAsync = !this.hasLineTerminator && (id === 'async') && - !this.match(':') && !this.match('(') && !this.match('*') && !this.match(','); - key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); - } - else if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - else { - if (!key) { - this.throwUnexpectedToken(this.lookahead); - } - kind = 'init'; - if (this.match(':') && !isAsync) { - if (!computed && this.isPropertyKey(key, '__proto__')) { - if (hasProto.value) { - this.tolerateError(messages_1.Messages.DuplicateProtoProperty); - } - hasProto.value = true; - } - this.nextToken(); - value = this.inheritCoverGrammar(this.parseAssignmentExpression); - } - else if (this.match('(')) { - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - else if (token.type === 3 /* Identifier */) { - var id = this.finalize(node, new Node.Identifier(token.value)); - if (this.match('=')) { - this.context.firstCoverInitializedNameError = this.lookahead; - this.nextToken(); - shorthand = true; - var init = this.isolateCoverGrammar(this.parseAssignmentExpression); - value = this.finalize(node, new Node.AssignmentPattern(id, init)); - } - else { - shorthand = true; - value = id; - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectInitializer = function () { - var node = this.createNode(); - this.expect('{'); - var properties = []; - var hasProto = { value: false }; - while (!this.match('}')) { - properties.push(this.parseObjectProperty(hasProto)); - if (!this.match('}')) { - this.expectCommaSeparator(); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectExpression(properties)); - }; - // https://tc39.github.io/ecma262/#sec-template-literals - Parser.prototype.parseTemplateHead = function () { - assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateElement = function () { - if (this.lookahead.type !== 10 /* Template */) { - this.throwUnexpectedToken(); - } - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateLiteral = function () { - var node = this.createNode(); - var expressions = []; - var quasis = []; - var quasi = this.parseTemplateHead(); - quasis.push(quasi); - while (!quasi.tail) { - expressions.push(this.parseExpression()); - quasi = this.parseTemplateElement(); - quasis.push(quasi); - } - return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); - }; - // https://tc39.github.io/ecma262/#sec-grouping-operator - Parser.prototype.reinterpretExpressionAsPattern = function (expr) { - switch (expr.type) { - case syntax_1.Syntax.Identifier: - case syntax_1.Syntax.MemberExpression: - case syntax_1.Syntax.RestElement: - case syntax_1.Syntax.AssignmentPattern: - break; - case syntax_1.Syntax.SpreadElement: - expr.type = syntax_1.Syntax.RestElement; - this.reinterpretExpressionAsPattern(expr.argument); - break; - case syntax_1.Syntax.ArrayExpression: - expr.type = syntax_1.Syntax.ArrayPattern; - for (var i = 0; i < expr.elements.length; i++) { - if (expr.elements[i] !== null) { - this.reinterpretExpressionAsPattern(expr.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectExpression: - expr.type = syntax_1.Syntax.ObjectPattern; - for (var i = 0; i < expr.properties.length; i++) { - this.reinterpretExpressionAsPattern(expr.properties[i].value); - } - break; - case syntax_1.Syntax.AssignmentExpression: - expr.type = syntax_1.Syntax.AssignmentPattern; - delete expr.operator; - this.reinterpretExpressionAsPattern(expr.left); - break; - default: - // Allow other node type for tolerant parsing. - break; - } - }; - Parser.prototype.parseGroupExpression = function () { - var expr; - this.expect('('); - if (this.match(')')) { - this.nextToken(); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [], - async: false - }; - } - else { - var startToken = this.lookahead; - var params = []; - if (this.match('...')) { - expr = this.parseRestElement(params); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - else { - var arrow = false; - this.context.isBindingElement = true; - expr = this.inheritCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - this.context.isAssignmentTarget = false; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - if (this.match(')')) { - this.nextToken(); - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else if (this.match('...')) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - expressions.push(this.parseRestElement(params)); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - this.context.isBindingElement = false; - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else { - expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - } - if (arrow) { - break; - } - } - if (!arrow) { - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - } - if (!arrow) { - this.expect(')'); - if (this.match('=>')) { - if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - if (!arrow) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - if (expr.type === syntax_1.Syntax.SequenceExpression) { - for (var i = 0; i < expr.expressions.length; i++) { - this.reinterpretExpressionAsPattern(expr.expressions[i]); - } - } - else { - this.reinterpretExpressionAsPattern(expr); - } - var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); - expr = { - type: ArrowParameterPlaceHolder, - params: parameters, - async: false - }; - } - } - this.context.isBindingElement = false; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions - Parser.prototype.parseArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAssignmentExpression); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.isIdentifierName = function (token) { - return token.type === 3 /* Identifier */ || - token.type === 4 /* Keyword */ || - token.type === 1 /* BooleanLiteral */ || - token.type === 5 /* NullLiteral */; - }; - Parser.prototype.parseIdentifierName = function () { - var node = this.createNode(); - var token = this.nextToken(); - if (!this.isIdentifierName(token)) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseNewExpression = function () { - var node = this.createNode(); - var id = this.parseIdentifierName(); - assert_1.assert(id.name === 'new', 'New expression must start with `new`'); - var expr; - if (this.match('.')) { - this.nextToken(); - if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { - var property = this.parseIdentifierName(); - expr = new Node.MetaProperty(id, property); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); - var args = this.match('(') ? this.parseArguments() : []; - expr = new Node.NewExpression(callee, args); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return this.finalize(node, expr); - }; - Parser.prototype.parseAsyncArgument = function () { - var arg = this.parseAssignmentExpression(); - this.context.firstCoverInitializedNameError = null; - return arg; - }; - Parser.prototype.parseAsyncArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAsyncArgument); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { - var startToken = this.lookahead; - var maybeAsync = this.matchContextualKeyword('async'); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var expr; - if (this.matchKeyword('super') && this.context.inFunctionBody) { - expr = this.createNode(); - this.nextToken(); - expr = this.finalize(expr, new Node.Super()); - if (!this.match('(') && !this.match('.') && !this.match('[')) { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - } - while (true) { - if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); - } - else if (this.match('(')) { - var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); - this.context.isBindingElement = false; - this.context.isAssignmentTarget = false; - var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); - expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); - if (asyncArrow && this.match('=>')) { - for (var i = 0; i < args.length; ++i) { - this.reinterpretExpressionAsPattern(args[i]); - } - expr = { - type: ArrowParameterPlaceHolder, - params: args, - async: true - }; - } - } - else if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - this.context.allowIn = previousAllowIn; - return expr; - }; - Parser.prototype.parseSuper = function () { - var node = this.createNode(); - this.expectKeyword('super'); - if (!this.match('[') && !this.match('.')) { - this.throwUnexpectedToken(this.lookahead); - } - return this.finalize(node, new Node.Super()); - }; - Parser.prototype.parseLeftHandSideExpression = function () { - assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); - var node = this.startNode(this.lookahead); - var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : - this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - while (true) { - if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); - } - else if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-update-expressions - Parser.prototype.parseUpdateExpression = function () { - var expr; - var startToken = this.lookahead; - if (this.match('++') || this.match('--')) { - var node = this.startNode(startToken); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPrefix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - var prefix = true; - expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { - if (this.match('++') || this.match('--')) { - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPostfix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var operator = this.nextToken().value; - var prefix = false; - expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-unary-operators - Parser.prototype.parseAwaitExpression = function () { - var node = this.createNode(); - this.nextToken(); - var argument = this.parseUnaryExpression(); - return this.finalize(node, new Node.AwaitExpression(argument)); - }; - Parser.prototype.parseUnaryExpression = function () { - var expr; - if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || - this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { - var node = this.startNode(this.lookahead); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); - if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { - this.tolerateError(messages_1.Messages.StrictDelete); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else if (this.context.await && this.matchContextualKeyword('await')) { - expr = this.parseAwaitExpression(); - } - else { - expr = this.parseUpdateExpression(); - } - return expr; - }; - Parser.prototype.parseExponentiationExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-exp-operator - // https://tc39.github.io/ecma262/#sec-multiplicative-operators - // https://tc39.github.io/ecma262/#sec-additive-operators - // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators - // https://tc39.github.io/ecma262/#sec-relational-operators - // https://tc39.github.io/ecma262/#sec-equality-operators - // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators - // https://tc39.github.io/ecma262/#sec-binary-logical-operators - Parser.prototype.binaryPrecedence = function (token) { - var op = token.value; - var precedence; - if (token.type === 7 /* Punctuator */) { - precedence = this.operatorPrecedence[op] || 0; - } - else if (token.type === 4 /* Keyword */) { - precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; - } - else { - precedence = 0; - } - return precedence; - }; - Parser.prototype.parseBinaryExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); - var token = this.lookahead; - var prec = this.binaryPrecedence(token); - if (prec > 0) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var markers = [startToken, this.lookahead]; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - var stack = [left, token.value, right]; - var precedences = [prec]; - while (true) { - prec = this.binaryPrecedence(this.lookahead); - if (prec <= 0) { - break; - } - // Reduce: make a binary expression from the three topmost entries. - while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { - right = stack.pop(); - var operator = stack.pop(); - precedences.pop(); - left = stack.pop(); - markers.pop(); - var node = this.startNode(markers[markers.length - 1]); - stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); - } - // Shift. - stack.push(this.nextToken().value); - precedences.push(prec); - markers.push(this.lookahead); - stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); - } - // Final reduce to clean-up the stack. - var i = stack.length - 1; - expr = stack[i]; - var lastMarker = markers.pop(); - while (i > 1) { - var marker = markers.pop(); - var lastLineStart = lastMarker && lastMarker.lineStart; - var node = this.startNode(marker, lastLineStart); - var operator = stack[i - 1]; - expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); - i -= 2; - lastMarker = marker; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-conditional-operator - Parser.prototype.parseConditionalExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseBinaryExpression); - if (this.match('?')) { - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - this.expect(':'); - var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-assignment-operators - Parser.prototype.checkPatternParam = function (options, param) { - switch (param.type) { - case syntax_1.Syntax.Identifier: - this.validateParam(options, param, param.name); - break; - case syntax_1.Syntax.RestElement: - this.checkPatternParam(options, param.argument); - break; - case syntax_1.Syntax.AssignmentPattern: - this.checkPatternParam(options, param.left); - break; - case syntax_1.Syntax.ArrayPattern: - for (var i = 0; i < param.elements.length; i++) { - if (param.elements[i] !== null) { - this.checkPatternParam(options, param.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectPattern: - for (var i = 0; i < param.properties.length; i++) { - this.checkPatternParam(options, param.properties[i].value); - } - break; - default: - break; - } - options.simple = options.simple && (param instanceof Node.Identifier); - }; - Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { - var params = [expr]; - var options; - var asyncArrow = false; - switch (expr.type) { - case syntax_1.Syntax.Identifier: - break; - case ArrowParameterPlaceHolder: - params = expr.params; - asyncArrow = expr.async; - break; - default: - return null; - } - options = { - simple: true, - paramSet: {} - }; - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.AssignmentPattern) { - if (param.right.type === syntax_1.Syntax.YieldExpression) { - if (param.right.argument) { - this.throwUnexpectedToken(this.lookahead); - } - param.right.type = syntax_1.Syntax.Identifier; - param.right.name = 'yield'; - delete param.right.argument; - delete param.right.delegate; - } - } - else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { - this.throwUnexpectedToken(this.lookahead); - } - this.checkPatternParam(options, param); - params[i] = param; - } - if (this.context.strict || !this.context.allowYield) { - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.YieldExpression) { - this.throwUnexpectedToken(this.lookahead); - } - } - } - if (options.message === messages_1.Messages.StrictParamDupe) { - var token = this.context.strict ? options.stricted : options.firstRestricted; - this.throwUnexpectedToken(token, options.message); - } - return { - simple: options.simple, - params: params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.parseAssignmentExpression = function () { - var expr; - if (!this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseYieldExpression(); - } - else { - var startToken = this.lookahead; - var token = startToken; - expr = this.parseConditionalExpression(); - if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { - if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { - var arg = this.parsePrimaryExpression(); - this.reinterpretExpressionAsPattern(arg); - expr = { - type: ArrowParameterPlaceHolder, - params: [arg], - async: true - }; - } - } - if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { - // https://tc39.github.io/ecma262/#sec-arrow-function-definitions - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var isAsync = expr.async; - var list = this.reinterpretAsCoverFormalsList(expr); - if (list) { - if (this.hasLineTerminator) { - this.tolerateUnexpectedToken(this.lookahead); - } - this.context.firstCoverInitializedNameError = null; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = list.simple; - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = true; - this.context.await = isAsync; - var node = this.startNode(startToken); - this.expect('=>'); - var body = void 0; - if (this.match('{')) { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - body = this.parseFunctionSourceElements(); - this.context.allowIn = previousAllowIn; - } - else { - body = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - var expression = body.type !== syntax_1.Syntax.BlockStatement; - if (this.context.strict && list.firstRestricted) { - this.throwUnexpectedToken(list.firstRestricted, list.message); - } - if (this.context.strict && list.stricted) { - this.tolerateUnexpectedToken(list.stricted, list.message); - } - expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : - this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - } - } - else { - if (this.matchAssign()) { - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { - var id = expr; - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); - } - if (this.scanner.isStrictModeReservedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - } - if (!this.match('=')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - this.reinterpretExpressionAsPattern(expr); - } - token = this.nextToken(); - var operator = token.value; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); - this.context.firstCoverInitializedNameError = null; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-comma-operator - Parser.prototype.parseExpression = function () { - var startToken = this.lookahead; - var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-block - Parser.prototype.parseStatementListItem = function () { - var statement; - this.context.isAssignmentTarget = true; - this.context.isBindingElement = true; - if (this.lookahead.type === 4 /* Keyword */) { - switch (this.lookahead.value) { - case 'export': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); - } - statement = this.parseExportDeclaration(); - break; - case 'import': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); - } - statement = this.parseImportDeclaration(); - break; - case 'const': - statement = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'class': - statement = this.parseClassDeclaration(); - break; - case 'let': - statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); - break; - default: - statement = this.parseStatement(); - break; - } - } - else { - statement = this.parseStatement(); - } - return statement; - }; - Parser.prototype.parseBlock = function () { - var node = this.createNode(); - this.expect('{'); - var block = []; - while (true) { - if (this.match('}')) { - break; - } - block.push(this.parseStatementListItem()); - } - this.expect('}'); - return this.finalize(node, new Node.BlockStatement(block)); - }; - // https://tc39.github.io/ecma262/#sec-let-and-const-declarations - Parser.prototype.parseLexicalBinding = function (kind, options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, kind); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (kind === 'const') { - if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else { - this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); - } - } - } - else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { - this.expect('='); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseBindingList = function (kind, options) { - var list = [this.parseLexicalBinding(kind, options)]; - while (this.match(',')) { - this.nextToken(); - list.push(this.parseLexicalBinding(kind, options)); - } - return list; - }; - Parser.prototype.isLexicalDeclaration = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - return (next.type === 3 /* Identifier */) || - (next.type === 7 /* Punctuator */ && next.value === '[') || - (next.type === 7 /* Punctuator */ && next.value === '{') || - (next.type === 4 /* Keyword */ && next.value === 'let') || - (next.type === 4 /* Keyword */ && next.value === 'yield'); - }; - Parser.prototype.parseLexicalDeclaration = function (options) { - var node = this.createNode(); - var kind = this.nextToken().value; - assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); - var declarations = this.parseBindingList(kind, options); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); - }; - // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns - Parser.prototype.parseBindingRestElement = function (params, kind) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params, kind); - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseArrayPattern = function (params, kind) { - var node = this.createNode(); - this.expect('['); - var elements = []; - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else { - if (this.match('...')) { - elements.push(this.parseBindingRestElement(params, kind)); - break; - } - else { - elements.push(this.parsePatternWithDefault(params, kind)); - } - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayPattern(elements)); - }; - Parser.prototype.parsePropertyPattern = function (params, kind) { - var node = this.createNode(); - var computed = false; - var shorthand = false; - var method = false; - var key; - var value; - if (this.lookahead.type === 3 /* Identifier */) { - var keyToken = this.lookahead; - key = this.parseVariableIdentifier(); - var init = this.finalize(node, new Node.Identifier(keyToken.value)); - if (this.match('=')) { - params.push(keyToken); - shorthand = true; - this.nextToken(); - var expr = this.parseAssignmentExpression(); - value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); - } - else if (!this.match(':')) { - params.push(keyToken); - shorthand = true; - value = init; - } - else { - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectPattern = function (params, kind) { - var node = this.createNode(); - var properties = []; - this.expect('{'); - while (!this.match('}')) { - properties.push(this.parsePropertyPattern(params, kind)); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectPattern(properties)); - }; - Parser.prototype.parsePattern = function (params, kind) { - var pattern; - if (this.match('[')) { - pattern = this.parseArrayPattern(params, kind); - } - else if (this.match('{')) { - pattern = this.parseObjectPattern(params, kind); - } - else { - if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); - } - params.push(this.lookahead); - pattern = this.parseVariableIdentifier(kind); - } - return pattern; - }; - Parser.prototype.parsePatternWithDefault = function (params, kind) { - var startToken = this.lookahead; - var pattern = this.parsePattern(params, kind); - if (this.match('=')) { - this.nextToken(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowYield = previousAllowYield; - pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); - } - return pattern; - }; - // https://tc39.github.io/ecma262/#sec-variable-statement - Parser.prototype.parseVariableIdentifier = function (kind) { - var node = this.createNode(); - var token = this.nextToken(); - if (token.type === 4 /* Keyword */ && token.value === 'yield') { - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else if (!this.context.allowYield) { - this.throwUnexpectedToken(token); - } - } - else if (token.type !== 3 /* Identifier */) { - if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else { - if (this.context.strict || token.value !== 'let' || kind !== 'var') { - this.throwUnexpectedToken(token); - } - } - } - else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { - this.tolerateUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseVariableDeclaration = function (options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, 'var'); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { - this.expect('='); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseVariableDeclarationList = function (options) { - var opt = { inFor: options.inFor }; - var list = []; - list.push(this.parseVariableDeclaration(opt)); - while (this.match(',')) { - this.nextToken(); - list.push(this.parseVariableDeclaration(opt)); - } - return list; - }; - Parser.prototype.parseVariableStatement = function () { - var node = this.createNode(); - this.expectKeyword('var'); - var declarations = this.parseVariableDeclarationList({ inFor: false }); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); - }; - // https://tc39.github.io/ecma262/#sec-empty-statement - Parser.prototype.parseEmptyStatement = function () { - var node = this.createNode(); - this.expect(';'); - return this.finalize(node, new Node.EmptyStatement()); - }; - // https://tc39.github.io/ecma262/#sec-expression-statement - Parser.prototype.parseExpressionStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ExpressionStatement(expr)); - }; - // https://tc39.github.io/ecma262/#sec-if-statement - Parser.prototype.parseIfClause = function () { - if (this.context.strict && this.matchKeyword('function')) { - this.tolerateError(messages_1.Messages.StrictFunction); - } - return this.parseStatement(); - }; - Parser.prototype.parseIfStatement = function () { - var node = this.createNode(); - var consequent; - var alternate = null; - this.expectKeyword('if'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - consequent = this.parseIfClause(); - if (this.matchKeyword('else')) { - this.nextToken(); - alternate = this.parseIfClause(); - } - } - return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); - }; - // https://tc39.github.io/ecma262/#sec-do-while-statement - Parser.prototype.parseDoWhileStatement = function () { - var node = this.createNode(); - this.expectKeyword('do'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - var body = this.parseStatement(); - this.context.inIteration = previousInIteration; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - } - else { - this.expect(')'); - if (this.match(';')) { - this.nextToken(); - } - } - return this.finalize(node, new Node.DoWhileStatement(body, test)); - }; - // https://tc39.github.io/ecma262/#sec-while-statement - Parser.prototype.parseWhileStatement = function () { - var node = this.createNode(); - var body; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.parseStatement(); - this.context.inIteration = previousInIteration; - } - return this.finalize(node, new Node.WhileStatement(test, body)); - }; - // https://tc39.github.io/ecma262/#sec-for-statement - // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements - Parser.prototype.parseForStatement = function () { - var init = null; - var test = null; - var update = null; - var forIn = true; - var left, right; - var node = this.createNode(); - this.expectKeyword('for'); - this.expect('('); - if (this.match(';')) { - this.nextToken(); - } - else { - if (this.matchKeyword('var')) { - init = this.createNode(); - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseVariableDeclarationList({ inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && this.matchKeyword('in')) { - var decl = declarations[0]; - if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { - this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); - } - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.expect(';'); - } - } - else if (this.matchKeyword('const') || this.matchKeyword('let')) { - init = this.createNode(); - var kind = this.nextToken().value; - if (!this.context.strict && this.lookahead.value === 'in') { - init = this.finalize(init, new Node.Identifier(kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseBindingList(kind, { inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - this.consumeSemicolon(); - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - } - } - } - else { - var initStartToken = this.lookahead; - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - init = this.inheritCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - if (this.matchKeyword('in')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForIn); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseExpression(); - init = null; - } - else if (this.matchContextualKeyword('of')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - if (this.match(',')) { - var initSeq = [init]; - while (this.match(',')) { - this.nextToken(); - initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); - } - this.expect(';'); - } - } - } - if (typeof left === 'undefined') { - if (!this.match(';')) { - test = this.parseExpression(); - } - this.expect(';'); - if (!this.match(')')) { - update = this.parseExpression(); - } - } - var body; - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.isolateCoverGrammar(this.parseStatement); - this.context.inIteration = previousInIteration; - } - return (typeof left === 'undefined') ? - this.finalize(node, new Node.ForStatement(init, test, update, body)) : - forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : - this.finalize(node, new Node.ForOfStatement(left, right, body)); - }; - // https://tc39.github.io/ecma262/#sec-continue-statement - Parser.prototype.parseContinueStatement = function () { - var node = this.createNode(); - this.expectKeyword('continue'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - label = id; - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration) { - this.throwError(messages_1.Messages.IllegalContinue); - } - return this.finalize(node, new Node.ContinueStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-break-statement - Parser.prototype.parseBreakStatement = function () { - var node = this.createNode(); - this.expectKeyword('break'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - label = id; - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration && !this.context.inSwitch) { - this.throwError(messages_1.Messages.IllegalBreak); - } - return this.finalize(node, new Node.BreakStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-return-statement - Parser.prototype.parseReturnStatement = function () { - if (!this.context.inFunctionBody) { - this.tolerateError(messages_1.Messages.IllegalReturn); - } - var node = this.createNode(); - this.expectKeyword('return'); - var hasArgument = (!this.match(';') && !this.match('}') && - !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) || - this.lookahead.type === 8 /* StringLiteral */ || - this.lookahead.type === 10 /* Template */; - var argument = hasArgument ? this.parseExpression() : null; - this.consumeSemicolon(); - return this.finalize(node, new Node.ReturnStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-with-statement - Parser.prototype.parseWithStatement = function () { - if (this.context.strict) { - this.tolerateError(messages_1.Messages.StrictModeWith); - } - var node = this.createNode(); - var body; - this.expectKeyword('with'); - this.expect('('); - var object = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - body = this.parseStatement(); - } - return this.finalize(node, new Node.WithStatement(object, body)); - }; - // https://tc39.github.io/ecma262/#sec-switch-statement - Parser.prototype.parseSwitchCase = function () { - var node = this.createNode(); - var test; - if (this.matchKeyword('default')) { - this.nextToken(); - test = null; - } - else { - this.expectKeyword('case'); - test = this.parseExpression(); - } - this.expect(':'); - var consequent = []; - while (true) { - if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { - break; - } - consequent.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.SwitchCase(test, consequent)); - }; - Parser.prototype.parseSwitchStatement = function () { - var node = this.createNode(); - this.expectKeyword('switch'); - this.expect('('); - var discriminant = this.parseExpression(); - this.expect(')'); - var previousInSwitch = this.context.inSwitch; - this.context.inSwitch = true; - var cases = []; - var defaultFound = false; - this.expect('{'); - while (true) { - if (this.match('}')) { - break; - } - var clause = this.parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - this.expect('}'); - this.context.inSwitch = previousInSwitch; - return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); - }; - // https://tc39.github.io/ecma262/#sec-labelled-statements - Parser.prototype.parseLabelledStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - var statement; - if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { - this.nextToken(); - var id = expr; - var key = '$' + id.name; - if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); - } - this.context.labelSet[key] = true; - var body = void 0; - if (this.matchKeyword('class')) { - this.tolerateUnexpectedToken(this.lookahead); - body = this.parseClassDeclaration(); - } - else if (this.matchKeyword('function')) { - var token = this.lookahead; - var declaration = this.parseFunctionDeclaration(); - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); - } - else if (declaration.generator) { - this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); - } - body = declaration; - } - else { - body = this.parseStatement(); - } - delete this.context.labelSet[key]; - statement = new Node.LabeledStatement(id, body); - } - else { - this.consumeSemicolon(); - statement = new Node.ExpressionStatement(expr); - } - return this.finalize(node, statement); - }; - // https://tc39.github.io/ecma262/#sec-throw-statement - Parser.prototype.parseThrowStatement = function () { - var node = this.createNode(); - this.expectKeyword('throw'); - if (this.hasLineTerminator) { - this.throwError(messages_1.Messages.NewlineAfterThrow); - } - var argument = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ThrowStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-try-statement - Parser.prototype.parseCatchClause = function () { - var node = this.createNode(); - this.expectKeyword('catch'); - this.expect('('); - if (this.match(')')) { - this.throwUnexpectedToken(this.lookahead); - } - var params = []; - var param = this.parsePattern(params); - var paramMap = {}; - for (var i = 0; i < params.length; i++) { - var key = '$' + params[i].value; - if (Object.prototype.hasOwnProperty.call(paramMap, key)) { - this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); - } - paramMap[key] = true; - } - if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(param.name)) { - this.tolerateError(messages_1.Messages.StrictCatchVariable); - } - } - this.expect(')'); - var body = this.parseBlock(); - return this.finalize(node, new Node.CatchClause(param, body)); - }; - Parser.prototype.parseFinallyClause = function () { - this.expectKeyword('finally'); - return this.parseBlock(); - }; - Parser.prototype.parseTryStatement = function () { - var node = this.createNode(); - this.expectKeyword('try'); - var block = this.parseBlock(); - var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; - var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; - if (!handler && !finalizer) { - this.throwError(messages_1.Messages.NoCatchOrFinally); - } - return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); - }; - // https://tc39.github.io/ecma262/#sec-debugger-statement - Parser.prototype.parseDebuggerStatement = function () { - var node = this.createNode(); - this.expectKeyword('debugger'); - this.consumeSemicolon(); - return this.finalize(node, new Node.DebuggerStatement()); - }; - // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations - Parser.prototype.parseStatement = function () { - var statement; - switch (this.lookahead.type) { - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 10 /* Template */: - case 9 /* RegularExpression */: - statement = this.parseExpressionStatement(); - break; - case 7 /* Punctuator */: - var value = this.lookahead.value; - if (value === '{') { - statement = this.parseBlock(); - } - else if (value === '(') { - statement = this.parseExpressionStatement(); - } - else if (value === ';') { - statement = this.parseEmptyStatement(); - } - else { - statement = this.parseExpressionStatement(); - } - break; - case 3 /* Identifier */: - statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); - break; - case 4 /* Keyword */: - switch (this.lookahead.value) { - case 'break': - statement = this.parseBreakStatement(); - break; - case 'continue': - statement = this.parseContinueStatement(); - break; - case 'debugger': - statement = this.parseDebuggerStatement(); - break; - case 'do': - statement = this.parseDoWhileStatement(); - break; - case 'for': - statement = this.parseForStatement(); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'if': - statement = this.parseIfStatement(); - break; - case 'return': - statement = this.parseReturnStatement(); - break; - case 'switch': - statement = this.parseSwitchStatement(); - break; - case 'throw': - statement = this.parseThrowStatement(); - break; - case 'try': - statement = this.parseTryStatement(); - break; - case 'var': - statement = this.parseVariableStatement(); - break; - case 'while': - statement = this.parseWhileStatement(); - break; - case 'with': - statement = this.parseWithStatement(); - break; - default: - statement = this.parseExpressionStatement(); - break; - } - break; - default: - statement = this.throwUnexpectedToken(this.lookahead); - } - return statement; - }; - // https://tc39.github.io/ecma262/#sec-function-definitions - Parser.prototype.parseFunctionSourceElements = function () { - var node = this.createNode(); - this.expect('{'); - var body = this.parseDirectivePrologues(); - var previousLabelSet = this.context.labelSet; - var previousInIteration = this.context.inIteration; - var previousInSwitch = this.context.inSwitch; - var previousInFunctionBody = this.context.inFunctionBody; - this.context.labelSet = {}; - this.context.inIteration = false; - this.context.inSwitch = false; - this.context.inFunctionBody = true; - while (this.lookahead.type !== 2 /* EOF */) { - if (this.match('}')) { - break; - } - body.push(this.parseStatementListItem()); - } - this.expect('}'); - this.context.labelSet = previousLabelSet; - this.context.inIteration = previousInIteration; - this.context.inSwitch = previousInSwitch; - this.context.inFunctionBody = previousInFunctionBody; - return this.finalize(node, new Node.BlockStatement(body)); - }; - Parser.prototype.validateParam = function (options, param, name) { - var key = '$' + name; - if (this.context.strict) { - if (this.scanner.isRestrictedWord(name)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - else if (!options.firstRestricted) { - if (this.scanner.isRestrictedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictParamName; - } - else if (this.scanner.isStrictModeReservedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictReservedWord; - } - else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - /* istanbul ignore next */ - if (typeof Object.defineProperty === 'function') { - Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); - } - else { - options.paramSet[key] = true; - } - }; - Parser.prototype.parseRestElement = function (params) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params); - if (this.match('=')) { - this.throwError(messages_1.Messages.DefaultRestParameter); - } - if (!this.match(')')) { - this.throwError(messages_1.Messages.ParameterAfterRestParameter); - } - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseFormalParameter = function (options) { - var params = []; - var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); - for (var i = 0; i < params.length; i++) { - this.validateParam(options, params[i], params[i].value); - } - options.simple = options.simple && (param instanceof Node.Identifier); - options.params.push(param); - }; - Parser.prototype.parseFormalParameters = function (firstRestricted) { - var options; - options = { - simple: true, - params: [], - firstRestricted: firstRestricted - }; - this.expect('('); - if (!this.match(')')) { - options.paramSet = {}; - while (this.lookahead.type !== 2 /* EOF */) { - this.parseFormalParameter(options); - if (this.match(')')) { - break; - } - this.expect(','); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return { - simple: options.simple, - params: options.params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.matchAsyncFunction = function () { - var match = this.matchContextualKeyword('async'); - if (match) { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); - } - return match; - }; - Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted = null; - if (!identifierIsOptional || !this.match('(')) { - var token = this.lookahead; - id = this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : - this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); - }; - Parser.prototype.parseFunctionExpression = function () { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted; - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - if (!this.match('(')) { - var token = this.lookahead; - id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : - this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive - Parser.prototype.parseDirective = function () { - var token = this.lookahead; - var node = this.createNode(); - var expr = this.parseExpression(); - var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; - this.consumeSemicolon(); - return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); - }; - Parser.prototype.parseDirectivePrologues = function () { - var firstRestricted = null; - var body = []; - while (true) { - var token = this.lookahead; - if (token.type !== 8 /* StringLiteral */) { - break; - } - var statement = this.parseDirective(); - body.push(statement); - var directive = statement.directive; - if (typeof directive !== 'string') { - break; - } - if (directive === 'use strict') { - this.context.strict = true; - if (firstRestricted) { - this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); - } - if (!this.context.allowStrictDirective) { - this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); - } - } - else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - return body; - }; - // https://tc39.github.io/ecma262/#sec-method-definitions - Parser.prototype.qualifiedPropertyName = function (token) { - switch (token.type) { - case 3 /* Identifier */: - case 8 /* StringLiteral */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 4 /* Keyword */: - return true; - case 7 /* Punctuator */: - return token.value === '['; - default: - break; - } - return false; - }; - Parser.prototype.parseGetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length > 0) { - this.tolerateError(messages_1.Messages.BadGetterArity); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseSetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length !== 1) { - this.tolerateError(messages_1.Messages.BadSetterArity); - } - else if (formalParameters.params[0] instanceof Node.RestElement) { - this.tolerateError(messages_1.Messages.BadSetterRestParameter); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseGeneratorMethod = function () { - var node = this.createNode(); - var isGenerator = true; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var params = this.parseFormalParameters(); - this.context.allowYield = false; - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-generator-function-definitions - Parser.prototype.isStartOfExpression = function () { - var start = true; - var value = this.lookahead.value; - switch (this.lookahead.type) { - case 7 /* Punctuator */: - start = (value === '[') || (value === '(') || (value === '{') || - (value === '+') || (value === '-') || - (value === '!') || (value === '~') || - (value === '++') || (value === '--') || - (value === '/') || (value === '/='); // regular expression literal - break; - case 4 /* Keyword */: - start = (value === 'class') || (value === 'delete') || - (value === 'function') || (value === 'let') || (value === 'new') || - (value === 'super') || (value === 'this') || (value === 'typeof') || - (value === 'void') || (value === 'yield'); - break; - default: - break; - } - return start; - }; - Parser.prototype.parseYieldExpression = function () { - var node = this.createNode(); - this.expectKeyword('yield'); - var argument = null; - var delegate = false; - if (!this.hasLineTerminator) { - var previousAllowYield = this.context.allowYield; - this.context.allowYield = false; - delegate = this.match('*'); - if (delegate) { - this.nextToken(); - argument = this.parseAssignmentExpression(); - } - else if (this.isStartOfExpression()) { - argument = this.parseAssignmentExpression(); - } - this.context.allowYield = previousAllowYield; - } - return this.finalize(node, new Node.YieldExpression(argument, delegate)); - }; - // https://tc39.github.io/ecma262/#sec-class-definitions - Parser.prototype.parseClassElement = function (hasConstructor) { - var token = this.lookahead; - var node = this.createNode(); - var kind = ''; - var key = null; - var value = null; - var computed = false; - var method = false; - var isStatic = false; - var isAsync = false; - if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - var id = key; - if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { - token = this.lookahead; - isStatic = true; - computed = this.match('['); - if (this.match('*')) { - this.nextToken(); - } - else { - key = this.parseObjectPropertyKey(); - } - } - if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { - var punctuator = this.lookahead.value; - if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { - isAsync = true; - token = this.lookahead; - key = this.parseObjectPropertyKey(); - if (token.type === 3 /* Identifier */ && token.value === 'constructor') { - this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); - } - } - } - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */) { - if (token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - if (!kind && key && this.match('(')) { - kind = 'init'; - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - if (!kind) { - this.throwUnexpectedToken(this.lookahead); - } - if (kind === 'init') { - kind = 'method'; - } - if (!computed) { - if (isStatic && this.isPropertyKey(key, 'prototype')) { - this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); - } - if (!isStatic && this.isPropertyKey(key, 'constructor')) { - if (kind !== 'method' || !method || (value && value.generator)) { - this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); - } - if (hasConstructor.value) { - this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); - } - else { - hasConstructor.value = true; - } - kind = 'constructor'; - } - } - return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); - }; - Parser.prototype.parseClassElementList = function () { - var body = []; - var hasConstructor = { value: false }; - this.expect('{'); - while (!this.match('}')) { - if (this.match(';')) { - this.nextToken(); - } - else { - body.push(this.parseClassElement(hasConstructor)); - } - } - this.expect('}'); - return body; - }; - Parser.prototype.parseClassBody = function () { - var node = this.createNode(); - var elementList = this.parseClassElementList(); - return this.finalize(node, new Node.ClassBody(elementList)); - }; - Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); - }; - Parser.prototype.parseClassExpression = function () { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); - }; - // https://tc39.github.io/ecma262/#sec-scripts - // https://tc39.github.io/ecma262/#sec-modules - Parser.prototype.parseModule = function () { - this.context.strict = true; - this.context.isModule = true; - this.scanner.isModule = true; - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Module(body)); - }; - Parser.prototype.parseScript = function () { - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Script(body)); - }; - // https://tc39.github.io/ecma262/#sec-imports - Parser.prototype.parseModuleSpecifier = function () { - var node = this.createNode(); - if (this.lookahead.type !== 8 /* StringLiteral */) { - this.throwError(messages_1.Messages.InvalidModuleSpecifier); - } - var token = this.nextToken(); - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - // import {} ...; - Parser.prototype.parseImportSpecifier = function () { - var node = this.createNode(); - var imported; - var local; - if (this.lookahead.type === 3 /* Identifier */) { - imported = this.parseVariableIdentifier(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - } - else { - imported = this.parseIdentifierName(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.ImportSpecifier(local, imported)); - }; - // {foo, bar as bas} - Parser.prototype.parseNamedImports = function () { - this.expect('{'); - var specifiers = []; - while (!this.match('}')) { - specifiers.push(this.parseImportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return specifiers; - }; - // import ...; - Parser.prototype.parseImportDefaultSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportDefaultSpecifier(local)); - }; - // import <* as foo> ...; - Parser.prototype.parseImportNamespaceSpecifier = function () { - var node = this.createNode(); - this.expect('*'); - if (!this.matchContextualKeyword('as')) { - this.throwError(messages_1.Messages.NoAsAfterImportNamespace); - } - this.nextToken(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); - }; - Parser.prototype.parseImportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalImportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('import'); - var src; - var specifiers = []; - if (this.lookahead.type === 8 /* StringLiteral */) { - // import 'foo'; - src = this.parseModuleSpecifier(); - } - else { - if (this.match('{')) { - // import {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else if (this.match('*')) { - // import * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { - // import foo - specifiers.push(this.parseImportDefaultSpecifier()); - if (this.match(',')) { - this.nextToken(); - if (this.match('*')) { - // import foo, * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.match('{')) { - // import foo, {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - src = this.parseModuleSpecifier(); - } - this.consumeSemicolon(); - return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); - }; - // https://tc39.github.io/ecma262/#sec-exports - Parser.prototype.parseExportSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - var exported = local; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - exported = this.parseIdentifierName(); - } - return this.finalize(node, new Node.ExportSpecifier(local, exported)); - }; - Parser.prototype.parseExportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalExportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('export'); - var exportDeclaration; - if (this.matchKeyword('default')) { - // export default ... - this.nextToken(); - if (this.matchKeyword('function')) { - // export default function foo () {} - // export default function () {} - var declaration = this.parseFunctionDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchKeyword('class')) { - // export default class foo {} - var declaration = this.parseClassDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchContextualKeyword('async')) { - // export default async function f () {} - // export default async function () {} - // export default async x => x - var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else { - if (this.matchContextualKeyword('from')) { - this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); - } - // export default {}; - // export default []; - // export default (1 + 2); - var declaration = this.match('{') ? this.parseObjectInitializer() : - this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - } - else if (this.match('*')) { - // export * from 'foo'; - this.nextToken(); - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - var src = this.parseModuleSpecifier(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); - } - else if (this.lookahead.type === 4 /* Keyword */) { - // export var f = 1; - var declaration = void 0; - switch (this.lookahead.value) { - case 'let': - case 'const': - declaration = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'var': - case 'class': - case 'function': - declaration = this.parseStatementListItem(); - break; - default: - this.throwUnexpectedToken(this.lookahead); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else if (this.matchAsyncFunction()) { - var declaration = this.parseFunctionDeclaration(); - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else { - var specifiers = []; - var source = null; - var isExportFromIdentifier = false; - this.expect('{'); - while (!this.match('}')) { - isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); - specifiers.push(this.parseExportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - if (this.matchContextualKeyword('from')) { - // export {default} from 'foo'; - // export {foo} from 'foo'; - this.nextToken(); - source = this.parseModuleSpecifier(); - this.consumeSemicolon(); - } - else if (isExportFromIdentifier) { - // export {default}; // missing fromClause - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - else { - // export {foo}; - this.consumeSemicolon(); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); - } - return exportDeclaration; - }; - return Parser; - }()); - exports.Parser = Parser; - - -/***/ }, -/* 9 */ -/***/ function(module, exports) { - - "use strict"; - // Ensure the condition is true, otherwise throw an error. - // This is only to have a better contract semantic, i.e. another safety net - // to catch a logic error. The condition shall be fulfilled in normal case. - // Do NOT use this to enforce a certain condition on any user input. - Object.defineProperty(exports, "__esModule", { value: true }); - function assert(condition, message) { - /* istanbul ignore if */ - if (!condition) { - throw new Error('ASSERT: ' + message); - } - } - exports.assert = assert; - - -/***/ }, -/* 10 */ -/***/ function(module, exports) { - - "use strict"; - /* tslint:disable:max-classes-per-file */ - Object.defineProperty(exports, "__esModule", { value: true }); - var ErrorHandler = (function () { - function ErrorHandler() { - this.errors = []; - this.tolerant = false; - } - ErrorHandler.prototype.recordError = function (error) { - this.errors.push(error); - }; - ErrorHandler.prototype.tolerate = function (error) { - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - ErrorHandler.prototype.constructError = function (msg, column) { - var error = new Error(msg); - try { - throw error; - } - catch (base) { - /* istanbul ignore else */ - if (Object.create && Object.defineProperty) { - error = Object.create(base); - Object.defineProperty(error, 'column', { value: column }); - } - } - /* istanbul ignore next */ - return error; - }; - ErrorHandler.prototype.createError = function (index, line, col, description) { - var msg = 'Line ' + line + ': ' + description; - var error = this.constructError(msg, col); - error.index = index; - error.lineNumber = line; - error.description = description; - return error; - }; - ErrorHandler.prototype.throwError = function (index, line, col, description) { - throw this.createError(index, line, col, description); - }; - ErrorHandler.prototype.tolerateError = function (index, line, col, description) { - var error = this.createError(index, line, col, description); - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - return ErrorHandler; - }()); - exports.ErrorHandler = ErrorHandler; - - -/***/ }, -/* 11 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // Error messages should be identical to V8. - exports.Messages = { - BadGetterArity: 'Getter must not have any formal parameters', - BadSetterArity: 'Setter must have exactly one formal parameter', - BadSetterRestParameter: 'Setter function argument must not be a rest parameter', - ConstructorIsAsync: 'Class constructor may not be an async method', - ConstructorSpecialMethod: 'Class constructor may not be an accessor', - DeclarationMissingInitializer: 'Missing initializer in %0 declaration', - DefaultRestParameter: 'Unexpected token =', - DuplicateBinding: 'Duplicate binding %0', - DuplicateConstructor: 'A class may only have one constructor', - DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', - ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', - GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', - IllegalBreak: 'Illegal break statement', - IllegalContinue: 'Illegal continue statement', - IllegalExportDeclaration: 'Unexpected token', - IllegalImportDeclaration: 'Unexpected token', - IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', - IllegalReturn: 'Illegal return statement', - InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', - InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', - InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', - InvalidModuleSpecifier: 'Unexpected token', - InvalidRegExp: 'Invalid regular expression', - LetInLexicalBinding: 'let is disallowed as a lexically bound name', - MissingFromClause: 'Unexpected token', - MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NewlineAfterThrow: 'Illegal newline after throw', - NoAsAfterImportNamespace: 'Unexpected token', - NoCatchOrFinally: 'Missing catch or finally after try', - ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', - Redeclaration: '%0 \'%1\' has already been declared', - StaticPrototype: 'Classes may not have static property named prototype', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', - UnexpectedEOS: 'Unexpected end of input', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedNumber: 'Unexpected number', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedString: 'Unexpected string', - UnexpectedTemplate: 'Unexpected quasi %0', - UnexpectedToken: 'Unexpected token %0', - UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', - UnknownLabel: 'Undefined label \'%0\'', - UnterminatedRegExp: 'Invalid regular expression: missing /' - }; - - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var character_1 = __webpack_require__(4); - var messages_1 = __webpack_require__(11); - function hexValue(ch) { - return '0123456789abcdef'.indexOf(ch.toLowerCase()); - } - function octalValue(ch) { - return '01234567'.indexOf(ch); - } - var Scanner = (function () { - function Scanner(code, handler) { - this.source = code; - this.errorHandler = handler; - this.trackComment = false; - this.isModule = false; - this.length = code.length; - this.index = 0; - this.lineNumber = (code.length > 0) ? 1 : 0; - this.lineStart = 0; - this.curlyStack = []; - } - Scanner.prototype.saveState = function () { - return { - index: this.index, - lineNumber: this.lineNumber, - lineStart: this.lineStart - }; - }; - Scanner.prototype.restoreState = function (state) { - this.index = state.index; - this.lineNumber = state.lineNumber; - this.lineStart = state.lineStart; - }; - Scanner.prototype.eof = function () { - return this.index >= this.length; - }; - Scanner.prototype.throwUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - Scanner.prototype.tolerateUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - // https://tc39.github.io/ecma262/#sec-comments - Scanner.prototype.skipSingleLineComment = function (offset) { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - offset; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - offset - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - ++this.index; - if (character_1.Character.isLineTerminator(ch)) { - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - 1 - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index - 1], - range: [start, this.index - 1], - loc: loc - }; - comments.push(entry); - } - if (ch === 13 && this.source.charCodeAt(this.index) === 10) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - return comments; - } - } - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - }; - Scanner.prototype.skipMultiLineComment = function () { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - 2; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - 2 - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isLineTerminator(ch)) { - if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - ++this.index; - this.lineStart = this.index; - } - else if (ch === 0x2A) { - // Block comment ends with '*/'. - if (this.source.charCodeAt(this.index + 1) === 0x2F) { - this.index += 2; - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index - 2], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - } - ++this.index; - } - else { - ++this.index; - } - } - // Ran off the end of the file - the whole thing is a comment - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - this.tolerateUnexpectedToken(); - return comments; - }; - Scanner.prototype.scanComments = function () { - var comments; - if (this.trackComment) { - comments = []; - } - var start = (this.index === 0); - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isWhiteSpace(ch)) { - ++this.index; - } - else if (character_1.Character.isLineTerminator(ch)) { - ++this.index; - if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - start = true; - } - else if (ch === 0x2F) { - ch = this.source.charCodeAt(this.index + 1); - if (ch === 0x2F) { - this.index += 2; - var comment = this.skipSingleLineComment(2); - if (this.trackComment) { - comments = comments.concat(comment); - } - start = true; - } - else if (ch === 0x2A) { - this.index += 2; - var comment = this.skipMultiLineComment(); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (start && ch === 0x2D) { - // U+003E is '>' - if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { - // '-->' is a single-line comment - this.index += 3; - var comment = this.skipSingleLineComment(3); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (ch === 0x3C && !this.isModule) { - if (this.source.slice(this.index + 1, this.index + 4) === '!--') { - this.index += 4; // ` - - - -``` - -Browser support was done mostly for the online demo. If you find any errors - feel -free to send pull requests with fixes. Also note, that IE and other old browsers -needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. - -Notes: - -1. We have no resources to support browserified version. Don't expect it to be - well tested. Don't expect fast fixes if something goes wrong there. -2. `!!js/function` in browser bundle will not work by default. If you really need - it - load `esprima` parser first (via amd or directly). -3. `!!bin` in browser will return `Array`, because browsers do not support - node.js `Buffer` and adding Buffer shims is completely useless on practice. - - -API ---- - -Here we cover the most 'useful' methods. If you need advanced details (creating -your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more -info. - -``` javascript -yaml = require('js-yaml'); -fs = require('fs'); - -// Get document, or throw exception on error -try { - var doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); - console.log(doc); -} catch (e) { - console.log(e); -} -``` - - -### safeLoad (string [ , options ]) - -**Recommended loading way.** Parses `string` as single YAML document. Returns a JavaScript -object or throws `YAMLException` on error. By default, does not support regexps, -functions and undefined. This method is safe for untrusted data. - -options: - -- `filename` _(default: null)_ - string to be used as a file path in - error/warning messages. -- `onWarning` _(default: null)_ - function to call on warning messages. - Loader will throw on warnings if this function is not provided. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. - - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: - http://www.yaml.org/spec/1.2/spec.html#id2802346 - - `JSON_SCHEMA` - all JSON-supported types: - http://www.yaml.org/spec/1.2/spec.html#id2803231 - - `CORE_SCHEMA` - same as `JSON_SCHEMA`: - http://www.yaml.org/spec/1.2/spec.html#id2804923 - - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones - (`!!js/undefined`, `!!js/regexp` and `!!js/function`): - http://yaml.org/type/ - - `DEFAULT_FULL_SCHEMA` - all supported YAML types. -- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. - -NOTE: This function **does not** understand multi-document sources, it throws -exception on those. - -NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. -So, the JSON schema is not as strictly defined in the YAML specification. -It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. -The core schema also has no such restrictions. It allows binary notation for integers. - - -### load (string [ , options ]) - -**Use with care with untrusted sources**. The same as `safeLoad()` but uses -`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: -`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you -must additionally validate object structure to avoid injections: - -``` javascript -var untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; - -// I'm just converting that string, what could possibly go wrong? -require('js-yaml').load(untrusted_code) + '' -``` - - -### safeLoadAll (string [, iterator] [, options ]) - -Same as `safeLoad()`, but understands multi-document sources. Applies -`iterator` to each document if specified, or returns array of documents. - -``` javascript -var yaml = require('js-yaml'); - -yaml.safeLoadAll(data, function (doc) { - console.log(doc); -}); -``` - - -### loadAll (string [, iterator] [ , options ]) - -Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. - - -### safeDump (object [ , options ]) - -Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will -throw an exception if you try to dump regexps or functions. However, you can -disable exceptions by setting the `skipInvalid` option to `true`. - -options: - -- `indent` _(default: 2)_ - indentation width to use (in spaces). -- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function - in the safe schema) and skip pairs and single values with such types. -- `flowLevel` (default: -1) - specifies level of nesting, when to switch from - block to flow style for collections. -1 means block style everwhere -- `styles` - "tag" => "style" map. Each tag may have own set of styles. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. -- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a - function, use the function to sort the keys. -- `lineWidth` _(default: `80`)_ - set max line width. -- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references -- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older - yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 -- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. - -The following table show availlable styles (e.g. "canonical", -"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml -output is shown on the right side after `=>` (default setting) or `->`: - -``` none -!!null - "canonical" -> "~" - "lowercase" => "null" - "uppercase" -> "NULL" - "camelcase" -> "Null" - -!!int - "binary" -> "0b1", "0b101010", "0b1110001111010" - "octal" -> "01", "052", "016172" - "decimal" => "1", "42", "7290" - "hexadecimal" -> "0x1", "0x2A", "0x1C7A" - -!!bool - "lowercase" => "true", "false" - "uppercase" -> "TRUE", "FALSE" - "camelcase" -> "True", "False" - -!!float - "lowercase" => ".nan", '.inf' - "uppercase" -> ".NAN", '.INF' - "camelcase" -> ".NaN", '.Inf' -``` - -Example: - -``` javascript -safeDump (object, { - 'styles': { - '!!null': 'canonical' // dump null as ~ - }, - 'sortKeys': true // sort object keys -}); -``` - -### dump (object [ , options ]) - -Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). - - -Supported YAML types --------------------- - -The list of standard YAML tags and corresponding JavaScipt types. See also -[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and -[YAML types repository](http://yaml.org/type/). - -``` -!!null '' # null -!!bool 'yes' # bool -!!int '3...' # number -!!float '3.14...' # number -!!binary '...base64...' # buffer -!!timestamp 'YYYY-...' # date -!!omap [ ... ] # array of key-value pairs -!!pairs [ ... ] # array or array pairs -!!set { ... } # array of objects with given keys and null values -!!str '...' # string -!!seq [ ... ] # array -!!map { ... } # object -``` - -**JavaScript-specific tags** - -``` -!!js/regexp /pattern/gim # RegExp -!!js/undefined '' # Undefined -!!js/function 'function () {...}' # Function -``` - -Caveats -------- - -Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects -or arrays as keys, and stringifies (by calling `toString()` method) them at the -moment of adding them. - -``` yaml ---- -? [ foo, bar ] -: - baz -? { foo: bar } -: - baz - - baz -``` - -``` javascript -{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } -``` - -Also, reading of properties on implicit block mapping keys is not supported yet. -So, the following YAML document cannot be loaded. - -``` yaml -&anchor foo: - foo: bar - *anchor: duplicate key - baz: bat - *anchor: duplicate key -``` - - -Breaking changes in 2.x.x -> 3.x.x ----------------------------------- - -If you have not used __custom__ tags or loader classes and not loaded yaml -files via `require()`, no changes are needed. Just upgrade the library. - -Otherwise, you should: - -1. Replace all occurrences of `require('xxxx.yml')` by `fs.readFileSync()` + - `yaml.safeLoad()`. -2. rewrite your custom tags constructors and custom loader - classes, to conform the new API. See - [examples](https://github.com/nodeca/js-yaml/tree/master/examples) and - [wiki](https://github.com/nodeca/js-yaml/wiki) for details. - - -License -------- - -View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file -(MIT). diff --git a/node_modules/js-yaml/bin/js-yaml.js b/node_modules/js-yaml/bin/js-yaml.js deleted file mode 100755 index e79186b..0000000 --- a/node_modules/js-yaml/bin/js-yaml.js +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env node - - -'use strict'; - -/*eslint-disable no-console*/ - - -// stdlib -var fs = require('fs'); - - -// 3rd-party -var argparse = require('argparse'); - - -// internal -var yaml = require('..'); - - -//////////////////////////////////////////////////////////////////////////////// - - -var cli = new argparse.ArgumentParser({ - prog: 'js-yaml', - version: require('../package.json').version, - addHelp: true -}); - - -cli.addArgument([ '-c', '--compact' ], { - help: 'Display errors in compact mode', - action: 'storeTrue' -}); - - -// deprecated (not needed after we removed output colors) -// option suppressed, but not completely removed for compatibility -cli.addArgument([ '-j', '--to-json' ], { - help: argparse.Const.SUPPRESS, - dest: 'json', - action: 'storeTrue' -}); - - -cli.addArgument([ '-t', '--trace' ], { - help: 'Show stack trace on error', - action: 'storeTrue' -}); - -cli.addArgument([ 'file' ], { - help: 'File to read, utf-8 encoded without BOM', - nargs: '?', - defaultValue: '-' -}); - - -//////////////////////////////////////////////////////////////////////////////// - - -var options = cli.parseArgs(); - - -//////////////////////////////////////////////////////////////////////////////// - -function readFile(filename, encoding, callback) { - if (options.file === '-') { - // read from stdin - - var chunks = []; - - process.stdin.on('data', function (chunk) { - chunks.push(chunk); - }); - - process.stdin.on('end', function () { - return callback(null, Buffer.concat(chunks).toString(encoding)); - }); - } else { - fs.readFile(filename, encoding, callback); - } -} - -readFile(options.file, 'utf8', function (error, input) { - var output, isYaml; - - if (error) { - if (error.code === 'ENOENT') { - console.error('File not found: ' + options.file); - process.exit(2); - } - - console.error( - options.trace && error.stack || - error.message || - String(error)); - - process.exit(1); - } - - try { - output = JSON.parse(input); - isYaml = false; - } catch (err) { - if (err instanceof SyntaxError) { - try { - output = []; - yaml.loadAll(input, function (doc) { output.push(doc); }, {}); - isYaml = true; - - if (output.length === 0) output = null; - else if (output.length === 1) output = output[0]; - - } catch (e) { - if (options.trace && err.stack) console.error(e.stack); - else console.error(e.toString(options.compact)); - - process.exit(1); - } - } else { - console.error( - options.trace && err.stack || - err.message || - String(err)); - - process.exit(1); - } - } - - if (isYaml) console.log(JSON.stringify(output, null, ' ')); - else console.log(yaml.dump(output)); -}); diff --git a/node_modules/js-yaml/dist/js-yaml.js b/node_modules/js-yaml/dist/js-yaml.js deleted file mode 100644 index 0c9e648..0000000 --- a/node_modules/js-yaml/dist/js-yaml.js +++ /dev/null @@ -1,3917 +0,0 @@ -/* js-yaml 3.12.0 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (map === null) return {}; - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if (tag.slice(0, 2) === '!!') { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - type = schema.compiledTypeMap['fallback'][tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; - } - - result[tag] = style; - } - - return result; -} - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; - this.noCompatMode = options['noCompatMode'] || false; - this.condenseFlow = options['condenseFlow'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -// Indents every line in a string. Empty lines (\n only) are not indented. -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - - if (line.length && line !== '\n') result += ind; - - result += line; - } - - return result; -} - -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} - -function testImplicitResolving(state, str) { - var index, length, type; - - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - - if (type.resolve(str)) { - return true; - } - } - - return false; -} - -// [33] s-white ::= s-space | s-tab -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; -} - -// Returns true if the character can be printed without escaping. -// From YAML 1.2: "any allowed characters known to be non-printable -// should also be escaped. [However,] This isn’t mandatory" -// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. -function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) - || (0x10000 <= c && c <= 0x10FFFF); -} - -// Simplified test for values allowed after the first character in plain style. -function isPlainSafe(c) { - // Uses a subset of nb-char - c-flow-indicator - ":" - "#" - // where nb-char ::= c-printable - b-char - c-byte-order-mark. - return isPrintable(c) && c !== 0xFEFF - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // - ":" - "#" - && c !== CHAR_COLON - && c !== CHAR_SHARP; -} - -// Simplified test for values allowed as the first character in plain style. -function isPlainSafeFirst(c) { - // Uses a subset of ns-char - c-indicator - // where ns-char = nb-char - s-white. - return isPrintable(c) && c !== 0xFEFF - && !isWhitespace(c) // - s-white - // - (c-indicator ::= - // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” - && c !== CHAR_MINUS - && c !== CHAR_QUESTION - && c !== CHAR_COLON - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"” - && c !== CHAR_SHARP - && c !== CHAR_AMPERSAND - && c !== CHAR_ASTERISK - && c !== CHAR_EXCLAMATION - && c !== CHAR_VERTICAL_LINE - && c !== CHAR_GREATER_THAN - && c !== CHAR_SINGLE_QUOTE - && c !== CHAR_DOUBLE_QUOTE - // | “%” | “@” | “`”) - && c !== CHAR_PERCENT - && c !== CHAR_COMMERCIAL_AT - && c !== CHAR_GRAVE_ACCENT; -} - -// Determines whether block indentation indicator is required. -function needIndentIndicator(string) { - var leadingSpaceRe = /^\n* /; - return leadingSpaceRe.test(string); -} - -var STYLE_PLAIN = 1, - STYLE_SINGLE = 2, - STYLE_LITERAL = 3, - STYLE_FOLDED = 4, - STYLE_DOUBLE = 5; - -// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { - var i; - var char; - var hasLineBreak = false; - var hasFoldableLine = false; // only checked if shouldTrackWidth - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(string.charCodeAt(0)) - && !isWhitespace(string.charCodeAt(string.length - 1)); - - if (singleLineOnly) { - // Case: no block styles. - // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - } else { - // Case: block styles permitted. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - // Check if any line can be folded. - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || - // Foldable line = too long, and not more-indented. - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' '); - previousLineBreak = i; - } - } else if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - // in case the end is missing a \n - hasFoldableLine = hasFoldableLine || (shouldTrackWidth && - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' ')); - } - // Although every style can represent \n without escaping, prefer block styles - // for multiline, since they're more readable and they don't add empty lines. - // Also prefer folding a super-long line. - if (!hasLineBreak && !hasFoldableLine) { - // Strings interpretable as another type have to be quoted; - // e.g. the string 'true' vs. the boolean true. - return plain && !testAmbiguousType(string) - ? STYLE_PLAIN : STYLE_SINGLE; - } - // Edge case: block indentation indicator can only have one digit. - if (indentPerLevel > 9 && needIndentIndicator(string)) { - return STYLE_DOUBLE; - } - // At this point we know block styles are valid. - // Prefer literal style unless we want to fold. - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; -} - -// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey) { - state.dump = (function () { - if (string.length === 0) { - return "''"; - } - if (!state.noCompatMode && - DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { - return "'" + string + "'"; - } - - var indent = state.indent * Math.max(1, level); // no 0-indent scalars - // As indentation gets deeper, let the width decrease monotonically - // to the lower bound min(state.lineWidth, 40). - // Note that this implies - // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. - // state.lineWidth > 40 + state.indent: width decreases until the lower bound. - // This behaves better than a constant minimum width which disallows narrower options, - // or an indent threshold which causes the width to suddenly increase. - var lineWidth = state.lineWidth === -1 - ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); - - // Without knowing if keys are implicit/explicit, assume implicit for safety. - var singleLineOnly = iskey - // No block styles in flow mode. - || (state.flowLevel > -1 && level >= state.flowLevel); - function testAmbiguity(string) { - return testImplicitResolving(state, string); - } - - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { - case STYLE_PLAIN: - return string; - case STYLE_SINGLE: - return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: - return '|' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: - return '>' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: - return '"' + escapeString(string, lineWidth) + '"'; - default: - throw new YAMLException('impossible error: invalid scalar style'); - } - }()); -} - -// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string, indentPerLevel) { - var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; - - // note the special case: the string '\n' counts as a "trailing" empty line. - var clip = string[string.length - 1] === '\n'; - var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); - var chomp = keep ? '+' : (clip ? '' : '-'); - - return indentIndicator + chomp + '\n'; -} - -// (See the note for writeScalar.) -function dropEndingNewline(string) { - return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; -} - -// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string, width) { - // In folded style, $k$ consecutive newlines output as $k+1$ newlines— - // unless they're before or after a more-indented line, or at the very - // beginning or end, in which case $k$ maps to $k$. - // Therefore, parse each chunk as newline(s) followed by a content line. - var lineRe = /(\n+)([^\n]*)/g; - - // first line (possibly an empty line) - var result = (function () { - var nextLF = string.indexOf('\n'); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }()); - // If we haven't reached the first content line yet, don't add an extra \n. - var prevMoreIndented = string[0] === '\n' || string[0] === ' '; - var moreIndented; - - // rest of the lines - var match; - while ((match = lineRe.exec(string))) { - var prefix = match[1], line = match[2]; - moreIndented = (line[0] === ' '); - result += prefix - + (!prevMoreIndented && !moreIndented && line !== '' - ? '\n' : '') - + foldLine(line, width); - prevMoreIndented = moreIndented; - } - - return result; -} - -// Greedy line breaking. -// Picks the longest line under the limit each time, -// otherwise settles for the shortest line over the limit. -// NB. More-indented lines *cannot* be folded, as that would add an extra \n. -function foldLine(line, width) { - if (line === '' || line[0] === ' ') return line; - - // Since a more-indented line adds a \n, breaks can't be followed by a space. - var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. - var match; - // start is an inclusive index. end, curr, and next are exclusive. - var start = 0, end, curr = 0, next = 0; - var result = ''; - - // Invariants: 0 <= start <= length-1. - // 0 <= curr <= next <= max(0, length-2). curr - start <= width. - // Inside the loop: - // A match implies length >= 2, so curr and next are <= length-2. - while ((match = breakRe.exec(line))) { - next = match.index; - // maintain invariant: curr - start <= width - if (next - start > width) { - end = (curr > start) ? curr : next; // derive end <= length-2 - result += '\n' + line.slice(start, end); - // skip the space that was output as \n - start = end + 1; // derive start <= length-1 - } - curr = next; - } - - // By the invariants, start <= length-1, so there is something left over. - // It is either the whole string or a part starting from non-whitespace. - result += '\n'; - // Insert a break if the remainder is too long and there is a break available. - if (line.length - start > width && curr > start) { - result += line.slice(start, curr) + '\n' + line.slice(curr + 1); - } else { - result += line.slice(start); - } - - return result.slice(1); // drop extra \n joiner -} - -// Escapes a double-quoted string. -function escapeString(string) { - var result = ''; - var char, nextChar; - var escapeSeq; - - for (var i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). - if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { - nextChar = string.charCodeAt(i + 1); - if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { - // Combine the surrogate pair and store it escaped. - result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); - // Advance index one extra since we already used that char here. - i++; continue; - } - } - escapeSeq = ESCAPE_SEQUENCES[char]; - result += !escapeSeq && isPrintable(char) - ? string[i] - : escapeSeq || encodeHex(char); - } - - return result; -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || index !== 0) { - _result += generateNextLine(state, level); - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - _result += '-'; - } else { - _result += '- '; - } - - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = state.condenseFlow ? '"' : ''; - - if (index !== 0) pairBuffer += ', '; - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) pairBuffer += '? '; - - pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || index !== 0) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (state.tag !== null && state.tag !== '?') || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; - } - } - - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } - - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; - } else { - pairBuffer += ': '; - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} - -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? state.explicitTypes : state.implicitTypes; - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { - - state.tag = explicit ? type.tag : '?'; - - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if (_toString.call(type.represent) === '[object Function]') { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; - } - - return true; - } - } - - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (state.flowLevel < 0 || state.flowLevel > level); - } - - var objectOrArray = type === '[object Object]' || type === '[object Array]', - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if (type === '[object Object]') { - if (block && (Object.keys(state.dump).length !== 0)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object Array]') { - if (block && (state.dump.length !== 0)) { - writeBlockSequence(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object String]') { - if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) return false; - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (state.tag !== null && state.tag !== '?') { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (object !== null && typeof object === 'object') { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } -} - -function dump(input, options) { - options = options || {}; - - var state = new State(options); - - if (!state.noRefs) getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; - -},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; - -},{}],5:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; - } - } -} - -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; - - keyNode = String(keyNode); - - if (_result === null) { - _result = {}; - } - - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); - } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } - - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x27/* ' */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x22/* " */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } - - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x21/* ! */) return false; - - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if (tagHandle === '!') { - state.tag = '!' + tagName; - - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x26/* & */) return false; - - if (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x2A/* * */) return false; - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (state.tag === null) { - state.tag = '?'; - } - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only assigned to plain scalars. So, it isn't - // needed to check for 'kind' conformity. - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; - - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) break; - - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (ch !== 0) readLineBreak(state); - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - var documents = loadDocuments(input, options), index, length; - - if (typeof iterator !== 'function') { - return documents; - } - - for (index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, output, options) { - if (typeof output === 'function') { - loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } else { - return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; - -},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; - -},{"./common":2}],7:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; - -},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); - -},{"../schema":7,"./json":12}],9:[function(require,module,exports){ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); - -},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); - -},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); - -},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); - -},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; - -},{"./exception":4}],14:[function(require,module,exports){ -'use strict'; - -/*eslint-disable no-bitwise*/ - -var NodeBuffer; - -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = _require('buffer').Buffer; -} catch (__) {} - -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (data === null) return false; - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) continue; - - // Fail on illegal characters - if (code < 0) return false; - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); - -},{"../type":13}],15:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); - -},{"../type":13}],16:[function(require,module,exports){ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (data === null) return false; - - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; - } - - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } - - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if (value === '.nan') { - return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); - -},{"../common":2,"../type":13}],17:[function(require,module,exports){ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; - - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } - - if (value === '0') return 0; - - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); - -},{"../common":2,"../type":13}],18:[function(require,module,exports){ -'use strict'; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /*global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} - -var Type = require('../../type'); - -function resolveJavascriptFunction(data) { - if (data === null) return false; - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - if (ast.body[0].expression.body.type === 'BlockStatement') { - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); - } - // ES6 arrow functions can omit the BlockStatement. In that case, just return - // the body. - /*eslint-disable no-new-func*/ - return new Function(params, 'return ' + source.slice(body[0], body[1])); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); - -},{"../../type":13}],19:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; - } - - return true; -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); - -},{"../../type":13}],20:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); - -},{"../../type":13}],21:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); - -},{"../type":13}],22:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); - -},{"../type":13}],23:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); - -},{"../type":13}],24:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if (_toString.call(pair) !== '[object Object]') return false; - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; - } - } - - if (!pairHasKey) return false; - - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } - - return true; -} - -function constructYamlOmap(data) { - return data !== null ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); - -},{"../type":13}],25:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (data === null) return true; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if (_toString.call(pair) !== '[object Object]') return false; - - keys = Object.keys(pair); - - if (keys.length !== 1) return false; - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (data === null) return []; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); - -},{"../type":13}],26:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); - -},{"../type":13}],27:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (data === null) return true; - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; - } - } - - return true; -} - -function constructYamlSet(data) { - return data !== null ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); - -},{"../type":13}],28:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); - -},{"../type":13}],29:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); - -},{"../type":13}],"/":[function(require,module,exports){ -'use strict'; - - -var yaml = require('./lib/js-yaml.js'); - - -module.exports = yaml; - -},{"./lib/js-yaml.js":1}]},{},[])("/") -}); diff --git a/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/js-yaml/dist/js-yaml.min.js deleted file mode 100644 index 0dcb7ba..0000000 --- a/node_modules/js-yaml/dist/js-yaml.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}}(function(){return function o(a,s,c){function u(t,e){if(!s[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(l)return l(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var r=s[t]={exports:{}};a[t][0].call(r.exports,function(e){return u(a[t][1][e]||e)},r,r.exports,o,a,s,c)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e=i.flowLevel;switch(H(r,n,i.indent,t,function(e){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+V(r,i.indent)+Z(L(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(s=e.indexOf("\n"),s=-1!==s?s:e.length,r.lastIndex=s,z(e.slice(0,s),t)),a="\n"===e[0]||" "===e[0];var s;for(;i=r.exec(e);){var c=i[1],u=i[2];n=" "===u[0],o+=c+(a||n||""===u?"":"\n")+z(u,t),a=n}return o}(r,t),e));case $:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function Q(e,t,n,i,r,o){e.tag=null,e.dump=n,J(e,n,!1)||J(e,n,!0);var a=l.call(e.dump);i&&(i=e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return!0}function X(e,t){var n,i,r=[],o=[];for(function e(t,n,i){var r,o,a;if(null!==t&&"object"==typeof t)if(-1!==(o=n.indexOf(t)))-1===i.indexOf(o)&&i.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;ot)&&0!==i)_(e,"bad indentation of a sequence entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt)&&(K(e,t,b,!0,r)&&(m?d=e.result:h=e.result),m||(D(e,l,p,f,d,h,o,a),f=d=h=null),q(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)_(e,"bad indentation of a mapping entry");else if(e.lineIndentl&&(l=e.lineIndent),j(o))p++;else{if(e.lineIndent>10),56320+(c-65536&1023)),e.position++}else _(e,"unknown escape sequence");n=i=e.position}else j(s)?(T(e,n,i,!0),R(e,q(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Y(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}_(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!I(i)&&!E(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||_(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],q(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,s,c,u,l,p=e.kind,f=e.result;if(I(l=e.input.charCodeAt(e.position))||E(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(I(i=e.input.charCodeAt(e.position+1))||n&&E(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==l;){if(58===l){if(I(i=e.input.charCodeAt(e.position+1))||n&&E(i))break}else if(35===l){if(I(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Y(e)||n&&E(l))break;if(j(l)){if(s=e.line,c=e.lineStart,u=e.lineIndent,q(e,!1,-1),e.lineIndent>=t){a=!0,l=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(T(e,r,o,!1),R(e,e.line-s),r=o=e.position,a=!1),S(l)||(o=e.position+1),l=e.input.charCodeAt(++e.position)}return T(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,p,x===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||_(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(m=s&&B(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):_(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):_(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function $(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(r=e.input.charCodeAt(e.position))&&(q(e,!0,-1),r=e.input.charCodeAt(e.position),!(0t/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var i=e("./common"),r=e("./exception"),o=e("./type");function a(e,t,i){var r=[];return e.include.forEach(function(e){i=a(e,t,i)}),e[t].forEach(function(n){i.forEach(function(e,t){e.tag===n.tag&&e.kind===n.kind&&r.push(t)}),i.push(n)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0==(n=r%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),c?c.from?c.from(s):new c(s):s},predicate:function(e){return c&&c.isBuffer(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=u;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},{"../type":13}],15:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type"),o=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var a=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,i,r;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type");t.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (map === null) return {}; - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if (tag.slice(0, 2) === '!!') { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - type = schema.compiledTypeMap['fallback'][tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; - } - - result[tag] = style; - } - - return result; -} - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; - this.noCompatMode = options['noCompatMode'] || false; - this.condenseFlow = options['condenseFlow'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -// Indents every line in a string. Empty lines (\n only) are not indented. -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - - if (line.length && line !== '\n') result += ind; - - result += line; - } - - return result; -} - -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} - -function testImplicitResolving(state, str) { - var index, length, type; - - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - - if (type.resolve(str)) { - return true; - } - } - - return false; -} - -// [33] s-white ::= s-space | s-tab -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; -} - -// Returns true if the character can be printed without escaping. -// From YAML 1.2: "any allowed characters known to be non-printable -// should also be escaped. [However,] This isn’t mandatory" -// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. -function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) - || (0x10000 <= c && c <= 0x10FFFF); -} - -// Simplified test for values allowed after the first character in plain style. -function isPlainSafe(c) { - // Uses a subset of nb-char - c-flow-indicator - ":" - "#" - // where nb-char ::= c-printable - b-char - c-byte-order-mark. - return isPrintable(c) && c !== 0xFEFF - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // - ":" - "#" - && c !== CHAR_COLON - && c !== CHAR_SHARP; -} - -// Simplified test for values allowed as the first character in plain style. -function isPlainSafeFirst(c) { - // Uses a subset of ns-char - c-indicator - // where ns-char = nb-char - s-white. - return isPrintable(c) && c !== 0xFEFF - && !isWhitespace(c) // - s-white - // - (c-indicator ::= - // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” - && c !== CHAR_MINUS - && c !== CHAR_QUESTION - && c !== CHAR_COLON - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"” - && c !== CHAR_SHARP - && c !== CHAR_AMPERSAND - && c !== CHAR_ASTERISK - && c !== CHAR_EXCLAMATION - && c !== CHAR_VERTICAL_LINE - && c !== CHAR_GREATER_THAN - && c !== CHAR_SINGLE_QUOTE - && c !== CHAR_DOUBLE_QUOTE - // | “%” | “@” | “`”) - && c !== CHAR_PERCENT - && c !== CHAR_COMMERCIAL_AT - && c !== CHAR_GRAVE_ACCENT; -} - -// Determines whether block indentation indicator is required. -function needIndentIndicator(string) { - var leadingSpaceRe = /^\n* /; - return leadingSpaceRe.test(string); -} - -var STYLE_PLAIN = 1, - STYLE_SINGLE = 2, - STYLE_LITERAL = 3, - STYLE_FOLDED = 4, - STYLE_DOUBLE = 5; - -// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { - var i; - var char; - var hasLineBreak = false; - var hasFoldableLine = false; // only checked if shouldTrackWidth - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(string.charCodeAt(0)) - && !isWhitespace(string.charCodeAt(string.length - 1)); - - if (singleLineOnly) { - // Case: no block styles. - // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - } else { - // Case: block styles permitted. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - // Check if any line can be folded. - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || - // Foldable line = too long, and not more-indented. - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' '); - previousLineBreak = i; - } - } else if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - // in case the end is missing a \n - hasFoldableLine = hasFoldableLine || (shouldTrackWidth && - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' ')); - } - // Although every style can represent \n without escaping, prefer block styles - // for multiline, since they're more readable and they don't add empty lines. - // Also prefer folding a super-long line. - if (!hasLineBreak && !hasFoldableLine) { - // Strings interpretable as another type have to be quoted; - // e.g. the string 'true' vs. the boolean true. - return plain && !testAmbiguousType(string) - ? STYLE_PLAIN : STYLE_SINGLE; - } - // Edge case: block indentation indicator can only have one digit. - if (indentPerLevel > 9 && needIndentIndicator(string)) { - return STYLE_DOUBLE; - } - // At this point we know block styles are valid. - // Prefer literal style unless we want to fold. - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; -} - -// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey) { - state.dump = (function () { - if (string.length === 0) { - return "''"; - } - if (!state.noCompatMode && - DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { - return "'" + string + "'"; - } - - var indent = state.indent * Math.max(1, level); // no 0-indent scalars - // As indentation gets deeper, let the width decrease monotonically - // to the lower bound min(state.lineWidth, 40). - // Note that this implies - // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. - // state.lineWidth > 40 + state.indent: width decreases until the lower bound. - // This behaves better than a constant minimum width which disallows narrower options, - // or an indent threshold which causes the width to suddenly increase. - var lineWidth = state.lineWidth === -1 - ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); - - // Without knowing if keys are implicit/explicit, assume implicit for safety. - var singleLineOnly = iskey - // No block styles in flow mode. - || (state.flowLevel > -1 && level >= state.flowLevel); - function testAmbiguity(string) { - return testImplicitResolving(state, string); - } - - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { - case STYLE_PLAIN: - return string; - case STYLE_SINGLE: - return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: - return '|' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: - return '>' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: - return '"' + escapeString(string, lineWidth) + '"'; - default: - throw new YAMLException('impossible error: invalid scalar style'); - } - }()); -} - -// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string, indentPerLevel) { - var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; - - // note the special case: the string '\n' counts as a "trailing" empty line. - var clip = string[string.length - 1] === '\n'; - var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); - var chomp = keep ? '+' : (clip ? '' : '-'); - - return indentIndicator + chomp + '\n'; -} - -// (See the note for writeScalar.) -function dropEndingNewline(string) { - return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; -} - -// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string, width) { - // In folded style, $k$ consecutive newlines output as $k+1$ newlines— - // unless they're before or after a more-indented line, or at the very - // beginning or end, in which case $k$ maps to $k$. - // Therefore, parse each chunk as newline(s) followed by a content line. - var lineRe = /(\n+)([^\n]*)/g; - - // first line (possibly an empty line) - var result = (function () { - var nextLF = string.indexOf('\n'); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }()); - // If we haven't reached the first content line yet, don't add an extra \n. - var prevMoreIndented = string[0] === '\n' || string[0] === ' '; - var moreIndented; - - // rest of the lines - var match; - while ((match = lineRe.exec(string))) { - var prefix = match[1], line = match[2]; - moreIndented = (line[0] === ' '); - result += prefix - + (!prevMoreIndented && !moreIndented && line !== '' - ? '\n' : '') - + foldLine(line, width); - prevMoreIndented = moreIndented; - } - - return result; -} - -// Greedy line breaking. -// Picks the longest line under the limit each time, -// otherwise settles for the shortest line over the limit. -// NB. More-indented lines *cannot* be folded, as that would add an extra \n. -function foldLine(line, width) { - if (line === '' || line[0] === ' ') return line; - - // Since a more-indented line adds a \n, breaks can't be followed by a space. - var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. - var match; - // start is an inclusive index. end, curr, and next are exclusive. - var start = 0, end, curr = 0, next = 0; - var result = ''; - - // Invariants: 0 <= start <= length-1. - // 0 <= curr <= next <= max(0, length-2). curr - start <= width. - // Inside the loop: - // A match implies length >= 2, so curr and next are <= length-2. - while ((match = breakRe.exec(line))) { - next = match.index; - // maintain invariant: curr - start <= width - if (next - start > width) { - end = (curr > start) ? curr : next; // derive end <= length-2 - result += '\n' + line.slice(start, end); - // skip the space that was output as \n - start = end + 1; // derive start <= length-1 - } - curr = next; - } - - // By the invariants, start <= length-1, so there is something left over. - // It is either the whole string or a part starting from non-whitespace. - result += '\n'; - // Insert a break if the remainder is too long and there is a break available. - if (line.length - start > width && curr > start) { - result += line.slice(start, curr) + '\n' + line.slice(curr + 1); - } else { - result += line.slice(start); - } - - return result.slice(1); // drop extra \n joiner -} - -// Escapes a double-quoted string. -function escapeString(string) { - var result = ''; - var char, nextChar; - var escapeSeq; - - for (var i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). - if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { - nextChar = string.charCodeAt(i + 1); - if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { - // Combine the surrogate pair and store it escaped. - result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); - // Advance index one extra since we already used that char here. - i++; continue; - } - } - escapeSeq = ESCAPE_SEQUENCES[char]; - result += !escapeSeq && isPrintable(char) - ? string[i] - : escapeSeq || encodeHex(char); - } - - return result; -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || index !== 0) { - _result += generateNextLine(state, level); - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - _result += '-'; - } else { - _result += '- '; - } - - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = state.condenseFlow ? '"' : ''; - - if (index !== 0) pairBuffer += ', '; - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) pairBuffer += '? '; - - pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || index !== 0) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (state.tag !== null && state.tag !== '?') || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; - } - } - - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } - - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; - } else { - pairBuffer += ': '; - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} - -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? state.explicitTypes : state.implicitTypes; - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { - - state.tag = explicit ? type.tag : '?'; - - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if (_toString.call(type.represent) === '[object Function]') { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; - } - - return true; - } - } - - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (state.flowLevel < 0 || state.flowLevel > level); - } - - var objectOrArray = type === '[object Object]' || type === '[object Array]', - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if (type === '[object Object]') { - if (block && (Object.keys(state.dump).length !== 0)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object Array]') { - if (block && (state.dump.length !== 0)) { - writeBlockSequence(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object String]') { - if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) return false; - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (state.tag !== null && state.tag !== '?') { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (object !== null && typeof object === 'object') { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } -} - -function dump(input, options) { - options = options || {}; - - var state = new State(options); - - if (!state.noRefs) getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; diff --git a/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/js-yaml/lib/js-yaml/exception.js deleted file mode 100644 index b744a1e..0000000 --- a/node_modules/js-yaml/lib/js-yaml/exception.js +++ /dev/null @@ -1,43 +0,0 @@ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; diff --git a/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/js-yaml/lib/js-yaml/loader.js deleted file mode 100644 index fe2cb4d..0000000 --- a/node_modules/js-yaml/lib/js-yaml/loader.js +++ /dev/null @@ -1,1598 +0,0 @@ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; - } - } -} - -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; - - keyNode = String(keyNode); - - if (_result === null) { - _result = {}; - } - - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); - } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } - - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x27/* ' */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x22/* " */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } - - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x21/* ! */) return false; - - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if (tagHandle === '!') { - state.tag = '!' + tagName; - - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x26/* & */) return false; - - if (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x2A/* * */) return false; - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (state.tag === null) { - state.tag = '?'; - } - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only assigned to plain scalars. So, it isn't - // needed to check for 'kind' conformity. - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; - - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) break; - - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (ch !== 0) readLineBreak(state); - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - var documents = loadDocuments(input, options), index, length; - - if (typeof iterator !== 'function') { - return documents; - } - - for (index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, output, options) { - if (typeof output === 'function') { - loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } else { - return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; diff --git a/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/js-yaml/lib/js-yaml/mark.js deleted file mode 100644 index 47b265c..0000000 --- a/node_modules/js-yaml/lib/js-yaml/mark.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; diff --git a/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/js-yaml/lib/js-yaml/schema.js deleted file mode 100644 index ca7cf47..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; diff --git a/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/js-yaml/lib/js-yaml/schema/core.js deleted file mode 100644 index 206daab..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/core.js +++ /dev/null @@ -1,18 +0,0 @@ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js deleted file mode 100644 index a55ef42..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +++ /dev/null @@ -1,25 +0,0 @@ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js deleted file mode 100644 index 11d89bb..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +++ /dev/null @@ -1,28 +0,0 @@ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js deleted file mode 100644 index b7a33eb..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +++ /dev/null @@ -1,17 +0,0 @@ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/js-yaml/lib/js-yaml/schema/json.js deleted file mode 100644 index 5be3dbf..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/json.js +++ /dev/null @@ -1,25 +0,0 @@ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/js-yaml/lib/js-yaml/type.js deleted file mode 100644 index 90b702a..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; diff --git a/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/js-yaml/lib/js-yaml/type/binary.js deleted file mode 100644 index 10b1875..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -/*eslint-disable no-bitwise*/ - -var NodeBuffer; - -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = _require('buffer').Buffer; -} catch (__) {} - -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (data === null) return false; - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) continue; - - // Fail on illegal characters - if (code < 0) return false; - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/js-yaml/lib/js-yaml/type/bool.js deleted file mode 100644 index cb77459..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/js-yaml/lib/js-yaml/type/float.js deleted file mode 100644 index 127671b..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/float.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (data === null) return false; - - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; - } - - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } - - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if (value === '.nan') { - return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/js-yaml/lib/js-yaml/type/int.js deleted file mode 100644 index ba61c5f..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/int.js +++ /dev/null @@ -1,173 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; - - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } - - if (value === '0') return 0; - - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/js-yaml/lib/js-yaml/type/js/function.js deleted file mode 100644 index 3604e23..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /*global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} - -var Type = require('../../type'); - -function resolveJavascriptFunction(data) { - if (data === null) return false; - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - if (ast.body[0].expression.body.type === 'BlockStatement') { - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); - } - // ES6 arrow functions can omit the BlockStatement. In that case, just return - // the body. - /*eslint-disable no-new-func*/ - return new Function(params, 'return ' + source.slice(body[0], body[1])); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js deleted file mode 100644 index 43fa470..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; - } - - return true; -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js deleted file mode 100644 index 95b5569..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/js-yaml/lib/js-yaml/type/map.js deleted file mode 100644 index f327bee..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/map.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/js-yaml/lib/js-yaml/type/merge.js deleted file mode 100644 index ae08a86..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/js-yaml/lib/js-yaml/type/null.js deleted file mode 100644 index 6874daa..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/null.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/js-yaml/lib/js-yaml/type/omap.js deleted file mode 100644 index b2b5323..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if (_toString.call(pair) !== '[object Object]') return false; - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; - } - } - - if (!pairHasKey) return false; - - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } - - return true; -} - -function constructYamlOmap(data) { - return data !== null ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/js-yaml/lib/js-yaml/type/pairs.js deleted file mode 100644 index 74b5240..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (data === null) return true; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if (_toString.call(pair) !== '[object Object]') return false; - - keys = Object.keys(pair); - - if (keys.length !== 1) return false; - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (data === null) return []; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/js-yaml/lib/js-yaml/type/seq.js deleted file mode 100644 index be8f77f..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/js-yaml/lib/js-yaml/type/set.js deleted file mode 100644 index f885a32..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/set.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (data === null) return true; - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; - } - } - - return true; -} - -function constructYamlSet(data) { - return data !== null ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/js-yaml/lib/js-yaml/type/str.js deleted file mode 100644 index 27acc10..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/str.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js deleted file mode 100644 index 8fa9c58..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); diff --git a/node_modules/js-yaml/package.json b/node_modules/js-yaml/package.json deleted file mode 100644 index d745ebe..0000000 --- a/node_modules/js-yaml/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_from": "js-yaml@^3.12.0", - "_id": "js-yaml@3.12.0", - "_inBundle": false, - "_integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", - "_location": "/js-yaml", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "js-yaml@^3.12.0", - "name": "js-yaml", - "escapedName": "js-yaml", - "rawSpec": "^3.12.0", - "saveSpec": null, - "fetchSpec": "^3.12.0" - }, - "_requiredBy": [ - "/app-builder-lib", - "/builder-util", - "/dmg-builder", - "/read-config-file" - ], - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "_shasum": "eaed656ec8344f10f527c6bfa1b6e2244de167d1", - "_spec": "js-yaml@^3.12.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "author": { - "name": "Vladimir Zapparov", - "email": "dervus.grim@gmail.com" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - }, - "bugs": { - "url": "https://github.com/nodeca/js-yaml/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Aleksey V Zapparov", - "email": "ixti@member.fsf.org", - "url": "http://www.ixti.net/" - }, - { - "name": "Vitaly Puzrin", - "email": "vitaly@rcdesign.ru", - "url": "https://github.com/puzrin" - }, - { - "name": "Martin Grenfell", - "email": "martin.grenfell@gmail.com", - "url": "http://got-ravings.blogspot.com" - } - ], - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "deprecated": false, - "description": "YAML 1.2 parser and serializer", - "devDependencies": { - "ansi": "^0.3.1", - "benchmark": "^2.1.4", - "browserify": "^16.2.2", - "codemirror": "^5.13.4", - "eslint": "^4.1.1", - "fast-check": "1.1.3", - "istanbul": "^0.4.5", - "mocha": "^5.2.0", - "uglify-js": "^3.0.1" - }, - "files": [ - "index.js", - "lib/", - "bin/", - "dist/" - ], - "homepage": "https://github.com/nodeca/js-yaml", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" - ], - "license": "MIT", - "name": "js-yaml", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/js-yaml.git" - }, - "scripts": { - "test": "make test" - }, - "version": "3.12.0" -} diff --git a/node_modules/jsbn/package.json b/node_modules/jsbn/package.json index dbeead0..c1a43d2 100644 --- a/node_modules/jsbn/package.json +++ b/node_modules/jsbn/package.json @@ -1,36 +1,39 @@ { - "_from": "jsbn@~0.1.0", + "_args": [ + [ + "jsbn@0.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "jsbn@0.1.1", "_id": "jsbn@0.1.1", "_inBundle": false, "_integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "_location": "/jsbn", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "jsbn@~0.1.0", + "raw": "jsbn@0.1.1", "name": "jsbn", "escapedName": "jsbn", - "rawSpec": "~0.1.0", + "rawSpec": "0.1.1", "saveSpec": null, - "fetchSpec": "~0.1.0" + "fetchSpec": "0.1.1" }, "_requiredBy": [ "/ecc-jsbn", "/sshpk" ], "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "_shasum": "a5e654c2e5a2deb5f201d96cefbca80c0ef2f513", - "_spec": "jsbn@~0.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sshpk", + "_spec": "0.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Tom Wu" }, "bugs": { "url": "https://github.com/andyperlitch/jsbn/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.", "homepage": "https://github.com/andyperlitch/jsbn#readme", "keywords": [ diff --git a/node_modules/json-schema-traverse/package.json b/node_modules/json-schema-traverse/package.json index 69dc0cc..e9723ea 100644 --- a/node_modules/json-schema-traverse/package.json +++ b/node_modules/json-schema-traverse/package.json @@ -1,35 +1,38 @@ { - "_from": "json-schema-traverse@^0.4.1", + "_args": [ + [ + "json-schema-traverse@0.4.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "json-schema-traverse@0.4.1", "_id": "json-schema-traverse@0.4.1", "_inBundle": false, "_integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "_location": "/json-schema-traverse", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "json-schema-traverse@^0.4.1", + "raw": "json-schema-traverse@0.4.1", "name": "json-schema-traverse", "escapedName": "json-schema-traverse", - "rawSpec": "^0.4.1", + "rawSpec": "0.4.1", "saveSpec": null, - "fetchSpec": "^0.4.1" + "fetchSpec": "0.4.1" }, "_requiredBy": [ "/ajv" ], "_resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "_shasum": "69f6a87d9513ab8bb8fe63bdb0979c448e684660", - "_spec": "json-schema-traverse@^0.4.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/ajv", + "_spec": "0.4.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Evgeny Poberezkin" }, "bugs": { "url": "https://github.com/epoberezkin/json-schema-traverse/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Traverse JSON Schema passing each schema object to callback", "devDependencies": { "coveralls": "^2.13.1", diff --git a/node_modules/json-schema/package.json b/node_modules/json-schema/package.json index 247b96d..b6cb674 100644 --- a/node_modules/json-schema/package.json +++ b/node_modules/json-schema/package.json @@ -1,4 +1,10 @@ { + "_args": [ + [ + "json-schema@0.2.3", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], "_from": "json-schema@0.2.3", "_id": "json-schema@0.2.3", "_inBundle": false, @@ -19,17 +25,14 @@ "/jsprim" ], "_resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "_shasum": "b480c892e59a2f05954ce727bd3f2a4e882f9e13", - "_spec": "json-schema@0.2.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/jsprim", + "_spec": "0.2.3", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Kris Zyp" }, "bugs": { "url": "https://github.com/kriszyp/json-schema/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "JSON Schema validation and specifications", "devDependencies": { "vows": "*" diff --git a/node_modules/json-stringify-safe/package.json b/node_modules/json-stringify-safe/package.json index 58567ff..84f19f8 100644 --- a/node_modules/json-stringify-safe/package.json +++ b/node_modules/json-stringify-safe/package.json @@ -1,27 +1,32 @@ { - "_from": "json-stringify-safe@~5.0.1", + "_args": [ + [ + "json-stringify-safe@5.0.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "json-stringify-safe@5.0.1", "_id": "json-stringify-safe@5.0.1", "_inBundle": false, "_integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "_location": "/json-stringify-safe", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "json-stringify-safe@~5.0.1", + "raw": "json-stringify-safe@5.0.1", "name": "json-stringify-safe", "escapedName": "json-stringify-safe", - "rawSpec": "~5.0.1", + "rawSpec": "5.0.1", "saveSpec": null, - "fetchSpec": "~5.0.1" + "fetchSpec": "5.0.1" }, "_requiredBy": [ "/request" ], "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "_spec": "json-stringify-safe@~5.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "5.0.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -30,7 +35,6 @@ "bugs": { "url": "https://github.com/isaacs/json-stringify-safe/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Andri Möll", @@ -38,7 +42,6 @@ "url": "http://themoll.com" } ], - "deprecated": false, "description": "Like JSON.stringify, but doesn't blow up on circular refs.", "devDependencies": { "mocha": ">= 2.1.0 < 3", diff --git a/node_modules/json5/CHANGELOG.md b/node_modules/json5/CHANGELOG.md deleted file mode 100644 index b27fd07..0000000 --- a/node_modules/json5/CHANGELOG.md +++ /dev/null @@ -1,315 +0,0 @@ -### v2.1.0 [[code][c2.1.0], [diff][d2.1.0]] - -[c2.1.0]: https://github.com/json5/json5/tree/v2.1.0 -[d2.1.0]: https://github.com/json5/json5/compare/v2.0.1...v2.1.0 - -- New: The `index.mjs` and `index.min.mjs` browser builds in the `dist` - directory support ES6 modules. ([#187]) - -### v2.0.1 [[code][c2.0.1], [diff][d2.0.1]] - -[c2.0.1]: https://github.com/json5/json5/tree/v2.0.1 -[d2.0.1]: https://github.com/json5/json5/compare/v2.0.0...v2.0.1 - -- Fix: The browser builds in the `dist` directory support ES5. ([#182]) - -### v2.0.0 [[code][c2.0.0], [diff][d2.0.0]] - -[c2.0.0]: https://github.com/json5/json5/tree/v2.0.0 -[d2.0.0]: https://github.com/json5/json5/compare/v1.0.1...v2.0.0 - -- **Major**: JSON5 officially supports Node.js v6 and later. Support for Node.js - v4 has been dropped. Since Node.js v6 supports ES5 features, the code has been - rewritten in native ES5, and the dependence on Babel has been eliminated. - -- New: Support for Unicode 10 has been added. - -- New: The test framework has been migrated from Mocha to Tap. - -- New: The browser build at `dist/index.js` is no longer minified by default. A - minified version is available at `dist/index.min.js`. ([#181]) - -- Fix: The warning has been made clearer when line and paragraph separators are - used in strings. - -- Fix: `package.json5` has been restored, and it is automatically generated and - committed when the version is bumped. A new `build-package` NPM script has - been added to facilitate this. - -### v1.0.1 [[code][c1.0.1], [diff][d1.0.1]] - -[c1.0.1]: https://github.com/json5/json5/tree/v1.0.1 -[d1.0.1]: https://github.com/json5/json5/compare/v1.0.0...v1.0.1 - -This release includes a bug fix and minor change. - -- Fix: `parse` throws on unclosed objects and arrays. - -- New: `package.json5` has been removed until an easier way to keep it in sync - with `package.json` is found. - - -### v1.0.0 [[code][c1.0.0], [diff][d1.0.0]] - -[c1.0.0]: https://github.com/json5/json5/tree/v1.0.0 -[d1.0.0]: https://github.com/json5/json5/compare/v0.5.1...v1.0.0 - -This release includes major internal changes and public API enhancements. - -- **Major**: JSON5 officially supports Node.js v4 and later. Support for Node.js - v0.10 and v0.12 have been dropped. - -- New: Unicode property names and Unicode escapes in property names are - supported. ([#1]) - -- New: `stringify` outputs trailing commas in objects and arrays when a `space` - option is provided. ([#66]) - -- New: JSON5 allows line and paragraph separator characters (U+2028 and U+2029) - in strings in order to be compatible with JSON. However, ES5 does not allow - these characters in strings, so JSON5 gives a warning when they are parsed and - escapes them when they are stringified. ([#70]) - -- New: `stringify` accepts an options object as its second argument. The - supported options are `replacer`, `space`, and a new `quote` option that - specifies the quote character used in strings. ([#71]) - -- New: The CLI supports STDIN and STDOUT and adds `--out-file`, `--space`, and - `--validate` options. See `json5 --help` for more information. ([#72], [#84], - and [#108]) - -- New: In addition to the white space characters space `\t`, `\v`, `\f`, `\n`, - `\r`, and `\xA0`, the additional white space characters `\u2028`, `\u2029`, - and all other characters in the Space Separator Unicode category are allowed. - -- New: In addition to the character escapes `\'`, `\"`, `\\`, `\b`, `\f`, `\n`, - `\r`, and `\t`, the additional character escapes `\v` and `\0`, hexadecimal - escapes like `\x0F`, and unnecessary escapes like `\a` are allowed in string - values and string property names. - -- New: `stringify` outputs strings with single quotes by default but - intelligently uses double quotes if there are more single quotes than double - quotes inside the string. (i.e. `stringify('Stay here.')` outputs - `'Stay here.'` while `stringify('Let\'s go.')` outputs `"Let's go."`) - -- New: When a character is not allowed in a string, `stringify` outputs a - character escape like `\t` when available, a hexadecimal escape like `\x0F` - when the Unicode code point is less than 256, or a Unicode character escape - like `\u01FF`, in that order. - -- New: `stringify` checks for a `toJSON5` method on objects and, if it exists, - stringifies its return value instead of the object. `toJSON5` overrides - `toJSON` if they both exist. - -- New: To `require` or `import` JSON5 files, use `require('json5/lib/register')` - or `import 'json5/lib/register'`. Previous versions used `json5/lib/require`, - which still exists for backward compatibility but is deprecated and will give - a warning. - -- New: To use JSON5 in browsers, use the file at `dist/index.js` or - `https://unpkg.com/json5@^1.0.0`. - -- Fix: `stringify` properly outputs `Infinity` and `NaN`. ([#67]) - -- Fix: `isWord` no longer becomes a property of `JSON5` after calling - `stringify`. ([#68] and [#89]) - -- Fix: `stringify` no longer throws when an object does not have a `prototype`. - ([#154]) - -- Fix: `stringify` properly handles the `key` argument of `toJSON(key)` methods. - `toJSON5(key)` follows this pattern. - -- Fix: `stringify` accepts `Number` and `String` objects as its `space` - argument. - -- Fix: In addition to a function, `stringify` also accepts an array of keys to - include in the output as its `replacer` argument. Numbers, `Number` objects, - and `String` objects will be converted to a string if they are given as array - values. - - -### v0.5.1 [[code][c0.5.1], [diff][d0.5.1]] - -[c0.5.1]: https://github.com/json5/json5/tree/v0.5.1 -[d0.5.1]: https://github.com/json5/json5/compare/v0.5.0...v0.5.1 - -This release includes a minor fix for indentations when stringifying empty -arrays. - -- Fix: Indents no longer appear in empty arrays when stringified. ([#134]) - - -### v0.5.0 [[code][c0.5.0], [diff][d0.5.0]] - -[c0.5.0]: https://github.com/json5/json5/tree/v0.5.0 -[d0.5.0]: https://github.com/json5/json5/compare/v0.4.0...v0.5.0 - -This release includes major internal changes and public API enhancements. - -- **Major:** JSON5 officially supports Node.js v4 LTS and v5. Support for - Node.js v0.6 and v0.8 have been dropped, while support for v0.10 and v0.12 - remain. - -- Fix: YUI Compressor no longer fails when compressing json5.js. ([#97]) - -- New: `parse` and the CLI provide line and column numbers when displaying error - messages. ([#101]; awesome work by [@amb26].) - - -### v0.4.0 [[code][c0.4.0], [diff][d0.4.0]] - -[c0.4.0]: https://github.com/json5/json5/tree/v0.4.0 -[d0.4.0]: https://github.com/json5/json5/compare/v0.2.0...v0.4.0 - -Note that v0.3.0 was tagged, but never published to npm, so this v0.4.0 -changelog entry includes v0.3.0 features. - -This is a massive release that adds `stringify` support, among other things. - -- **Major:** `JSON5.stringify()` now exists! - This method is analogous to the native `JSON.stringify()`; - it just avoids quoting keys where possible. - See the [usage documentation](./README.md#usage) for more. - ([#32]; huge thanks and props [@aeisenberg]!) - -- New: `NaN` and `-NaN` are now allowed number literals. - ([#30]; thanks [@rowanhill].) - -- New: Duplicate object keys are now allowed; the last value is used. - This is the same behavior as JSON. ([#57]; thanks [@jordanbtucker].) - -- Fix: Properly handle various whitespace and newline cases now. - E.g. JSON5 now properly supports escaped CR and CRLF newlines in strings, - and JSON5 now accepts the same whitespace as JSON (stricter than ES5). - ([#58], [#60], and [#63]; thanks [@jordanbtucker].) - -- New: Negative hexadecimal numbers (e.g. `-0xC8`) are allowed again. - (They were disallowed in v0.2.0; see below.) - It turns out they *are* valid in ES5, so JSON5 supports them now too. - ([#36]; thanks [@jordanbtucker]!) - - -### v0.2.0 [[code][c0.2.0], [diff][d0.2.0]] - -[c0.2.0]: https://github.com/json5/json5/tree/v0.2.0 -[d0.2.0]: https://github.com/json5/json5/compare/v0.1.0...v0.2.0 - -This release fixes some bugs and adds some more utility features to help you -express data more easily: - -- **Breaking:** Negative hexadecimal numbers (e.g. `-0xC8`) are rejected now. - While V8 (e.g. Chrome and Node) supported them, it turns out they're invalid - in ES5. This has been [fixed in V8][v8-hex-fix] (and by extension, Chrome - and Node), so JSON5 officially rejects them now, too. ([#36]) - -- New: Trailing decimal points in decimal numbers are allowed again. - (They were disallowed in v0.1.0; see below.) - They're allowed by ES5, and differentiating between integers and floats may - make sense on some platforms. ([#16]; thanks [@Midar].) - -- New: `Infinity` and `-Infinity` are now allowed number literals. - ([#30]; thanks [@pepkin88].) - -- New: Plus signs (`+`) in front of numbers are now allowed, since it can - be helpful in some contexts to explicitly mark numbers as positive. - (E.g. when a property represents changes or deltas.) - -- Fix: unescaped newlines in strings are rejected now. - ([#24]; thanks [@Midar].) - - -### v0.1.0 [[code][c0.1.0], [diff][d0.1.0]] - -[c0.1.0]: https://github.com/json5/json5/tree/v0.1.0 -[d0.1.0]: https://github.com/json5/json5/compare/v0.0.1...v0.1.0 - -This release tightens JSON5 support and adds helpful utility features: - -- New: Support hexadecimal numbers. (Thanks [@MaxNanasy].) - -- Fix: Reject octal numbers properly now. Previously, they were accepted but - improperly parsed as base-10 numbers. (Thanks [@MaxNanasy].) - -- **Breaking:** Reject "noctal" numbers now (base-10 numbers that begin with a - leading zero). These are disallowed by both JSON5 and JSON, as well as by - ES5's strict mode. (Thanks [@MaxNanasy].) - -- New: Support leading decimal points in decimal numbers. - (Thanks [@MaxNanasy].) - -- **Breaking:** Reject trailing decimal points in decimal numbers now. These - are disallowed by both JSON5 and JSON. (Thanks [@MaxNanasy].) - -- **Breaking:** Reject omitted elements in arrays now. These are disallowed by - both JSON5 and JSON. - -- Fix: Throw proper `SyntaxError` instances on errors now. - -- New: Add Node.js `require()` hook. Register via `json5/lib/require`. - -- New: Add Node.js `json5` executable to compile JSON5 files to JSON. - - -### v0.0.1 [[code][c0.0.1], [diff][d0.0.1]] - -[c0.0.1]: https://github.com/json5/json5/tree/v0.0.1 -[d0.0.1]: https://github.com/json5/json5/compare/v0.0.0...v0.0.1 - -This was the first implementation of this JSON5 parser. - -- Support unquoted object keys, including reserved words. Unicode characters - and escape sequences sequences aren't yet supported. - -- Support single-quoted strings. - -- Support multi-line strings. - -- Support trailing commas in arrays and objects. - -- Support comments, both inline and block. - - -### v0.0.0 [[code](https://github.com/json5/json5/tree/v0.0.0)] - -Let's consider this to be Douglas Crockford's original [json_parse.js] — a -parser for the regular JSON format. - - -[json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js -[v8-hex-fix]: http://code.google.com/p/v8/issues/detail?id=2240 - -[@MaxNanasy]: https://github.com/MaxNanasy -[@Midar]: https://github.com/Midar -[@pepkin88]: https://github.com/pepkin88 -[@rowanhill]: https://github.com/rowanhill -[@aeisenberg]: https://github.com/aeisenberg -[@jordanbtucker]: https://github.com/jordanbtucker -[@amb26]: https://github.com/amb26 - -[#1]: https://github.com/json5/json5/issues/1 -[#16]: https://github.com/json5/json5/issues/16 -[#24]: https://github.com/json5/json5/issues/24 -[#30]: https://github.com/json5/json5/issues/30 -[#32]: https://github.com/json5/json5/issues/32 -[#36]: https://github.com/json5/json5/issues/36 -[#57]: https://github.com/json5/json5/issues/57 -[#58]: https://github.com/json5/json5/pull/58 -[#60]: https://github.com/json5/json5/pull/60 -[#63]: https://github.com/json5/json5/pull/63 -[#66]: https://github.com/json5/json5/issues/66 -[#67]: https://github.com/json5/json5/issues/67 -[#68]: https://github.com/json5/json5/issues/68 -[#70]: https://github.com/json5/json5/issues/70 -[#71]: https://github.com/json5/json5/issues/71 -[#72]: https://github.com/json5/json5/issues/72 -[#84]: https://github.com/json5/json5/pull/84 -[#89]: https://github.com/json5/json5/pull/89 -[#97]: https://github.com/json5/json5/pull/97 -[#101]: https://github.com/json5/json5/pull/101 -[#108]: https://github.com/json5/json5/pull/108 -[#134]: https://github.com/json5/json5/pull/134 -[#154]: https://github.com/json5/json5/issues/154 -[#181]: https://github.com/json5/json5/issues/181 -[#182]: https://github.com/json5/json5/issues/182 -[#187]: https://github.com/json5/json5/issues/187 diff --git a/node_modules/json5/LICENSE.md b/node_modules/json5/LICENSE.md deleted file mode 100644 index 2171aca..0000000 --- a/node_modules/json5/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -MIT License - -Copyright (c) 2012-2018 Aseem Kishore, and [others]. - -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. - -[others]: https://github.com/json5/json5/contributors diff --git a/node_modules/json5/README.md b/node_modules/json5/README.md deleted file mode 100644 index 9064b12..0000000 --- a/node_modules/json5/README.md +++ /dev/null @@ -1,234 +0,0 @@ -# JSON5 – JSON for Humans - -[![Build Status](https://travis-ci.org/json5/json5.svg)][Build Status] -[![Coverage -Status](https://coveralls.io/repos/github/json5/json5/badge.svg)][Coverage -Status] - -The JSON5 Data Interchange Format (JSON5) is a superset of [JSON] that aims to -alleviate some of the limitations of JSON by expanding its syntax to include -some productions from [ECMAScript 5.1]. - -This JavaScript library is the official reference implementation for JSON5 -parsing and serialization libraries. - -[Build Status]: https://travis-ci.org/json5/json5 - -[Coverage Status]: https://coveralls.io/github/json5/json5 - -[JSON]: https://tools.ietf.org/html/rfc7159 - -[ECMAScript 5.1]: https://www.ecma-international.org/ecma-262/5.1/ - -## Summary of Features -The following ECMAScript 5.1 features, which are not supported in JSON, have -been extended to JSON5. - -### Objects -- Object keys may be an ECMAScript 5.1 _[IdentifierName]_. -- Objects may have a single trailing comma. - -### Arrays -- Arrays may have a single trailing comma. - -### Strings -- Strings may be single quoted. -- Strings may span multiple lines by escaping new line characters. -- Strings may include character escapes. - -### Numbers -- Numbers may be hexadecimal. -- Numbers may have a leading or trailing decimal point. -- Numbers may be [IEEE 754] positive infinity, negative infinity, and NaN. -- Numbers may begin with an explicit plus sign. - -### Comments -- Single and multi-line comments are allowed. - -### White Space -- Additional white space characters are allowed. - -[IdentifierName]: https://www.ecma-international.org/ecma-262/5.1/#sec-7.6 - -[IEEE 754]: http://ieeexplore.ieee.org/servlet/opac?punumber=4610933 - -## Short Example -```js -{ - // comments - unquoted: 'and you can quote me on that', - singleQuotes: 'I can use "double quotes" here', - lineBreaks: "Look, Mom! \ -No \\n's!", - hexadecimal: 0xdecaf, - leadingDecimalPoint: .8675309, andTrailing: 8675309., - positiveSign: +1, - trailingComma: 'in objects', andIn: ['arrays',], - "backwardsCompatible": "with JSON", -} -``` - -## Specification -For a detailed explanation of the JSON5 format, please read the [official -specification](https://json5.github.io/json5-spec/). - -## Installation -### Node.js -```sh -npm install json5 -``` - -```js -const JSON5 = require('json5') -``` - -### Browsers -```html - -``` - -This will create a global `JSON5` variable. - -## API -The JSON5 API is compatible with the [JSON API]. - -[JSON API]: -https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON - -### JSON5.parse() -Parses a JSON5 string, constructing the JavaScript value or object described by -the string. An optional reviver function can be provided to perform a -transformation on the resulting object before it is returned. - -#### Syntax - JSON5.parse(text[, reviver]) - -#### Parameters -- `text`: The string to parse as JSON5. -- `reviver`: If a function, this prescribes how the value originally produced by - parsing is transformed, before being returned. - -#### Return value -The object corresponding to the given JSON5 text. - -### JSON5.stringify() -Converts a JavaScript value to a JSON5 string, optionally replacing values if a -replacer function is specified, or optionally including only the specified -properties if a replacer array is specified. - -#### Syntax - JSON5.stringify(value[, replacer[, space]]) - JSON5.stringify(value[, options]) - -#### Parameters -- `value`: The value to convert to a JSON5 string. -- `replacer`: A function that alters the behavior of the stringification - process, or an array of String and Number objects that serve as a whitelist - for selecting/filtering the properties of the value object to be included in - the JSON5 string. If this value is null or not provided, all properties of the - object are included in the resulting JSON5 string. -- `space`: A String or Number object that's used to insert white space into the - output JSON5 string for readability purposes. If this is a Number, it - indicates the number of space characters to use as white space; this number is - capped at 10 (if it is greater, the value is just 10). Values less than 1 - indicate that no space should be used. If this is a String, the string (or the - first 10 characters of the string, if it's longer than that) is used as white - space. If this parameter is not provided (or is null), no white space is used. - If white space is used, trailing commas will be used in objects and arrays. -- `options`: An object with the following properties: - - `replacer`: Same as the `replacer` parameter. - - `space`: Same as the `space` parameter. - - `quote`: A String representing the quote character to use when serializing - strings. - -#### Return value -A JSON5 string representing the value. - -### Node.js `require()` JSON5 files -When using Node.js, you can `require()` JSON5 files by adding the following -statement. - -```js -require('json5/lib/register') -``` - -Then you can load a JSON5 file with a Node.js `require()` statement. For -example: - -```js -const config = require('./config.json5') -``` - -## CLI -Since JSON is more widely used than JSON5, this package includes a CLI for -converting JSON5 to JSON and for validating the syntax of JSON5 documents. - -### Installation -```sh -npm install --global json5 -``` - -### Usage -```sh -json5 [options] -``` - -If `` is not provided, then STDIN is used. - -#### Options: -- `-s`, `--space`: The number of spaces to indent or `t` for tabs -- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT -- `-v`, `--validate`: Validate JSON5 but do not output JSON -- `-V`, `--version`: Output the version number -- `-h`, `--help`: Output usage information - -## Contributing -### Development -```sh -git clone https://github.com/json5/json5 -cd json5 -npm install -``` - -When contributing code, please write relevant tests and run `npm test` and `npm -run lint` before submitting pull requests. Please use an editor that supports -[EditorConfig](http://editorconfig.org/). - -### Issues -To report bugs or request features regarding the JSON5 data format, please -submit an issue to the [official specification -repository](https://github.com/json5/json5-spec). - -To report bugs or request features regarding the JavaScript implentation of -JSON5, please submit an issue to this repository. - -## License -MIT. See [LICENSE.md](./LICENSE.md) for details. - -## Credits -[Assem Kishore](https://github.com/aseemk) founded this project. - -[Michael Bolin](http://bolinfest.com/) independently arrived at and published -some of these same ideas with awesome explanations and detail. Recommended -reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html) - -[Douglas Crockford](http://www.crockford.com/) of course designed and built -JSON, but his state machine diagrams on the [JSON website](http://json.org/), as -cheesy as it may sound, gave us motivation and confidence that building a new -parser to implement these ideas was within reach! The original -implementation of JSON5 was also modeled directly off of Doug’s open-source -[json_parse.js] parser. We’re grateful for that clean and well-documented -code. - -[json_parse.js]: -https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js - -[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific -supporter, contributing multiple patches and ideas. - -[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original -`stringify` method. - -[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely -with ES5, wrote the official JSON5 specification, completely rewrote the -codebase from the ground up, and is actively maintaining this project. diff --git a/node_modules/json5/dist/index.js b/node_modules/json5/dist/index.js deleted file mode 100644 index dcbe04f..0000000 --- a/node_modules/json5/dist/index.js +++ /dev/null @@ -1,1688 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.JSON5 = factory()); -}(this, (function () { 'use strict'; - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var _global = createCommonjsModule(function (module) { - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); - if (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef - }); - - var _core = createCommonjsModule(function (module) { - var core = module.exports = { version: '2.5.7' }; - if (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef - }); - var _core_1 = _core.version; - - var _isObject = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; - }; - - var _anObject = function (it) { - if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); } - return it; - }; - - var _fails = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } - }; - - // Thank's IE8 for his funny defineProperty - var _descriptors = !_fails(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; - }); - - var document = _global.document; - // typeof document.createElement is 'object' in old IE - var is = _isObject(document) && _isObject(document.createElement); - var _domCreate = function (it) { - return is ? document.createElement(it) : {}; - }; - - var _ie8DomDefine = !_descriptors && !_fails(function () { - return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; - }); - - // 7.1.1 ToPrimitive(input [, PreferredType]) - - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - var _toPrimitive = function (it, S) { - if (!_isObject(it)) { return it; } - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } - if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; } - if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } - throw TypeError("Can't convert object to primitive value"); - }; - - var dP = Object.defineProperty; - - var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { - _anObject(O); - P = _toPrimitive(P, true); - _anObject(Attributes); - if (_ie8DomDefine) { try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } } - if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); } - if ('value' in Attributes) { O[P] = Attributes.value; } - return O; - }; - - var _objectDp = { - f: f - }; - - var _propertyDesc = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; - }; - - var _hide = _descriptors ? function (object, key, value) { - return _objectDp.f(object, key, _propertyDesc(1, value)); - } : function (object, key, value) { - object[key] = value; - return object; - }; - - var hasOwnProperty = {}.hasOwnProperty; - var _has = function (it, key) { - return hasOwnProperty.call(it, key); - }; - - var id = 0; - var px = Math.random(); - var _uid = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); - }; - - var _redefine = createCommonjsModule(function (module) { - var SRC = _uid('src'); - var TO_STRING = 'toString'; - var $toString = Function[TO_STRING]; - var TPL = ('' + $toString).split(TO_STRING); - - _core.inspectSource = function (it) { - return $toString.call(it); - }; - - (module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); } - if (O[key] === val) { return; } - if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); } - if (O === _global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - _hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - _hide(O, key, val); - } - // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative - })(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); - }); - }); - - var _aFunction = function (it) { - if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); } - return it; - }; - - // optional / simple context binding - - var _ctx = function (fn, that, length) { - _aFunction(fn); - if (that === undefined) { return fn; } - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; - }; - - var PROTOTYPE = 'prototype'; - - var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) { source = name; } - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; - // extend global - if (target) { _redefine(target, key, out, type & $export.U); } - // export - if (exports[key] != out) { _hide(exports, key, exp); } - if (IS_PROTO && expProto[key] != out) { expProto[key] = out; } - } - }; - _global.core = _core; - // type bitmap - $export.F = 1; // forced - $export.G = 2; // global - $export.S = 4; // static - $export.P = 8; // proto - $export.B = 16; // bind - $export.W = 32; // wrap - $export.U = 64; // safe - $export.R = 128; // real proto method for `library` - var _export = $export; - - // 7.1.4 ToInteger - var ceil = Math.ceil; - var floor = Math.floor; - var _toInteger = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); - }; - - // 7.2.1 RequireObjectCoercible(argument) - var _defined = function (it) { - if (it == undefined) { throw TypeError("Can't call method on " + it); } - return it; - }; - - // true -> String#at - // false -> String#codePointAt - var _stringAt = function (TO_STRING) { - return function (that, pos) { - var s = String(_defined(that)); - var i = _toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; } - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; - }; - - var $at = _stringAt(false); - _export(_export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } - }); - - var codePointAt = _core.String.codePointAt; - - var max = Math.max; - var min = Math.min; - var _toAbsoluteIndex = function (index, length) { - index = _toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); - }; - - var fromCharCode = String.fromCharCode; - var $fromCodePoint = String.fromCodePoint; - - // length should be 1, old FF problem - _export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { - var arguments$1 = arguments; - // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments$1[i++]; - if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); } - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } - }); - - var fromCodePoint = _core.String.fromCodePoint; - - // This is a generated file. Do not edit. - var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/; - var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\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DC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/; - var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10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uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\u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uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/; - - var unicode = { - Space_Separator: Space_Separator, - ID_Start: ID_Start, - ID_Continue: ID_Continue - }; - - var util = { - isSpaceSeparator: function isSpaceSeparator (c) { - return unicode.Space_Separator.test(c) - }, - - isIdStartChar: function isIdStartChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar: function isIdContinueChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit: function isDigit (c) { - return /[0-9]/.test(c) - }, - - isHexDigit: function isHexDigit (c) { - return /[0-9A-Fa-f]/.test(c) - }, - }; - - var source; - var parseState; - var stack; - var pos; - var line; - var column; - var token; - var key; - var root; - - var parse = function parse (text, reviver) { - source = String(text); - parseState = 'start'; - stack = []; - pos = 0; - line = 1; - column = 0; - token = undefined; - key = undefined; - root = undefined; - - do { - token = lex(); - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState](); - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root - }; - - function internalize (holder, name, reviver) { - var value = holder[name]; - if (value != null && typeof value === 'object') { - for (var key in value) { - var replacement = internalize(value, key, reviver); - if (replacement === undefined) { - delete value[key]; - } else { - value[key] = replacement; - } - } - } - - return reviver.call(holder, name, value) - } - - var lexState; - var buffer; - var doubleQuote; - var sign; - var c; - - function lex () { - lexState = 'default'; - buffer = ''; - doubleQuote = false; - sign = 1; - - for (;;) { - c = peek(); - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - var token = lexStates[lexState](); - if (token) { - return token - } - } - } - - function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } - } - - function read () { - var c = peek(); - - if (c === '\n') { - line++; - column = 0; - } else if (c) { - column += c.length; - } else { - column++; - } - - if (c) { - pos += c.length; - } - - return c - } - - var lexStates = { - default: function default$1 () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - return - - case '/': - read(); - lexState = 'comment'; - return - - case undefined: - read(); - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read(); - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment: function comment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineComment'; - return - - case '/': - read(); - lexState = 'singleLineComment'; - return - } - - throw invalidChar(read()) - }, - - multiLineComment: function multiLineComment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineCommentAsterisk'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - }, - - multiLineCommentAsterisk: function multiLineCommentAsterisk () { - switch (c) { - case '*': - read(); - return - - case '/': - read(); - lexState = 'default'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - lexState = 'multiLineComment'; - }, - - singleLineComment: function singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - lexState = 'default'; - return - - case undefined: - read(); - return newToken('eof') - } - - read(); - }, - - value: function value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read(); - literal('ull'); - return newToken('null', null) - - case 't': - read(); - literal('rue'); - return newToken('boolean', true) - - case 'f': - read(); - literal('alse'); - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1; - } - - lexState = 'sign'; - return - - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"'); - buffer = ''; - lexState = 'string'; - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape: function identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - var u = unicodeEscape(); - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - identifierName: function identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read(); - return - - case '\\': - read(); - lexState = 'identifierNameEscape'; - return - } - - if (util.isIdContinueChar(c)) { - buffer += read(); - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape: function identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - var u = unicodeEscape(); - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - sign: function sign$1 () { - switch (c) { - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', sign * Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero: function zero () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - - case 'x': - case 'X': - buffer += read(); - lexState = 'hexadecimal'; - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger: function decimalInteger () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading: function decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - throw invalidChar(read()) - }, - - decimalPoint: function decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction: function decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent: function decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read(); - lexState = 'decimalExponentSign'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign: function decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger: function decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal: function hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read(); - lexState = 'hexadecimalInteger'; - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger: function hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string: function string () { - switch (c) { - case '\\': - read(); - buffer += escape(); - return - - case '"': - if (doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case "'": - if (!doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c); - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read(); - }, - - start: function start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value'; - }, - - beforePropertyName: function beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read(); - lexState = 'identifierName'; - return - - case '\\': - read(); - lexState = 'identifierNameStartEscape'; - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"'); - lexState = 'string'; - return - } - - if (util.isIdStartChar(c)) { - buffer += read(); - lexState = 'identifierName'; - return - } - - throw invalidChar(read()) - }, - - afterPropertyName: function afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue: function beforePropertyValue () { - lexState = 'value'; - }, - - afterPropertyValue: function afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue: function beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value'; - }, - - afterArrayValue: function afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end: function end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, - }; - - function newToken (type, value) { - return { - type: type, - value: value, - line: line, - column: column, - } - } - - function literal (s) { - for (var i = 0, list = s; i < list.length; i += 1) { - var c = list[i]; - - var p = peek(); - - if (p !== c) { - throw invalidChar(read()) - } - - read(); - } - } - - function escape () { - var c = peek(); - switch (c) { - case 'b': - read(); - return '\b' - - case 'f': - read(); - return '\f' - - case 'n': - read(); - return '\n' - - case 'r': - read(); - return '\r' - - case 't': - read(); - return '\t' - - case 'v': - read(); - return '\v' - - case '0': - read(); - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read(); - return hexEscape() - - case 'u': - read(); - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read(); - return '' - - case '\r': - read(); - if (peek() === '\n') { - read(); - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() - } - - function hexEscape () { - var buffer = ''; - var c = peek(); - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - return String.fromCodePoint(parseInt(buffer, 16)) - } - - function unicodeEscape () { - var buffer = ''; - var count = 4; - - while (count-- > 0) { - var c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - } - - return String.fromCodePoint(parseInt(buffer, 16)) - } - - var parseStates = { - start: function start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforePropertyName: function beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value; - parseState = 'afterPropertyName'; - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop(); - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName: function afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue'; - }, - - beforePropertyValue: function beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforeArrayValue: function beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop(); - return - } - - push(); - }, - - afterPropertyValue: function afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName'; - return - - case '}': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue: function afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue'; - return - - case ']': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end: function end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, - }; - - function push () { - var value; - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {}; - break - - case '[': - value = []; - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value; - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value; - } else { - var parent = stack[stack.length - 1]; - if (Array.isArray(parent)) { - parent.push(value); - } else { - parent[key] = value; - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value); - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue'; - } else { - parseState = 'beforePropertyName'; - } - } else { - var current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } - } - - function pop () { - stack.pop(); - - var current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } - - // This code is unreachable. - // function invalidParseState () { - // return new Error(`JSON5: invalid parse state '${parseState}'`) - // } - - // This code is unreachable. - // function invalidLexState (state) { - // return new Error(`JSON5: invalid lex state '${state}'`) - // } - - function invalidChar (c) { - if (c === undefined) { - return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) - } - - return syntaxError(("JSON5: invalid character '" + (formatChar(c)) + "' at " + line + ":" + column)) - } - - function invalidEOF () { - return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) - } - - // This code is unreachable. - // function invalidToken () { - // if (token.type === 'eof') { - // return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - // } - - // const c = String.fromCodePoint(token.value.codePointAt(0)) - // return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) - // } - - function invalidIdentifier () { - column -= 5; - return syntaxError(("JSON5: invalid identifier character at " + line + ":" + column)) - } - - function separatorChar (c) { - console.warn(("JSON5: '" + (formatChar(c)) + "' in strings is not valid ECMAScript; consider escaping")); - } - - function formatChar (c) { - var replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - var hexString = c.charCodeAt(0).toString(16); - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c - } - - function syntaxError (message) { - var err = new SyntaxError(message); - err.lineNumber = line; - err.columnNumber = column; - return err - } - - var stringify = function stringify (value, replacer, space) { - var stack = []; - var indent = ''; - var propertyList; - var replacerFunc; - var gap = ''; - var quote; - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space; - quote = replacer.quote; - replacer = replacer.replacer; - } - - if (typeof replacer === 'function') { - replacerFunc = replacer; - } else if (Array.isArray(replacer)) { - propertyList = []; - for (var i = 0, list = replacer; i < list.length; i += 1) { - var v = list[i]; - - var item = (void 0); - - if (typeof v === 'string') { - item = v; - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v); - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item); - } - } - } - - if (space instanceof Number) { - space = Number(space); - } else if (space instanceof String) { - space = String(space); - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)); - gap = ' '.substr(0, space); - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10); - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - var value = holder[key]; - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key); - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value); - } - - if (value instanceof Number) { - value = Number(value); - } else if (value instanceof String) { - value = String(value); - } else if (value instanceof Boolean) { - value = value.valueOf(); - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - var quotes = { - "'": 0.1, - '"': 0.2, - }; - - var replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - var product = ''; - - for (var i = 0, list = value; i < list.length; i += 1) { - var c = list[i]; - - switch (c) { - case "'": - case '"': - quotes[c]++; - product += c; - continue - } - - if (replacements[c]) { - product += replacements[c]; - continue - } - - if (c < ' ') { - var hexString = c.charCodeAt(0).toString(16); - product += '\\x' + ('00' + hexString).substring(hexString.length); - continue - } - - product += c; - } - - var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; }); - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - var stepback = indent; - indent = indent + gap; - - var keys = propertyList || Object.keys(value); - var partial = []; - for (var i = 0, list = keys; i < list.length; i += 1) { - var key = list[i]; - - var propertyString = serializeProperty(key, value); - if (propertyString !== undefined) { - var member = serializeKey(key) + ':'; - if (gap !== '') { - member += ' '; - } - member += propertyString; - partial.push(member); - } - } - - var final; - if (partial.length === 0) { - final = '{}'; - } else { - var properties; - if (gap === '') { - properties = partial.join(','); - final = '{' + properties + '}'; - } else { - var separator = ',\n' + indent; - properties = partial.join(separator); - final = '{\n' + indent + properties + ',\n' + stepback + '}'; - } - } - - stack.pop(); - indent = stepback; - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - var firstChar = String.fromCodePoint(key.codePointAt(0)); - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (var i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - var stepback = indent; - indent = indent + gap; - - var partial = []; - for (var i = 0; i < value.length; i++) { - var propertyString = serializeProperty(String(i), value); - partial.push((propertyString !== undefined) ? propertyString : 'null'); - } - - var final; - if (partial.length === 0) { - final = '[]'; - } else { - if (gap === '') { - var properties = partial.join(','); - final = '[' + properties + ']'; - } else { - var separator = ',\n' + indent; - var properties$1 = partial.join(separator); - final = '[\n' + indent + properties$1 + ',\n' + stepback + ']'; - } - } - - stack.pop(); - indent = stepback; - return final - } - }; - - var JSON5 = { - parse: parse, - stringify: stringify, - }; - - var lib = JSON5; - - var es5 = lib; - - return es5; - -}))); diff --git a/node_modules/json5/dist/index.min.js b/node_modules/json5/dist/index.min.js deleted file mode 100644 index b336aba..0000000 --- a/node_modules/json5/dist/index.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(u,D){"object"==typeof exports&&"undefined"!=typeof module?module.exports=D():"function"==typeof define&&define.amd?define(D):u.JSON5=D()}(this,function(){"use strict";function u(u,D){return u(D={exports:{}},D.exports),D.exports}var D=u(function(u){var D=u.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=D)}),e=u(function(u){var D=u.exports={version:"2.5.7"};"number"==typeof __e&&(__e=D)}),t=(e.version,function(u){return"object"==typeof u?null!==u:"function"==typeof u}),r=function(u){if(!t(u))throw TypeError(u+" is not an object!");return u},F=function(u){try{return!!u()}catch(u){return!0}},n=!F(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),C=D.document,A=t(C)&&t(C.createElement),E=!n&&!F(function(){return 7!=Object.defineProperty((u="div",A?C.createElement(u):{}),"a",{get:function(){return 7}}).a;var u}),i=Object.defineProperty,o={f:n?Object.defineProperty:function(u,D,e){if(r(u),D=function(u,D){if(!t(u))return u;var e,r;if(D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;if("function"==typeof(e=u.valueOf)&&!t(r=e.call(u)))return r;if(!D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;throw TypeError("Can't convert object to primitive value")}(D,!0),r(e),E)try{return i(u,D,e)}catch(u){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(u[D]=e.value),u}},a=n?function(u,D,e){return o.f(u,D,function(u,D){return{enumerable:!(1&u),configurable:!(2&u),writable:!(4&u),value:D}}(1,e))}:function(u,D,e){return u[D]=e,u},c={}.hasOwnProperty,B=function(u,D){return c.call(u,D)},s=0,f=Math.random(),l=u(function(u){var t,r="Symbol(".concat(void 0===(t="src")?"":t,")_",(++s+f).toString(36)),F=Function.toString,n=(""+F).split("toString");e.inspectSource=function(u){return F.call(u)},(u.exports=function(u,e,t,F){var C="function"==typeof t;C&&(B(t,"name")||a(t,"name",e)),u[e]!==t&&(C&&(B(t,r)||a(t,r,u[e]?""+u[e]:n.join(String(e)))),u===D?u[e]=t:F?u[e]?u[e]=t:a(u,e,t):(delete u[e],a(u,e,t)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[r]||F.call(this)})}),d=function(u,D,e){if(function(u){if("function"!=typeof u)throw TypeError(u+" is not a function!")}(u),void 0===D)return u;switch(e){case 1:return function(e){return u.call(D,e)};case 2:return function(e,t){return u.call(D,e,t)};case 3:return function(e,t,r){return u.call(D,e,t,r)}}return function(){return u.apply(D,arguments)}},v=function(u,t,r){var F,n,C,A,E=u&v.F,i=u&v.G,o=u&v.S,c=u&v.P,B=u&v.B,s=i?D:o?D[t]||(D[t]={}):(D[t]||{}).prototype,f=i?e:e[t]||(e[t]={}),p=f.prototype||(f.prototype={});for(F in i&&(r=t),r)C=((n=!E&&s&&void 0!==s[F])?s:r)[F],A=B&&n?d(C,D):c&&"function"==typeof C?d(Function.call,C):C,s&&l(s,F,C,u&v.U),f[F]!=C&&a(f,F,A),c&&p[F]!=C&&(p[F]=C)};D.core=e,v.F=1,v.G=2,v.S=4,v.P=8,v.B=16,v.W=32,v.U=64,v.R=128;var p,h=v,m=Math.ceil,g=Math.floor,y=function(u){return isNaN(u=+u)?0:(u>0?g:m)(u)},w=(p=!1,function(u,D){var e,t,r=String(function(u){if(null==u)throw TypeError("Can't call method on "+u);return u}(u)),F=y(D),n=r.length;return F<0||F>=n?p?"":void 0:(e=r.charCodeAt(F))<55296||e>56319||F+1===n||(t=r.charCodeAt(F+1))<56320||t>57343?p?r.charAt(F):e:p?r.slice(F,F+2):t-56320+(e-55296<<10)+65536});h(h.P,"String",{codePointAt:function(u){return w(this,u)}});e.String.codePointAt;var S=Math.max,b=Math.min,x=String.fromCharCode,N=String.fromCodePoint;h(h.S+h.F*(!!N&&1!=N.length),"String",{fromCodePoint:function(u){for(var D,e,t,r=arguments,F=[],n=arguments.length,C=0;n>C;){if(D=+r[C++],t=1114111,((e=y(e=D))<0?S(e+t,0):b(e,t))!==D)throw RangeError(D+" is not a valid code point");F.push(D<65536?x(D):x(55296+((D-=65536)>>10),D%1024+56320))}return F.join("")}});e.String.fromCodePoint;var P,I,O,_,j,V,J,M,L,k,T,H,$,z,R={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0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F\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40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\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},G={isSpaceSeparator:function(u){return R.Space_Separator.test(u)},isIdStartChar:function(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||R.ID_Start.test(u)},isIdContinueChar:function(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||R.ID_Continue.test(u)},isDigit:function(u){return/[0-9]/.test(u)},isHexDigit:function(u){return/[0-9A-Fa-f]/.test(u)}};function U(){for(k="default",T="",H=!1,$=1;;){z=Z();var u=W[k]();if(u)return u}}function Z(){if(P[_])return String.fromCodePoint(P.codePointAt(_))}function q(){var u=Z();return"\n"===u?(j++,V=0):u?V+=u.length:V++,u&&(_+=u.length),u}var W={default:function(){switch(z){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void q();case"/":return q(),void(k="comment");case void 0:return q(),X("eof")}if(!G.isSpaceSeparator(z))return W[I]();q()},comment:function(){switch(z){case"*":return q(),void(k="multiLineComment");case"/":return q(),void(k="singleLineComment")}throw eu(q())},multiLineComment:function(){switch(z){case"*":return q(),void(k="multiLineCommentAsterisk");case void 0:throw eu(q())}q()},multiLineCommentAsterisk:function(){switch(z){case"*":return void q();case"/":return q(),void(k="default");case void 0:throw eu(q())}q(),k="multiLineComment"},singleLineComment:function(){switch(z){case"\n":case"\r":case"\u2028":case"\u2029":return q(),void(k="default");case void 0:return q(),X("eof")}q()},value:function(){switch(z){case"{":case"[":return X("punctuator",q());case"n":return q(),K("ull"),X("null",null);case"t":return q(),K("rue"),X("boolean",!0);case"f":return q(),K("alse"),X("boolean",!1);case"-":case"+":return"-"===q()&&($=-1),void(k="sign");case".":return T=q(),void(k="decimalPointLeading");case"0":return T=q(),void(k="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return T=q(),void(k="decimalInteger");case"I":return q(),K("nfinity"),X("numeric",1/0);case"N":return q(),K("aN"),X("numeric",NaN);case'"':case"'":return H='"'===q(),T="",void(k="string")}throw eu(q())},identifierNameStartEscape:function(){if("u"!==z)throw eu(q());q();var u=Q();switch(u){case"$":case"_":break;default:if(!G.isIdStartChar(u))throw ru()}T+=u,k="identifierName"},identifierName:function(){switch(z){case"$":case"_":case"‌":case"‍":return void(T+=q());case"\\":return q(),void(k="identifierNameEscape")}if(!G.isIdContinueChar(z))return X("identifier",T);T+=q()},identifierNameEscape:function(){if("u"!==z)throw eu(q());q();var u=Q();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!G.isIdContinueChar(u))throw ru()}T+=u,k="identifierName"},sign:function(){switch(z){case".":return T=q(),void(k="decimalPointLeading");case"0":return T=q(),void(k="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return T=q(),void(k="decimalInteger");case"I":return q(),K("nfinity"),X("numeric",$*(1/0));case"N":return q(),K("aN"),X("numeric",NaN)}throw eu(q())},zero:function(){switch(z){case".":return T+=q(),void(k="decimalPoint");case"e":case"E":return T+=q(),void(k="decimalExponent");case"x":case"X":return T+=q(),void(k="hexadecimal")}return X("numeric",0*$)},decimalInteger:function(){switch(z){case".":return T+=q(),void(k="decimalPoint");case"e":case"E":return T+=q(),void(k="decimalExponent")}if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},decimalPointLeading:function(){if(G.isDigit(z))return T+=q(),void(k="decimalFraction");throw eu(q())},decimalPoint:function(){switch(z){case"e":case"E":return T+=q(),void(k="decimalExponent")}return G.isDigit(z)?(T+=q(),void(k="decimalFraction")):X("numeric",$*Number(T))},decimalFraction:function(){switch(z){case"e":case"E":return T+=q(),void(k="decimalExponent")}if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},decimalExponent:function(){switch(z){case"+":case"-":return T+=q(),void(k="decimalExponentSign")}if(G.isDigit(z))return T+=q(),void(k="decimalExponentInteger");throw eu(q())},decimalExponentSign:function(){if(G.isDigit(z))return T+=q(),void(k="decimalExponentInteger");throw eu(q())},decimalExponentInteger:function(){if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},hexadecimal:function(){if(G.isHexDigit(z))return T+=q(),void(k="hexadecimalInteger");throw eu(q())},hexadecimalInteger:function(){if(!G.isHexDigit(z))return X("numeric",$*Number(T));T+=q()},string:function(){switch(z){case"\\":return q(),void(T+=function(){switch(Z()){case"b":return q(),"\b";case"f":return q(),"\f";case"n":return q(),"\n";case"r":return q(),"\r";case"t":return q(),"\t";case"v":return q(),"\v";case"0":if(q(),G.isDigit(Z()))throw eu(q());return"\0";case"x":return q(),function(){var u="",D=Z();if(!G.isHexDigit(D))throw eu(q());if(u+=q(),D=Z(),!G.isHexDigit(D))throw eu(q());return u+=q(),String.fromCodePoint(parseInt(u,16))}();case"u":return q(),Q();case"\n":case"\u2028":case"\u2029":return q(),"";case"\r":return q(),"\n"===Z()&&q(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw eu(q())}return q()}());case'"':return H?(q(),X("string",T)):void(T+=q());case"'":return H?void(T+=q()):(q(),X("string",T));case"\n":case"\r":throw eu(q());case"\u2028":case"\u2029":!function(u){console.warn("JSON5: '"+Fu(u)+"' in strings is not valid ECMAScript; consider escaping")}(z);break;case void 0:throw eu(q())}T+=q()},start:function(){switch(z){case"{":case"[":return X("punctuator",q())}k="value"},beforePropertyName:function(){switch(z){case"$":case"_":return T=q(),void(k="identifierName");case"\\":return q(),void(k="identifierNameStartEscape");case"}":return X("punctuator",q());case'"':case"'":return H='"'===q(),void(k="string")}if(G.isIdStartChar(z))return T+=q(),void(k="identifierName");throw eu(q())},afterPropertyName:function(){if(":"===z)return X("punctuator",q());throw eu(q())},beforePropertyValue:function(){k="value"},afterPropertyValue:function(){switch(z){case",":case"}":return X("punctuator",q())}throw eu(q())},beforeArrayValue:function(){if("]"===z)return X("punctuator",q());k="value"},afterArrayValue:function(){switch(z){case",":case"]":return X("punctuator",q())}throw eu(q())},end:function(){throw eu(q())}};function X(u,D){return{type:u,value:D,line:j,column:V}}function K(u){for(var D=0,e=u;D0;){var e=Z();if(!G.isHexDigit(e))throw eu(q());u+=q()}return String.fromCodePoint(parseInt(u,16))}var Y={start:function(){if("eof"===J.type)throw tu();uu()},beforePropertyName:function(){switch(J.type){case"identifier":case"string":return M=J.value,void(I="afterPropertyName");case"punctuator":return void Du();case"eof":throw tu()}},afterPropertyName:function(){if("eof"===J.type)throw tu();I="beforePropertyValue"},beforePropertyValue:function(){if("eof"===J.type)throw tu();uu()},beforeArrayValue:function(){if("eof"===J.type)throw tu();"punctuator"!==J.type||"]"!==J.value?uu():Du()},afterPropertyValue:function(){if("eof"===J.type)throw tu();switch(J.value){case",":return void(I="beforePropertyName");case"}":Du()}},afterArrayValue:function(){if("eof"===J.type)throw tu();switch(J.value){case",":return void(I="beforeArrayValue");case"]":Du()}},end:function(){}};function uu(){var u;switch(J.type){case"punctuator":switch(J.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=J.value}if(void 0===L)L=u;else{var D=O[O.length-1];Array.isArray(D)?D.push(u):D[M]=u}if(null!==u&&"object"==typeof u)O.push(u),I=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var e=O[O.length-1];I=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function Du(){O.pop();var u=O[O.length-1];I=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function eu(u){return nu(void 0===u?"JSON5: invalid end of input at "+j+":"+V:"JSON5: invalid character '"+Fu(u)+"' at "+j+":"+V)}function tu(){return nu("JSON5: invalid end of input at "+j+":"+V)}function ru(){return nu("JSON5: invalid identifier character at "+j+":"+(V-=5))}function Fu(u){var D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){var e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function nu(u){var D=new SyntaxError(u);return D.lineNumber=j,D.columnNumber=V,D}return{parse:function(u,D){P=String(u),I="start",O=[],_=0,j=1,V=0,J=void 0,M=void 0,L=void 0;do{J=U(),Y[I]()}while("eof"!==J.type);return"function"==typeof D?function u(D,e,t){var r=D[e];if(null!=r&&"object"==typeof r)for(var F in r){var n=u(r,F,t);void 0===n?delete r[F]:r[F]=n}return t.call(D,e,r)}({"":L},"",D):L},stringify:function(u,D,e){var t,r,F,n=[],C="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,F=D.quote,D=D.replacer),"function"==typeof D)r=D;else if(Array.isArray(D)){t=[];for(var E=0,i=D;E0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),c("",{"":u});function c(u,D){var e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),r&&(e=r.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?B(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(n.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,t=[],r=0;r=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,r,F=t||Object.keys(u),E=[],i=0,o=F;iunicode.Space_Separator.test(u),isIdStartChar:u=>u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||unicode.ID_Start.test(u),isIdContinueChar:u=>u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||unicode.ID_Continue.test(u),isDigit:u=>/[0-9]/.test(u),isHexDigit:u=>/[0-9A-Fa-f]/.test(u)};let source,parseState,stack,pos,line,column,token,key,root;var parse=function(u,D){source=String(u),parseState="start",stack=[],pos=0,line=1,column=0,token=void 0,key=void 0,root=void 0;do{token=lex(),parseStates[parseState]()}while("eof"!==token.type);return"function"==typeof D?internalize({"":root},"",D):root};function internalize(u,D,e){const r=u[D];if(null!=r&&"object"==typeof r)for(const u in r){const D=internalize(r,u,e);void 0===D?delete r[u]:r[u]=D}return e.call(u,D,r)}let lexState,buffer,doubleQuote,sign,c;function lex(){for(lexState="default",buffer="",doubleQuote=!1,sign=1;;){c=peek();const u=lexStates[lexState]();if(u)return u}}function peek(){if(source[pos])return String.fromCodePoint(source.codePointAt(pos))}function read(){const u=peek();return"\n"===u?(line++,column=0):u?column+=u.length:column++,u&&(pos+=u.length),u}const lexStates={default(){switch(c){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void read();case"/":return read(),void(lexState="comment");case void 0:return read(),newToken("eof")}if(!util.isSpaceSeparator(c))return lexStates[parseState]();read()},comment(){switch(c){case"*":return read(),void(lexState="multiLineComment");case"/":return read(),void(lexState="singleLineComment")}throw invalidChar(read())},multiLineComment(){switch(c){case"*":return read(),void(lexState="multiLineCommentAsterisk");case void 0:throw invalidChar(read())}read()},multiLineCommentAsterisk(){switch(c){case"*":return void read();case"/":return read(),void(lexState="default");case void 0:throw invalidChar(read())}read(),lexState="multiLineComment"},singleLineComment(){switch(c){case"\n":case"\r":case"\u2028":case"\u2029":return read(),void(lexState="default");case void 0:return read(),newToken("eof")}read()},value(){switch(c){case"{":case"[":return newToken("punctuator",read());case"n":return read(),literal("ull"),newToken("null",null);case"t":return read(),literal("rue"),newToken("boolean",!0);case"f":return read(),literal("alse"),newToken("boolean",!1);case"-":case"+":return"-"===read()&&(sign=-1),void(lexState="sign");case".":return buffer=read(),void(lexState="decimalPointLeading");case"0":return buffer=read(),void(lexState="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return buffer=read(),void(lexState="decimalInteger");case"I":return read(),literal("nfinity"),newToken("numeric",1/0);case"N":return read(),literal("aN"),newToken("numeric",NaN);case'"':case"'":return doubleQuote='"'===read(),buffer="",void(lexState="string")}throw invalidChar(read())},identifierNameStartEscape(){if("u"!==c)throw invalidChar(read());read();const u=unicodeEscape();switch(u){case"$":case"_":break;default:if(!util.isIdStartChar(u))throw invalidIdentifier()}buffer+=u,lexState="identifierName"},identifierName(){switch(c){case"$":case"_":case"‌":case"‍":return void(buffer+=read());case"\\":return read(),void(lexState="identifierNameEscape")}if(!util.isIdContinueChar(c))return newToken("identifier",buffer);buffer+=read()},identifierNameEscape(){if("u"!==c)throw invalidChar(read());read();const u=unicodeEscape();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!util.isIdContinueChar(u))throw invalidIdentifier()}buffer+=u,lexState="identifierName"},sign(){switch(c){case".":return buffer=read(),void(lexState="decimalPointLeading");case"0":return buffer=read(),void(lexState="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return buffer=read(),void(lexState="decimalInteger");case"I":return read(),literal("nfinity"),newToken("numeric",sign*(1/0));case"N":return read(),literal("aN"),newToken("numeric",NaN)}throw invalidChar(read())},zero(){switch(c){case".":return buffer+=read(),void(lexState="decimalPoint");case"e":case"E":return buffer+=read(),void(lexState="decimalExponent");case"x":case"X":return buffer+=read(),void(lexState="hexadecimal")}return newToken("numeric",0*sign)},decimalInteger(){switch(c){case".":return buffer+=read(),void(lexState="decimalPoint");case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},decimalPointLeading(){if(util.isDigit(c))return buffer+=read(),void(lexState="decimalFraction");throw invalidChar(read())},decimalPoint(){switch(c){case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}return util.isDigit(c)?(buffer+=read(),void(lexState="decimalFraction")):newToken("numeric",sign*Number(buffer))},decimalFraction(){switch(c){case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},decimalExponent(){switch(c){case"+":case"-":return buffer+=read(),void(lexState="decimalExponentSign")}if(util.isDigit(c))return buffer+=read(),void(lexState="decimalExponentInteger");throw invalidChar(read())},decimalExponentSign(){if(util.isDigit(c))return buffer+=read(),void(lexState="decimalExponentInteger");throw invalidChar(read())},decimalExponentInteger(){if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},hexadecimal(){if(util.isHexDigit(c))return buffer+=read(),void(lexState="hexadecimalInteger");throw invalidChar(read())},hexadecimalInteger(){if(!util.isHexDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},string(){switch(c){case"\\":return read(),void(buffer+=escape());case'"':return doubleQuote?(read(),newToken("string",buffer)):void(buffer+=read());case"'":return doubleQuote?void(buffer+=read()):(read(),newToken("string",buffer));case"\n":case"\r":throw invalidChar(read());case"\u2028":case"\u2029":separatorChar(c);break;case void 0:throw invalidChar(read())}buffer+=read()},start(){switch(c){case"{":case"[":return newToken("punctuator",read())}lexState="value"},beforePropertyName(){switch(c){case"$":case"_":return buffer=read(),void(lexState="identifierName");case"\\":return read(),void(lexState="identifierNameStartEscape");case"}":return newToken("punctuator",read());case'"':case"'":return doubleQuote='"'===read(),void(lexState="string")}if(util.isIdStartChar(c))return buffer+=read(),void(lexState="identifierName");throw invalidChar(read())},afterPropertyName(){if(":"===c)return newToken("punctuator",read());throw invalidChar(read())},beforePropertyValue(){lexState="value"},afterPropertyValue(){switch(c){case",":case"}":return newToken("punctuator",read())}throw invalidChar(read())},beforeArrayValue(){if("]"===c)return newToken("punctuator",read());lexState="value"},afterArrayValue(){switch(c){case",":case"]":return newToken("punctuator",read())}throw invalidChar(read())},end(){throw invalidChar(read())}};function newToken(u,D){return{type:u,value:D,line:line,column:column}}function literal(u){for(const D of u){if(peek()!==D)throw invalidChar(read());read()}}function escape(){switch(peek()){case"b":return read(),"\b";case"f":return read(),"\f";case"n":return read(),"\n";case"r":return read(),"\r";case"t":return read(),"\t";case"v":return read(),"\v";case"0":if(read(),util.isDigit(peek()))throw invalidChar(read());return"\0";case"x":return read(),hexEscape();case"u":return read(),unicodeEscape();case"\n":case"\u2028":case"\u2029":return read(),"";case"\r":return read(),"\n"===peek()&&read(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw invalidChar(read())}return read()}function hexEscape(){let u="",D=peek();if(!util.isHexDigit(D))throw invalidChar(read());if(u+=read(),D=peek(),!util.isHexDigit(D))throw invalidChar(read());return u+=read(),String.fromCodePoint(parseInt(u,16))}function unicodeEscape(){let u="",D=4;for(;D-- >0;){const D=peek();if(!util.isHexDigit(D))throw invalidChar(read());u+=read()}return String.fromCodePoint(parseInt(u,16))}const parseStates={start(){if("eof"===token.type)throw invalidEOF();push()},beforePropertyName(){switch(token.type){case"identifier":case"string":return key=token.value,void(parseState="afterPropertyName");case"punctuator":return void pop();case"eof":throw invalidEOF()}},afterPropertyName(){if("eof"===token.type)throw invalidEOF();parseState="beforePropertyValue"},beforePropertyValue(){if("eof"===token.type)throw invalidEOF();push()},beforeArrayValue(){if("eof"===token.type)throw invalidEOF();"punctuator"!==token.type||"]"!==token.value?push():pop()},afterPropertyValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforePropertyName");case"}":pop()}},afterArrayValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforeArrayValue");case"]":pop()}},end(){}};function push(){let u;switch(token.type){case"punctuator":switch(token.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=token.value}if(void 0===root)root=u;else{const D=stack[stack.length-1];Array.isArray(D)?D.push(u):D[key]=u}if(null!==u&&"object"==typeof u)stack.push(u),parseState=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}}function pop(){stack.pop();const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function invalidChar(u){return syntaxError(void 0===u?`JSON5: invalid end of input at ${line}:${column}`:`JSON5: invalid character '${formatChar(u)}' at ${line}:${column}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)}function invalidIdentifier(){return syntaxError(`JSON5: invalid identifier character at ${line}:${column-=5}`)}function separatorChar(u){console.warn(`JSON5: '${formatChar(u)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return"\\x"+("00"+D).substring(D.length)}return u}function syntaxError(u){const D=new SyntaxError(u);return D.lineNumber=line,D.columnNumber=column,D}var stringify=function(u,D,e){const r=[];let t,F,C,a="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,C=D.quote,D=D.replacer),"function"==typeof D)F=D;else if(Array.isArray(D)){t=[];for(const u of D){let D;"string"==typeof u?D=u:("number"==typeof u||u instanceof String||u instanceof Number)&&(D=String(u)),void 0!==D&&t.indexOf(D)<0&&t.push(D)}}return e instanceof Number?e=Number(e):e instanceof String&&(e=String(e)),"number"==typeof e?e>0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),E("",{"":u});function E(u,D){let e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),F&&(e=F.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?n(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(r.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,t=[];for(let D=0;D=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,F=t||Object.keys(u),C=[];for(const D of F){const e=E(D,u);if(void 0!==e){let u=i(D)+":";""!==A&&(u+=" "),u+=e,C.push(u)}}if(0===C.length)e="{}";else{let u;if(""===A)u=C.join(","),e="{"+u+"}";else{let r=",\n"+a;u=C.join(r),e="{\n"+a+u+",\n"+D+"}"}}return r.pop(),a=D,e}(e):void 0}function n(u){const D={"'":.1,'"':.2},e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let r="";for(const t of u){switch(t){case"'":case'"':D[t]++,r+=t;continue}if(e[t])r+=e[t];else if(t<" "){let u=t.charCodeAt(0).toString(16);r+="\\x"+("00"+u).substring(u.length)}else r+=t}const t=C||Object.keys(D).reduce((u,e)=>D[u]= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit (c) { - return /[0-9]/.test(c) - }, - - isHexDigit (c) { - return /[0-9A-Fa-f]/.test(c) - }, -}; - -let source; -let parseState; -let stack; -let pos; -let line; -let column; -let token; -let key; -let root; - -var parse = function parse (text, reviver) { - source = String(text); - parseState = 'start'; - stack = []; - pos = 0; - line = 1; - column = 0; - token = undefined; - key = undefined; - root = undefined; - - do { - token = lex(); - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState](); - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root -}; - -function internalize (holder, name, reviver) { - const value = holder[name]; - if (value != null && typeof value === 'object') { - for (const key in value) { - const replacement = internalize(value, key, reviver); - if (replacement === undefined) { - delete value[key]; - } else { - value[key] = replacement; - } - } - } - - return reviver.call(holder, name, value) -} - -let lexState; -let buffer; -let doubleQuote; -let sign; -let c; - -function lex () { - lexState = 'default'; - buffer = ''; - doubleQuote = false; - sign = 1; - - for (;;) { - c = peek(); - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - const token = lexStates[lexState](); - if (token) { - return token - } - } -} - -function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } -} - -function read () { - const c = peek(); - - if (c === '\n') { - line++; - column = 0; - } else if (c) { - column += c.length; - } else { - column++; - } - - if (c) { - pos += c.length; - } - - return c -} - -const lexStates = { - default () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - return - - case '/': - read(); - lexState = 'comment'; - return - - case undefined: - read(); - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read(); - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineComment'; - return - - case '/': - read(); - lexState = 'singleLineComment'; - return - } - - throw invalidChar(read()) - }, - - multiLineComment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineCommentAsterisk'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - }, - - multiLineCommentAsterisk () { - switch (c) { - case '*': - read(); - return - - case '/': - read(); - lexState = 'default'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - lexState = 'multiLineComment'; - }, - - singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - lexState = 'default'; - return - - case undefined: - read(); - return newToken('eof') - } - - read(); - }, - - value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read(); - literal('ull'); - return newToken('null', null) - - case 't': - read(); - literal('rue'); - return newToken('boolean', true) - - case 'f': - read(); - literal('alse'); - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1; - } - - lexState = 'sign'; - return - - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"'); - buffer = ''; - lexState = 'string'; - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - const u = unicodeEscape(); - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read(); - return - - case '\\': - read(); - lexState = 'identifierNameEscape'; - return - } - - if (util.isIdContinueChar(c)) { - buffer += read(); - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - const u = unicodeEscape(); - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - sign () { - switch (c) { - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', sign * Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - - case 'x': - case 'X': - buffer += read(); - lexState = 'hexadecimal'; - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - throw invalidChar(read()) - }, - - decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read(); - lexState = 'decimalExponentSign'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read(); - lexState = 'hexadecimalInteger'; - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string () { - switch (c) { - case '\\': - read(); - buffer += escape(); - return - - case '"': - if (doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case "'": - if (!doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c); - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read(); - }, - - start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value'; - }, - - beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read(); - lexState = 'identifierName'; - return - - case '\\': - read(); - lexState = 'identifierNameStartEscape'; - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"'); - lexState = 'string'; - return - } - - if (util.isIdStartChar(c)) { - buffer += read(); - lexState = 'identifierName'; - return - } - - throw invalidChar(read()) - }, - - afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue () { - lexState = 'value'; - }, - - afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value'; - }, - - afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, -}; - -function newToken (type, value) { - return { - type, - value, - line, - column, - } -} - -function literal (s) { - for (const c of s) { - const p = peek(); - - if (p !== c) { - throw invalidChar(read()) - } - - read(); - } -} - -function escape () { - const c = peek(); - switch (c) { - case 'b': - read(); - return '\b' - - case 'f': - read(); - return '\f' - - case 'n': - read(); - return '\n' - - case 'r': - read(); - return '\r' - - case 't': - read(); - return '\t' - - case 'v': - read(); - return '\v' - - case '0': - read(); - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read(); - return hexEscape() - - case 'u': - read(); - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read(); - return '' - - case '\r': - read(); - if (peek() === '\n') { - read(); - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() -} - -function hexEscape () { - let buffer = ''; - let c = peek(); - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -function unicodeEscape () { - let buffer = ''; - let count = 4; - - while (count-- > 0) { - const c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - } - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -const parseStates = { - start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value; - parseState = 'afterPropertyName'; - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop(); - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue'; - }, - - beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop(); - return - } - - push(); - }, - - afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName'; - return - - case '}': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue'; - return - - case ']': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, -}; - -function push () { - let value; - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {}; - break - - case '[': - value = []; - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value; - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value; - } else { - const parent = stack[stack.length - 1]; - if (Array.isArray(parent)) { - parent.push(value); - } else { - parent[key] = value; - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value); - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue'; - } else { - parseState = 'beforePropertyName'; - } - } else { - const current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } -} - -function pop () { - stack.pop(); - - const current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } -} - -// This code is unreachable. -// function invalidParseState () { -// return new Error(`JSON5: invalid parse state '${parseState}'`) -// } - -// This code is unreachable. -// function invalidLexState (state) { -// return new Error(`JSON5: invalid lex state '${state}'`) -// } - -function invalidChar (c) { - if (c === undefined) { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - } - - return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -} - -function invalidEOF () { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -} - -// This code is unreachable. -// function invalidToken () { -// if (token.type === 'eof') { -// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -// } - -// const c = String.fromCodePoint(token.value.codePointAt(0)) -// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -// } - -function invalidIdentifier () { - column -= 5; - return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) -} - -function separatorChar (c) { - console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`); -} - -function formatChar (c) { - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - const hexString = c.charCodeAt(0).toString(16); - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c -} - -function syntaxError (message) { - const err = new SyntaxError(message); - err.lineNumber = line; - err.columnNumber = column; - return err -} - -var stringify = function stringify (value, replacer, space) { - const stack = []; - let indent = ''; - let propertyList; - let replacerFunc; - let gap = ''; - let quote; - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space; - quote = replacer.quote; - replacer = replacer.replacer; - } - - if (typeof replacer === 'function') { - replacerFunc = replacer; - } else if (Array.isArray(replacer)) { - propertyList = []; - for (const v of replacer) { - let item; - - if (typeof v === 'string') { - item = v; - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v); - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item); - } - } - } - - if (space instanceof Number) { - space = Number(space); - } else if (space instanceof String) { - space = String(space); - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)); - gap = ' '.substr(0, space); - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10); - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - let value = holder[key]; - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key); - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value); - } - - if (value instanceof Number) { - value = Number(value); - } else if (value instanceof String) { - value = String(value); - } else if (value instanceof Boolean) { - value = value.valueOf(); - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - const quotes = { - "'": 0.1, - '"': 0.2, - }; - - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - let product = ''; - - for (const c of value) { - switch (c) { - case "'": - case '"': - quotes[c]++; - product += c; - continue - } - - if (replacements[c]) { - product += replacements[c]; - continue - } - - if (c < ' ') { - let hexString = c.charCodeAt(0).toString(16); - product += '\\x' + ('00' + hexString).substring(hexString.length); - continue - } - - product += c; - } - - const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b); - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - let stepback = indent; - indent = indent + gap; - - let keys = propertyList || Object.keys(value); - let partial = []; - for (const key of keys) { - const propertyString = serializeProperty(key, value); - if (propertyString !== undefined) { - let member = serializeKey(key) + ':'; - if (gap !== '') { - member += ' '; - } - member += propertyString; - partial.push(member); - } - } - - let final; - if (partial.length === 0) { - final = '{}'; - } else { - let properties; - if (gap === '') { - properties = partial.join(','); - final = '{' + properties + '}'; - } else { - let separator = ',\n' + indent; - properties = partial.join(separator); - final = '{\n' + indent + properties + ',\n' + stepback + '}'; - } - } - - stack.pop(); - indent = stepback; - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - const firstChar = String.fromCodePoint(key.codePointAt(0)); - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (let i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - let stepback = indent; - indent = indent + gap; - - let partial = []; - for (let i = 0; i < value.length; i++) { - const propertyString = serializeProperty(String(i), value); - partial.push((propertyString !== undefined) ? propertyString : 'null'); - } - - let final; - if (partial.length === 0) { - final = '[]'; - } else { - if (gap === '') { - let properties = partial.join(','); - final = '[' + properties + ']'; - } else { - let separator = ',\n' + indent; - let properties = partial.join(separator); - final = '[\n' + indent + properties + ',\n' + stepback + ']'; - } - } - - stack.pop(); - indent = stepback; - return final - } -}; - -const JSON5 = { - parse, - stringify, -}; - -var lib = JSON5; - -export default lib; diff --git a/node_modules/json5/lib/cli.js b/node_modules/json5/lib/cli.js deleted file mode 100755 index de852f1..0000000 --- a/node_modules/json5/lib/cli.js +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs') -const path = require('path') -const minimist = require('minimist') -const pkg = require('../package.json') -const JSON5 = require('./') - -const argv = minimist(process.argv.slice(2), { - alias: { - 'convert': 'c', - 'space': 's', - 'validate': 'v', - 'out-file': 'o', - 'version': 'V', - 'help': 'h', - }, - boolean: [ - 'convert', - 'validate', - 'version', - 'help', - ], - string: [ - 'space', - 'out-file', - ], -}) - -if (argv.version) { - version() -} else if (argv.help) { - usage() -} else { - const inFilename = argv._[0] - - let readStream - if (inFilename) { - readStream = fs.createReadStream(inFilename) - } else { - readStream = process.stdin - } - - let json5 = '' - readStream.on('data', data => { - json5 += data - }) - - readStream.on('end', () => { - let space - if (argv.space === 't' || argv.space === 'tab') { - space = '\t' - } else { - space = Number(argv.space) - } - - let value - try { - value = JSON5.parse(json5) - if (!argv.validate) { - const json = JSON.stringify(value, null, space) - - let writeStream - - // --convert is for backward compatibility with v0.5.1. If - // specified with and not --out-file, then a file with - // the same name but with a .json extension will be written. - if (argv.convert && inFilename && !argv.o) { - const parsedFilename = path.parse(inFilename) - const outFilename = path.format( - Object.assign( - parsedFilename, - {base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'} - ) - ) - - writeStream = fs.createWriteStream(outFilename) - } else if (argv.o) { - writeStream = fs.createWriteStream(argv.o) - } else { - writeStream = process.stdout - } - - writeStream.write(json) - } - } catch (err) { - console.error(err.message) - process.exit(1) - } - }) -} - -function version () { - console.log(pkg.version) -} - -function usage () { - console.log( - ` - Usage: json5 [options] - - If is not provided, then STDIN is used. - - Options: - - -s, --space The number of spaces to indent or 't' for tabs - -o, --out-file [file] Output to the specified file, otherwise STDOUT - -v, --validate Validate JSON5 but do not output JSON - -V, --version Output the version number - -h, --help Output usage information` - ) -} diff --git a/node_modules/json5/lib/index.js b/node_modules/json5/lib/index.js deleted file mode 100644 index 3679638..0000000 --- a/node_modules/json5/lib/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const parse = require('./parse') -const stringify = require('./stringify') - -const JSON5 = { - parse, - stringify, -} - -module.exports = JSON5 diff --git a/node_modules/json5/lib/parse.js b/node_modules/json5/lib/parse.js deleted file mode 100644 index c01646f..0000000 --- a/node_modules/json5/lib/parse.js +++ /dev/null @@ -1,1087 +0,0 @@ -const util = require('./util') - -let source -let parseState -let stack -let pos -let line -let column -let token -let key -let root - -module.exports = function parse (text, reviver) { - source = String(text) - parseState = 'start' - stack = [] - pos = 0 - line = 1 - column = 0 - token = undefined - key = undefined - root = undefined - - do { - token = lex() - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState]() - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root -} - -function internalize (holder, name, reviver) { - const value = holder[name] - if (value != null && typeof value === 'object') { - for (const key in value) { - const replacement = internalize(value, key, reviver) - if (replacement === undefined) { - delete value[key] - } else { - value[key] = replacement - } - } - } - - return reviver.call(holder, name, value) -} - -let lexState -let buffer -let doubleQuote -let sign -let c - -function lex () { - lexState = 'default' - buffer = '' - doubleQuote = false - sign = 1 - - for (;;) { - c = peek() - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - const token = lexStates[lexState]() - if (token) { - return token - } - } -} - -function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } -} - -function read () { - const c = peek() - - if (c === '\n') { - line++ - column = 0 - } else if (c) { - column += c.length - } else { - column++ - } - - if (c) { - pos += c.length - } - - return c -} - -const lexStates = { - default () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read() - return - - case '/': - read() - lexState = 'comment' - return - - case undefined: - read() - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read() - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment () { - switch (c) { - case '*': - read() - lexState = 'multiLineComment' - return - - case '/': - read() - lexState = 'singleLineComment' - return - } - - throw invalidChar(read()) - }, - - multiLineComment () { - switch (c) { - case '*': - read() - lexState = 'multiLineCommentAsterisk' - return - - case undefined: - throw invalidChar(read()) - } - - read() - }, - - multiLineCommentAsterisk () { - switch (c) { - case '*': - read() - return - - case '/': - read() - lexState = 'default' - return - - case undefined: - throw invalidChar(read()) - } - - read() - lexState = 'multiLineComment' - }, - - singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read() - lexState = 'default' - return - - case undefined: - read() - return newToken('eof') - } - - read() - }, - - value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read() - literal('ull') - return newToken('null', null) - - case 't': - read() - literal('rue') - return newToken('boolean', true) - - case 'f': - read() - literal('alse') - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1 - } - - lexState = 'sign' - return - - case '.': - buffer = read() - lexState = 'decimalPointLeading' - return - - case '0': - buffer = read() - lexState = 'zero' - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read() - lexState = 'decimalInteger' - return - - case 'I': - read() - literal('nfinity') - return newToken('numeric', Infinity) - - case 'N': - read() - literal('aN') - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"') - buffer = '' - lexState = 'string' - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read() - const u = unicodeEscape() - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u - lexState = 'identifierName' - }, - - identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read() - return - - case '\\': - read() - lexState = 'identifierNameEscape' - return - } - - if (util.isIdContinueChar(c)) { - buffer += read() - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read() - const u = unicodeEscape() - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u - lexState = 'identifierName' - }, - - sign () { - switch (c) { - case '.': - buffer = read() - lexState = 'decimalPointLeading' - return - - case '0': - buffer = read() - lexState = 'zero' - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read() - lexState = 'decimalInteger' - return - - case 'I': - read() - literal('nfinity') - return newToken('numeric', sign * Infinity) - - case 'N': - read() - literal('aN') - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero () { - switch (c) { - case '.': - buffer += read() - lexState = 'decimalPoint' - return - - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - - case 'x': - case 'X': - buffer += read() - lexState = 'hexadecimal' - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger () { - switch (c) { - case '.': - buffer += read() - lexState = 'decimalPoint' - return - - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalFraction' - return - } - - throw invalidChar(read()) - }, - - decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalFraction' - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read() - lexState = 'decimalExponentSign' - return - } - - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalExponentInteger' - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalExponentInteger' - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read() - lexState = 'hexadecimalInteger' - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string () { - switch (c) { - case '\\': - read() - buffer += escape() - return - - case '"': - if (doubleQuote) { - read() - return newToken('string', buffer) - } - - buffer += read() - return - - case "'": - if (!doubleQuote) { - read() - return newToken('string', buffer) - } - - buffer += read() - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c) - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read() - }, - - start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value' - }, - - beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read() - lexState = 'identifierName' - return - - case '\\': - read() - lexState = 'identifierNameStartEscape' - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"') - lexState = 'string' - return - } - - if (util.isIdStartChar(c)) { - buffer += read() - lexState = 'identifierName' - return - } - - throw invalidChar(read()) - }, - - afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue () { - lexState = 'value' - }, - - afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value' - }, - - afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, -} - -function newToken (type, value) { - return { - type, - value, - line, - column, - } -} - -function literal (s) { - for (const c of s) { - const p = peek() - - if (p !== c) { - throw invalidChar(read()) - } - - read() - } -} - -function escape () { - const c = peek() - switch (c) { - case 'b': - read() - return '\b' - - case 'f': - read() - return '\f' - - case 'n': - read() - return '\n' - - case 'r': - read() - return '\r' - - case 't': - read() - return '\t' - - case 'v': - read() - return '\v' - - case '0': - read() - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read() - return hexEscape() - - case 'u': - read() - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read() - return '' - - case '\r': - read() - if (peek() === '\n') { - read() - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() -} - -function hexEscape () { - let buffer = '' - let c = peek() - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - - c = peek() - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -function unicodeEscape () { - let buffer = '' - let count = 4 - - while (count-- > 0) { - const c = peek() - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - } - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -const parseStates = { - start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push() - }, - - beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value - parseState = 'afterPropertyName' - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop() - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue' - }, - - beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push() - }, - - beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop() - return - } - - push() - }, - - afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName' - return - - case '}': - pop() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue' - return - - case ']': - pop() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, -} - -function push () { - let value - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {} - break - - case '[': - value = [] - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value - } else { - const parent = stack[stack.length - 1] - if (Array.isArray(parent)) { - parent.push(value) - } else { - parent[key] = value - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value) - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue' - } else { - parseState = 'beforePropertyName' - } - } else { - const current = stack[stack.length - 1] - if (current == null) { - parseState = 'end' - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue' - } else { - parseState = 'afterPropertyValue' - } - } -} - -function pop () { - stack.pop() - - const current = stack[stack.length - 1] - if (current == null) { - parseState = 'end' - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue' - } else { - parseState = 'afterPropertyValue' - } -} - -// This code is unreachable. -// function invalidParseState () { -// return new Error(`JSON5: invalid parse state '${parseState}'`) -// } - -// This code is unreachable. -// function invalidLexState (state) { -// return new Error(`JSON5: invalid lex state '${state}'`) -// } - -function invalidChar (c) { - if (c === undefined) { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - } - - return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -} - -function invalidEOF () { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -} - -// This code is unreachable. -// function invalidToken () { -// if (token.type === 'eof') { -// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -// } - -// const c = String.fromCodePoint(token.value.codePointAt(0)) -// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -// } - -function invalidIdentifier () { - column -= 5 - return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) -} - -function separatorChar (c) { - console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`) -} - -function formatChar (c) { - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - } - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - const hexString = c.charCodeAt(0).toString(16) - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c -} - -function syntaxError (message) { - const err = new SyntaxError(message) - err.lineNumber = line - err.columnNumber = column - return err -} diff --git a/node_modules/json5/lib/register.js b/node_modules/json5/lib/register.js deleted file mode 100644 index 935cdba..0000000 --- a/node_modules/json5/lib/register.js +++ /dev/null @@ -1,13 +0,0 @@ -const fs = require('fs') -const JSON5 = require('./') - -// eslint-disable-next-line node/no-deprecated-api -require.extensions['.json5'] = function (module, filename) { - const content = fs.readFileSync(filename, 'utf8') - try { - module.exports = JSON5.parse(content) - } catch (err) { - err.message = filename + ': ' + err.message - throw err - } -} diff --git a/node_modules/json5/lib/require.js b/node_modules/json5/lib/require.js deleted file mode 100644 index 3aa29be..0000000 --- a/node_modules/json5/lib/require.js +++ /dev/null @@ -1,4 +0,0 @@ -// This file is for backward compatibility with v0.5.1. -require('./register') - -console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.") diff --git a/node_modules/json5/lib/stringify.js b/node_modules/json5/lib/stringify.js deleted file mode 100644 index 0df12f4..0000000 --- a/node_modules/json5/lib/stringify.js +++ /dev/null @@ -1,254 +0,0 @@ -const util = require('./util') - -module.exports = function stringify (value, replacer, space) { - const stack = [] - let indent = '' - let propertyList - let replacerFunc - let gap = '' - let quote - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space - quote = replacer.quote - replacer = replacer.replacer - } - - if (typeof replacer === 'function') { - replacerFunc = replacer - } else if (Array.isArray(replacer)) { - propertyList = [] - for (const v of replacer) { - let item - - if (typeof v === 'string') { - item = v - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v) - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item) - } - } - } - - if (space instanceof Number) { - space = Number(space) - } else if (space instanceof String) { - space = String(space) - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)) - gap = ' '.substr(0, space) - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10) - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - let value = holder[key] - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key) - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key) - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value) - } - - if (value instanceof Number) { - value = Number(value) - } else if (value instanceof String) { - value = String(value) - } else if (value instanceof Boolean) { - value = value.valueOf() - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - const quotes = { - "'": 0.1, - '"': 0.2, - } - - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - } - - let product = '' - - for (const c of value) { - switch (c) { - case "'": - case '"': - quotes[c]++ - product += c - continue - } - - if (replacements[c]) { - product += replacements[c] - continue - } - - if (c < ' ') { - let hexString = c.charCodeAt(0).toString(16) - product += '\\x' + ('00' + hexString).substring(hexString.length) - continue - } - - product += c - } - - const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b) - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]) - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value) - - let stepback = indent - indent = indent + gap - - let keys = propertyList || Object.keys(value) - let partial = [] - for (const key of keys) { - const propertyString = serializeProperty(key, value) - if (propertyString !== undefined) { - let member = serializeKey(key) + ':' - if (gap !== '') { - member += ' ' - } - member += propertyString - partial.push(member) - } - } - - let final - if (partial.length === 0) { - final = '{}' - } else { - let properties - if (gap === '') { - properties = partial.join(',') - final = '{' + properties + '}' - } else { - let separator = ',\n' + indent - properties = partial.join(separator) - final = '{\n' + indent + properties + ',\n' + stepback + '}' - } - } - - stack.pop() - indent = stepback - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - const firstChar = String.fromCodePoint(key.codePointAt(0)) - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (let i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value) - - let stepback = indent - indent = indent + gap - - let partial = [] - for (let i = 0; i < value.length; i++) { - const propertyString = serializeProperty(String(i), value) - partial.push((propertyString !== undefined) ? propertyString : 'null') - } - - let final - if (partial.length === 0) { - final = '[]' - } else { - if (gap === '') { - let properties = partial.join(',') - final = '[' + properties + ']' - } else { - let separator = ',\n' + indent - let properties = partial.join(separator) - final = '[\n' + indent + properties + ',\n' + stepback + ']' - } - } - - stack.pop() - indent = stepback - return final - } -} diff --git a/node_modules/json5/lib/unicode.js b/node_modules/json5/lib/unicode.js deleted file mode 100644 index 215ccd8..0000000 --- a/node_modules/json5/lib/unicode.js +++ /dev/null @@ -1,4 +0,0 @@ -// This is a generated file. Do not edit. -module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/ -module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uA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7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/ -module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85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\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\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CF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43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\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ diff --git a/node_modules/json5/lib/util.js b/node_modules/json5/lib/util.js deleted file mode 100644 index 3b5e466..0000000 --- a/node_modules/json5/lib/util.js +++ /dev/null @@ -1,35 +0,0 @@ -const unicode = require('../lib/unicode') - -module.exports = { - isSpaceSeparator (c) { - return unicode.Space_Separator.test(c) - }, - - isIdStartChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit (c) { - return /[0-9]/.test(c) - }, - - isHexDigit (c) { - return /[0-9A-Fa-f]/.test(c) - }, -} diff --git a/node_modules/json5/package.json b/node_modules/json5/package.json deleted file mode 100644 index 459b042..0000000 --- a/node_modules/json5/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_from": "json5@^2.1.0", - "_id": "json5@2.1.0", - "_inBundle": false, - "_integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "_location": "/json5", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "json5@^2.1.0", - "name": "json5", - "escapedName": "json5", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/read-config-file" - ], - "_resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "_shasum": "e7a0c62c48285c628d20a10b85c89bb807c32850", - "_spec": "json5@^2.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/read-config-file", - "author": { - "name": "Aseem Kishore", - "email": "aseem.kishore@gmail.com" - }, - "bin": { - "json5": "lib/cli.js" - }, - "browser": "dist/index.js", - "bugs": { - "url": "https://github.com/json5/json5/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Max Nanasy", - "email": "max.nanasy@gmail.com" - }, - { - "name": "Andrew Eisenberg", - "email": "andrew@eisenberg.as" - }, - { - "name": "Jordan Tucker", - "email": "jordanbtucker@gmail.com" - } - ], - "dependencies": { - "minimist": "^1.2.0" - }, - "deprecated": false, - "description": "JSON for humans.", - "devDependencies": { - "core-js": "^2.5.7", - "eslint": "^5.3.0", - "eslint-config-standard": "^11.0.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-node": "^7.0.1", - "eslint-plugin-promise": "^3.8.0", - "eslint-plugin-standard": "^3.1.0", - "regenerate": "^1.4.0", - "rollup": "^0.64.1", - "rollup-plugin-buble": "^0.19.2", - "rollup-plugin-commonjs": "^9.1.5", - "rollup-plugin-node-resolve": "^3.3.0", - "rollup-plugin-terser": "^1.0.1", - "sinon": "^6.1.5", - "tap": "^12.0.1", - "unicode-10.0.0": "^0.7.5" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "lib/", - "dist/" - ], - "homepage": "http://json5.org/", - "keywords": [ - "json", - "json5", - "es5", - "es2015", - "ecmascript" - ], - "license": "MIT", - "main": "lib/index.js", - "name": "json5", - "repository": { - "type": "git", - "url": "git+https://github.com/json5/json5.git" - }, - "scripts": { - "build": "rollup -c", - "build-package": "node build/package.js", - "build-unicode": "node build/unicode.js", - "coverage": "tap --coverage-report html test", - "lint": "eslint --fix .", - "prepublishOnly": "npm run production", - "preversion": "npm run production", - "production": "npm run lint && npm test && npm run build", - "test": "tap -Rspec --100 test", - "version": "npm run build-package && git add package.json5" - }, - "version": "2.1.0" -} diff --git a/node_modules/jsonfile/package.json b/node_modules/jsonfile/package.json index 675a2b1..5fa7a46 100644 --- a/node_modules/jsonfile/package.json +++ b/node_modules/jsonfile/package.json @@ -1,27 +1,35 @@ { - "_from": "jsonfile@^4.0.0", + "_args": [ + [ + "jsonfile@4.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "jsonfile@4.0.0", "_id": "jsonfile@4.0.0", "_inBundle": false, "_integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "_location": "/jsonfile", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "jsonfile@^4.0.0", + "raw": "jsonfile@4.0.0", "name": "jsonfile", "escapedName": "jsonfile", - "rawSpec": "^4.0.0", + "rawSpec": "4.0.0", "saveSpec": null, - "fetchSpec": "^4.0.0" + "fetchSpec": "4.0.0" }, "_requiredBy": [ + "/electron-notarize/fs-extra", + "/electron-packager/fs-extra", "/fs-extra" ], "_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "_shasum": "8771aae0799b64076b76640fca058f9c10e33ecb", - "_spec": "jsonfile@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/fs-extra", + "_spec": "4.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "JP Richardson", "email": "jprichardson@gmail.com" @@ -29,11 +37,9 @@ "bugs": { "url": "https://github.com/jprichardson/node-jsonfile/issues" }, - "bundleDependencies": false, "dependencies": { "graceful-fs": "^4.1.6" }, - "deprecated": false, "description": "Easily read/write JSON files.", "devDependencies": { "mocha": "2.x", diff --git a/node_modules/jsprim/package.json b/node_modules/jsprim/package.json index cfe0134..5351fd7 100644 --- a/node_modules/jsprim/package.json +++ b/node_modules/jsprim/package.json @@ -1,38 +1,41 @@ { - "_from": "jsprim@^1.2.2", + "_args": [ + [ + "jsprim@1.4.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "jsprim@1.4.1", "_id": "jsprim@1.4.1", "_inBundle": false, "_integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "_location": "/jsprim", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "jsprim@^1.2.2", + "raw": "jsprim@1.4.1", "name": "jsprim", "escapedName": "jsprim", - "rawSpec": "^1.2.2", + "rawSpec": "1.4.1", "saveSpec": null, - "fetchSpec": "^1.2.2" + "fetchSpec": "1.4.1" }, "_requiredBy": [ "/http-signature" ], "_resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "_shasum": "313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2", - "_spec": "jsprim@^1.2.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/http-signature", + "_spec": "1.4.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/joyent/node-jsprim/issues" }, - "bundleDependencies": false, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", "json-schema": "0.2.3", "verror": "1.10.0" }, - "deprecated": false, "description": "utilities for primitive JavaScript types", "engines": [ "node >=0.6.0" diff --git a/node_modules/latest-version/index.js b/node_modules/latest-version/index.js deleted file mode 100644 index bfb79d1..0000000 --- a/node_modules/latest-version/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const packageJson = require('package-json'); - -module.exports = name => packageJson(name.toLowerCase()).then(data => data.version); diff --git a/node_modules/latest-version/license b/node_modules/latest-version/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/latest-version/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/latest-version/package.json b/node_modules/latest-version/package.json deleted file mode 100644 index 970d7f3..0000000 --- a/node_modules/latest-version/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "latest-version@^3.0.0", - "_id": "latest-version@3.1.0", - "_inBundle": false, - "_integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", - "_location": "/latest-version", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "latest-version@^3.0.0", - "name": "latest-version", - "escapedName": "latest-version", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "_shasum": "a205383fea322b33b5ae3b18abee0dc2f356ee15", - "_spec": "latest-version@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/latest-version/issues" - }, - "bundleDependencies": false, - "dependencies": { - "package-json": "^4.0.0" - }, - "deprecated": false, - "description": "Get the latest version of an npm package", - "devDependencies": { - "ava": "*", - "semver-regex": "^1.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/latest-version#readme", - "keywords": [ - "latest", - "version", - "npm", - "pkg", - "package", - "package.json", - "current", - "module" - ], - "license": "MIT", - "name": "latest-version", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/latest-version.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.1.0" -} diff --git a/node_modules/latest-version/readme.md b/node_modules/latest-version/readme.md deleted file mode 100644 index 3fcffdd..0000000 --- a/node_modules/latest-version/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# latest-version [![Build Status](https://travis-ci.org/sindresorhus/latest-version.svg?branch=master)](https://travis-ci.org/sindresorhus/latest-version) - -> Get the latest version of an npm package - -Fetches the version directly from the registry instead of depending on the massive [npm](https://github.com/npm/npm/blob/8b5e7b6ae5b4cd2d7d62eaf93b1428638b387072/package.json#L37-L85) module like the [latest](https://github.com/bahamas10/node-latest) module does. - - -## Install - -``` -$ npm install --save latest-version -``` - - -## Usage - -```js -const latestVersion = require('latest-version'); - -latestVersion('ava').then(version => { - console.log(version); - //=> '0.18.0' -}); - -latestVersion('@sindresorhus/df').then(version => { - console.log(version); - //=> '1.0.1' -}); -``` - - -## Related - -- [latest-version-cli](https://github.com/sindresorhus/latest-version-cli) - CLI for this module -- [package-json](https://github.com/sindresorhus/package-json) - Get the package.json of a package from the npm registry - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/lazy-val/out/main.d.ts b/node_modules/lazy-val/out/main.d.ts deleted file mode 100644 index e9ad837..0000000 --- a/node_modules/lazy-val/out/main.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare class Lazy { - private _value; - private creator; - constructor(creator: () => Promise); - readonly hasValue: boolean; - value: Promise; -} diff --git a/node_modules/lazy-val/out/main.js b/node_modules/lazy-val/out/main.js deleted file mode 100644 index 34fa3b7..0000000 --- a/node_modules/lazy-val/out/main.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -class Lazy { - constructor(creator) { - this.creator = creator; - } - get hasValue() { - return this.creator == null; - } - get value() { - if (this.creator == null) { - return this._value; - } - this.value = this.creator(); - return this._value; - } - set value(value) { - this._value = value; - this.creator = null; - } -} -exports.Lazy = Lazy; //# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/node_modules/lazy-val/out/main.js.map b/node_modules/lazy-val/out/main.js.map deleted file mode 100644 index e4e843c..0000000 --- a/node_modules/lazy-val/out/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;AAIE,gBAAY,AAAyB;AACnC,AAAI,aAAC,AAAO,UAAG,AAAO,AACxB;AAAC;AAED,QAAI,AAAQ;AACV,AAAM,eAAC,AAAI,KAAC,AAAO,WAAI,AAAI,AAC7B;AAAC;AAED,QAAI,AAAK;AACP,AAAE,AAAC,YAAC,AAAI,KAAC,AAAO,WAAI,AAAI,AAAC,MAAC,AAAC;AACzB,AAAM,mBAAC,AAAI,KAAC,AAAM,AACpB;AAAC;AAED,AAAI,aAAC,AAAK,QAAG,AAAI,KAAC,AAAO,AAAE;AAC3B,AAAM,eAAC,AAAI,KAAC,AAAM,AACpB;AAAC;AAED,QAAI,AAAK,MAAC,AAAiB;AACzB,AAAI,aAAC,AAAM,SAAG,AAAK;AACnB,AAAI,aAAC,AAAO,UAAG,AAAI,AACrB;AAAC,AACF","sourcesContent":["export class Lazy {\n private _value: Promise\n private creator: (() => Promise) | null\n\n constructor(creator: () => Promise) {\n this.creator = creator\n }\n\n get hasValue() {\n return this.creator == null\n }\n\n get value(): Promise {\n if (this.creator == null) {\n return this._value\n }\n\n this.value = this.creator()\n return this._value\n }\n\n set value(value: Promise) {\n this._value = value\n this.creator = null\n }\n}"]} diff --git a/node_modules/lazy-val/package.json b/node_modules/lazy-val/package.json deleted file mode 100644 index 4060f9b..0000000 --- a/node_modules/lazy-val/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "lazy-val@^1.0.3", - "_id": "lazy-val@1.0.3", - "_inBundle": false, - "_integrity": "sha512-pjCf3BYk+uv3ZcPzEVM0BFvO9Uw58TmlrU0oG5tTrr9Kcid3+kdKxapH8CjdYmVa2nO5wOoZn2rdvZx2PKj/xg==", - "_location": "/lazy-val", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lazy-val@^1.0.3", - "name": "lazy-val", - "escapedName": "lazy-val", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/app-builder-lib", - "/electron-builder", - "/electron-publish", - "/read-config-file" - ], - "_resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.3.tgz", - "_shasum": "bb97b200ef00801d94c317e29dc6ed39e31c5edc", - "_spec": "lazy-val@^1.0.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", - "author": { - "name": "Vladimir Krivosheev" - }, - "babel": { - "presets": [ - "babel-preset-ts-node6-bluebird" - ] - }, - "bugs": { - "url": "https://github.com/develar/read-config-file/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Lazy value.", - "devDependencies": { - "babel-preset-ts-node6-bluebird": "^1.0.1", - "ts-babel": "^4.1.8", - "typescript": "^2.6.2" - }, - "files": [ - "out" - ], - "homepage": "https://github.com/develar/read-config-file", - "license": "MIT", - "main": "out/main.js", - "name": "lazy-val", - "repository": { - "type": "git", - "url": "git+https://github.com/develar/read-config-file.git" - }, - "scripts": { - "compile": "ts-babel", - "release": "yarn compile && npm publish" - }, - "typings": "./out/main.d.ts", - "version": "1.0.3" -} diff --git a/node_modules/lazy-val/readme.md b/node_modules/lazy-val/readme.md deleted file mode 100644 index dde7417..0000000 --- a/node_modules/lazy-val/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -## lazy-val - -Lazy value. - -```typescript -class Lazy { - constructor(creator: () => Promise) - readonly hasValue: boolean - value: Promise -} -``` \ No newline at end of file diff --git a/node_modules/lcid/index.js b/node_modules/lcid/index.js index b666ef0..69bd3d2 100644 --- a/node_modules/lcid/index.js +++ b/node_modules/lcid/index.js @@ -1,10 +1,9 @@ 'use strict'; -const invertKv = require('invert-kv'); -const all = require('./lcid.json'); +var invertKv = require('invert-kv'); +var all = require('./lcid.json'); +var inverted = invertKv(all); -const inverted = invertKv(all); - -exports.from = lcidCode => { +exports.from = function (lcidCode) { if (typeof lcidCode !== 'number') { throw new TypeError('Expected a number'); } @@ -12,7 +11,7 @@ exports.from = lcidCode => { return inverted[lcidCode]; }; -exports.to = localeId => { +exports.to = function (localeId) { if (typeof localeId !== 'string') { throw new TypeError('Expected a string'); } diff --git a/node_modules/lcid/license b/node_modules/lcid/license index e7af2f7..654d0bf 100644 --- a/node_modules/lcid/license +++ b/node_modules/lcid/license @@ -1,9 +1,21 @@ -MIT License +The MIT License (MIT) Copyright (c) Sindre Sorhus (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: +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 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. +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/lcid/package.json b/node_modules/lcid/package.json index b8f1cd1..bbdf4ec 100644 --- a/node_modules/lcid/package.json +++ b/node_modules/lcid/package.json @@ -1,26 +1,26 @@ { - "_from": "lcid@^2.0.0", - "_id": "lcid@2.0.0", + "_from": "lcid@^1.0.0", + "_id": "lcid@1.0.0", "_inBundle": false, - "_integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "_integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "_location": "/lcid", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "lcid@^2.0.0", + "raw": "lcid@^1.0.0", "name": "lcid", "escapedName": "lcid", - "rawSpec": "^2.0.0", + "rawSpec": "^1.0.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "^1.0.0" }, "_requiredBy": [ "/os-locale" ], - "_resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "_shasum": "6ef5d2df60e52f82eb228a4c373e8d1f397253cf", - "_spec": "lcid@^2.0.0", + "_resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "_shasum": "308accafa0bc483a3867b4b6f2b9506251d1b835", + "_spec": "lcid@^1.0.0", "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/os-locale", "author": { "name": "Sindre Sorhus", @@ -32,16 +32,15 @@ }, "bundleDependencies": false, "dependencies": { - "invert-kv": "^2.0.0" + "invert-kv": "^1.0.0" }, "deprecated": false, "description": "Mapping between standard locale identifiers and Windows locale identifiers (LCID)", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "0.0.4" }, "engines": { - "node": ">=6" + "node": ">=0.10.0" }, "files": [ "index.js", @@ -73,7 +72,7 @@ "url": "git+https://github.com/sindresorhus/lcid.git" }, "scripts": { - "test": "xo && ava" + "test": "node test.js" }, - "version": "2.0.0" + "version": "1.0.0" } diff --git a/node_modules/lcid/readme.md b/node_modules/lcid/readme.md index 2b1aa79..bee4a70 100644 --- a/node_modules/lcid/readme.md +++ b/node_modules/lcid/readme.md @@ -1,8 +1,8 @@ # lcid [![Build Status](https://travis-ci.org/sindresorhus/lcid.svg?branch=master)](https://travis-ci.org/sindresorhus/lcid) -> Mapping between [standard locale identifiers](https://en.wikipedia.org/wiki/Locale_(computer_software)) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) +> Mapping between [standard locale identifiers](http://en.wikipedia.org/wiki/Locale) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) -Based on the [mapping](https://github.com/python/cpython/blob/8f7bb100d0fa7fb2714f3953b5b627878277c7c6/Lib/locale.py#L1465-L1674) used in the Python standard library. +Based on the [mapping](https://github.com/python/cpython/blob/be2a1a76fa43bb1ea1b3577bb5bdd506a2e90e37/Lib/locale.py#L1395-L1604) used in the Python standard library. The mapping itself is just a [JSON file](lcid.json) and can be used wherever. @@ -10,14 +10,14 @@ The mapping itself is just a [JSON file](lcid.json) and can be used wherever. ## Install ``` -$ npm install lcid +$ npm install --save lcid ``` ## Usage ```js -const lcid = require('lcid'); +var lcid = require('lcid'); lcid.from(1044); //=> 'nb_NO' @@ -32,4 +32,4 @@ lcid.all; ## License -MIT © [Sindre Sorhus](https://sindresorhus.com) +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/load-json-file/package.json b/node_modules/load-json-file/package.json index 4233578..8426150 100644 --- a/node_modules/load-json-file/package.json +++ b/node_modules/load-json-file/package.json @@ -1,27 +1,33 @@ { - "_from": "load-json-file@^1.0.0", + "_args": [ + [ + "load-json-file@1.1.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "load-json-file@1.1.0", "_id": "load-json-file@1.1.0", "_inBundle": false, "_integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "_location": "/load-json-file", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "load-json-file@^1.0.0", + "raw": "load-json-file@1.1.0", "name": "load-json-file", "escapedName": "load-json-file", - "rawSpec": "^1.0.0", + "rawSpec": "1.1.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.1.0" }, "_requiredBy": [ "/read-pkg" ], "_resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "_shasum": "956905708d58b4bab4c2261b04f59f31c99374c0", - "_spec": "load-json-file@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/read-pkg", + "_spec": "1.1.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/load-json-file/issues" }, - "bundleDependencies": false, "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", @@ -38,7 +43,6 @@ "pinkie-promise": "^2.0.0", "strip-bom": "^2.0.0" }, - "deprecated": false, "description": "Read and parse a JSON file", "devDependencies": { "ava": "*", diff --git a/node_modules/locate-path/index.js b/node_modules/locate-path/index.js deleted file mode 100644 index 5aae6ee..0000000 --- a/node_modules/locate-path/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const path = require('path'); -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -module.exports = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - - return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options); -}; - -module.exports.sync = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - - for (const el of iterable) { - if (pathExists.sync(path.resolve(options.cwd, el))) { - return el; - } - } -}; diff --git a/node_modules/locate-path/license b/node_modules/locate-path/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/locate-path/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/locate-path/package.json b/node_modules/locate-path/package.json deleted file mode 100644 index 7ffdaf1..0000000 --- a/node_modules/locate-path/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "locate-path@^3.0.0", - "_id": "locate-path@3.0.0", - "_inBundle": false, - "_integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "_location": "/locate-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "locate-path@^3.0.0", - "name": "locate-path", - "escapedName": "locate-path", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/yargs/find-up" - ], - "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "_shasum": "dbec3b3ab759758071b58fe59fc41871af21400e", - "_spec": "locate-path@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/yargs/node_modules/find-up", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/locate-path/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "deprecated": false, - "description": "Get the first path that exists on disk of multiple paths", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/locate-path#readme", - "keywords": [ - "locate", - "path", - "paths", - "file", - "files", - "exists", - "find", - "finder", - "search", - "searcher", - "array", - "iterable", - "iterator" - ], - "license": "MIT", - "name": "locate-path", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/locate-path.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/node_modules/locate-path/readme.md b/node_modules/locate-path/readme.md deleted file mode 100644 index a1d2e62..0000000 --- a/node_modules/locate-path/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) - -> Get the first path that exists on disk of multiple paths - - -## Install - -``` -$ npm install locate-path -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const locatePath = require('locate-path'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' -]; - -(async () => { - console(await locatePath(files)); - //=> 'rainbow' -})(); -``` - - -## API - -### locatePath(input, [options]) - -Returns a `Promise` for the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
-Default: `Infinity`
-Minimum: `1` - -Number of concurrently pending promises. - -##### preserveOrder - -Type: `boolean`
-Default: `true` - -Preserve `input` order when searching. - -Disable this to improve performance if you don't care about the order. - -##### cwd - -Type: `string`
-Default: `process.cwd()` - -Current working directory. - -### locatePath.sync(input, [options]) - -Returns the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### cwd - -Same as above. - - -## Related - -- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/loud-rejection/package.json b/node_modules/loud-rejection/package.json index 4ccaab8..1d9c141 100644 --- a/node_modules/loud-rejection/package.json +++ b/node_modules/loud-rejection/package.json @@ -1,27 +1,33 @@ { - "_from": "loud-rejection@^1.0.0", + "_args": [ + [ + "loud-rejection@1.6.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "loud-rejection@1.6.0", "_id": "loud-rejection@1.6.0", "_inBundle": false, "_integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "_location": "/loud-rejection", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "loud-rejection@^1.0.0", + "raw": "loud-rejection@1.6.0", "name": "loud-rejection", "escapedName": "loud-rejection", - "rawSpec": "^1.0.0", + "rawSpec": "1.6.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.6.0" }, "_requiredBy": [ "/meow" ], "_resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "_shasum": "5b46f80147edee578870f086d04821cf998e551f", - "_spec": "loud-rejection@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/meow", + "_spec": "1.6.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,12 +36,10 @@ "bugs": { "url": "https://github.com/sindresorhus/loud-rejection/issues" }, - "bundleDependencies": false, "dependencies": { "currently-unhandled": "^0.4.1", "signal-exit": "^3.0.0" }, - "deprecated": false, "description": "Make unhandled promise rejections fail loudly instead of the default silent fail", "devDependencies": { "ava": "*", diff --git a/node_modules/lowercase-keys/index.js b/node_modules/lowercase-keys/index.js deleted file mode 100644 index b8d8898..0000000 --- a/node_modules/lowercase-keys/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -module.exports = function (obj) { - var ret = {}; - var keys = Object.keys(Object(obj)); - - for (var i = 0; i < keys.length; i++) { - ret[keys[i].toLowerCase()] = obj[keys[i]]; - } - - return ret; -}; diff --git a/node_modules/lowercase-keys/license b/node_modules/lowercase-keys/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/lowercase-keys/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/lowercase-keys/package.json b/node_modules/lowercase-keys/package.json deleted file mode 100644 index aec2d82..0000000 --- a/node_modules/lowercase-keys/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "lowercase-keys@^1.0.0", - "_id": "lowercase-keys@1.0.1", - "_inBundle": false, - "_integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "_location": "/lowercase-keys", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lowercase-keys@^1.0.0", - "name": "lowercase-keys", - "escapedName": "lowercase-keys", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "_shasum": "6f9e30b47084d971a7c820ff15a6c5167b74c26f", - "_spec": "lowercase-keys@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/got", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/lowercase-keys/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Lowercase the keys of an object", - "devDependencies": { - "ava": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/lowercase-keys#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "lowercase", - "lower-case", - "case", - "keys", - "key" - ], - "license": "MIT", - "name": "lowercase-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/lowercase-keys.git" - }, - "scripts": { - "test": "ava" - }, - "version": "1.0.1" -} diff --git a/node_modules/lowercase-keys/readme.md b/node_modules/lowercase-keys/readme.md deleted file mode 100644 index dc65770..0000000 --- a/node_modules/lowercase-keys/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys) - -> Lowercase the keys of an object - - -## Install - -``` -$ npm install --save lowercase-keys -``` - - -## Usage - -```js -var lowercaseKeys = require('lowercase-keys'); - -lowercaseKeys({FOO: true, bAr: false}); -//=> {foo: true, bar: false} -``` - - -## API - -### lowercaseKeys(object) - -Lowercases the keys and returns a new object. - - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/lru-cache/LICENSE b/node_modules/lru-cache/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -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/lru-cache/README.md b/node_modules/lru-cache/README.md deleted file mode 100644 index d660dd5..0000000 --- a/node_modules/lru-cache/README.md +++ /dev/null @@ -1,158 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) - -## Installation: - -```javascript -npm install lru-cache --save -``` - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n, key) { return n * 2 + key.length } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -// non-string keys ARE fully supported -// but note that it must be THE SAME object, not -// just a JSON-equivalent object. -var someObject = { a: 1 } -cache.set(someObject, 'a value') -// Object keys are not toString()-ed -cache.set('[object Object]', 'a different value') -assert.equal(cache.get(someObject), 'a value') -// A similar object with same keys/values won't work, -// because it's a different object identity -assert.equal(cache.get({ a: 1 }), undefined) - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n, key){return n.length}`. The default is - `function(){return 1}`, which is fine if you want to store `max` - like-sized things. The item is passed as the first argument, and - the key is passed as the second argumnet. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. -* `noDisposeOnSet` By default, if you set a `dispose()` method, then - it'll be called whenever a `set()` operation overwrites an existing - key. If you set this option, `dispose()` will only be called when a - key falls out of the cache, not when it is overwritten. - -## API - -* `set(key, value, maxAge)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. `maxAge` is optional and overrides the - cache `maxAge` option if provided. - - If the key is not found, `get()` will return `undefined`. - - The key and val can be any value. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `rforEach(function(value,key,cache), [thisp])` - - The same as `cache.forEach(...)` but items are iterated over in - reverse order. (ie, less recently used items are iterated over - first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. - -* `length` - - Return total length of objects in cache taking into account - `length` options function. - -* `itemCount` - - Return total quantity of objects currently in cache. Note, that - `stale` (see options) items are returned as part of this item - count. - -* `dump()` - - Return an array of the cache entries ready for serialization and usage - with 'destinationCache.load(arr)`. - -* `load(cacheEntriesArray)` - - Loads another cache entries array, obtained with `sourceCache.dump()`, - into the cache. The destination cache is reset before loading new entries - -* `prune()` - - Manually iterates over the entire cache proactively pruning old entries diff --git a/node_modules/lru-cache/index.js b/node_modules/lru-cache/index.js deleted file mode 100644 index bd35b53..0000000 --- a/node_modules/lru-cache/index.js +++ /dev/null @@ -1,468 +0,0 @@ -'use strict' - -module.exports = LRUCache - -// This will be a proper iterable 'Map' in engines that support it, -// or a fakey-fake PseudoMap in older versions. -var Map = require('pseudomap') -var util = require('util') - -// A linked list to keep track of recently-used-ness -var Yallist = require('yallist') - -// use symbols if possible, otherwise just _props -var hasSymbol = typeof Symbol === 'function' && process.env._nodeLRUCacheForceNoSymbol !== '1' -var makeSymbol -if (hasSymbol) { - makeSymbol = function (key) { - return Symbol(key) - } -} else { - makeSymbol = function (key) { - return '_' + key - } -} - -var MAX = makeSymbol('max') -var LENGTH = makeSymbol('length') -var LENGTH_CALCULATOR = makeSymbol('lengthCalculator') -var ALLOW_STALE = makeSymbol('allowStale') -var MAX_AGE = makeSymbol('maxAge') -var DISPOSE = makeSymbol('dispose') -var NO_DISPOSE_ON_SET = makeSymbol('noDisposeOnSet') -var LRU_LIST = makeSymbol('lruList') -var CACHE = makeSymbol('cache') - -function naiveLength () { return 1 } - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -function LRUCache (options) { - if (!(this instanceof LRUCache)) { - return new LRUCache(options) - } - - if (typeof options === 'number') { - options = { max: options } - } - - if (!options) { - options = {} - } - - var max = this[MAX] = options.max - // Kind of weird to have a default max of Infinity, but oh well. - if (!max || - !(typeof max === 'number') || - max <= 0) { - this[MAX] = Infinity - } - - var lc = options.length || naiveLength - if (typeof lc !== 'function') { - lc = naiveLength - } - this[LENGTH_CALCULATOR] = lc - - this[ALLOW_STALE] = options.stale || false - this[MAX_AGE] = options.maxAge || 0 - this[DISPOSE] = options.dispose - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, 'max', { - set: function (mL) { - if (!mL || !(typeof mL === 'number') || mL <= 0) { - mL = Infinity - } - this[MAX] = mL - trim(this) - }, - get: function () { - return this[MAX] - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'allowStale', { - set: function (allowStale) { - this[ALLOW_STALE] = !!allowStale - }, - get: function () { - return this[ALLOW_STALE] - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'maxAge', { - set: function (mA) { - if (!mA || !(typeof mA === 'number') || mA < 0) { - mA = 0 - } - this[MAX_AGE] = mA - trim(this) - }, - get: function () { - return this[MAX_AGE] - }, - enumerable: true -}) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { - set: function (lC) { - if (typeof lC !== 'function') { - lC = naiveLength - } - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC - this[LENGTH] = 0 - this[LRU_LIST].forEach(function (hit) { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) - this[LENGTH] += hit.length - }, this) - } - trim(this) - }, - get: function () { return this[LENGTH_CALCULATOR] }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'length', { - get: function () { return this[LENGTH] }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'itemCount', { - get: function () { return this[LRU_LIST].length }, - enumerable: true -}) - -LRUCache.prototype.rforEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this[LRU_LIST].tail; walker !== null;) { - var prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev - } -} - -function forEachStep (self, fn, node, thisp) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) { - hit = undefined - } - } - if (hit) { - fn.call(thisp, hit.value, hit.key, self) - } -} - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this[LRU_LIST].head; walker !== null;) { - var next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next - } -} - -LRUCache.prototype.keys = function () { - return this[LRU_LIST].toArray().map(function (k) { - return k.key - }, this) -} - -LRUCache.prototype.values = function () { - return this[LRU_LIST].toArray().map(function (k) { - return k.value - }, this) -} - -LRUCache.prototype.reset = function () { - if (this[DISPOSE] && - this[LRU_LIST] && - this[LRU_LIST].length) { - this[LRU_LIST].forEach(function (hit) { - this[DISPOSE](hit.key, hit.value) - }, this) - } - - this[CACHE] = new Map() // hash of items by key - this[LRU_LIST] = new Yallist() // list of items in order of use recency - this[LENGTH] = 0 // length of items in the list -} - -LRUCache.prototype.dump = function () { - return this[LRU_LIST].map(function (hit) { - if (!isStale(this, hit)) { - return { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - } - } - }, this).toArray().filter(function (h) { - return h - }) -} - -LRUCache.prototype.dumpLru = function () { - return this[LRU_LIST] -} - -/* istanbul ignore next */ -LRUCache.prototype.inspect = function (n, opts) { - var str = 'LRUCache {' - var extras = false - - var as = this[ALLOW_STALE] - if (as) { - str += '\n allowStale: true' - extras = true - } - - var max = this[MAX] - if (max && max !== Infinity) { - if (extras) { - str += ',' - } - str += '\n max: ' + util.inspect(max, opts) - extras = true - } - - var maxAge = this[MAX_AGE] - if (maxAge) { - if (extras) { - str += ',' - } - str += '\n maxAge: ' + util.inspect(maxAge, opts) - extras = true - } - - var lc = this[LENGTH_CALCULATOR] - if (lc && lc !== naiveLength) { - if (extras) { - str += ',' - } - str += '\n length: ' + util.inspect(this[LENGTH], opts) - extras = true - } - - var didFirst = false - this[LRU_LIST].forEach(function (item) { - if (didFirst) { - str += ',\n ' - } else { - if (extras) { - str += ',\n' - } - didFirst = true - str += '\n ' - } - var key = util.inspect(item.key).split('\n').join('\n ') - var val = { value: item.value } - if (item.maxAge !== maxAge) { - val.maxAge = item.maxAge - } - if (lc !== naiveLength) { - val.length = item.length - } - if (isStale(this, item)) { - val.stale = true - } - - val = util.inspect(val, opts).split('\n').join('\n ') - str += key + ' => ' + val - }) - - if (didFirst || extras) { - str += '\n' - } - str += '}' - - return str -} - -LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE] - - var now = maxAge ? Date.now() : 0 - var len = this[LENGTH_CALCULATOR](value, key) - - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)) - return false - } - - var node = this[CACHE].get(key) - var item = node.value - - // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) { - this[DISPOSE](key, item.value) - } - } - - item.now = now - item.maxAge = maxAge - item.value = value - this[LENGTH] += len - item.length - item.length = len - this.get(key) - trim(this) - return true - } - - var hit = new Entry(key, value, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this[MAX]) { - if (this[DISPOSE]) { - this[DISPOSE](key, value) - } - return false - } - - this[LENGTH] += hit.length - this[LRU_LIST].unshift(hit) - this[CACHE].set(key, this[LRU_LIST].head) - trim(this) - return true -} - -LRUCache.prototype.has = function (key) { - if (!this[CACHE].has(key)) return false - var hit = this[CACHE].get(key).value - if (isStale(this, hit)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var node = this[LRU_LIST].tail - if (!node) return null - del(this, node) - return node.value -} - -LRUCache.prototype.del = function (key) { - del(this, this[CACHE].get(key)) -} - -LRUCache.prototype.load = function (arr) { - // reset the cache - this.reset() - - var now = Date.now() - // A previous serialized cache has the most recent items first - for (var l = arr.length - 1; l >= 0; l--) { - var hit = arr[l] - var expiresAt = hit.e || 0 - if (expiresAt === 0) { - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - } else { - var maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) - } - } - } -} - -LRUCache.prototype.prune = function () { - var self = this - this[CACHE].forEach(function (value, key) { - get(self, key, false) - }) -} - -function get (self, key, doUse) { - var node = self[CACHE].get(key) - if (node) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) hit = undefined - } else { - if (doUse) { - self[LRU_LIST].unshiftNode(node) - } - } - if (hit) hit = hit.value - } - return hit -} - -function isStale (self, hit) { - if (!hit || (!hit.maxAge && !self[MAX_AGE])) { - return false - } - var stale = false - var diff = Date.now() - hit.now - if (hit.maxAge) { - stale = diff > hit.maxAge - } else { - stale = self[MAX_AGE] && (diff > self[MAX_AGE]) - } - return stale -} - -function trim (self) { - if (self[LENGTH] > self[MAX]) { - for (var walker = self[LRU_LIST].tail; - self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - var prev = walker.prev - del(self, walker) - walker = prev - } - } -} - -function del (self, node) { - if (node) { - var hit = node.value - if (self[DISPOSE]) { - self[DISPOSE](hit.key, hit.value) - } - self[LENGTH] -= hit.length - self[CACHE].delete(hit.key) - self[LRU_LIST].removeNode(node) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 -} diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json deleted file mode 100644 index bdfd981..0000000 --- a/node_modules/lru-cache/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "lru-cache@^4.0.1", - "_id": "lru-cache@4.1.5", - "_inBundle": false, - "_integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "_location": "/lru-cache", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lru-cache@^4.0.1", - "name": "lru-cache", - "escapedName": "lru-cache", - "rawSpec": "^4.0.1", - "saveSpec": null, - "fetchSpec": "^4.0.1" - }, - "_requiredBy": [ - "/cross-spawn" - ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "_shasum": "8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd", - "_spec": "lru-cache@^4.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/cross-spawn", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "bundleDependencies": false, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - }, - "deprecated": false, - "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "benchmark": "^2.1.4", - "standard": "^12.0.1", - "tap": "^12.1.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "keywords": [ - "mru", - "lru", - "cache" - ], - "license": "ISC", - "main": "index.js", - "name": "lru-cache", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "scripts": { - "coveragerport": "tap --coverage-report=html", - "lintfix": "standard --fix test/*.js index.js", - "postpublish": "git push origin --all; git push origin --tags", - "posttest": "standard test/*.js index.js", - "postversion": "npm publish --tag=legacy", - "preversion": "npm test", - "snap": "TAP_SNAPSHOT=1 tap test/*.js -J", - "test": "tap test/*.js --100 -J" - }, - "version": "4.1.5" -} diff --git a/node_modules/make-dir/index.js b/node_modules/make-dir/index.js deleted file mode 100644 index 1843955..0000000 --- a/node_modules/make-dir/index.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -const fs = require('fs'); -const path = require('path'); -const pify = require('pify'); - -const defaults = { - mode: 0o777 & (~process.umask()), - fs -}; - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - - if (pathHasInvalidWinCharacters) { - const err = new Error(`Path contains invalid characters: ${pth}`); - err.code = 'EINVAL'; - throw err; - } - } -}; - -module.exports = (input, opts) => Promise.resolve().then(() => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const mkdir = pify(opts.fs.mkdir); - const stat = pify(opts.fs.stat); - - const make = pth => { - return mkdir(pth, opts.mode) - .then(() => pth) - .catch(err => { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - return make(path.dirname(pth)).then(() => make(pth)); - } - - return stat(pth) - .then(stats => stats.isDirectory() ? pth : Promise.reject()) - .catch(() => { - throw err; - }); - }); - }; - - return make(path.resolve(input)); -}); - -module.exports.sync = (input, opts) => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const make = pth => { - try { - opts.fs.mkdirSync(pth, opts.mode); - } catch (err) { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - make(path.dirname(pth)); - return make(pth); - } - - try { - if (!opts.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw err; - } - } - - return pth; - }; - - return make(path.resolve(input)); -}; diff --git a/node_modules/make-dir/license b/node_modules/make-dir/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/make-dir/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/make-dir/node_modules/pify/index.js b/node_modules/make-dir/node_modules/pify/index.js deleted file mode 100644 index 1dee43a..0000000 --- a/node_modules/make-dir/node_modules/pify/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const processFn = (fn, opts) => function () { - const P = opts.promiseModule; - const args = new Array(arguments.length); - - for (let i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - return new P((resolve, reject) => { - if (opts.errorFirst) { - args.push(function (err, result) { - if (opts.multiArgs) { - const results = new Array(arguments.length - 1); - - for (let i = 1; i < arguments.length; i++) { - results[i - 1] = arguments[i]; - } - - if (err) { - results.unshift(err); - reject(results); - } else { - resolve(results); - } - } else if (err) { - reject(err); - } else { - resolve(result); - } - }); - } else { - args.push(function (result) { - if (opts.multiArgs) { - const results = new Array(arguments.length - 1); - - for (let i = 0; i < arguments.length; i++) { - results[i] = arguments[i]; - } - - resolve(results); - } else { - resolve(result); - } - }); - } - - fn.apply(this, args); - }); -}; - -module.exports = (obj, opts) => { - opts = Object.assign({ - exclude: [/.+(Sync|Stream)$/], - errorFirst: true, - promiseModule: Promise - }, opts); - - const filter = key => { - const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); - return opts.include ? opts.include.some(match) : !opts.exclude.some(match); - }; - - let ret; - if (typeof obj === 'function') { - ret = function () { - if (opts.excludeMain) { - return obj.apply(this, arguments); - } - - return processFn(obj, opts).apply(this, arguments); - }; - } else { - ret = Object.create(Object.getPrototypeOf(obj)); - } - - for (const key in obj) { // eslint-disable-line guard-for-in - const x = obj[key]; - ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; - } - - return ret; -}; diff --git a/node_modules/make-dir/node_modules/pify/license b/node_modules/make-dir/node_modules/pify/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/make-dir/node_modules/pify/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/make-dir/node_modules/pify/package.json b/node_modules/make-dir/node_modules/pify/package.json deleted file mode 100644 index 9086edf..0000000 --- a/node_modules/make-dir/node_modules/pify/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "pify@^3.0.0", - "_id": "pify@3.0.0", - "_inBundle": false, - "_integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "_location": "/make-dir/pify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pify@^3.0.0", - "name": "pify", - "escapedName": "pify", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/make-dir" - ], - "_resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "_shasum": "e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176", - "_spec": "pify@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/make-dir", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/pify/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Promisify a callback-style function", - "devDependencies": { - "ava": "*", - "pinkie-promise": "^2.0.0", - "v8-natives": "^1.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/pify#readme", - "keywords": [ - "promise", - "promises", - "promisify", - "all", - "denodify", - "denodeify", - "callback", - "cb", - "node", - "then", - "thenify", - "convert", - "transform", - "wrap", - "wrapper", - "bind", - "to", - "async", - "await", - "es2015", - "bluebird" - ], - "license": "MIT", - "name": "pify", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/pify.git" - }, - "scripts": { - "optimization-test": "node --allow-natives-syntax optimization-test.js", - "test": "xo && ava && npm run optimization-test" - }, - "version": "3.0.0" -} diff --git a/node_modules/make-dir/node_modules/pify/readme.md b/node_modules/make-dir/node_modules/pify/readme.md deleted file mode 100644 index 376ca4e..0000000 --- a/node_modules/make-dir/node_modules/pify/readme.md +++ /dev/null @@ -1,131 +0,0 @@ -# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) - -> Promisify a callback-style function - - -## Install - -``` -$ npm install --save pify -``` - - -## Usage - -```js -const fs = require('fs'); -const pify = require('pify'); - -// Promisify a single function -pify(fs.readFile)('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); - -// Promisify all methods in a module -pify(fs).readFile('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); -``` - - -## API - -### pify(input, [options]) - -Returns a `Promise` wrapped version of the supplied function or module. - -#### input - -Type: `Function` `Object` - -Callback-style function or module whose methods you want to promisify. - -#### options - -##### multiArgs - -Type: `boolean`
-Default: `false` - -By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error. - -```js -const request = require('request'); -const pify = require('pify'); - -pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { - const [httpResponse, body] = result; -}); -``` - -##### include - -Type: `string[]` `RegExp[]` - -Methods in a module to promisify. Remaining methods will be left untouched. - -##### exclude - -Type: `string[]` `RegExp[]`
-Default: `[/.+(Sync|Stream)$/]` - -Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. - -##### excludeMain - -Type: `boolean`
-Default: `false` - -If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module. - -```js -const pify = require('pify'); - -function fn() { - return true; -} - -fn.method = (data, callback) => { - setImmediate(() => { - callback(null, data); - }); -}; - -// Promisify methods but not `fn()` -const promiseFn = pify(fn, {excludeMain: true}); - -if (promiseFn()) { - promiseFn.method('hi').then(data => { - console.log(data); - }); -} -``` - -##### errorFirst - -Type: `boolean`
-Default: `true` - -Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc. - -##### promiseModule - -Type: `Function` - -Custom promise module to use instead of the native one. - -Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. - - -## Related - -- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted -- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/make-dir/package.json b/node_modules/make-dir/package.json deleted file mode 100644 index 20310e2..0000000 --- a/node_modules/make-dir/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "make-dir@^1.0.0", - "_id": "make-dir@1.3.0", - "_inBundle": false, - "_integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "_location": "/make-dir", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "make-dir@^1.0.0", - "name": "make-dir", - "escapedName": "make-dir", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/configstore" - ], - "_resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "_shasum": "79c1033b80515bd6d24ec9933e860ca75ee27f0c", - "_spec": "make-dir@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/configstore", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/make-dir/issues" - }, - "bundleDependencies": false, - "dependencies": { - "pify": "^3.0.0" - }, - "deprecated": false, - "description": "Make a directory and its parents if needed - Think `mkdir -p`", - "devDependencies": { - "ava": "*", - "codecov": "^3.0.0", - "graceful-fs": "^4.1.11", - "nyc": "^11.3.0", - "path-type": "^3.0.0", - "tempy": "^0.2.1", - "xo": "^0.20.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/make-dir#readme", - "keywords": [ - "mkdir", - "mkdirp", - "make", - "directories", - "dir", - "dirs", - "folders", - "directory", - "folder", - "path", - "parent", - "parents", - "intermediate", - "recursively", - "recursive", - "create", - "fs", - "filesystem", - "file-system" - ], - "license": "MIT", - "name": "make-dir", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/make-dir.git" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "version": "1.3.0" -} diff --git a/node_modules/make-dir/readme.md b/node_modules/make-dir/readme.md deleted file mode 100644 index 8a32bf4..0000000 --- a/node_modules/make-dir/readme.md +++ /dev/null @@ -1,116 +0,0 @@ -# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) - -> Make a directory and its parents if needed - Think `mkdir -p` - - -## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) - -- Promise API *(Async/await ready!)* -- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) -- 100% test coverage -- CI-tested on macOS, Linux, and Windows -- Actively maintained -- Doesn't bundle a CLI - - -## Install - -``` -$ npm install make-dir -``` - - -## Usage - -``` -$ pwd -/Users/sindresorhus/fun -$ tree -. -``` - -```js -const makeDir = require('make-dir'); - -makeDir('unicorn/rainbow/cake').then(path => { - console.log(path); - //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' -}); -``` - -``` -$ tree -. -└── unicorn - └── rainbow - └── cake -``` - -Multiple directories: - -```js -const makeDir = require('make-dir'); - -Promise.all([ - makeDir('unicorn/rainbow') - makeDir('foo/bar') -]).then(paths => { - console.log(paths); - /* - [ - '/Users/sindresorhus/fun/unicorn/rainbow', - '/Users/sindresorhus/fun/foo/bar' - ] - */ -}); -``` - - -## API - -### makeDir(path, [options]) - -Returns a `Promise` for the path to the created directory. - -### makeDir.sync(path, [options]) - -Returns the path to the created directory. - -#### path - -Type: `string` - -Directory to create. - -#### options - -Type: `Object` - -##### mode - -Type: `integer`
-Default: `0o777 & (~process.umask())` - -Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). - -##### fs - -Type: `Object`
-Default: `require('fs')` - -Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). - - -## Related - -- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module -- [del](https://github.com/sindresorhus/del) - Delete files and directories -- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching -- [cpy](https://github.com/sindresorhus/cpy) - Copy files -- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line -- [move-file](https://github.com/sindresorhus/move-file) - Move a file - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/map-age-cleaner/dist/index.d.ts b/node_modules/map-age-cleaner/dist/index.d.ts deleted file mode 100644 index fbf5ce0..0000000 --- a/node_modules/map-age-cleaner/dist/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -interface Entry { - [key: string]: any; -} -interface MaxAgeEntry extends Entry { - maxAge: number; -} -/** - * Automatically cleanup the items in the provided `map`. The property of the expiration timestamp should be named `maxAge`. - * - * @param map - Map instance which should be cleaned up. - */ -export default function mapAgeCleaner(map: Map): any; -/** - * Automatically cleanup the items in the provided `map`. - * - * @param map - Map instance which should be cleaned up. - * @param property - Name of the property which olds the expiry timestamp. - */ -export default function mapAgeCleaner(map: Map, property: string): any; -export {}; diff --git a/node_modules/map-age-cleaner/dist/index.js b/node_modules/map-age-cleaner/dist/index.js deleted file mode 100644 index ff137de..0000000 --- a/node_modules/map-age-cleaner/dist/index.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const p_defer_1 = __importDefault(require("p-defer")); -function mapAgeCleaner(map, property = 'maxAge') { - let processingKey; - let processingTimer; - let processingDeferred; - const cleanup = () => __awaiter(this, void 0, void 0, function* () { - if (processingKey !== undefined) { - // If we are already processing an item, we can safely exit - return; - } - const setupTimer = (item) => __awaiter(this, void 0, void 0, function* () { - processingDeferred = p_defer_1.default(); - const delay = item[1][property] - Date.now(); - if (delay <= 0) { - // Remove the item immediately if the delay is equal to or below 0 - map.delete(item[0]); - processingDeferred.resolve(); - return; - } - // Keep track of the current processed key - processingKey = item[0]; - processingTimer = setTimeout(() => { - // Remove the item when the timeout fires - map.delete(item[0]); - if (processingDeferred) { - processingDeferred.resolve(); - } - }, delay); - // tslint:disable-next-line:strict-type-predicates - if (typeof processingTimer.unref === 'function') { - // Don't hold up the process from exiting - processingTimer.unref(); - } - return processingDeferred.promise; - }); - try { - for (const entry of map) { - yield setupTimer(entry); - } - } - catch (_a) { - // Do nothing if an error occurs, this means the timer was cleaned up and we should stop processing - } - processingKey = undefined; - }); - const reset = () => { - processingKey = undefined; - if (processingTimer !== undefined) { - clearTimeout(processingTimer); - processingTimer = undefined; - } - if (processingDeferred !== undefined) { // tslint:disable-line:early-exit - processingDeferred.reject(undefined); - processingDeferred = undefined; - } - }; - const originalSet = map.set.bind(map); - map.set = (key, value) => { - if (map.has(key)) { - // If the key already exist, remove it so we can add it back at the end of the map. - map.delete(key); - } - // Call the original `map.set` - const result = originalSet(key, value); - // If we are already processing a key and the key added is the current processed key, stop processing it - if (processingKey && processingKey === key) { - reset(); - } - // Always run the cleanup method in case it wasn't started yet - cleanup(); // tslint:disable-line:no-floating-promises - return result; - }; - cleanup(); // tslint:disable-line:no-floating-promises - return map; -} -exports.default = mapAgeCleaner; -// Add support for CJS -module.exports = mapAgeCleaner; -module.exports.default = mapAgeCleaner; diff --git a/node_modules/map-age-cleaner/license b/node_modules/map-age-cleaner/license deleted file mode 100644 index 0711ab0..0000000 --- a/node_modules/map-age-cleaner/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sam Verschueren (github.com/SamVerschueren) - -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/map-age-cleaner/package.json b/node_modules/map-age-cleaner/package.json deleted file mode 100644 index 9e01216..0000000 --- a/node_modules/map-age-cleaner/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "_from": "map-age-cleaner@^0.1.1", - "_id": "map-age-cleaner@0.1.3", - "_inBundle": false, - "_integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "_location": "/map-age-cleaner", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "map-age-cleaner@^0.1.1", - "name": "map-age-cleaner", - "escapedName": "map-age-cleaner", - "rawSpec": "^0.1.1", - "saveSpec": null, - "fetchSpec": "^0.1.1" - }, - "_requiredBy": [ - "/mem" - ], - "_resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "_shasum": "7d583a7306434c055fe474b0f45078e6e1b4b92a", - "_spec": "map-age-cleaner@^0.1.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/mem", - "author": { - "name": "Sam Verschueren", - "email": "sam.verschueren@gmail.com", - "url": "github.com/SamVerschueren" - }, - "bugs": { - "url": "https://github.com/SamVerschueren/map-age-cleaner/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-defer": "^1.0.0" - }, - "deprecated": false, - "description": "Automatically cleanup expired items in a Map", - "devDependencies": { - "@types/delay": "^2.0.1", - "@types/node": "^10.7.1", - "ava": "^0.25.0", - "codecov": "^3.0.0", - "del-cli": "^1.1.0", - "delay": "^3.0.0", - "nyc": "^12.0.0", - "tslint": "^5.11.0", - "tslint-xo": "^0.9.0", - "typescript": "^3.0.1" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "dist/index.js", - "dist/index.d.ts" - ], - "homepage": "https://github.com/SamVerschueren/map-age-cleaner#readme", - "keywords": [ - "map", - "age", - "cleaner", - "maxage", - "expire", - "expiration", - "expiring" - ], - "license": "MIT", - "main": "dist/index.js", - "name": "map-age-cleaner", - "nyc": { - "exclude": [ - "dist/test.js" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/SamVerschueren/map-age-cleaner.git" - }, - "scripts": { - "build": "npm run clean && tsc", - "clean": "del-cli dist", - "lint": "tslint --format stylish --project .", - "prepublishOnly": "npm run build", - "pretest": "npm run build -- --sourceMap", - "test": "npm run lint && nyc ava dist/test.js" - }, - "sideEffects": false, - "typings": "dist/index.d.ts", - "version": "0.1.3" -} diff --git a/node_modules/map-age-cleaner/readme.md b/node_modules/map-age-cleaner/readme.md deleted file mode 100644 index 471d933..0000000 --- a/node_modules/map-age-cleaner/readme.md +++ /dev/null @@ -1,67 +0,0 @@ -# map-age-cleaner - -[![Build Status](https://travis-ci.org/SamVerschueren/map-age-cleaner.svg?branch=master)](https://travis-ci.org/SamVerschueren/map-age-cleaner) [![codecov](https://codecov.io/gh/SamVerschueren/map-age-cleaner/badge.svg?branch=master)](https://codecov.io/gh/SamVerschueren/map-age-cleaner?branch=master) - -> Automatically cleanup expired items in a Map - - -## Install - -``` -$ npm install map-age-cleaner -``` - - -## Usage - -```js -import mapAgeCleaner from 'map-age-cleaner'; - -const map = new Map([ - ['unicorn', {data: '🦄', maxAge: Date.now() + 1000}] -]); - -mapAgeCleaner(map); - -map.has('unicorn'); -//=> true - -// Wait for 1 second... - -map.has('unicorn'); -//=> false -``` - -> **Note**: Items have to be ordered ascending based on the expiry property. This means that the item which will be expired first, should be in the first position of the `Map`. - - -## API - -### mapAgeCleaner(map, [property]) - -Returns the `Map` instance. - -#### map - -Type: `Map` - -Map instance which should be cleaned up. - -#### property - -Type: `string`
-Default: `maxAge` - -Name of the property which olds the expiry timestamp. - - -## Related - -- [expiry-map](https://github.com/SamVerschueren/expiry-map) - A `Map` implementation with expirable items -- [expiry-set](https://github.com/SamVerschueren/expiry-set) - A `Set` implementation with expirable keys -- [mem](https://github.com/sindresorhus/mem) - Memoize functions - - -## License - -MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/node_modules/map-obj/package.json b/node_modules/map-obj/package.json index 0a7d9e3..1722bcb 100644 --- a/node_modules/map-obj/package.json +++ b/node_modules/map-obj/package.json @@ -1,28 +1,34 @@ { - "_from": "map-obj@^1.0.1", + "_args": [ + [ + "map-obj@1.0.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "map-obj@1.0.1", "_id": "map-obj@1.0.1", "_inBundle": false, "_integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", "_location": "/map-obj", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "map-obj@^1.0.1", + "raw": "map-obj@1.0.1", "name": "map-obj", "escapedName": "map-obj", - "rawSpec": "^1.0.1", + "rawSpec": "1.0.1", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "1.0.1" }, "_requiredBy": [ "/camelcase-keys", "/meow" ], "_resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "_shasum": "d933ceb9205d82bdcf4886f6742bdc2b4dea146d", - "_spec": "map-obj@^1.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/meow", + "_spec": "1.0.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -31,8 +37,6 @@ "bugs": { "url": "https://github.com/sindresorhus/map-obj/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Map object keys and values into a new object", "devDependencies": { "ava": "0.0.4" diff --git a/node_modules/mem/index.js b/node_modules/mem/index.js deleted file mode 100644 index cc78de5..0000000 --- a/node_modules/mem/index.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; -const mimicFn = require('mimic-fn'); -const isPromise = require('p-is-promise'); -const mapAgeCleaner = require('map-age-cleaner'); - -const cacheStore = new WeakMap(); - -const defaultCacheKey = (...args) => { - if (args.length === 0) { - return '__defaultKey'; - } - - if (args.length === 1) { - const [firstArgument] = args; - if ( - firstArgument === null || - firstArgument === undefined || - (typeof firstArgument !== 'function' && typeof firstArgument !== 'object') - ) { - return firstArgument; - } - } - - return JSON.stringify(args); -}; - -module.exports = (fn, options) => { - options = Object.assign({ - cacheKey: defaultCacheKey, - cache: new Map(), - cachePromiseRejection: false - }, options); - - if (typeof options.maxAge === 'number') { - mapAgeCleaner(options.cache); - } - - const {cache} = options; - options.maxAge = options.maxAge || 0; - - const setData = (key, data) => { - cache.set(key, { - data, - maxAge: Date.now() + options.maxAge - }); - }; - - const memoized = function (...args) { - const key = options.cacheKey(...args); - - if (cache.has(key)) { - const c = cache.get(key); - - return c.data; - } - - const ret = fn.call(this, ...args); - - setData(key, ret); - - if (isPromise(ret) && options.cachePromiseRejection === false) { - // Remove rejected promises from cache unless `cachePromiseRejection` is set to `true` - ret.catch(() => cache.delete(key)); - } - - return ret; - }; - - mimicFn(memoized, fn); - - cacheStore.set(memoized, options.cache); - - return memoized; -}; - -module.exports.clear = fn => { - const cache = cacheStore.get(fn); - - if (cache && typeof cache.clear === 'function') { - cache.clear(); - } -}; diff --git a/node_modules/mem/license b/node_modules/mem/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/mem/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/mem/package.json b/node_modules/mem/package.json deleted file mode 100644 index 84e9a06..0000000 --- a/node_modules/mem/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "mem@^4.0.0", - "_id": "mem@4.0.0", - "_inBundle": false, - "_integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", - "_location": "/mem", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "mem@^4.0.0", - "name": "mem", - "escapedName": "mem", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/os-locale" - ], - "_resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", - "_shasum": "6437690d9471678f6cc83659c00cbafcd6b0cdaf", - "_spec": "mem@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/os-locale", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/mem/issues" - }, - "bundleDependencies": false, - "dependencies": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" - }, - "deprecated": false, - "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", - "devDependencies": { - "ava": "*", - "delay": "^3.0.0", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/mem#readme", - "keywords": [ - "memoize", - "function", - "mem", - "memoization", - "cache", - "caching", - "optimize", - "performance", - "ttl", - "expire", - "promise" - ], - "license": "MIT", - "name": "mem", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/mem.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} diff --git a/node_modules/mem/readme.md b/node_modules/mem/readme.md deleted file mode 100644 index add4222..0000000 --- a/node_modules/mem/readme.md +++ /dev/null @@ -1,167 +0,0 @@ -# mem [![Build Status](https://travis-ci.org/sindresorhus/mem.svg?branch=master)](https://travis-ci.org/sindresorhus/mem) - -> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input - -Memory is automatically released when an item expires. - - -## Install - -``` -$ npm install mem -``` - - -## Usage - -```js -const mem = require('mem'); - -let i = 0; -const counter = () => ++i; -const memoized = mem(counter); - -memoized('foo'); -//=> 1 - -// Cached as it's the same arguments -memoized('foo'); -//=> 1 - -// Not cached anymore as the arguments changed -memoized('bar'); -//=> 2 - -memoized('bar'); -//=> 2 -``` - -##### Works fine with promise returning functions - -```js -const mem = require('mem'); - -let i = 0; -const counter = async () => ++i; -const memoized = mem(counter); - -(async () => { - console.log(await memoized()); - //=> 1 - - // The return value didn't increase as it's cached - console.log(await memoized()); - //=> 1 -})(); -``` - -```js -const mem = require('mem'); -const got = require('got'); -const delay = require('delay'); - -const memGot = mem(got, {maxAge: 1000}); - -(async () => { - await memGot('sindresorhus.com'); - - // This call is cached - await memGot('sindresorhus.com'); - - await delay(2000); - - // This call is not cached as the cache has expired - await memGot('sindresorhus.com'); -})(); -``` - - -## API - -### mem(fn, [options]) - -#### fn - -Type: `Function` - -Function to be memoized. - -#### options - -Type: `Object` - -##### maxAge - -Type: `number`
-Default: `Infinity` - -Milliseconds until the cache expires. - -##### cacheKey - -Type: `Function` - -Determines the cache key for storing the result based on the function arguments. By default, if there's only one argument and it's a [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive), it's used directly as a key, otherwise it's all the function arguments JSON stringified as an array. - -You could for example change it to only cache on the first argument `x => JSON.stringify(x)`. - -##### cache - -Type: `Object`
-Default: `new Map()` - -Use a different cache storage. Must implement the following methods: `.has(key)`, `.get(key)`, `.set(key, value)`, `.delete(key)`, and optionally `.clear()`. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache. - -##### cachePromiseRejection - -Type: `boolean`
-Default: `false` - -Cache rejected promises. - -### mem.clear(fn) - -Clear all cached data of a memoized function. - -#### fn - -Type: `Function` - -Memoized function. - - -## Tips - -### Cache statistics - -If you want to know how many times your cache had a hit or a miss, you can make use of [stats-map](https://github.com/SamVerschueren/stats-map) as a replacement for the default cache. - -#### Example - -```js -const mem = require('mem'); -const StatsMap = require('stats-map'); -const got = require('got'); - -const cache = new StatsMap(); -const memGot = mem(got, {cache}); - -(async () => { - await memGot('sindresorhus.com'); - await memGot('sindresorhus.com'); - await memGot('sindresorhus.com'); - - console.log(cache.stats); - //=> {hits: 2, misses: 1} -})(); -``` - - -## Related - -- [p-memoize](https://github.com/sindresorhus/p-memoize) - Memoize promise-returning & async functions - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/meow/package.json b/node_modules/meow/package.json index 90834b1..8d3d74a 100644 --- a/node_modules/meow/package.json +++ b/node_modules/meow/package.json @@ -1,27 +1,33 @@ { - "_from": "meow@^3.1.0", + "_args": [ + [ + "meow@3.7.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "meow@3.7.0", "_id": "meow@3.7.0", "_inBundle": false, "_integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "_location": "/meow", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "meow@^3.1.0", + "raw": "meow@3.7.0", "name": "meow", "escapedName": "meow", - "rawSpec": "^3.1.0", + "rawSpec": "3.7.0", "saveSpec": null, - "fetchSpec": "^3.1.0" + "fetchSpec": "3.7.0" }, "_requiredBy": [ "/pretty-bytes" ], "_resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "_shasum": "72cb668b425228290abbfa856892587308a801fb", - "_spec": "meow@^3.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/pretty-bytes", + "_spec": "3.7.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/meow/issues" }, - "bundleDependencies": false, "dependencies": { "camelcase-keys": "^2.0.0", "decamelize": "^1.1.2", @@ -43,7 +48,6 @@ "redent": "^1.0.0", "trim-newlines": "^1.0.0" }, - "deprecated": false, "description": "CLI app helper", "devDependencies": { "ava": "*", diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json index 1f0be23..cf3ab00 100644 --- a/node_modules/mime-db/package.json +++ b/node_modules/mime-db/package.json @@ -1,31 +1,36 @@ { - "_from": "mime-db@~1.37.0", + "_args": [ + [ + "mime-db@1.37.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "mime-db@1.37.0", "_id": "mime-db@1.37.0", "_inBundle": false, "_integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", "_location": "/mime-db", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "mime-db@~1.37.0", + "raw": "mime-db@1.37.0", "name": "mime-db", "escapedName": "mime-db", - "rawSpec": "~1.37.0", + "rawSpec": "1.37.0", "saveSpec": null, - "fetchSpec": "~1.37.0" + "fetchSpec": "1.37.0" }, "_requiredBy": [ + "/ext-list", "/mime-types" ], "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "_shasum": "0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8", - "_spec": "mime-db@~1.37.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/mime-types", + "_spec": "1.37.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Douglas Christopher Wilson", @@ -42,7 +47,6 @@ "url": "http://github.com/broofa" } ], - "deprecated": false, "description": "Media Type Database", "devDependencies": { "bluebird": "3.5.2", diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json index 7f7a453..91ea5bc 100644 --- a/node_modules/mime-types/package.json +++ b/node_modules/mime-types/package.json @@ -1,32 +1,36 @@ { - "_from": "mime-types@~2.1.19", + "_args": [ + [ + "mime-types@2.1.21", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "mime-types@2.1.21", "_id": "mime-types@2.1.21", "_inBundle": false, "_integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", "_location": "/mime-types", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "mime-types@~2.1.19", + "raw": "mime-types@2.1.21", "name": "mime-types", "escapedName": "mime-types", - "rawSpec": "~2.1.19", + "rawSpec": "2.1.21", "saveSpec": null, - "fetchSpec": "~2.1.19" + "fetchSpec": "2.1.21" }, "_requiredBy": [ "/form-data", "/request" ], "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "_shasum": "28995aa1ecb770742fe6ae7e58f9181c744b3f96", - "_spec": "mime-types@~2.1.19", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "2.1.21", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/jshttp/mime-types/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Douglas Christopher Wilson", @@ -46,7 +50,6 @@ "dependencies": { "mime-db": "~1.37.0" }, - "deprecated": false, "description": "The ultimate javascript content-type utility.", "devDependencies": { "eslint": "5.7.0", diff --git a/node_modules/mime/.eslintrc.json b/node_modules/mime/.eslintrc.json deleted file mode 100644 index 845527f..0000000 --- a/node_modules/mime/.eslintrc.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "root": true, - "parserOptions": { - "ecmaVersion": 6 - }, - "env": { - "browser": true, - "commonjs": true, - "node": true, - "mocha": true - }, - "extends": ["eslint:recommended"], - "rules": { - "array-bracket-spacing": ["warn", "never"], - "arrow-body-style": ["warn", "as-needed"], - "arrow-parens": ["warn", "as-needed"], - "arrow-spacing": "warn", - "brace-style": ["warn", "1tbs"], - "camelcase": "warn", - "comma-spacing": ["warn", {"after": true}], - "dot-notation": "warn", - "eqeqeq": ["warn", "smart"], - "indent": ["warn", 2, { - "SwitchCase": 1, - "FunctionDeclaration": {"parameters": 1}, - "MemberExpression": 1, - "CallExpression": {"arguments": 1} - }], - "key-spacing": ["warn", {"beforeColon": false, "afterColon": true, "mode": "minimum"}], - "keyword-spacing": "warn", - "no-console": "off", - "no-empty": "off", - "no-multi-spaces": "warn", - "no-redeclare": "off", - "no-restricted-globals": ["warn", "Promise"], - "no-trailing-spaces": "warn", - "no-undef": "error", - "no-unused-vars": ["warn", {"args": "none"}], - "one-var": ["warn", "never"], - "padded-blocks": ["warn", "never"], - "object-curly-spacing": ["warn", "never"], - "quotes": ["warn", "single"], - "react/prop-types": "off", - "react/jsx-no-bind": "off", - "semi": ["warn", "always"], - "space-before-blocks": ["warn", "always"], - "space-before-function-paren": ["warn", "never"], - "space-in-parens": ["warn", "never"], - "strict": ["warn", "global"] - } -} diff --git a/node_modules/mime/.github/ISSUE_TEMPLATE.md b/node_modules/mime/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 8764eff..0000000 --- a/node_modules/mime/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,6 +0,0 @@ -### If you have an issue with a specific extension or type - -Locate the definition for your extension/type in the [db.json file](https://github.com/jshttp/mime-db/blob/master/db.json) in the `mime-db` project. Does it look right? - - [ ] No. [File a `mime-db` issue](https://github.com/jshttp/mime-db/issues/new). - [ ] Yes: Go ahead and submit your issue/PR here and I'll look into it. diff --git a/node_modules/mime/.github/PULL_REQUEST_TEMPLATE.md b/node_modules/mime/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 8764eff..0000000 --- a/node_modules/mime/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,6 +0,0 @@ -### If you have an issue with a specific extension or type - -Locate the definition for your extension/type in the [db.json file](https://github.com/jshttp/mime-db/blob/master/db.json) in the `mime-db` project. Does it look right? - - [ ] No. [File a `mime-db` issue](https://github.com/jshttp/mime-db/issues/new). - [ ] Yes: Go ahead and submit your issue/PR here and I'll look into it. diff --git a/node_modules/mime/.travis.yml b/node_modules/mime/.travis.yml deleted file mode 100644 index 71b650d..0000000 --- a/node_modules/mime/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "4" - - "6" - - "8" diff --git a/node_modules/mime/CHANGELOG.md b/node_modules/mime/CHANGELOG.md deleted file mode 100644 index cfa203b..0000000 --- a/node_modules/mime/CHANGELOG.md +++ /dev/null @@ -1,236 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -# [2.4.0](https://github.com/broofa/node-mime/compare/v2.3.1...v2.4.0) (2018-11-26) - - -### Features - -* Bind exported methods ([9d2a7b8](https://github.com/broofa/node-mime/commit/9d2a7b8)) -* update to mime-db@1.37.0 ([49e6e41](https://github.com/broofa/node-mime/commit/49e6e41)) - - - - -## [2.3.1](https://github.com/broofa/node-mime/compare/v2.3.0...v2.3.1) (2018-04-11) - - -### Bug Fixes - -* fix [#198](https://github.com/broofa/node-mime/issues/198) ([25ca180](https://github.com/broofa/node-mime/commit/25ca180)) - - - - -# [2.3.0](https://github.com/broofa/node-mime/compare/v2.2.2...v2.3.0) (2018-04-11) - - -### Bug Fixes - -* fix [#192](https://github.com/broofa/node-mime/issues/192) ([5c35df6](https://github.com/broofa/node-mime/commit/5c35df6)) - - -### Features - -* add travis-ci testing ([d64160f](https://github.com/broofa/node-mime/commit/d64160f)) - - - - -## [2.2.2](https://github.com/broofa/node-mime/compare/v2.2.1...v2.2.2) (2018-03-30) - - -### Bug Fixes - -* update types files to mime-db@1.32.0 ([85aac16](https://github.com/broofa/node-mime/commit/85aac16)) - - - - -## [2.2.1](https://github.com/broofa/node-mime/compare/v2.2.0...v2.2.1) (2018-03-30) - - -### Bug Fixes - -* Retain type->extension mappings for non-default types. Fixes [#180](https://github.com/broofa/node-mime/issues/180) ([b5c83fb](https://github.com/broofa/node-mime/commit/b5c83fb)) - - - - -# [2.2.0](https://github.com/broofa/node-mime/compare/v2.1.0...v2.2.0) (2018-01-04) - - -### Features - -* Retain type->extension mappings for non-default types. Fixes [#180](https://github.com/broofa/node-mime/issues/180) ([10f82ac](https://github.com/broofa/node-mime/commit/10f82ac)) - - - - -# [2.1.0](https://github.com/broofa/node-mime/compare/v2.0.5...v2.1.0) (2017-12-22) - - -### Features - -* Upgrade to mime-db@1.32.0. Fixes [#185](https://github.com/broofa/node-mime/issues/185) ([3f775ba](https://github.com/broofa/node-mime/commit/3f775ba)) - - - - -## [2.0.5](https://github.com/broofa/node-mime/compare/v2.0.1...v2.0.5) (2017-12-22) - - -### Bug Fixes - -* ES5 support (back to node v0.4) ([f14ccb6](https://github.com/broofa/node-mime/commit/f14ccb6)) - - - -# Changelog - -## v2.0.4 (24/11/2017) -- [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/node-mime/issues/182) -- [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/node-mime/issues/181) - ---- - -## v1.5.0 (22/11/2017) -- [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/node-mime/issues/179) -- [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/node-mime/issues/178) -- [**closed**] How it works in brownser ? [#176](https://github.com/broofa/node-mime/issues/176) -- [**closed**] Missing `./Mime` [#175](https://github.com/broofa/node-mime/issues/175) -- [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/node-mime/issues/167) - ---- - -## v2.0.3 (25/09/2017) -*No changelog for this release.* - ---- - -## v1.4.1 (25/09/2017) -- [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/node-mime/issues/172) - ---- - -## v2.0.2 (15/09/2017) -- [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/node-mime/issues/165) -- [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/node-mime/issues/164) -- [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/node-mime/issues/163) -- [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/node-mime/issues/162) -- [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/node-mime/issues/161) -- [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/node-mime/issues/160) -- [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/node-mime/issues/152) -- [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/node-mime/issues/139) -- [**V2**] reset mime-types [#124](https://github.com/broofa/node-mime/issues/124) -- [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/node-mime/issues/113) - ---- - -## v2.0.1 (14/09/2017) -- [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/node-mime/issues/171) -- [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/node-mime/issues/170) - ---- - -## v2.0.0 (12/09/2017) -- [**closed**] woff and woff2 [#168](https://github.com/broofa/node-mime/issues/168) - ---- - -## v1.4.0 (28/08/2017) -- [**closed**] support for ac3 voc files [#159](https://github.com/broofa/node-mime/issues/159) -- [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/node-mime/issues/158) -- [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/node-mime/issues/157) -- [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/node-mime/issues/147) -- [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/node-mime/issues/135) -- [**closed**] requested features [#131](https://github.com/broofa/node-mime/issues/131) -- [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/node-mime/issues/129) -- [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/node-mime/issues/120) -- [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/node-mime/issues/118) -- [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/node-mime/issues/108) -- [**closed**] don't make default_type global [#78](https://github.com/broofa/node-mime/issues/78) -- [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/node-mime/issues/74) - ---- - -## v1.3.6 (11/05/2017) -- [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/node-mime/issues/154) -- [**closed**] Error while installing mime [#153](https://github.com/broofa/node-mime/issues/153) -- [**closed**] application/manifest+json [#149](https://github.com/broofa/node-mime/issues/149) -- [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/node-mime/issues/141) -- [**closed**] charsets image/png undefined [#140](https://github.com/broofa/node-mime/issues/140) -- [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/node-mime/issues/130) -- [**closed**] how to support plist? [#126](https://github.com/broofa/node-mime/issues/126) -- [**closed**] how does .types file format look like? [#123](https://github.com/broofa/node-mime/issues/123) -- [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/node-mime/issues/121) -- [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/node-mime/issues/117) - ---- - -## v1.3.4 (06/02/2015) -*No changelog for this release.* - ---- - -## v1.3.3 (06/02/2015) -*No changelog for this release.* - ---- - -## v1.3.1 (05/02/2015) -- [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/node-mime/issues/111) -- [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/node-mime/issues/110) -- [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/node-mime/issues/94) -- [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/node-mime/issues/77) - ---- - -## v1.3.0 (05/02/2015) -- [**closed**] Add common name? [#114](https://github.com/broofa/node-mime/issues/114) -- [**closed**] application/x-yaml [#104](https://github.com/broofa/node-mime/issues/104) -- [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/node-mime/issues/102) -- [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/node-mime/issues/99) -- [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/node-mime/issues/98) -- [**closed**] collaborators [#88](https://github.com/broofa/node-mime/issues/88) -- [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/node-mime/issues/87) -- [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/node-mime/issues/86) -- [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/node-mime/issues/81) -- [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/node-mime/issues/68) - ---- - -## v1.2.11 (15/08/2013) -- [**closed**] Update mime.types [#65](https://github.com/broofa/node-mime/issues/65) -- [**closed**] Publish a new version [#63](https://github.com/broofa/node-mime/issues/63) -- [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/node-mime/issues/55) -- [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/node-mime/issues/52) - ---- - -## v1.2.10 (25/07/2013) -- [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/node-mime/issues/62) -- [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/node-mime/issues/51) - ---- - -## v1.2.9 (17/01/2013) -- [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/node-mime/issues/49) -- [**closed**] Please add semicolon [#46](https://github.com/broofa/node-mime/issues/46) -- [**closed**] parse full mime types [#43](https://github.com/broofa/node-mime/issues/43) - ---- - -## v1.2.8 (10/01/2013) -- [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/node-mime/issues/47) -- [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/node-mime/issues/45) - ---- - -## v1.2.7 (19/10/2012) -- [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/node-mime/issues/41) -- [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/node-mime/issues/36) -- [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/node-mime/issues/30) -- [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/node-mime/issues/27) diff --git a/node_modules/mime/CONTRIBUTING.md b/node_modules/mime/CONTRIBUTING.md deleted file mode 100644 index dd5c86a..0000000 --- a/node_modules/mime/CONTRIBUTING.md +++ /dev/null @@ -1,5 +0,0 @@ -1. Commit messages should have a [Conventional Commit](https://conventionalcommits.org/) prefix. -2. If you're editing the `types/*` files, just stop. These are auto-generated from [mime-db](https://github.com/jshttp/mime-db). Go talk to those folks. -3. README edits should be made to [src/README_md.js](src/README_md.js). - -Thanks for helping out with this project. You rock! diff --git a/node_modules/mime/LICENSE b/node_modules/mime/LICENSE deleted file mode 100644 index d3f46f7..0000000 --- a/node_modules/mime/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -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/mime/Mime.js b/node_modules/mime/Mime.js deleted file mode 100644 index 97d502e..0000000 --- a/node_modules/mime/Mime.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -/** - * @param typeMap [Object] Map of MIME type -> Array[extensions] - * @param ... - */ -function Mime() { - this._types = Object.create(null); - this._extensions = Object.create(null); - - for (var i = 0; i < arguments.length; i++) { - this.define(arguments[i]); - } - - this.define = this.define.bind(this); - this.getType = this.getType.bind(this); - this.getExtension = this.getExtension.bind(this); -} - -/** - * Define mimetype -> xtension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * If a type declares an extension that has already been defined, an error will - * be thrown. To suppress this error and force the extension to be associated - * with the new type, pass `force`=true. Alternatively, you may prefix the - * extension with "*" to map the type to extension, without mapping the - * extension to the type. - * - * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']}); - * - * - * @param map (Object) type definitions - * @param force (Boolean) if true, force overriding of existing definitions - */ -Mime.prototype.define = function(typeMap, force) { - for (var type in typeMap) { - var extensions = typeMap[type]; - for (var i = 0; i < extensions.length; i++) { - var ext = extensions[i]; - - // '*' prefix = not the preferred type for this extension. So fixup the - // extension, and skip it. - if (ext[0] == '*') { - continue; - } - - if (!force && (ext in this._types)) { - throw new Error( - 'Attempt to change mapping for "' + ext + - '" extension from "' + this._types[ext] + '" to "' + type + - '". Pass `force=true` to allow this, otherwise remove "' + ext + - '" from the list of extensions for "' + type + '".' - ); - } - - this._types[ext] = type; - } - - // Use first extension as default - if (force || !this._extensions[type]) { - var ext = extensions[0]; - this._extensions[type] = (ext[0] != '*') ? ext : ext.substr(1) - } - } -}; - -/** - * Lookup a mime type based on extension - */ -Mime.prototype.getType = function(path) { - path = String(path); - var last = path.replace(/^.*[/\\]/, '').toLowerCase(); - var ext = last.replace(/^.*\./, '').toLowerCase(); - - var hasPath = last.length < path.length; - var hasDot = ext.length < last.length - 1; - - return (hasDot || !hasPath) && this._types[ext] || null; -}; - -/** - * Return file extension associated with a mime type - */ -Mime.prototype.getExtension = function(type) { - type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; - return type && this._extensions[type.toLowerCase()] || null; -}; - -module.exports = Mime; diff --git a/node_modules/mime/README.md b/node_modules/mime/README.md deleted file mode 100644 index b16619a..0000000 --- a/node_modules/mime/README.md +++ /dev/null @@ -1,190 +0,0 @@ - -# Mime - -A comprehensive, compact MIME type module. - -[![Build Status](https://travis-ci.org/broofa/node-mime.svg?branch=master)](https://travis-ci.org/broofa/node-mime) - -## Version 2 Notes - -Version 2 is a breaking change from 1.x as the semver implies. Specifically: - -* `lookup()` renamed to `getType()` -* `extension()` renamed to `getExtension()` -* `charset()` and `load()` methods have been removed - -If you prefer the legacy version of this module please `npm install mime@^1`. Version 1 docs may be found [here](https://github.com/broofa/node-mime/tree/v1.4.0). - -## Install - -### NPM -``` -npm install mime -``` - -### Browser - -It is recommended that you use a bundler such as -[webpack](https://webpack.github.io/) or [browserify](http://browserify.org/) to -package your code. However, browser-ready versions are available via wzrd.in. -E.g. For the full version: - - - - - - - -``` - -This library also works if you use AMD (Asynchronous Module Definition), which is used in tools like [RequireJS](http://requirejs.org/). Just list `browser-source-map-support` as a dependency: - -```html - -``` - -## Options - -This module installs two things: a change to the `stack` property on `Error` objects and a handler for uncaught exceptions that mimics node's default exception handler (the handler can be seen in the demos below). You may want to disable the handler if you have your own uncaught exception handler. This can be done by passing an argument to the installer: - -```js -require('source-map-support').install({ - handleUncaughtExceptions: false -}); -``` - -This module loads source maps from the filesystem by default. You can provide alternate loading behavior through a callback as shown below. For example, [Meteor](https://github.com/meteor) keeps all source maps cached in memory to avoid disk access. - -```js -require('source-map-support').install({ - retrieveSourceMap: function(source) { - if (source === 'compiled.js') { - return { - url: 'original.js', - map: fs.readFileSync('compiled.js.map', 'utf8') - }; - } - return null; - } -}); -``` - -The module will by default assume a browser environment if XMLHttpRequest and window are defined. If either of these do not exist it will instead assume a node environment. -In some rare cases, e.g. when running a browser emulation and where both variables are also set, you can explictly specify the environment to be either 'browser' or 'node'. - -```js -require('source-map-support').install({ - environment: 'node' -}); -``` - -To support files with inline source maps, the `hookRequire` options can be specified, which will monitor all source files for inline source maps. - - -```js -require('source-map-support').install({ - hookRequire: true -}); -``` - -This monkey patches the `require` module loading chain, so is not enabled by default and is not recommended for any sort of production usage. - -## Demos - -#### Basic Demo - -original.js: - -```js -throw new Error('test'); // This is the original code -``` - -compiled.js: - -```js -require('source-map-support').install(); - -throw new Error('test'); // This is the compiled code -// The next line defines the sourceMapping. -//# sourceMappingURL=compiled.js.map -``` - -compiled.js.map: - -```json -{ - "version": 3, - "file": "compiled.js", - "sources": ["original.js"], - "names": [], - "mappings": ";;AAAA,MAAM,IAAI" -} -``` - -Run compiled.js using node (notice how the stack trace uses original.js instead of compiled.js): - -``` -$ node compiled.js - -original.js:1 -throw new Error('test'); // This is the original code - ^ -Error: test - at Object. (original.js:1:7) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### TypeScript Demo - -demo.ts: - -```typescript -declare function require(name: string); -require('source-map-support').install(); -class Foo { - constructor() { this.bar(); } - bar() { throw new Error('this is a demo'); } -} -new Foo(); -``` - -Compile and run the file using the TypeScript compiler from the terminal: - -``` -$ npm install source-map-support typescript -$ node_modules/typescript/bin/tsc -sourcemap demo.ts -$ node demo.js - -demo.ts:5 - bar() { throw new Error('this is a demo'); } - ^ -Error: this is a demo - at Foo.bar (demo.ts:5:17) - at new Foo (demo.ts:4:24) - at Object. (demo.ts:7:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### CoffeeScript Demo - -demo.coffee: - -```coffee -require('source-map-support').install() -foo = -> - bar = -> throw new Error 'this is a demo' - bar() -foo() -``` - -Compile and run the file using the CoffeeScript compiler from the terminal: - -```sh -$ npm install source-map-support coffee-script -$ node_modules/coffee-script/bin/coffee --map --compile demo.coffee -$ node demo.js - -demo.coffee:3 - bar = -> throw new Error 'this is a demo' - ^ -Error: this is a demo - at bar (demo.coffee:3:22) - at foo (demo.coffee:4:3) - at Object. (demo.coffee:5:1) - at Object. (demo.coffee:1:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) -``` - -## Tests - -This repo contains both automated tests for node and manual tests for the browser. The automated tests can be run using mocha (type `mocha` in the root directory). To run the manual tests: - -* Build the tests using `build.js` -* Launch the HTTP server (`npm run serve-tests`) and visit - * http://127.0.0.1:1336/amd-test - * http://127.0.0.1:1336/browser-test - * http://127.0.0.1:1336/browserify-test - **Currently not working** due to a bug with browserify (see [pull request #66](https://github.com/evanw/node-source-map-support/pull/66) for details). -* For `header-test`, run `server.js` inside that directory and visit http://127.0.0.1:1337/ - -## License - -This code is available under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/node_modules/source-map-support/browser-source-map-support.js b/node_modules/source-map-support/browser-source-map-support.js deleted file mode 100644 index afa56e3..0000000 --- a/node_modules/source-map-support/browser-source-map-support.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Support for source maps in V8 stack traces - * https://github.com/evanw/node-source-map-support - */ -/* - The buffer module from node.js, for the browser. - - @author Feross Aboukhadijeh - license MIT -*/ -(this.define||function(N,O){this.sourceMapSupport=O()})("browser-source-map-support",function(N){(function b(p,v,m){function f(d,a){if(!v[d]){if(!p[d]){var l="function"==typeof require&&require;if(!a&&l)return l(d,!0);if(k)return k(d,!0);throw Error("Cannot find module '"+d+"'");}l=v[d]={exports:{}};p[d][0].call(l.exports,function(a){var b=p[d][1][a];return f(b?b:a)},l,l.exports,b,p,v,m)}return v[d].exports}for(var k="function"==typeof require&&require,h=0;hb)return-1;if(58>b)return b-48+52;if(91>b)return b-65;if(123>b)return b-97+26}var k="undefined"!==typeof Uint8Array?Uint8Array:Array;b.toByteArray=function(b){function d(a){u[t++]=a}if(0>16);d((h&65280)>>8);d(h&255)}2===l?(h=f(b.charAt(a))<<2|f(b.charAt(a+1))>>4,d(h&255)):1===l&&(h=f(b.charAt(a))<<10|f(b.charAt(a+1))<<4|f(b.charAt(a+2))>>2,d(h>>8&255),d(h&255));return u};b.fromByteArray=function(b){var d=b.length%3,a="",l;var f=0;for(l=b.length-d;f>18&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>12&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>6&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r&63);a+=r}switch(d){case 1:r=b[b.length-1];a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r<< -4&63);a+="==";break;case 2:r=(b[b.length-2]<<8)+b[b.length-1],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>10),a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>4&63),a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r<<2&63),a+="="}return a}})("undefined"===typeof m?this.base64js={}:m)},{}],3:[function(p,v,m){},{}],4:[function(p,v,m){(function(b){var f=Object.prototype.toString,k="function"===typeof b.alloc&& -"function"===typeof b.allocUnsafe&&"function"===typeof b.from;v.exports=function(h,d,a){if("number"===typeof h)throw new TypeError('"value" argument must not be a number');if("ArrayBuffer"===f.call(h).slice(8,-1)){d>>>=0;var l=h.byteLength-d;if(0>l)throw new RangeError("'offset' is out of bounds");if(void 0===a)a=l;else if(a>>>=0,a>l)throw new RangeError("'length' is out of bounds");return k?b.from(h.slice(d,d+a)):new b(new Uint8Array(h.slice(d,d+a)))}if("string"===typeof h){a=d;if("string"!==typeof a|| -""===a)a="utf8";if(!b.isEncoding(a))throw new TypeError('"encoding" must be a valid string encoding');return k?b.from(h,a):new b(h,a)}return k?b.from(h):new b(h)}}).call(this,p("buffer").Buffer)},{buffer:5}],5:[function(p,v,m){function b(e,g,y){if(!(this instanceof b))return new b(e,g,y);var a=typeof e;if("base64"===g&&"string"===a)for(e=e.trim?e.trim():e.replace(/^\s+|\s+$/g,"");0!==e.length%4;)e+="=";if("number"===a)var c=I(e);else if("string"===a)c=b.byteLength(e,g);else if("object"===a)c=I(e.length); -else throw Error("First argument needs to be a number, array or string.");if(b._useTypedArrays)var d=b._augment(new Uint8Array(c));else d=this,d.length=c,d._isBuffer=!0;if(b._useTypedArrays&&"number"===typeof e.byteLength)d._set(e);else{var n=e;if(M(n)||b.isBuffer(n)||n&&"object"===typeof n&&"number"===typeof n.length)for(g=0;g=a))return y?(y=e[g],g+1=a)){var c;y?(g+2>>0)):(g+1>>0);return c}}function d(e,g,a,c){c||(q("boolean"===typeof a,"missing or invalid endian"),q(void 0!==g&&null!==g,"missing offset"),q(g+1=e.length))return e=k(e,g,a,!0),e&32768?-1*(65535-e+1):e}function a(e,g,a,c){c||(q("boolean"===typeof a,"missing or invalid endian"), -q(void 0!==g&&null!==g,"missing offset"),q(g+3=e.length))return e=h(e,g,a,!0),e&2147483648?-1*(4294967295-e+1):e}function l(e,g,a,c){c||(q("boolean"===typeof a,"missing or invalid endian"),q(g+3=y))for(b=0,y=Math.min(y-a,2);b>>8*(c?b:1-b)}function t(e,g,a,c,b){b||(q(void 0!==g&&null!==g,"missing value"),q("boolean"===typeof c,"missing or invalid endian"),q(void 0!==a&&null!==a,"missing offset"),q(a+3=y))for(b=0,y=Math.min(y-a,4);b>>8*(c?b:3-b)&255}function z(e,g,a,c,b){b||(q(void 0!==g&&null!==g,"missing value"),q("boolean"===typeof c,"missing or invalid endian"),q(void 0!==a&&null!==a,"missing offset"),q(a+1=e.length||(0<=g?r(e,g,a,c,b):r(e,65535+g+1,a,c,b))}function c(e,g,a,c,b){b||(q(void 0!==g&&null!==g,"missing value"),q("boolean"===typeof c,"missing or invalid endian"), -q(void 0!==a&&null!==a,"missing offset"),q(a+3=e.length||(0<=g?t(e,g,a,c,b):t(e,4294967295+g+1,a,c,b))}function n(e,g,a,c,b){b||(q(void 0!==g&&null!==g,"missing value"),q("boolean"===typeof c,"missing or invalid endian"),q(void 0!==a&&null!==a,"missing offset"),q(a+3=e.length||G.write(e,g,a,c,23,4)}function x(e,g,a, -c,b){b||(q(void 0!==g&&null!==g,"missing value"),q("boolean"===typeof c,"missing or invalid endian"),q(void 0!==a&&null!==a,"missing offset"),q(a+7=e.length||G.write(e,g,a,c,52,8)}function B(e,g,a){if("number"!==typeof e)return a;e=~~e;if(e>=g)return g;if(0<=e)return e;e+=g;return 0<=e?e:0}function I(e){e=~~Math.ceil(+e);return 0>e?0:e}function M(e){return(Array.isArray||function(e){return"[object Array]"=== -Object.prototype.toString.call(e)})(e)}function K(e){return 16>e?"0"+e.toString(16):e.toString(16)}function L(e){for(var g=[],a=0;a=c)g.push(e.charCodeAt(a));else{var b=a;55296<=c&&57343>=c&&a++;c=encodeURIComponent(e.slice(b,a+1)).substr(1).split("%");for(b=0;b=a.length||g>=e.length);g++)a[g+ -c]=e[g];return g}function F(e){try{return decodeURIComponent(e)}catch(g){return String.fromCharCode(65533)}}function H(e,a){q("number"===typeof e,"cannot write a non-number as a number");q(0<=e,"specified a negative value for writing an unsigned value");q(e<=a,"value is larger than maximum value for type");q(Math.floor(e)===e,"value has a fractional component")}function A(e,a,c){q("number"===typeof e,"cannot write a non-number as a number");q(e<=a,"value larger than maximum allowed value");q(e>=c, -"value smaller than minimum allowed value");q(Math.floor(e)===e,"value has a fractional component")}function D(e,a,c){q("number"===typeof e,"cannot write a non-number as a number");q(e<=a,"value larger than maximum allowed value");q(e>=c,"value smaller than minimum allowed value")}function q(e,a){if(!e)throw Error(a||"Failed assertion");}var E=p("base64-js"),G=p("ieee754");m.Buffer=b;m.SlowBuffer=b;m.INSPECT_MAX_BYTES=50;b.poolSize=8192;b._useTypedArrays=function(){try{var e=new ArrayBuffer(0),a= -new Uint8Array(e);a.foo=function(){return 42};return 42===a.foo()&&"function"===typeof a.subarray}catch(y){return!1}}();b.isEncoding=function(e){switch(String(e).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "raw":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;default:return!1}};b.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)};b.byteLength=function(e,a){e+="";switch(a||"utf8"){case "hex":var g=e.length/2;break; -case "utf8":case "utf-8":g=L(e).length;break;case "ascii":case "binary":case "raw":g=e.length;break;case "base64":g=E.toByteArray(e).length;break;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":g=2*e.length;break;default:throw Error("Unknown encoding");}return g};b.concat=function(e,a){q(M(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array.");if(0===e.length)return new b(0);if(1===e.length)return e[0];var g;if("number"!==typeof a)for(g=a=0;gg&&(c=g)):c=g;d=String(d||"utf8").toLowerCase();switch(d){case "hex":a=Number(a)||0;d=this.length-a;c?(c=Number(c),c>d&&(c=d)):c=d;d=e.length;q(0===d%2,"Invalid hex string");c>d/2&&(c=d/2);for(d=0;d>8;y%=256;g.push(y);g.push(d)}e=b._charsWritten=C(g,this,a,c);break;default:throw Error("Unknown encoding"); -}return e};b.prototype.toString=function(e,a,c){e=String(e||"utf8").toLowerCase();a=Number(a)||0;c=void 0!==c?Number(c):c=this.length;if(c===a)return"";switch(e){case "hex":e=this.length;if(!a||0>a)a=0;if(!c||0>c||c>e)c=e;for(e="";a=this[a]?(e+=F(g)+String.fromCharCode(this[a]),g=""):g+="%"+this[a].toString(16);c=e+F(g);break;case "ascii":c=f(this,a,c);break;case "binary":c=f(this,a,c);break; -case "base64":c=0===a&&c===this.length?E.fromByteArray(this):E.fromByteArray(this.slice(a,c));break;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":c=this.slice(a,c);a="";for(e=0;e=c,"sourceEnd < sourceStart"),q(0<=a&&athis.length&&(d=this.length),e.length-ad||!b._useTypedArrays)for(var g=0;g=this.length))return this[e]}; -b.prototype.readUInt16LE=function(e,a){return k(this,e,!0,a)};b.prototype.readUInt16BE=function(e,a){return k(this,e,!1,a)};b.prototype.readUInt32LE=function(e,a){return h(this,e,!0,a)};b.prototype.readUInt32BE=function(e,a){return h(this,e,!1,a)};b.prototype.readInt8=function(e,a){a||(q(void 0!==e&&null!==e,"missing offset"),q(e=this.length))return this[e]&128?-1*(255-this[e]+1):this[e]};b.prototype.readInt16LE=function(e,a){return d(this, -e,!0,a)};b.prototype.readInt16BE=function(e,a){return d(this,e,!1,a)};b.prototype.readInt32LE=function(e,c){return a(this,e,!0,c)};b.prototype.readInt32BE=function(e,c){return a(this,e,!1,c)};b.prototype.readFloatLE=function(e,a){return l(this,e,!0,a)};b.prototype.readFloatBE=function(e,a){return l(this,e,!1,a)};b.prototype.readDoubleLE=function(e,a){return u(this,e,!0,a)};b.prototype.readDoubleBE=function(e,a){return u(this,e,!1,a)};b.prototype.writeUInt8=function(e,a,c){c||(q(void 0!==e&&null!== -e,"missing value"),q(void 0!==a&&null!==a,"missing offset"),q(a=this.length||(this[a]=e)};b.prototype.writeUInt16LE=function(a,c,b){r(this,a,c,!0,b)};b.prototype.writeUInt16BE=function(a,c,b){r(this,a,c,!1,b)};b.prototype.writeUInt32LE=function(a,c,b){t(this,a,c,!0,b)};b.prototype.writeUInt32BE=function(a,c,b){t(this,a,c,!1,b)};b.prototype.writeInt8=function(a,c,b){b||(q(void 0!==a&&null!==a,"missing value"),q(void 0!==c&&null!==c,"missing offset"), -q(c=this.length||(0<=a?this.writeUInt8(a,c,b):this.writeUInt8(255+a+1,c,b))};b.prototype.writeInt16LE=function(a,c,b){z(this,a,c,!0,b)};b.prototype.writeInt16BE=function(a,c,b){z(this,a,c,!1,b)};b.prototype.writeInt32LE=function(a,b,d){c(this,a,b,!0,d)};b.prototype.writeInt32BE=function(a,b,d){c(this,a,b,!1,d)};b.prototype.writeFloatLE=function(a,c,b){n(this,a,c,!0,b)};b.prototype.writeFloatBE=function(a,c,b){n(this,a,c,!1,b)}; -b.prototype.writeDoubleLE=function(a,c,b){x(this,a,c,!0,b)};b.prototype.writeDoubleBE=function(a,c,b){x(this,a,c,!1,b)};b.prototype.fill=function(a,c,b){a||(a=0);c||(c=0);b||(b=this.length);"string"===typeof a&&(a=a.charCodeAt(0));q("number"===typeof a&&!isNaN(a),"value is not a number");q(b>=c,"end < start");if(b!==c&&0!==this.length)for(q(0<=c&&c"};b.prototype.toArrayBuffer=function(){if("undefined"!==typeof Uint8Array){if(b._useTypedArrays)return(new b(this)).buffer;for(var a=new Uint8Array(this.length),c=0,d=a.length;c>1,r=-7;d=k?d-1:0;var t=k?-1:1,z=b[f+d];d+=t;k=z&(1<<-r)-1;z>>=-r;for(r+=a;0>=-r;for(r+=h;0>1,z=23===d?Math.pow(2,-24)-Math.pow(2,-77):0;a=h?0:a-1;var c=h?1:-1, -n=0>f||0===f&&0>1/f?1:0;f=Math.abs(f);isNaN(f)||Infinity===f?(f=isNaN(f)?1:0,h=r):(h=Math.floor(Math.log(f)/Math.LN2),1>f*(l=Math.pow(2,-h))&&(h--,l*=2),f=1<=h+t?f+z/l:f+z*Math.pow(2,1-t),2<=f*l&&(h++,l/=2),h+t>=r?(f=0,h=r):1<=h+t?(f=(f*l-1)*Math.pow(2,d),h+=t):(f=f*Math.pow(2,t-1)*Math.pow(2,d),h=0));for(;8<=d;b[k+a]=f&255,a+=c,f/=256,d-=8);h=h<b?[]:a.slice(c,b-c+1)}a=m.resolve(a).substr(1);b=m.resolve(b).substr(1);for(var l=d(a.split("/")),t=d(b.split("/")),f=Math.min(l.length,t.length),c=f,n=0;nb&&(b=a.length+b);return a.substr(b,d)}}).call(this,p("node_modules/process/browser.js"))},{"node_modules/process/browser.js":8}],8:[function(p,v,m){function b(){}p=v.exports= -{};p.nextTick=function(){if("undefined"!==typeof window&&window.setImmediate)return function(b){return window.setImmediate(b)};if("undefined"!==typeof window&&window.postMessage&&window.addEventListener){var b=[];window.addEventListener("message",function(f){var k=f.source;k!==window&&null!==k||"process-tick"!==f.data||(f.stopPropagation(),0f?(-f<<1)+1:f<<1;do f=h&31,h>>>=5,0=d)throw Error("Expected more digits in base 64 VLQ value."); -var u=b.decode(f.charCodeAt(k++));if(-1===u)throw Error("Invalid base64 digit: "+f.charAt(k-1));var r=!!(u&32);u&=31;a+=u<>1;h.value=1===(a&1)?-f:f;h.rest=k}},{"./base64":11}],11:[function(p,v,m){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");m.encode=function(f){if(0<=f&&f=b?b-65:97<=b&&122>=b?b-97+26:48<=b&&57>=b?b-48+52:43==b? -62:47==b?63:-1}},{}],12:[function(p,v,m){function b(f,k,h,d,a,l){var u=Math.floor((k-f)/2)+f,r=a(h,d[u],!0);return 0===r?u:0f?-1:f}m.GREATEST_LOWER_BOUND=1;m.LEAST_UPPER_BOUND=2;m.search=function(f,k,h,d){if(0===k.length)return-1;f=b(-1,k.length,f,k,h,d||m.GREATEST_LOWER_BOUND);if(0>f)return-1;for(;0<=f-1&&0===h(k[f],k[f-1],!0);)--f;return f}},{}],13:[function(p,v,m){function b(){this._array= -[];this._sorted=!0;this._last={generatedLine:-1,generatedColumn:0}}var f=p("./util");b.prototype.unsortedForEach=function(b,f){this._array.forEach(b,f)};b.prototype.add=function(b){var k=this._last,d=k.generatedLine,a=b.generatedLine,l=k.generatedColumn,u=b.generatedColumn;a>d||a==d&&u>=l||0>=f.compareByGeneratedPositionsInflated(k,b)?this._last=b:this._sorted=!1;this._array.push(b)};b.prototype.toArray=function(){this._sorted||(this._array.sort(f.compareByGeneratedPositionsInflated),this._sorted= -!0);return this._array};m.MappingList=b},{"./util":18}],14:[function(p,v,m){function b(b,f,d){var a=b[f];b[f]=b[d];b[d]=a}function f(k,h,d,a){if(d=h(k[r],u)&&(l+=1,b(k,l,r));b(k,l+1,r);l+=1;f(k,h,d,l-1);f(k,h,l+1,a)}}m.quickSort=function(b,h){f(b,h,0,b.length-1)}},{}],15:[function(p,v,m){function b(a,b){var c=a;"string"===typeof a&&(c=d.parseSourceMapInput(a));return null!=c.sections?new h(c,b):new f(c,b)}function f(a, -b){var c=a;"string"===typeof a&&(c=d.parseSourceMapInput(a));var n=d.getArg(c,"version"),t=d.getArg(c,"sources"),f=d.getArg(c,"names",[]),r=d.getArg(c,"sourceRoot",null),k=d.getArg(c,"sourcesContent",null),u=d.getArg(c,"mappings");c=d.getArg(c,"file",null);if(n!=this._version)throw Error("Unsupported version: "+n);r&&(r=d.normalize(r));t=t.map(String).map(d.normalize).map(function(a){return r&&d.isAbsolute(r)&&d.isAbsolute(a)?d.relative(r,a):a});this._names=l.fromArray(f.map(String),!0);this._sources= -l.fromArray(t,!0);this.sourceRoot=r;this.sourcesContent=k;this._mappings=u;this._sourceMapURL=b;this.file=c}function k(){this.generatedColumn=this.generatedLine=0;this.name=this.originalColumn=this.originalLine=this.source=null}function h(a,f){var c=a;"string"===typeof a&&(c=d.parseSourceMapInput(a));var n=d.getArg(c,"version");c=d.getArg(c,"sections");if(n!=this._version)throw Error("Unsupported version: "+n);this._sources=new l;this._names=new l;var t={line:-1,column:0};this._sections=c.map(function(a){if(a.url)throw Error("Support for url field in sections not implemented."); -var c=d.getArg(a,"offset"),n=d.getArg(c,"line"),l=d.getArg(c,"column");if(n=b[c])throw new TypeError("Line must be greater than or equal to 1, got "+b[c]);if(0>b[n])throw new TypeError("Column must be greater than or equal to 0, got "+b[n]);return a.search(b,d,f,l)};f.prototype.computeColumnSpans=function(){for(var a=0;a=this._sources.size()&&!this.sourcesContent.some(function(a){return null== -a}):!1};f.prototype.sourceContentFor=function(a,b){if(!this.sourcesContent)return null;var c=a;null!=this.sourceRoot&&(c=d.relative(this.sourceRoot,c));if(this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];var n=this.sources,f;for(f=0;fb||95!==a.charCodeAt(b-1)||95!==a.charCodeAt(b-2)||111!==a.charCodeAt(b-3)||116!==a.charCodeAt(b-4)||111!==a.charCodeAt(b-5)||114!==a.charCodeAt(b-6)||112!==a.charCodeAt(b-7)||95!==a.charCodeAt(b-8)||95!==a.charCodeAt(b-9))return!1;for(b-=10;0<=b;b--)if(36!==a.charCodeAt(b))return!1;return!0}function r(a,b){return a===b?0:null===a?1:null===b?-1:a>b?1:-1}m.getArg=function(a,b,d){if(b in -a)return a[b];if(3===arguments.length)return d;throw Error('"'+b+'" is a required argument.');};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,z=/^data:.+,.+$/;m.urlParse=b;m.urlGenerate=f;m.normalize=k;m.join=h;m.isAbsolute=function(a){return"/"===a.charAt(0)||t.test(a)};m.relative=function(a,b){""===a&&(a=".");a=a.replace(/\/$/,"");for(var c=0;0!==b.indexOf(a+"/");){var d=a.lastIndexOf("/");if(0>d)return b;a=a.slice(0,d);if(a.match(/^([^\/]+:\/)?\/*$/))return b;++c}return Array(c+ -1).join("../")+b.substr(a.length+1)};p=!("__proto__"in Object.create(null));m.toSetString=p?d:a;m.fromSetString=p?d:l;m.compareByOriginalPositions=function(a,b,d){var c=r(a.source,b.source);if(0!==c)return c;c=a.originalLine-b.originalLine;if(0!==c)return c;c=a.originalColumn-b.originalColumn;if(0!==c||d)return c;c=a.generatedColumn-b.generatedColumn;if(0!==c)return c;c=a.generatedLine-b.generatedLine;return 0!==c?c:r(a.name,b.name)};m.compareByGeneratedPositionsDeflated=function(a,b,d){var c=a.generatedLine- -b.generatedLine;if(0!==c)return c;c=a.generatedColumn-b.generatedColumn;if(0!==c||d)return c;c=r(a.source,b.source);if(0!==c)return c;c=a.originalLine-b.originalLine;if(0!==c)return c;c=a.originalColumn-b.originalColumn;return 0!==c?c:r(a.name,b.name)};m.compareByGeneratedPositionsInflated=function(a,b){var c=a.generatedLine-b.generatedLine;if(0!==c)return c;c=a.generatedColumn-b.generatedColumn;if(0!==c)return c;c=r(a.source,b.source);if(0!==c)return c;c=a.originalLine-b.originalLine;if(0!==c)return c; -c=a.originalColumn-b.originalColumn;return 0!==c?c:r(a.name,b.name)};m.parseSourceMapInput=function(a){return JSON.parse(a.replace(/^\)]}'[^\n]*\n/,""))};m.computeSourceURL=function(a,d,l){d=d||"";a&&("/"!==a[a.length-1]&&"/"!==d[0]&&(a+="/"),d=a+d);if(l){a=b(l);if(!a)throw Error("sourceMapURL could not be parsed");a.path&&(l=a.path.lastIndexOf("/"),0<=l&&(a.path=a.path.substring(0,l+1)));d=h(f(a),d)}return k(d)}},{}],19:[function(p,v,m){m.SourceMapGenerator=p("./lib/source-map-generator").SourceMapGenerator; -m.SourceMapConsumer=p("./lib/source-map-consumer").SourceMapConsumer;m.SourceNode=p("./lib/source-node").SourceNode},{"./lib/source-map-consumer":15,"./lib/source-map-generator":16,"./lib/source-node":17}],20:[function(p,v,m){(function(b){function f(){return"browser"===J?!0:"node"===J?!1:"undefined"!==typeof window&&"function"===typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type)}function k(a){return function(b){for(var c=0;c";b=this.getLineNumber();null!=b&&(a+=":"+b,(b=this.getColumnNumber())&&(a+=":"+b))}b="";var c=this.getFunctionName(),d=!0,f=this.isConstructor();if(this.isToplevel()||f)f?b+="new "+(c||""):c?b+=c:(b+=a,d=!1);else{f=this.getTypeName();"[object Object]"===f&&(f="null");var h=this.getMethodName();c?(f&&0!=c.indexOf(f)&&(b+=f+"."),b+=c,h&&c.indexOf("."+h)!=c.length-h.length-1&&(b+=" [as "+h+"]")):b+=f+"."+(h||"")}d&&(b+=" ("+a+")");return b}function u(a){var b= -{};Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach(function(c){b[c]=/^(?:is|get)/.test(c)?function(){return a[c].call(a)}:a[c]});b.toString=l;return b}function r(b){if(b.isNative())return b;var c=b.getFileName()||b.getScriptNameOrSourceURL();if(c){var e=b.getLineNumber(),h=b.getColumnNumber()-1;1===e&&62 C:/dir/file - '/'; // file:///root-dir/file -> /root-dir/file - }); - } - if (path in fileContentsCache) { - return fileContentsCache[path]; - } - - var contents = ''; - try { - if (!fs) { - // Use SJAX if we are in the browser - var xhr = new XMLHttpRequest(); - xhr.open('GET', path, /** async */ false); - xhr.send(null); - if (xhr.readyState === 4 && xhr.status === 200) { - contents = xhr.responseText; - } - } else if (fs.existsSync(path)) { - // Otherwise, use the filesystem - contents = fs.readFileSync(path, 'utf8'); - } - } catch (er) { - /* ignore any errors */ - } - - return fileContentsCache[path] = contents; -}); - -// Support URLs relative to a directory, but be careful about a protocol prefix -// in case we are in the browser (i.e. directories may start with "http://" or "file:///") -function supportRelativeURL(file, url) { - if (!file) return url; - var dir = path.dirname(file); - var match = /^\w+:\/\/[^\/]*/.exec(dir); - var protocol = match ? match[0] : ''; - var startPath = dir.slice(protocol.length); - if (protocol && /^\/\w\:/.test(startPath)) { - // handle file:///C:/ paths - protocol += '/'; - return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, '/'); - } - return protocol + path.resolve(dir.slice(protocol.length), url); -} - -function retrieveSourceMapURL(source) { - var fileData; - - if (isInBrowser()) { - try { - var xhr = new XMLHttpRequest(); - xhr.open('GET', source, false); - xhr.send(null); - fileData = xhr.readyState === 4 ? xhr.responseText : null; - - // Support providing a sourceMappingURL via the SourceMap header - var sourceMapHeader = xhr.getResponseHeader("SourceMap") || - xhr.getResponseHeader("X-SourceMap"); - if (sourceMapHeader) { - return sourceMapHeader; - } - } catch (e) { - } - } - - // Get the URL of the source map - fileData = retrieveFile(source); - var re = /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg; - // Keep executing the search to find the *last* sourceMappingURL to avoid - // picking up sourceMappingURLs from comments, strings, etc. - var lastMatch, match; - while (match = re.exec(fileData)) lastMatch = match; - if (!lastMatch) return null; - return lastMatch[1]; -}; - -// Can be overridden by the retrieveSourceMap option to install. Takes a -// generated source filename; returns a {map, optional url} object, or null if -// there is no source map. The map field may be either a string or the parsed -// JSON object (ie, it must be a valid argument to the SourceMapConsumer -// constructor). -var retrieveSourceMap = handlerExec(retrieveMapHandlers); -retrieveMapHandlers.push(function(source) { - var sourceMappingURL = retrieveSourceMapURL(source); - if (!sourceMappingURL) return null; - - // Read the contents of the source map - var sourceMapData; - if (reSourceMap.test(sourceMappingURL)) { - // Support source map URL as a data url - var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1); - sourceMapData = bufferFrom(rawData, "base64").toString(); - sourceMappingURL = source; - } else { - // Support source map URLs relative to the source URL - sourceMappingURL = supportRelativeURL(source, sourceMappingURL); - sourceMapData = retrieveFile(sourceMappingURL); - } - - if (!sourceMapData) { - return null; - } - - return { - url: sourceMappingURL, - map: sourceMapData - }; -}); - -function mapSourcePosition(position) { - var sourceMap = sourceMapCache[position.source]; - if (!sourceMap) { - // Call the (overrideable) retrieveSourceMap function to get the source map. - var urlAndMap = retrieveSourceMap(position.source); - if (urlAndMap) { - sourceMap = sourceMapCache[position.source] = { - url: urlAndMap.url, - map: new SourceMapConsumer(urlAndMap.map) - }; - - // Load all sources stored inline with the source map into the file cache - // to pretend like they are already loaded. They may not exist on disk. - if (sourceMap.map.sourcesContent) { - sourceMap.map.sources.forEach(function(source, i) { - var contents = sourceMap.map.sourcesContent[i]; - if (contents) { - var url = supportRelativeURL(sourceMap.url, source); - fileContentsCache[url] = contents; - } - }); - } - } else { - sourceMap = sourceMapCache[position.source] = { - url: null, - map: null - }; - } - } - - // Resolve the source URL relative to the URL of the source map - if (sourceMap && sourceMap.map) { - var originalPosition = sourceMap.map.originalPositionFor(position); - - // Only return the original position if a matching line was found. If no - // matching line is found then we return position instead, which will cause - // the stack trace to print the path and line for the compiled file. It is - // better to give a precise location in the compiled file than a vague - // location in the original file. - if (originalPosition.source !== null) { - originalPosition.source = supportRelativeURL( - sourceMap.url, originalPosition.source); - return originalPosition; - } - } - - return position; -} - -// Parses code generated by FormatEvalOrigin(), a function inside V8: -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js -function mapEvalOrigin(origin) { - // Most eval() calls are in this format - var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin); - if (match) { - var position = mapSourcePosition({ - source: match[2], - line: +match[3], - column: match[4] - 1 - }); - return 'eval at ' + match[1] + ' (' + position.source + ':' + - position.line + ':' + (position.column + 1) + ')'; - } - - // Parse nested eval() calls using recursion - match = /^eval at ([^(]+) \((.+)\)$/.exec(origin); - if (match) { - return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')'; - } - - // Make sure we still return useful information if we didn't find anything - return origin; -} - -// This is copied almost verbatim from the V8 source code at -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js. The -// implementation of wrapCallSite() used to just forward to the actual source -// code of CallSite.prototype.toString but unfortunately a new release of V8 -// did something to the prototype chain and broke the shim. The only fix I -// could find was copy/paste. -function CallSiteToString() { - var fileName; - var fileLocation = ""; - if (this.isNative()) { - fileLocation = "native"; - } else { - fileName = this.getScriptNameOrSourceURL(); - if (!fileName && this.isEval()) { - fileLocation = this.getEvalOrigin(); - fileLocation += ", "; // Expecting source position to follow. - } - - if (fileName) { - fileLocation += fileName; - } else { - // Source code does not originate from a file and is not native, but we - // can still get the source position inside the source string, e.g. in - // an eval string. - fileLocation += ""; - } - var lineNumber = this.getLineNumber(); - if (lineNumber != null) { - fileLocation += ":" + lineNumber; - var columnNumber = this.getColumnNumber(); - if (columnNumber) { - fileLocation += ":" + columnNumber; - } - } - } - - var line = ""; - var functionName = this.getFunctionName(); - var addSuffix = true; - var isConstructor = this.isConstructor(); - var isMethodCall = !(this.isToplevel() || isConstructor); - if (isMethodCall) { - var typeName = this.getTypeName(); - // Fixes shim to be backward compatable with Node v0 to v4 - if (typeName === "[object Object]") { - typeName = "null"; - } - var methodName = this.getMethodName(); - if (functionName) { - if (typeName && functionName.indexOf(typeName) != 0) { - line += typeName + "."; - } - line += functionName; - if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) { - line += " [as " + methodName + "]"; - } - } else { - line += typeName + "." + (methodName || ""); - } - } else if (isConstructor) { - line += "new " + (functionName || ""); - } else if (functionName) { - line += functionName; - } else { - line += fileLocation; - addSuffix = false; - } - if (addSuffix) { - line += " (" + fileLocation + ")"; - } - return line; -} - -function cloneCallSite(frame) { - var object = {}; - Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) { - object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name]; - }); - object.toString = CallSiteToString; - return object; -} - -function wrapCallSite(frame) { - if(frame.isNative()) { - return frame; - } - - // Most call sites will return the source file from getFileName(), but code - // passed to eval() ending in "//# sourceURL=..." will return the source file - // from getScriptNameOrSourceURL() instead - var source = frame.getFileName() || frame.getScriptNameOrSourceURL(); - if (source) { - var line = frame.getLineNumber(); - var column = frame.getColumnNumber() - 1; - - // Fix position in Node where some (internal) code is prepended. - // See https://github.com/evanw/node-source-map-support/issues/36 - var headerLength = 62; - if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) { - column -= headerLength; - } - - var position = mapSourcePosition({ - source: source, - line: line, - column: column - }); - frame = cloneCallSite(frame); - var originalFunctionName = frame.getFunctionName; - frame.getFunctionName = function() { return position.name || originalFunctionName(); }; - frame.getFileName = function() { return position.source; }; - frame.getLineNumber = function() { return position.line; }; - frame.getColumnNumber = function() { return position.column + 1; }; - frame.getScriptNameOrSourceURL = function() { return position.source; }; - return frame; - } - - // Code called using eval() needs special handling - var origin = frame.isEval() && frame.getEvalOrigin(); - if (origin) { - origin = mapEvalOrigin(origin); - frame = cloneCallSite(frame); - frame.getEvalOrigin = function() { return origin; }; - return frame; - } - - // If we get here then we were unable to change the source position - return frame; -} - -// This function is part of the V8 stack trace API, for more info see: -// http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi -function prepareStackTrace(error, stack) { - if (emptyCacheBetweenOperations) { - fileContentsCache = {}; - sourceMapCache = {}; - } - - return error + stack.map(function(frame) { - return '\n at ' + wrapCallSite(frame); - }).join(''); -} - -// Generate position and snippet of original source with pointer -function getErrorSource(error) { - var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack); - if (match) { - var source = match[1]; - var line = +match[2]; - var column = +match[3]; - - // Support the inline sourceContents inside the source map - var contents = fileContentsCache[source]; - - // Support files on disk - if (!contents && fs && fs.existsSync(source)) { - try { - contents = fs.readFileSync(source, 'utf8'); - } catch (er) { - contents = ''; - } - } - - // Format the line from the original source code like node does - if (contents) { - var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1]; - if (code) { - return source + ':' + line + '\n' + code + '\n' + - new Array(column).join(' ') + '^'; - } - } - } - return null; -} - -function printErrorAndExit (error) { - var source = getErrorSource(error); - - // Ensure error is printed synchronously and not truncated - if (process.stderr._handle && process.stderr._handle.setBlocking) { - process.stderr._handle.setBlocking(true); - } - - if (source) { - console.error(); - console.error(source); - } - - console.error(error.stack); - process.exit(1); -} - -function shimEmitUncaughtException () { - var origEmit = process.emit; - - process.emit = function (type) { - if (type === 'uncaughtException') { - var hasStack = (arguments[1] && arguments[1].stack); - var hasListeners = (this.listeners(type).length > 0); - - if (hasStack && !hasListeners) { - return printErrorAndExit(arguments[1]); - } - } - - return origEmit.apply(this, arguments); - }; -} - -var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0); -var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0); - -exports.wrapCallSite = wrapCallSite; -exports.getErrorSource = getErrorSource; -exports.mapSourcePosition = mapSourcePosition; -exports.retrieveSourceMap = retrieveSourceMap; - -exports.install = function(options) { - options = options || {}; - - if (options.environment) { - environment = options.environment; - if (["node", "browser", "auto"].indexOf(environment) === -1) { - throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}") - } - } - - // Allow sources to be found by methods other than reading the files - // directly from disk. - if (options.retrieveFile) { - if (options.overrideRetrieveFile) { - retrieveFileHandlers.length = 0; - } - - retrieveFileHandlers.unshift(options.retrieveFile); - } - - // Allow source maps to be found by methods other than reading the files - // directly from disk. - if (options.retrieveSourceMap) { - if (options.overrideRetrieveSourceMap) { - retrieveMapHandlers.length = 0; - } - - retrieveMapHandlers.unshift(options.retrieveSourceMap); - } - - // Support runtime transpilers that include inline source maps - if (options.hookRequire && !isInBrowser()) { - var Module; - try { - Module = require('module'); - } catch (err) { - // NOP: Loading in catch block to convert webpack error to warning. - } - var $compile = Module.prototype._compile; - - if (!$compile.__sourceMapSupport) { - Module.prototype._compile = function(content, filename) { - fileContentsCache[filename] = content; - sourceMapCache[filename] = undefined; - return $compile.call(this, content, filename); - }; - - Module.prototype._compile.__sourceMapSupport = true; - } - } - - // Configure options - if (!emptyCacheBetweenOperations) { - emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ? - options.emptyCacheBetweenOperations : false; - } - - // Install the error reformatter - if (!errorFormatterInstalled) { - errorFormatterInstalled = true; - Error.prepareStackTrace = prepareStackTrace; - } - - if (!uncaughtShimInstalled) { - var installHandler = 'handleUncaughtExceptions' in options ? - options.handleUncaughtExceptions : true; - - // Provide the option to not install the uncaught exception handler. This is - // to support other uncaught exception handlers (in test frameworks, for - // example). If this handler is not installed and there are no other uncaught - // exception handlers, uncaught exceptions will be caught by node's built-in - // exception handler and the process will still be terminated. However, the - // generated JavaScript code will be shown above the stack trace instead of - // the original source code. - if (installHandler && hasGlobalProcessEventEmitter()) { - uncaughtShimInstalled = true; - shimEmitUncaughtException(); - } - } -}; - -exports.resetRetrieveHandlers = function() { - retrieveFileHandlers.length = 0; - retrieveMapHandlers.length = 0; - - retrieveFileHandlers = originalRetrieveFileHandlers.slice(0); - retrieveMapHandlers = originalRetrieveMapHandlers.slice(0); -} diff --git a/node_modules/source-map/CHANGELOG.md b/node_modules/source-map/CHANGELOG.md deleted file mode 100644 index 3a8c066..0000000 --- a/node_modules/source-map/CHANGELOG.md +++ /dev/null @@ -1,301 +0,0 @@ -# Change Log - -## 0.5.6 - -* Fix for regression when people were using numbers as names in source maps. See - #236. - -## 0.5.5 - -* Fix "regression" of unsupported, implementation behavior that half the world - happens to have come to depend on. See #235. - -* Fix regression involving function hoisting in SpiderMonkey. See #233. - -## 0.5.4 - -* Large performance improvements to source-map serialization. See #228 and #229. - -## 0.5.3 - -* Do not include unnecessary distribution files. See - commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. - -## 0.5.2 - -* Include browser distributions of the library in package.json's `files`. See - issue #212. - -## 0.5.1 - -* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See - ff05274becc9e6e1295ed60f3ea090d31d843379. - -## 0.5.0 - -* Node 0.8 is no longer supported. - -* Use webpack instead of dryice for bundling. - -* Big speedups serializing source maps. See pull request #203. - -* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that - explicitly start with the source root. See issue #199. - -## 0.4.4 - -* Fix an issue where using a `SourceMapGenerator` after having created a - `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See - issue #191. - -* Fix an issue with where `SourceMapGenerator` would mistakenly consider - different mappings as duplicates of each other and avoid generating them. See - issue #192. - -## 0.4.3 - -* A very large number of performance improvements, particularly when parsing - source maps. Collectively about 75% of time shaved off of the source map - parsing benchmark! - -* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy - searching in the presence of a column option. See issue #177. - -* Fix a bug with joining a source and its source root when the source is above - the root. See issue #182. - -* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to - determine when all sources' contents are inlined into the source map. See - issue #190. - -## 0.4.2 - -* Add an `.npmignore` file so that the benchmarks aren't pulled down by - dependent projects. Issue #169. - -* Add an optional `column` argument to - `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines - with no mappings. Issues #172 and #173. - -## 0.4.1 - -* Fix accidentally defining a global variable. #170. - -## 0.4.0 - -* The default direction for fuzzy searching was changed back to its original - direction. See #164. - -* There is now a `bias` option you can supply to `SourceMapConsumer` to control - the fuzzy searching direction. See #167. - -* About an 8% speed up in parsing source maps. See #159. - -* Added a benchmark for parsing and generating source maps. - -## 0.3.0 - -* Change the default direction that searching for positions fuzzes when there is - not an exact match. See #154. - -* Support for environments using json2.js for JSON serialization. See #156. - -## 0.2.0 - -* Support for consuming "indexed" source maps which do not have any remote - sections. See pull request #127. This introduces a minor backwards - incompatibility if you are monkey patching `SourceMapConsumer.prototype` - methods. - -## 0.1.43 - -* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue - #148 for some discussion and issues #150, #151, and #152 for implementations. - -## 0.1.42 - -* Fix an issue where `SourceNode`s from different versions of the source-map - library couldn't be used in conjunction with each other. See issue #142. - -## 0.1.41 - -* Fix a bug with getting the source content of relative sources with a "./" - prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). - -* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the - column span of each mapping. - -* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find - all generated positions associated with a given original source and line. - -## 0.1.40 - -* Performance improvements for parsing source maps in SourceMapConsumer. - -## 0.1.39 - -* Fix a bug where setting a source's contents to null before any source content - had been set before threw a TypeError. See issue #131. - -## 0.1.38 - -* Fix a bug where finding relative paths from an empty path were creating - absolute paths. See issue #129. - -## 0.1.37 - -* Fix a bug where if the source root was an empty string, relative source paths - would turn into absolute source paths. Issue #124. - -## 0.1.36 - -* Allow the `names` mapping property to be an empty string. Issue #121. - -## 0.1.35 - -* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` - to specify a path that relative sources in the second parameter should be - relative to. Issue #105. - -* If no file property is given to a `SourceMapGenerator`, then the resulting - source map will no longer have a `null` file property. The property will - simply not exist. Issue #104. - -* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. - Issue #116. - -## 0.1.34 - -* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. - -* Fix bug involving source contents and the - `SourceMapGenerator.prototype.applySourceMap`. Issue #100. - -## 0.1.33 - -* Fix some edge cases surrounding path joining and URL resolution. - -* Add a third parameter for relative path to - `SourceMapGenerator.prototype.applySourceMap`. - -* Fix issues with mappings and EOLs. - -## 0.1.32 - -* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns - (issue 92). - -* Fixed test runner to actually report number of failed tests as its process - exit code. - -* Fixed a typo when reporting bad mappings (issue 87). - -## 0.1.31 - -* Delay parsing the mappings in SourceMapConsumer until queried for a source - location. - -* Support Sass source maps (which at the time of writing deviate from the spec - in small ways) in SourceMapConsumer. - -## 0.1.30 - -* Do not join source root with a source, when the source is a data URI. - -* Extend the test runner to allow running single specific test files at a time. - -* Performance improvements in `SourceNode.prototype.walk` and - `SourceMapConsumer.prototype.eachMapping`. - -* Source map browser builds will now work inside Workers. - -* Better error messages when attempting to add an invalid mapping to a - `SourceMapGenerator`. - -## 0.1.29 - -* Allow duplicate entries in the `names` and `sources` arrays of source maps - (usually from TypeScript) we are parsing. Fixes github issue 72. - -## 0.1.28 - -* Skip duplicate mappings when creating source maps from SourceNode; github - issue 75. - -## 0.1.27 - -* Don't throw an error when the `file` property is missing in SourceMapConsumer, - we don't use it anyway. - -## 0.1.26 - -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. - -## 0.1.25 - -* Make compatible with browserify - -## 0.1.24 - -* Fix issue with absolute paths and `file://` URIs. See - https://bugzilla.mozilla.org/show_bug.cgi?id=885597 - -## 0.1.23 - -* Fix issue with absolute paths and sourcesContent, github issue 64. - -## 0.1.22 - -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. - -## 0.1.21 - -* Fixed handling of sources that start with a slash so that they are relative to - the source root's host. - -## 0.1.20 - -* Fixed github issue #43: absolute URLs aren't joined with the source root - anymore. - -## 0.1.19 - -* Using Travis CI to run tests. - -## 0.1.18 - -* Fixed a bug in the handling of sourceRoot. - -## 0.1.17 - -* Added SourceNode.fromStringWithSourceMap. - -## 0.1.16 - -* Added missing documentation. - -* Fixed the generating of empty mappings in SourceNode. - -## 0.1.15 - -* Added SourceMapGenerator.applySourceMap. - -## 0.1.14 - -* The sourceRoot is now handled consistently. - -## 0.1.13 - -* Added SourceMapGenerator.fromSourceMap. - -## 0.1.12 - -* SourceNode now generates empty mappings too. - -## 0.1.11 - -* Added name support to SourceNode. - -## 0.1.10 - -* Added sourcesContent support to the customer and generator. diff --git a/node_modules/source-map/LICENSE b/node_modules/source-map/LICENSE deleted file mode 100644 index ed1b7cf..0000000 --- a/node_modules/source-map/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/source-map/README.md b/node_modules/source-map/README.md deleted file mode 100644 index fea4beb..0000000 --- a/node_modules/source-map/README.md +++ /dev/null @@ -1,742 +0,0 @@ -# Source Map - -[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) - -[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) - -This is a library to generate and consume the source map format -[described here][format]. - -[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit - -## Use with Node - - $ npm install source-map - -## Use on the Web - - - --------------------------------------------------------------------------------- - - - - - -## Table of Contents - -- [Examples](#examples) - - [Consuming a source map](#consuming-a-source-map) - - [Generating a source map](#generating-a-source-map) - - [With SourceNode (high level API)](#with-sourcenode-high-level-api) - - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) -- [API](#api) - - [SourceMapConsumer](#sourcemapconsumer) - - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) - - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) - - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) - - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) - - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) - - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) - - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) - - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) - - [SourceMapGenerator](#sourcemapgenerator) - - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) - - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) - - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) - - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) - - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) - - [SourceNode](#sourcenode) - - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) - - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) - - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) - - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) - - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) - - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) - - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) - - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) - - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) - - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) - - - -## Examples - -### Consuming a source map - -```js -var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' -}; - -var smc = new SourceMapConsumer(rawSourceMap); - -console.log(smc.sources); -// [ 'http://example.com/www/js/one.js', -// 'http://example.com/www/js/two.js' ] - -console.log(smc.originalPositionFor({ - line: 2, - column: 28 -})); -// { source: 'http://example.com/www/js/two.js', -// line: 2, -// column: 10, -// name: 'n' } - -console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 -})); -// { line: 2, column: 28 } - -smc.eachMapping(function (m) { - // ... -}); -``` - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - -```js -function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } -} - -var ast = parse("40 + 2", "add.js"); -console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' -})); -// { code: '40 + 2', -// map: [object SourceMapGenerator] } -``` - -#### With SourceMapGenerator (low level API) - -```js -var map = new SourceMapGenerator({ - file: "source-mapped.js" -}); - -map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" -}); - -console.log(map.toString()); -// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' -``` - -## API - -Get a reference to the module: - -```js -// Node.js -var sourceMap = require('source-map'); - -// Browser builds -var sourceMap = window.sourceMap; - -// Inside Firefox -const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); -``` - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: Optional. The generated filename this source map is associated with. - -```js -var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); -``` - -#### SourceMapConsumer.prototype.computeColumnSpans() - -Compute the last column for each generated mapping. The last column is -inclusive. - -```js -// Before: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] - -consumer.computeColumnSpans(); - -// After: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1, -// lastColumn: 9 }, -// { line: 2, -// column: 10, -// lastColumn: 19 }, -// { line: 2, -// column: 20, -// lastColumn: Infinity } ] - -``` - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. Line numbers in - this library are 1-based (note that the underlying source map - specification uses 0-based line numbers -- this library handles the - translation). - -* `column`: The column number in the generated source. Column numbers - in this library are 0-based. - -* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or - `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest - element that is smaller than or greater than the one we are searching for, - respectively, if the exact element cannot be found. Defaults to - `SourceMapConsumer.GREATEST_LOWER_BOUND`. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. The line number is 1-based. - -* `column`: The column number in the original source, or null if this - information is not available. The column number is 0-based. - -* `name`: The original identifier, or null if this information is not available. - -```js -consumer.originalPositionFor({ line: 2, column: 10 }) -// { source: 'foo.coffee', -// line: 2, -// column: 2, -// name: null } - -consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) -// { source: null, -// line: null, -// column: null, -// name: null } -``` - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: The column number in the original source. The column - number is 0-based. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) -// { line: 1, -// column: 56 } -``` - -#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) - -Returns all generated line and column information for the original source, line, -and column provided. If no column is provided, returns all mappings -corresponding to a either the line we are searching for or the next closest line -that has any mappings. Otherwise, returns all mappings corresponding to the -given line and either the column we are searching for or the next closest column -that has any offsets. - -The only argument is an object with the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: Optional. The column number in the original source. The - column number is 0-based. - -and an array of objects is returned, each with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] -``` - -#### SourceMapConsumer.prototype.hasContentsOfAllSources() - -Return true if we have the embedded source content for every source listed in -the source map, false otherwise. - -In other words, if this method returns `true`, then -`consumer.sourceContentFor(s)` will succeed for every source `s` in -`consumer.sources`. - -```js -// ... -if (consumer.hasContentsOfAllSources()) { - consumerReadyCallback(consumer); -} else { - fetchSources(consumer, consumerReadyCallback); -} -// ... -``` - -#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -If the source content for the given source is not found, then an error is -thrown. Optionally, pass `true` as the second param to have `null` returned -instead. - -```js -consumer.sources -// [ "my-cool-lib.clj" ] - -consumer.sourceContentFor("my-cool-lib.clj") -// "..." - -consumer.sourceContentFor("this is not in the source map"); -// Error: "this is not in the source map" is not in the source map - -consumer.sourceContentFor("this is not in the source map", true); -// null -``` - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -```js -consumer.eachMapping(function (m) { console.log(m); }) -// ... -// { source: 'illmatic.js', -// generatedLine: 1, -// generatedColumn: 0, -// originalLine: 1, -// originalColumn: 0, -// name: null } -// { source: 'illmatic.js', -// generatedLine: 2, -// generatedColumn: 0, -// originalLine: 2, -// originalColumn: 0, -// name: null } -// ... -``` -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator([startOfSourceMap]) - -You may pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: A root for all relative URLs in this source map. - -* `skipValidation`: Optional. When `true`, disables validation of mappings as - they are added. This can improve performance but should be used with - discretion, as a last resort. Even then, one should avoid using this flag when - running tests, if possible. - -```js -var generator = new sourceMap.SourceMapGenerator({ - file: "my-generated-javascript-file.js", - sourceRoot: "http://example.com/app/js/" -}); -``` - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. - -* `sourceMapConsumer` The SourceMap. - -```js -var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); -``` - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -```js -generator.addMapping({ - source: "module-one.scm", - original: { line: 128, column: 0 }, - generated: { line: 3, column: 456 } -}) -``` - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -```js -generator.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimum of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used, if it exists. - Otherwise an error will be thrown. - -* `sourceMapPath`: Optional. The dirname of the path to the SourceMap - to be applied. If relative, it is relative to the SourceMap. - - This parameter is needed when the two SourceMaps aren't in the same - directory, and the SourceMap to be applied contains relative source - paths. If so, those relative source paths need to be rewritten - relative to the SourceMap. - - If omitted, it is assumed that both SourceMaps are in the same directory, - thus not needing any rewriting. (Supplying `'.'` has the same effect.) - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -```js -generator.toString() -// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' -``` - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode([line, column, source[, chunk[, name]]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. The line number is 1-based. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. The column number - is 0-based. - -* `source`: The original source's filename; null if no filename is provided. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -```js -var node = new SourceNode(1, 2, "a.cpp", [ - new SourceNode(3, 4, "b.cpp", "extern int status;\n"), - new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), - new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), -]); -``` - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -* `relativePath` The optional path that relative sources in `sourceMapConsumer` - should be relative to. - -```js -var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); -var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), - consumer); -``` - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.add(" + "); -node.add(otherNode); -node.add([leftHandOperandNode, " + ", rightHandOperandNode]); -``` - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.prepend("/** Build Id: f783haef86324gf **/\n\n"); -``` - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -```js -node.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.walk(function (code, loc) { console.log("WALK:", code, loc); }) -// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } -// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } -// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } -// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } -``` - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -```js -var a = new SourceNode(1, 2, "a.js", "generated from a"); -a.setSourceContent("a.js", "original a"); -var b = new SourceNode(1, 2, "b.js", "generated from b"); -b.setSourceContent("b.js", "original b"); -var c = new SourceNode(1, 2, "c.js", "generated from c"); -c.setSourceContent("c.js", "original c"); - -var node = new SourceNode(null, null, null, [a, b, c]); -node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) -// WALK: a.js : original a -// WALK: b.js : original b -// WALK: c.js : original c -``` - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -```js -var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); -var operand = new SourceNode(3, 4, "a.rs", "="); -var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); - -var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); -var joinedNode = node.join(" "); -``` - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming white space from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -```js -// Trim trailing white space. -node.replaceRight(/\s*$/, ""); -``` - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toString() -// 'unodostresquatro' -``` - -#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toStringWithSourceMap({ file: "my-output-file.js" }) -// { code: 'unodostresquatro', -// map: [object SourceMapGenerator] } -``` diff --git a/node_modules/source-map/dist/source-map.debug.js b/node_modules/source-map/dist/source-map.debug.js deleted file mode 100644 index aad0620..0000000 --- a/node_modules/source-map/dist/source-map.debug.js +++ /dev/null @@ -1,3234 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAxNjI0YzcyOTliODg3ZjdiZGY2NCIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LXZscS5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LmpzIiwid2VicGFjazovLy8uL2xpYi91dGlsLmpzIiwid2VicGFjazovLy8uL2xpYi9hcnJheS1zZXQuanMiLCJ3ZWJwYWNrOi8vLy4vbGliL21hcHBpbmctbGlzdC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW1hcC1jb25zdW1lci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmluYXJ5LXNlYXJjaC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvcXVpY2stc29ydC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW5vZGUuanMiXSwibmFt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ZENvbHVtbjtcblxuICAgICAgaWYgKG1hcHBpbmcuc291cmNlICE9IG51bGwpIHtcbiAgICAgICAgc291cmNlSWR4ID0gdGhpcy5fc291cmNlcy5pbmRleE9mKG1hcHBpbmcuc291cmNlKTtcbiAgICAgICAgbmV4dCArPSBiYXNlNjRWTFEuZW5jb2RlKHNvdXJjZUlkeCAtIHByZXZpb3VzU291cmNlKTtcbiAgICAgICAgcHJldmlvdXNTb3VyY2UgPSBzb3VyY2VJZHg7XG5cbiAgICAgICAgLy8gbGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkIGluIFNvdXJjZU1hcCBzcGVjIHZlcnNpb24gM1xuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbExpbmUgLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNPcmlnaW5hbExpbmUpO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsTGluZSA9IG1hcHBpbmcub3JpZ2luYWxMaW5lIC0gMTtcblxuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHByZXZpb3VzT3JpZ2luYWxDb2x1bW4pO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsQ29sdW1uID0gbWFwcGluZy5vcmlnaW5hbENvbHVtbjtcblxuICAgICAgICBpZiAobWFwcGluZy5uYW1lICE9IG51bGwpIHtcbiAgICAgICAgICBuYW1lSWR4ID0gdGhpcy5fbmFtZXMuaW5kZXhPZihtYXBwaW5nLm5hbWUpO1xuICAgICAgICAgIG5leHQgKz0gYmFzZTY0VkxRLmVuY29kZShuYW1lSWR4IC0gcHJldmlvdXNOYW1lKTtcbiAgICAgICAgICBwcmV2aW91c05hbWUgPSBuYW1lSWR4O1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJl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MgPSBzbWMuX3NvdXJjZXMgPSBBcnJheVNldC5mcm9tQXJyYXkoYVNvdXJjZU1hcC5fc291cmNlcy50b0FycmF5KCksIHRydWUpO1xuICAgIHNtYy5zb3VyY2VSb290ID0gYVNvdXJjZU1hcC5fc291cmNlUm9vdDtcbiAgICBzbWMuc291cmNlc0NvbnRlbnQgPSBhU291cmNlTWFwLl9nZW5lcmF0ZVNvdXJjZXNDb250ZW50KHNtYy5fc291cmNlcy50b0FycmF5KCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWMuc291cmNlUm9vdCk7XG4gICAgc21jLmZpbGUgPSBhU291cmNlTWFwLl9maWxlO1xuICAgIHNtYy5fc291cmNlTWFwVVJMID0gYVNvdXJjZU1hcFVSTDtcbiAgICBzbWMuX2Fic29sdXRlU291cmNlcyA9IHNtYy5fc291cmNlcy50b0FycmF5KCkubWFwKGZ1bmN0aW9uIChzKSB7XG4gICAgICByZXR1cm4gdXRpbC5jb21wdXRlU291cmNlVVJMKHNtYy5zb3VyY2VSb290LCBzLCBhU291cmNlTWFwVVJMKTtcbiAgICB9KTtcblxuICAgIC8vIEJlY2F1c2Ugd2UgYXJlIG1vZGlmeWluZyB0aGUgZW50cmllcyAoYnkgY29udmVydGluZyBzdHJpbmcgc291cmNlcyBhbmRcbiAgICAvLyBuYW1lcyB0byBpbmRpY2VzIGludG8gdGhlIHNvdXJjZXMgYW5kIG5hbWVzIEFycmF5U2V0cyksIHdlIGhhdmUgdG8gbWFrZVxuICAgIC8vIGEgY29weSBvZiB0aGUgZW50cnkgb3IgZWxzZSBiYWQgdGhpbmdzIGhhcHBlbi4gU2hhcmVkIG11dGFibGUgc3RhdGVcbiAgICAvLyBzdHJpa2VzIGFnYWluISBTZWUgZ2l0aHViIGlzc3VlICMxOTEuXG5cbiAgICB2YXIgZ2VuZXJhdGVkTWFwcGluZ3MgPSBhU291cmNlTWFwLl9tYXBwaW5ncy50b0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AgICAgICAgIHdoaWxlIChpbmRleCA8IGVuZCkge1xuICAgICAgICAgICAgYmFzZTY0VkxRLmRlY29kZShhU3RyLCBpbmRleCwgdGVtcCk7XG4gICAgICAgICAgICB2YWx1ZSA9IHRlbXAudmFsdWU7XG4gICAgICAgICAgICBpbmRleCA9IHRlbXAucmVzdDtcbiAgICAgICAgICAgIHNlZ21lbnQucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAyKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlLCBidXQgbm8gbGluZSBhbmQgY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlIGFuZCBsaW5lLCBidXQgbm8gY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FjaGVkU2VnbWVudHNbc3RyXSA9IHNlZ21lbnQ7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZWQgY29sdW1uLlxuICAgICAgICBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbiA9IHByZXZpb3VzR2VuZXJhdGVkQ29sdW1uICsgc2VnbWVudFswXTtcbiAgICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgLy8gT3JpZ2luYWwgc291cmNlLlxuICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gcHJldmlvdXNTb3VyY2UgKyBzZWdtZW50WzFdO1xuICAgICAgICAgIHByZXZpb3VzU291cmNlICs9IHNlZ21lbnRbMV07XG5cbiAgICAgICAgICAvLyBPc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yYXRlZC5saW5lLFxuICAgICAgICAgIGNvbHVtbjogZ2VuZXJhdGVkLmNvbHVtblxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGxhc3RPcmlnaW5hbFNvdXJjZSA9IG51bGw7XG4gICAgICBzb3VyY2VNYXBwaW5nQWN0aXZlID0gZmFsc2U7XG4gICAgfVxuICAgIGZvciAodmFyIGlkeCA9IDAsIGxlbmd0aCA9IGNodW5rLmxlbmd0aDsgaWR4IDwgbGVuZ3RoOyBpZHgrKykge1xuICAgICAgaWYgKGNodW5rLmNoYXJDb2RlQXQoaWR4KSA9PT0gTkVXTElORV9DT0RFKSB7XG4gICAgICAgIGdlbmVyYXRlZC5saW5lKys7XG4gICAgICAgIGdlbmVyYXRlZC5jb2x1bW4gPSAwO1xuICAgICAgICAvLyBNYXBwaW5ncyBlbmQgYXQgZW9sXG4gICAgICAgIGlmIChpZHggKyAxID09PSBsZW5ndGgpIHtcbiAgICAgICAgICBsYXN0T3JpZ2luYWxTb3VyY2UgPSBudWxsO1xuICAgICAgICAgIHNvdXJjZU1hcHBpbmdBY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgfSBlbHNlIGlmIChzb3VyY2VNYXBwaW5nQWN0aXZlKSB7XG4gICAgICAgICAgbWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgc291cmNlOiBvcmlnaW5hbC5zb3VyY2UsXG4gICAgICAgICAgICBvcmlnaW5hbDoge1xuICAgICAgICAgICAgICBsaW5lOiBvcmlnaW5hbC5saW5lLFxuICAgICAgICAgICAgICBjb2x1bW46IG9yaWdpbmFsLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWQubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWQuY29sdW1uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmFtZTogb3JpZ2luYWwubmFtZVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBnZW5lcmF0ZWQuY29sdW1uKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbiAgdGhpcy53YWxrU291cmNlQ29udGVudHMoZnVuY3Rpb24gKHNvdXJjZUZpbGUsIHNvdXJjZUNvbnRlbnQpIHtcbiAgICBtYXAuc2V0U291cmNlQ29udGVudChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KTtcbiAgfSk7XG5cbiAgcmV0dXJuIHsgY29kZTogZ2VuZXJhdGVkLmNvZGUsIG1hcDogbWFwIH07XG59O1xuXG5leHBvcnRzLlNvdXJjZU5vZGUgPSBTb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW5vZGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/node_modules/source-map/dist/source-map.js b/node_modules/source-map/dist/source-map.js deleted file mode 100644 index b4eb087..0000000 --- a/node_modules/source-map/dist/source-map.js +++ /dev/null @@ -1,3233 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; \ No newline at end of file diff --git a/node_modules/source-map/dist/source-map.min.js b/node_modules/source-map/dist/source-map.min.js deleted file mode 100644 index c7c72da..0000000 --- a/node_modules/source-map/dist/source-map.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var o=t;null!==n&&(o=i.relative(n,t)),r._sources.has(o)||r._sources.add(o);var s=e.sourceContentFor(t);null!=s&&r.setSourceContent(t,s)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(y))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=f(e.source,n.source);return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:f(e.name,n.name)))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=f(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:f(e.name,n.name)))))}function f(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}function m(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function _(e,n,r){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),r){var a=t(r);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var u=a.path.lastIndexOf("/");u>=0&&(a.path=a.path.substring(0,u+1))}n=s(o(a),n)}return i(n)}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,y=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||v.test(e)},n.relative=a;var C=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=C?u:l,n.fromSetString=C?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d,n.parseSourceMapInput=m,n.computeSourceURL=_},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e,n){var r=e;return"string"==typeof e&&(r=a.parseSourceMapInput(e)),null!=r.sections?new s(r,n):new o(r,n)}function o(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var t=a.getArg(r,"version"),o=a.getArg(r,"sources"),i=a.getArg(r,"names",[]),s=a.getArg(r,"sourceRoot",null),u=a.getArg(r,"sourcesContent",null),c=a.getArg(r,"mappings"),g=a.getArg(r,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);s&&(s=a.normalize(s)),o=o.map(String).map(a.normalize).map(function(e){return s&&a.isAbsolute(s)&&a.isAbsolute(e)?a.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return a.computeSourceURL(s,e,n)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=n,this.file=g}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var o=a.getArg(r,"version"),i=a.getArg(r,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=a.getArg(e,"offset"),o=a.getArg(r,"line"),i=a.getArg(r,"column");if(o=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(e){var n=e;if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),A.push(r),"number"==typeof r.originalLine&&S.push(r)}g(A,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,g(S,a.compareByOriginalPositions),this.__originalMappings=S},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=a.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var t=e;null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t));var o;if(null!=this.sourceRoot&&(o=a.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!o.path||"/"==o.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(n)return null;throw new Error('"'+t+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r0){for(n=[],r=0;r 0 && aGenerated.column >= 0\n\t && !aOriginal && !aSource && !aName) {\n\t // Case 1.\n\t return;\n\t }\n\t else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n\t && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n\t && aGenerated.line > 0 && aGenerated.column >= 0\n\t && aOriginal.line > 0 && aOriginal.column >= 0\n\t && aSource) {\n\t // Cases 2 and 3.\n\t return;\n\t }\n\t else {\n\t throw new Error('Invalid mapping: ' + JSON.stringify({\n\t generated: aGenerated,\n\t source: aSource,\n\t original: aOriginal,\n\t name: aName\n\t }));\n\t }\n\t };\n\t\n\t/**\n\t * Serialize the accumulated mappings in to the stream of base 64 VLQs\n\t * specified by the source map format.\n\t */\n\tSourceMapGenerator.prototype._serializeMappings =\n\t function SourceMapGenerator_serializeMappings() {\n\t var previousGeneratedColumn = 0;\n\t var previousGeneratedLine = 1;\n\t var previousOriginalColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousName = 0;\n\t var previousSource = 0;\n\t var result = '';\n\t var next;\n\t var mapping;\n\t var nameIdx;\n\t var sourceIdx;\n\t\n\t var mappings = this._mappings.toArray();\n\t for (var i = 0, len = mappings.length; i < len; i++) {\n\t mapping = mappings[i];\n\t next = ''\n\t\n\t if (mapping.generatedLine !== previousGeneratedLine) {\n\t previousGeneratedColumn = 0;\n\t while (mapping.generatedLine !== previousGeneratedLine) {\n\t next += ';';\n\t previousGeneratedLine++;\n\t }\n\t }\n\t else {\n\t if (i > 0) {\n\t if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n\t continue;\n\t }\n\t next += ',';\n\t }\n\t }\n\t\n\t next += base64VLQ.encode(mapping.generatedColumn\n\t - previousGeneratedColumn);\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (mapping.source != null) {\n\t sourceIdx = this._sources.indexOf(mapping.source);\n\t next += base64VLQ.encode(sourceIdx - previousSource);\n\t previousSource = sourceIdx;\n\t\n\t // lines are stored 0-based in SourceMap spec version 3\n\t next += base64VLQ.encode(mapping.originalLine - 1\n\t - previousOriginalLine);\n\t previousOriginalLine = mapping.originalLine - 1;\n\t\n\t next += base64VLQ.encode(mapping.originalColumn\n\t - previousOriginalColumn);\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (mapping.name != null) {\n\t nameIdx = this._names.indexOf(mapping.name);\n\t next += base64VLQ.encode(nameIdx - previousName);\n\t previousName = nameIdx;\n\t }\n\t }\n\t\n\t result += next;\n\t }\n\t\n\t return result;\n\t };\n\t\n\tSourceMapGenerator.prototype._generateSourcesContent =\n\t function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n\t return aSources.map(function (source) {\n\t if (!this._sourcesContents) {\n\t return null;\n\t }\n\t if (aSourceRoot != null) {\n\t source = util.relative(aSourceRoot, source);\n\t }\n\t var key = util.toSetString(source);\n\t return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n\t ? this._sourcesContents[key]\n\t : null;\n\t }, this);\n\t };\n\t\n\t/**\n\t * Externalize the source map.\n\t */\n\tSourceMapGenerator.prototype.toJSON =\n\t function SourceMapGenerator_toJSON() {\n\t var map = {\n\t version: this._version,\n\t sources: this._sources.toArray(),\n\t names: this._names.toArray(),\n\t mappings: this._serializeMappings()\n\t };\n\t if (this._file != null) {\n\t map.file = this._file;\n\t }\n\t if (this._sourceRoot != null) {\n\t map.sourceRoot = this._sourceRoot;\n\t }\n\t if (this._sourcesContents) {\n\t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n\t }\n\t\n\t return map;\n\t };\n\t\n\t/**\n\t * Render the source map being generated to a string.\n\t */\n\tSourceMapGenerator.prototype.toString =\n\t function SourceMapGenerator_toString() {\n\t return JSON.stringify(this.toJSON());\n\t };\n\t\n\texports.SourceMapGenerator = SourceMapGenerator;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t *\n\t * Based on the Base 64 VLQ implementation in Closure Compiler:\n\t * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n\t *\n\t * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * * Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t * * Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t * * Neither the name of Google Inc. nor the names of its\n\t * contributors may be used to endorse or promote products derived\n\t * from this software without specific prior written permission.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\t * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\t * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\t * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\t * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n\t * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n\t * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\t * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n\t * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t */\n\t\n\tvar base64 = __webpack_require__(3);\n\t\n\t// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n\t// length quantities we use in the source map spec, the first bit is the sign,\n\t// the next four bits are the actual value, and the 6th bit is the\n\t// continuation bit. The continuation bit tells us whether there are more\n\t// digits in this value following this digit.\n\t//\n\t// Continuation\n\t// | Sign\n\t// | |\n\t// V V\n\t// 101011\n\t\n\tvar VLQ_BASE_SHIFT = 5;\n\t\n\t// binary: 100000\n\tvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\t\n\t// binary: 011111\n\tvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\t\n\t// binary: 100000\n\tvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\t\n\t/**\n\t * Converts from a two-complement value to a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n\t * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n\t */\n\tfunction toVLQSigned(aValue) {\n\t return aValue < 0\n\t ? ((-aValue) << 1) + 1\n\t : (aValue << 1) + 0;\n\t}\n\t\n\t/**\n\t * Converts to a two-complement value from a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n\t * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n\t */\n\tfunction fromVLQSigned(aValue) {\n\t var isNegative = (aValue & 1) === 1;\n\t var shifted = aValue >> 1;\n\t return isNegative\n\t ? -shifted\n\t : shifted;\n\t}\n\t\n\t/**\n\t * Returns the base 64 VLQ encoded value.\n\t */\n\texports.encode = function base64VLQ_encode(aValue) {\n\t var encoded = \"\";\n\t var digit;\n\t\n\t var vlq = toVLQSigned(aValue);\n\t\n\t do {\n\t digit = vlq & VLQ_BASE_MASK;\n\t vlq >>>= VLQ_BASE_SHIFT;\n\t if (vlq > 0) {\n\t // There are still more digits in this value, so we must make sure the\n\t // continuation bit is marked.\n\t digit |= VLQ_CONTINUATION_BIT;\n\t }\n\t encoded += base64.encode(digit);\n\t } while (vlq > 0);\n\t\n\t return encoded;\n\t};\n\t\n\t/**\n\t * Decodes the next base 64 VLQ value from the given string and returns the\n\t * value and the rest of the string via the out parameter.\n\t */\n\texports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n\t var strLen = aStr.length;\n\t var result = 0;\n\t var shift = 0;\n\t var continuation, digit;\n\t\n\t do {\n\t if (aIndex >= strLen) {\n\t throw new Error(\"Expected more digits in base 64 VLQ value.\");\n\t }\n\t\n\t digit = base64.decode(aStr.charCodeAt(aIndex++));\n\t if (digit === -1) {\n\t throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n\t }\n\t\n\t continuation = !!(digit & VLQ_CONTINUATION_BIT);\n\t digit &= VLQ_BASE_MASK;\n\t result = result + (digit << shift);\n\t shift += VLQ_BASE_SHIFT;\n\t } while (continuation);\n\t\n\t aOutParam.value = fromVLQSigned(result);\n\t aOutParam.rest = aIndex;\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\t\n\t/**\n\t * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n\t */\n\texports.encode = function (number) {\n\t if (0 <= number && number < intToCharMap.length) {\n\t return intToCharMap[number];\n\t }\n\t throw new TypeError(\"Must be between 0 and 63: \" + number);\n\t};\n\t\n\t/**\n\t * Decode a single base 64 character code digit to an integer. Returns -1 on\n\t * failure.\n\t */\n\texports.decode = function (charCode) {\n\t var bigA = 65; // 'A'\n\t var bigZ = 90; // 'Z'\n\t\n\t var littleA = 97; // 'a'\n\t var littleZ = 122; // 'z'\n\t\n\t var zero = 48; // '0'\n\t var nine = 57; // '9'\n\t\n\t var plus = 43; // '+'\n\t var slash = 47; // '/'\n\t\n\t var littleOffset = 26;\n\t var numberOffset = 52;\n\t\n\t // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\t if (bigA <= charCode && charCode <= bigZ) {\n\t return (charCode - bigA);\n\t }\n\t\n\t // 26 - 51: abcdefghijklmnopqrstuvwxyz\n\t if (littleA <= charCode && charCode <= littleZ) {\n\t return (charCode - littleA + littleOffset);\n\t }\n\t\n\t // 52 - 61: 0123456789\n\t if (zero <= charCode && charCode <= nine) {\n\t return (charCode - zero + numberOffset);\n\t }\n\t\n\t // 62: +\n\t if (charCode == plus) {\n\t return 62;\n\t }\n\t\n\t // 63: /\n\t if (charCode == slash) {\n\t return 63;\n\t }\n\t\n\t // Invalid base64 digit.\n\t return -1;\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t/**\n\t * This is a helper function for getting values from parameter/options\n\t * objects.\n\t *\n\t * @param args The object we are extracting values from\n\t * @param name The name of the property we are getting.\n\t * @param defaultValue An optional value to return if the property is missing\n\t * from the object. If this is not specified and the property is missing, an\n\t * error will be thrown.\n\t */\n\tfunction getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}\n\texports.getArg = getArg;\n\t\n\tvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\n\tvar dataUrlRegexp = /^data:.+\\,.+$/;\n\t\n\tfunction urlParse(aUrl) {\n\t var match = aUrl.match(urlRegexp);\n\t if (!match) {\n\t return null;\n\t }\n\t return {\n\t scheme: match[1],\n\t auth: match[2],\n\t host: match[3],\n\t port: match[4],\n\t path: match[5]\n\t };\n\t}\n\texports.urlParse = urlParse;\n\t\n\tfunction urlGenerate(aParsedUrl) {\n\t var url = '';\n\t if (aParsedUrl.scheme) {\n\t url += aParsedUrl.scheme + ':';\n\t }\n\t url += '//';\n\t if (aParsedUrl.auth) {\n\t url += aParsedUrl.auth + '@';\n\t }\n\t if (aParsedUrl.host) {\n\t url += aParsedUrl.host;\n\t }\n\t if (aParsedUrl.port) {\n\t url += \":\" + aParsedUrl.port\n\t }\n\t if (aParsedUrl.path) {\n\t url += aParsedUrl.path;\n\t }\n\t return url;\n\t}\n\texports.urlGenerate = urlGenerate;\n\t\n\t/**\n\t * Normalizes a path, or the path portion of a URL:\n\t *\n\t * - Replaces consecutive slashes with one slash.\n\t * - Removes unnecessary '.' parts.\n\t * - Removes unnecessary '/..' parts.\n\t *\n\t * Based on code in the Node.js 'path' core module.\n\t *\n\t * @param aPath The path or url to normalize.\n\t */\n\tfunction normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}\n\texports.normalize = normalize;\n\t\n\t/**\n\t * Joins two paths/URLs.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be joined with the root.\n\t *\n\t * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n\t * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n\t * first.\n\t * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n\t * is updated with the result and aRoot is returned. Otherwise the result\n\t * is returned.\n\t * - If aPath is absolute, the result is aPath.\n\t * - Otherwise the two paths are joined with a slash.\n\t * - Joining for example 'http://' and 'www.example.com' is also supported.\n\t */\n\tfunction join(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t if (aPath === \"\") {\n\t aPath = \".\";\n\t }\n\t var aPathUrl = urlParse(aPath);\n\t var aRootUrl = urlParse(aRoot);\n\t if (aRootUrl) {\n\t aRoot = aRootUrl.path || '/';\n\t }\n\t\n\t // `join(foo, '//www.example.org')`\n\t if (aPathUrl && !aPathUrl.scheme) {\n\t if (aRootUrl) {\n\t aPathUrl.scheme = aRootUrl.scheme;\n\t }\n\t return urlGenerate(aPathUrl);\n\t }\n\t\n\t if (aPathUrl || aPath.match(dataUrlRegexp)) {\n\t return aPath;\n\t }\n\t\n\t // `join('http://', 'www.example.com')`\n\t if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n\t aRootUrl.host = aPath;\n\t return urlGenerate(aRootUrl);\n\t }\n\t\n\t var joined = aPath.charAt(0) === '/'\n\t ? aPath\n\t : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\t\n\t if (aRootUrl) {\n\t aRootUrl.path = joined;\n\t return urlGenerate(aRootUrl);\n\t }\n\t return joined;\n\t}\n\texports.join = join;\n\t\n\texports.isAbsolute = function (aPath) {\n\t return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n\t};\n\t\n\t/**\n\t * Make a path relative to a URL or another path.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be made relative to aRoot.\n\t */\n\tfunction relative(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t\n\t aRoot = aRoot.replace(/\\/$/, '');\n\t\n\t // It is possible for the path to be above the root. In this case, simply\n\t // checking whether the root is a prefix of the path won't work. Instead, we\n\t // need to remove components from the root one by one, until either we find\n\t // a prefix that fits, or we run out of components to remove.\n\t var level = 0;\n\t while (aPath.indexOf(aRoot + '/') !== 0) {\n\t var index = aRoot.lastIndexOf(\"/\");\n\t if (index < 0) {\n\t return aPath;\n\t }\n\t\n\t // If the only part of the root that is left is the scheme (i.e. http://,\n\t // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n\t // have exhausted all components, so the path is not relative to the root.\n\t aRoot = aRoot.slice(0, index);\n\t if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n\t return aPath;\n\t }\n\t\n\t ++level;\n\t }\n\t\n\t // Make sure we add a \"../\" for each component we removed from the root.\n\t return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n\t}\n\texports.relative = relative;\n\t\n\tvar supportsNullProto = (function () {\n\t var obj = Object.create(null);\n\t return !('__proto__' in obj);\n\t}());\n\t\n\tfunction identity (s) {\n\t return s;\n\t}\n\t\n\t/**\n\t * Because behavior goes wacky when you set `__proto__` on objects, we\n\t * have to prefix all the strings in our set with an arbitrary character.\n\t *\n\t * See https://github.com/mozilla/source-map/pull/31 and\n\t * https://github.com/mozilla/source-map/issues/30\n\t *\n\t * @param String aStr\n\t */\n\tfunction toSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return '$' + aStr;\n\t }\n\t\n\t return aStr;\n\t}\n\texports.toSetString = supportsNullProto ? identity : toSetString;\n\t\n\tfunction fromSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return aStr.slice(1);\n\t }\n\t\n\t return aStr;\n\t}\n\texports.fromSetString = supportsNullProto ? identity : fromSetString;\n\t\n\tfunction isProtoString(s) {\n\t if (!s) {\n\t return false;\n\t }\n\t\n\t var length = s.length;\n\t\n\t if (length < 9 /* \"__proto__\".length */) {\n\t return false;\n\t }\n\t\n\t if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n\t s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n\t s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n\t s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 9) !== 95 /* '_' */) {\n\t return false;\n\t }\n\t\n\t for (var i = length - 10; i >= 0; i--) {\n\t if (s.charCodeAt(i) !== 36 /* '$' */) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings where the original positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same original source/line/column, but different generated\n\t * line and column the same. Useful when searching for a mapping with a\n\t * stubbed out mapping.\n\t */\n\tfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n\t var cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0 || onlyCompareOriginal) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByOriginalPositions = compareByOriginalPositions;\n\t\n\t/**\n\t * Comparator between two mappings with deflated source and name indices where\n\t * the generated positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same generated line and column, but different\n\t * source/name/original line and column the same. Useful when searching for a\n\t * mapping with a stubbed out mapping.\n\t */\n\tfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0 || onlyCompareGenerated) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\t\n\tfunction strcmp(aStr1, aStr2) {\n\t if (aStr1 === aStr2) {\n\t return 0;\n\t }\n\t\n\t if (aStr1 === null) {\n\t return 1; // aStr2 !== null\n\t }\n\t\n\t if (aStr2 === null) {\n\t return -1; // aStr1 !== null\n\t }\n\t\n\t if (aStr1 > aStr2) {\n\t return 1;\n\t }\n\t\n\t return -1;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings with inflated source and name strings where\n\t * the generated positions are compared.\n\t */\n\tfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\t\n\t/**\n\t * Strip any JSON XSSI avoidance prefix from the string (as documented\n\t * in the source maps specification), and then parse the string as\n\t * JSON.\n\t */\n\tfunction parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}\n\texports.parseSourceMapInput = parseSourceMapInput;\n\t\n\t/**\n\t * Compute the URL of a source given the the source root, the source's\n\t * URL, and the source map's URL.\n\t */\n\tfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n\t sourceURL = sourceURL || '';\n\t\n\t if (sourceRoot) {\n\t // This follows what Chrome does.\n\t if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n\t sourceRoot += '/';\n\t }\n\t // The spec says:\n\t // Line 4: An optional source root, useful for relocating source\n\t // files on a server or removing repeated values in the\n\t // “sources” entry. This value is prepended to the individual\n\t // entries in the “source” field.\n\t sourceURL = sourceRoot + sourceURL;\n\t }\n\t\n\t // Historically, SourceMapConsumer did not take the sourceMapURL as\n\t // a parameter. This mode is still somewhat supported, which is why\n\t // this code block is conditional. However, it's preferable to pass\n\t // the source map URL to SourceMapConsumer, so that this function\n\t // can implement the source URL resolution algorithm as outlined in\n\t // the spec. This block is basically the equivalent of:\n\t // new URL(sourceURL, sourceMapURL).toString()\n\t // ... except it avoids using URL, which wasn't available in the\n\t // older releases of node still supported by this library.\n\t //\n\t // The spec says:\n\t // If the sources are not absolute URLs after prepending of the\n\t // “sourceRoot”, the sources are resolved relative to the\n\t // SourceMap (like resolving script src in a html document).\n\t if (sourceMapURL) {\n\t var parsed = urlParse(sourceMapURL);\n\t if (!parsed) {\n\t throw new Error(\"sourceMapURL could not be parsed\");\n\t }\n\t if (parsed.path) {\n\t // Strip the last path component, but keep the \"/\".\n\t var index = parsed.path.lastIndexOf('/');\n\t if (index >= 0) {\n\t parsed.path = parsed.path.substring(0, index + 1);\n\t }\n\t }\n\t sourceURL = join(urlGenerate(parsed), sourceURL);\n\t }\n\t\n\t return normalize(sourceURL);\n\t}\n\texports.computeSourceURL = computeSourceURL;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar hasNativeMap = typeof Map !== \"undefined\";\n\t\n\t/**\n\t * A data structure which is a combination of an array and a set. Adding a new\n\t * member is O(1), testing for membership is O(1), and finding the index of an\n\t * element is O(1). Removing elements from the set is not supported. Only\n\t * strings are supported for membership.\n\t */\n\tfunction ArraySet() {\n\t this._array = [];\n\t this._set = hasNativeMap ? new Map() : Object.create(null);\n\t}\n\t\n\t/**\n\t * Static method for creating ArraySet instances from an existing array.\n\t */\n\tArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n\t var set = new ArraySet();\n\t for (var i = 0, len = aArray.length; i < len; i++) {\n\t set.add(aArray[i], aAllowDuplicates);\n\t }\n\t return set;\n\t};\n\t\n\t/**\n\t * Return how many unique items are in this ArraySet. If duplicates have been\n\t * added, than those do not count towards the size.\n\t *\n\t * @returns Number\n\t */\n\tArraySet.prototype.size = function ArraySet_size() {\n\t return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n\t};\n\t\n\t/**\n\t * Add the given string to this set.\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n\t var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n\t var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n\t var idx = this._array.length;\n\t if (!isDuplicate || aAllowDuplicates) {\n\t this._array.push(aStr);\n\t }\n\t if (!isDuplicate) {\n\t if (hasNativeMap) {\n\t this._set.set(aStr, idx);\n\t } else {\n\t this._set[sStr] = idx;\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Is the given string a member of this set?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.has = function ArraySet_has(aStr) {\n\t if (hasNativeMap) {\n\t return this._set.has(aStr);\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t return has.call(this._set, sStr);\n\t }\n\t};\n\t\n\t/**\n\t * What is the index of the given string in the array?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n\t if (hasNativeMap) {\n\t var idx = this._set.get(aStr);\n\t if (idx >= 0) {\n\t return idx;\n\t }\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t if (has.call(this._set, sStr)) {\n\t return this._set[sStr];\n\t }\n\t }\n\t\n\t throw new Error('\"' + aStr + '\" is not in the set.');\n\t};\n\t\n\t/**\n\t * What is the element at the given index?\n\t *\n\t * @param Number aIdx\n\t */\n\tArraySet.prototype.at = function ArraySet_at(aIdx) {\n\t if (aIdx >= 0 && aIdx < this._array.length) {\n\t return this._array[aIdx];\n\t }\n\t throw new Error('No element indexed by ' + aIdx);\n\t};\n\t\n\t/**\n\t * Returns the array representation of this set (which has the proper indices\n\t * indicated by indexOf). Note that this is a copy of the internal array used\n\t * for storing the members so that no one can mess with internal state.\n\t */\n\tArraySet.prototype.toArray = function ArraySet_toArray() {\n\t return this._array.slice();\n\t};\n\t\n\texports.ArraySet = ArraySet;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2014 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\t\n\t/**\n\t * Determine whether mappingB is after mappingA with respect to generated\n\t * position.\n\t */\n\tfunction generatedPositionAfter(mappingA, mappingB) {\n\t // Optimized for most common case\n\t var lineA = mappingA.generatedLine;\n\t var lineB = mappingB.generatedLine;\n\t var columnA = mappingA.generatedColumn;\n\t var columnB = mappingB.generatedColumn;\n\t return lineB > lineA || lineB == lineA && columnB >= columnA ||\n\t util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n\t}\n\t\n\t/**\n\t * A data structure to provide a sorted view of accumulated mappings in a\n\t * performance conscious manner. It trades a neglibable overhead in general\n\t * case for a large speedup in case of mappings being added in order.\n\t */\n\tfunction MappingList() {\n\t this._array = [];\n\t this._sorted = true;\n\t // Serves as infimum\n\t this._last = {generatedLine: -1, generatedColumn: 0};\n\t}\n\t\n\t/**\n\t * Iterate through internal items. This method takes the same arguments that\n\t * `Array.prototype.forEach` takes.\n\t *\n\t * NOTE: The order of the mappings is NOT guaranteed.\n\t */\n\tMappingList.prototype.unsortedForEach =\n\t function MappingList_forEach(aCallback, aThisArg) {\n\t this._array.forEach(aCallback, aThisArg);\n\t };\n\t\n\t/**\n\t * Add the given source mapping.\n\t *\n\t * @param Object aMapping\n\t */\n\tMappingList.prototype.add = function MappingList_add(aMapping) {\n\t if (generatedPositionAfter(this._last, aMapping)) {\n\t this._last = aMapping;\n\t this._array.push(aMapping);\n\t } else {\n\t this._sorted = false;\n\t this._array.push(aMapping);\n\t }\n\t};\n\t\n\t/**\n\t * Returns the flat, sorted array of mappings. The mappings are sorted by\n\t * generated position.\n\t *\n\t * WARNING: This method returns internal data without copying, for\n\t * performance. The return value must NOT be mutated, and should be treated as\n\t * an immutable borrow. If you want to take ownership, you must make your own\n\t * copy.\n\t */\n\tMappingList.prototype.toArray = function MappingList_toArray() {\n\t if (!this._sorted) {\n\t this._array.sort(util.compareByGeneratedPositionsInflated);\n\t this._sorted = true;\n\t }\n\t return this._array;\n\t};\n\t\n\texports.MappingList = MappingList;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar binarySearch = __webpack_require__(8);\n\tvar ArraySet = __webpack_require__(5).ArraySet;\n\tvar base64VLQ = __webpack_require__(2);\n\tvar quickSort = __webpack_require__(9).quickSort;\n\t\n\tfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t return sourceMap.sections != null\n\t ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n\t : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n\t}\n\t\n\tSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n\t return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n\t}\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tSourceMapConsumer.prototype._version = 3;\n\t\n\t// `__generatedMappings` and `__originalMappings` are arrays that hold the\n\t// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n\t// are lazily instantiated, accessed via the `_generatedMappings` and\n\t// `_originalMappings` getters respectively, and we only parse the mappings\n\t// and create these arrays once queried for a source location. We jump through\n\t// these hoops because there can be many thousands of mappings, and parsing\n\t// them is expensive, so we only want to do it if we must.\n\t//\n\t// Each object in the arrays is of the form:\n\t//\n\t// {\n\t// generatedLine: The line number in the generated code,\n\t// generatedColumn: The column number in the generated code,\n\t// source: The path to the original source file that generated this\n\t// chunk of code,\n\t// originalLine: The line number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// originalColumn: The column number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// name: The name of the original symbol which generated this chunk of\n\t// code.\n\t// }\n\t//\n\t// All properties except for `generatedLine` and `generatedColumn` can be\n\t// `null`.\n\t//\n\t// `_generatedMappings` is ordered by the generated positions.\n\t//\n\t// `_originalMappings` is ordered by the original positions.\n\t\n\tSourceMapConsumer.prototype.__generatedMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__generatedMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__generatedMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype.__originalMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__originalMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__originalMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype._charIsMappingSeparator =\n\t function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n\t var c = aStr.charAt(index);\n\t return c === \";\" || c === \",\";\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t throw new Error(\"Subclasses must implement _parseMappings\");\n\t };\n\t\n\tSourceMapConsumer.GENERATED_ORDER = 1;\n\tSourceMapConsumer.ORIGINAL_ORDER = 2;\n\t\n\tSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\n\tSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Iterate over each mapping between an original source/line/column and a\n\t * generated line/column in this source map.\n\t *\n\t * @param Function aCallback\n\t * The function that is called with each mapping.\n\t * @param Object aContext\n\t * Optional. If specified, this object will be the value of `this` every\n\t * time that `aCallback` is called.\n\t * @param aOrder\n\t * Either `SourceMapConsumer.GENERATED_ORDER` or\n\t * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n\t * iterate over the mappings sorted by the generated file's line/column\n\t * order or the original's source/line/column order, respectively. Defaults to\n\t * `SourceMapConsumer.GENERATED_ORDER`.\n\t */\n\tSourceMapConsumer.prototype.eachMapping =\n\t function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n\t var context = aContext || null;\n\t var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\t\n\t var mappings;\n\t switch (order) {\n\t case SourceMapConsumer.GENERATED_ORDER:\n\t mappings = this._generatedMappings;\n\t break;\n\t case SourceMapConsumer.ORIGINAL_ORDER:\n\t mappings = this._originalMappings;\n\t break;\n\t default:\n\t throw new Error(\"Unknown order of iteration.\");\n\t }\n\t\n\t var sourceRoot = this.sourceRoot;\n\t mappings.map(function (mapping) {\n\t var source = mapping.source === null ? null : this._sources.at(mapping.source);\n\t source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n\t return {\n\t source: source,\n\t generatedLine: mapping.generatedLine,\n\t generatedColumn: mapping.generatedColumn,\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: mapping.name === null ? null : this._names.at(mapping.name)\n\t };\n\t }, this).forEach(aCallback, context);\n\t };\n\t\n\t/**\n\t * Returns all generated line and column information for the original source,\n\t * line, and column provided. If no column is provided, returns all mappings\n\t * corresponding to a either the line we are searching for or the next\n\t * closest line that has any mappings. Otherwise, returns all mappings\n\t * corresponding to the given line and either the column we are searching for\n\t * or the next closest column that has any offsets.\n\t *\n\t * The only argument is an object with the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number is 1-based.\n\t * - column: Optional. the column number in the original source.\n\t * The column number is 0-based.\n\t *\n\t * and an array of objects is returned, each with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tSourceMapConsumer.prototype.allGeneratedPositionsFor =\n\t function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n\t var line = util.getArg(aArgs, 'line');\n\t\n\t // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n\t // returns the index of the closest mapping less than the needle. By\n\t // setting needle.originalColumn to 0, we thus find the last mapping for\n\t // the given line, provided such a mapping exists.\n\t var needle = {\n\t source: util.getArg(aArgs, 'source'),\n\t originalLine: line,\n\t originalColumn: util.getArg(aArgs, 'column', 0)\n\t };\n\t\n\t needle.source = this._findSourceIndex(needle.source);\n\t if (needle.source < 0) {\n\t return [];\n\t }\n\t\n\t var mappings = [];\n\t\n\t var index = this._findMapping(needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t binarySearch.LEAST_UPPER_BOUND);\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (aArgs.column === undefined) {\n\t var originalLine = mapping.originalLine;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we found. Since\n\t // mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we found.\n\t while (mapping && mapping.originalLine === originalLine) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t } else {\n\t var originalColumn = mapping.originalColumn;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we were searching for.\n\t // Since mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we are searching for.\n\t while (mapping &&\n\t mapping.originalLine === line &&\n\t mapping.originalColumn == originalColumn) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t }\n\t }\n\t\n\t return mappings;\n\t };\n\t\n\texports.SourceMapConsumer = SourceMapConsumer;\n\t\n\t/**\n\t * A BasicSourceMapConsumer instance represents a parsed source map which we can\n\t * query for information about the original file positions by giving it a file\n\t * position in the generated source.\n\t *\n\t * The first parameter is the raw source map (either as a JSON string, or\n\t * already parsed to an object). According to the spec, source maps have the\n\t * following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - sources: An array of URLs to the original source files.\n\t * - names: An array of identifiers which can be referrenced by individual mappings.\n\t * - sourceRoot: Optional. The URL root from which all sources are relative.\n\t * - sourcesContent: Optional. An array of contents of the original source files.\n\t * - mappings: A string of base64 VLQs which contain the actual mappings.\n\t * - file: Optional. The generated file this source map is associated with.\n\t *\n\t * Here is an example source map, taken from the source map spec[0]:\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"out.js\",\n\t * sourceRoot : \"\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AA,AB;;ABCDE;\"\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n\t */\n\tfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sources = util.getArg(sourceMap, 'sources');\n\t // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n\t // requires the array) to play nice here.\n\t var names = util.getArg(sourceMap, 'names', []);\n\t var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n\t var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n\t var mappings = util.getArg(sourceMap, 'mappings');\n\t var file = util.getArg(sourceMap, 'file', null);\n\t\n\t // Once again, Sass deviates from the spec and supplies the version as a\n\t // string rather than a number, so we use loose equality checking here.\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t if (sourceRoot) {\n\t sourceRoot = util.normalize(sourceRoot);\n\t }\n\t\n\t sources = sources\n\t .map(String)\n\t // Some source maps produce relative source paths like \"./foo.js\" instead of\n\t // \"foo.js\". Normalize these first so that future comparisons will succeed.\n\t // See bugzil.la/1090768.\n\t .map(util.normalize)\n\t // Always ensure that absolute sources are internally stored relative to\n\t // the source root, if the source root is absolute. Not doing this would\n\t // be particularly problematic when the source root is a prefix of the\n\t // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n\t .map(function (source) {\n\t return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n\t ? util.relative(sourceRoot, source)\n\t : source;\n\t });\n\t\n\t // Pass `true` below to allow duplicate names and sources. While source maps\n\t // are intended to be compressed and deduplicated, the TypeScript compiler\n\t // sometimes generates source maps with duplicates in them. See Github issue\n\t // #72 and bugzil.la/889492.\n\t this._names = ArraySet.fromArray(names.map(String), true);\n\t this._sources = ArraySet.fromArray(sources, true);\n\t\n\t this._absoluteSources = this._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t this.sourceRoot = sourceRoot;\n\t this.sourcesContent = sourcesContent;\n\t this._mappings = mappings;\n\t this._sourceMapURL = aSourceMapURL;\n\t this.file = file;\n\t}\n\t\n\tBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\t\n\t/**\n\t * Utility function to find the index of a source. Returns -1 if not\n\t * found.\n\t */\n\tBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t if (this._sources.has(relativeSource)) {\n\t return this._sources.indexOf(relativeSource);\n\t }\n\t\n\t // Maybe aSource is an absolute URL as returned by |sources|. In\n\t // this case we can't simply undo the transform.\n\t var i;\n\t for (i = 0; i < this._absoluteSources.length; ++i) {\n\t if (this._absoluteSources[i] == aSource) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t};\n\t\n\t/**\n\t * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n\t *\n\t * @param SourceMapGenerator aSourceMap\n\t * The source map that will be consumed.\n\t * @param String aSourceMapURL\n\t * The URL at which the source map can be found (optional)\n\t * @returns BasicSourceMapConsumer\n\t */\n\tBasicSourceMapConsumer.fromSourceMap =\n\t function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n\t var smc = Object.create(BasicSourceMapConsumer.prototype);\n\t\n\t var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n\t var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n\t smc.sourceRoot = aSourceMap._sourceRoot;\n\t smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n\t smc.sourceRoot);\n\t smc.file = aSourceMap._file;\n\t smc._sourceMapURL = aSourceMapURL;\n\t smc._absoluteSources = smc._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t // Because we are modifying the entries (by converting string sources and\n\t // names to indices into the sources and names ArraySets), we have to make\n\t // a copy of the entry or else bad things happen. Shared mutable state\n\t // strikes again! See github issue #191.\n\t\n\t var generatedMappings = aSourceMap._mappings.toArray().slice();\n\t var destGeneratedMappings = smc.__generatedMappings = [];\n\t var destOriginalMappings = smc.__originalMappings = [];\n\t\n\t for (var i = 0, length = generatedMappings.length; i < length; i++) {\n\t var srcMapping = generatedMappings[i];\n\t var destMapping = new Mapping;\n\t destMapping.generatedLine = srcMapping.generatedLine;\n\t destMapping.generatedColumn = srcMapping.generatedColumn;\n\t\n\t if (srcMapping.source) {\n\t destMapping.source = sources.indexOf(srcMapping.source);\n\t destMapping.originalLine = srcMapping.originalLine;\n\t destMapping.originalColumn = srcMapping.originalColumn;\n\t\n\t if (srcMapping.name) {\n\t destMapping.name = names.indexOf(srcMapping.name);\n\t }\n\t\n\t destOriginalMappings.push(destMapping);\n\t }\n\t\n\t destGeneratedMappings.push(destMapping);\n\t }\n\t\n\t quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\t\n\t return smc;\n\t };\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tBasicSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t return this._absoluteSources.slice();\n\t }\n\t});\n\t\n\t/**\n\t * Provide the JIT with a nice shape / hidden class.\n\t */\n\tfunction Mapping() {\n\t this.generatedLine = 0;\n\t this.generatedColumn = 0;\n\t this.source = null;\n\t this.originalLine = null;\n\t this.originalColumn = null;\n\t this.name = null;\n\t}\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tBasicSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t var generatedLine = 1;\n\t var previousGeneratedColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousOriginalColumn = 0;\n\t var previousSource = 0;\n\t var previousName = 0;\n\t var length = aStr.length;\n\t var index = 0;\n\t var cachedSegments = {};\n\t var temp = {};\n\t var originalMappings = [];\n\t var generatedMappings = [];\n\t var mapping, str, segment, end, value;\n\t\n\t while (index < length) {\n\t if (aStr.charAt(index) === ';') {\n\t generatedLine++;\n\t index++;\n\t previousGeneratedColumn = 0;\n\t }\n\t else if (aStr.charAt(index) === ',') {\n\t index++;\n\t }\n\t else {\n\t mapping = new Mapping();\n\t mapping.generatedLine = generatedLine;\n\t\n\t // Because each offset is encoded relative to the previous one,\n\t // many segments often have the same encoding. We can exploit this\n\t // fact by caching the parsed variable length fields of each segment,\n\t // allowing us to avoid a second parse if we encounter the same\n\t // segment again.\n\t for (end = index; end < length; end++) {\n\t if (this._charIsMappingSeparator(aStr, end)) {\n\t break;\n\t }\n\t }\n\t str = aStr.slice(index, end);\n\t\n\t segment = cachedSegments[str];\n\t if (segment) {\n\t index += str.length;\n\t } else {\n\t segment = [];\n\t while (index < end) {\n\t base64VLQ.decode(aStr, index, temp);\n\t value = temp.value;\n\t index = temp.rest;\n\t segment.push(value);\n\t }\n\t\n\t if (segment.length === 2) {\n\t throw new Error('Found a source, but no line and column');\n\t }\n\t\n\t if (segment.length === 3) {\n\t throw new Error('Found a source and line, but no column');\n\t }\n\t\n\t cachedSegments[str] = segment;\n\t }\n\t\n\t // Generated column.\n\t mapping.generatedColumn = previousGeneratedColumn + segment[0];\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (segment.length > 1) {\n\t // Original source.\n\t mapping.source = previousSource + segment[1];\n\t previousSource += segment[1];\n\t\n\t // Original line.\n\t mapping.originalLine = previousOriginalLine + segment[2];\n\t previousOriginalLine = mapping.originalLine;\n\t // Lines are stored 0-based\n\t mapping.originalLine += 1;\n\t\n\t // Original column.\n\t mapping.originalColumn = previousOriginalColumn + segment[3];\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (segment.length > 4) {\n\t // Original name.\n\t mapping.name = previousName + segment[4];\n\t previousName += segment[4];\n\t }\n\t }\n\t\n\t generatedMappings.push(mapping);\n\t if (typeof mapping.originalLine === 'number') {\n\t originalMappings.push(mapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t this.__generatedMappings = generatedMappings;\n\t\n\t quickSort(originalMappings, util.compareByOriginalPositions);\n\t this.__originalMappings = originalMappings;\n\t };\n\t\n\t/**\n\t * Find the mapping that best matches the hypothetical \"needle\" mapping that\n\t * we are searching for in the given \"haystack\" of mappings.\n\t */\n\tBasicSourceMapConsumer.prototype._findMapping =\n\t function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n\t aColumnName, aComparator, aBias) {\n\t // To return the position we are searching for, we must first find the\n\t // mapping for the given position and then return the opposite position it\n\t // points to. Because the mappings are sorted, we can use binary search to\n\t // find the best mapping.\n\t\n\t if (aNeedle[aLineName] <= 0) {\n\t throw new TypeError('Line must be greater than or equal to 1, got '\n\t + aNeedle[aLineName]);\n\t }\n\t if (aNeedle[aColumnName] < 0) {\n\t throw new TypeError('Column must be greater than or equal to 0, got '\n\t + aNeedle[aColumnName]);\n\t }\n\t\n\t return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n\t };\n\t\n\t/**\n\t * Compute the last column for each generated mapping. The last column is\n\t * inclusive.\n\t */\n\tBasicSourceMapConsumer.prototype.computeColumnSpans =\n\t function SourceMapConsumer_computeColumnSpans() {\n\t for (var index = 0; index < this._generatedMappings.length; ++index) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t // Mappings do not contain a field for the last generated columnt. We\n\t // can come up with an optimistic estimate, however, by assuming that\n\t // mappings are contiguous (i.e. given two consecutive mappings, the\n\t // first mapping ends where the second one starts).\n\t if (index + 1 < this._generatedMappings.length) {\n\t var nextMapping = this._generatedMappings[index + 1];\n\t\n\t if (mapping.generatedLine === nextMapping.generatedLine) {\n\t mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n\t continue;\n\t }\n\t }\n\t\n\t // The last mapping for each line spans the entire line.\n\t mapping.lastGeneratedColumn = Infinity;\n\t }\n\t };\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tBasicSourceMapConsumer.prototype.originalPositionFor =\n\t function SourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._generatedMappings,\n\t \"generatedLine\",\n\t \"generatedColumn\",\n\t util.compareByGeneratedPositionsDeflated,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t if (mapping.generatedLine === needle.generatedLine) {\n\t var source = util.getArg(mapping, 'source', null);\n\t if (source !== null) {\n\t source = this._sources.at(source);\n\t source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n\t }\n\t var name = util.getArg(mapping, 'name', null);\n\t if (name !== null) {\n\t name = this._names.at(name);\n\t }\n\t return {\n\t source: source,\n\t line: util.getArg(mapping, 'originalLine', null),\n\t column: util.getArg(mapping, 'originalColumn', null),\n\t name: name\n\t };\n\t }\n\t }\n\t\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function BasicSourceMapConsumer_hasContentsOfAllSources() {\n\t if (!this.sourcesContent) {\n\t return false;\n\t }\n\t return this.sourcesContent.length >= this._sources.size() &&\n\t !this.sourcesContent.some(function (sc) { return sc == null; });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tBasicSourceMapConsumer.prototype.sourceContentFor =\n\t function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t if (!this.sourcesContent) {\n\t return null;\n\t }\n\t\n\t var index = this._findSourceIndex(aSource);\n\t if (index >= 0) {\n\t return this.sourcesContent[index];\n\t }\n\t\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t var url;\n\t if (this.sourceRoot != null\n\t && (url = util.urlParse(this.sourceRoot))) {\n\t // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n\t // many users. We can help them out when they expect file:// URIs to\n\t // behave like it would if they were running a local HTTP server. See\n\t // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n\t var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n\t if (url.scheme == \"file\"\n\t && this._sources.has(fileUriAbsPath)) {\n\t return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n\t }\n\t\n\t if ((!url.path || url.path == \"/\")\n\t && this._sources.has(\"/\" + relativeSource)) {\n\t return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n\t }\n\t }\n\t\n\t // This function is used recursively from\n\t // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n\t // don't want to throw if we can't find the source - we just want to\n\t // return null, so we provide a flag to exit gracefully.\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tBasicSourceMapConsumer.prototype.generatedPositionFor =\n\t function SourceMapConsumer_generatedPositionFor(aArgs) {\n\t var source = util.getArg(aArgs, 'source');\n\t source = this._findSourceIndex(source);\n\t if (source < 0) {\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t }\n\t\n\t var needle = {\n\t source: source,\n\t originalLine: util.getArg(aArgs, 'line'),\n\t originalColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (mapping.source === needle.source) {\n\t return {\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t };\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t };\n\t\n\texports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\t\n\t/**\n\t * An IndexedSourceMapConsumer instance represents a parsed source map which\n\t * we can query for information. It differs from BasicSourceMapConsumer in\n\t * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n\t * input.\n\t *\n\t * The first parameter is a raw source map (either as a JSON string, or already\n\t * parsed to an object). According to the spec for indexed source maps, they\n\t * have the following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - file: Optional. The generated file this source map is associated with.\n\t * - sections: A list of section definitions.\n\t *\n\t * Each value under the \"sections\" field has two fields:\n\t * - offset: The offset into the original specified at which this section\n\t * begins to apply, defined as an object with a \"line\" and \"column\"\n\t * field.\n\t * - map: A source map definition. This source map could also be indexed,\n\t * but doesn't have to be.\n\t *\n\t * Instead of the \"map\" field, it's also possible to have a \"url\" field\n\t * specifying a URL to retrieve a source map from, but that's currently\n\t * unsupported.\n\t *\n\t * Here's an example source map, taken from the source map spec[0], but\n\t * modified to omit a section which uses the \"url\" field.\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"app.js\",\n\t * sections: [{\n\t * offset: {line:100, column:10},\n\t * map: {\n\t * version : 3,\n\t * file: \"section.js\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AAAA,E;;ABCDE;\"\n\t * }\n\t * }],\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n\t */\n\tfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sections = util.getArg(sourceMap, 'sections');\n\t\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t this._sources = new ArraySet();\n\t this._names = new ArraySet();\n\t\n\t var lastOffset = {\n\t line: -1,\n\t column: 0\n\t };\n\t this._sections = sections.map(function (s) {\n\t if (s.url) {\n\t // The url field will require support for asynchronicity.\n\t // See https://github.com/mozilla/source-map/issues/16\n\t throw new Error('Support for url field in sections not implemented.');\n\t }\n\t var offset = util.getArg(s, 'offset');\n\t var offsetLine = util.getArg(offset, 'line');\n\t var offsetColumn = util.getArg(offset, 'column');\n\t\n\t if (offsetLine < lastOffset.line ||\n\t (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n\t throw new Error('Section offsets must be ordered and non-overlapping.');\n\t }\n\t lastOffset = offset;\n\t\n\t return {\n\t generatedOffset: {\n\t // The offset fields are 0-based, but we use 1-based indices when\n\t // encoding/decoding from VLQ.\n\t generatedLine: offsetLine + 1,\n\t generatedColumn: offsetColumn + 1\n\t },\n\t consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n\t }\n\t });\n\t}\n\t\n\tIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tIndexedSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t var sources = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n\t sources.push(this._sections[i].consumer.sources[j]);\n\t }\n\t }\n\t return sources;\n\t }\n\t});\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tIndexedSourceMapConsumer.prototype.originalPositionFor =\n\t function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t // Find the section containing the generated position we're trying to map\n\t // to an original position.\n\t var sectionIndex = binarySearch.search(needle, this._sections,\n\t function(needle, section) {\n\t var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n\t if (cmp) {\n\t return cmp;\n\t }\n\t\n\t return (needle.generatedColumn -\n\t section.generatedOffset.generatedColumn);\n\t });\n\t var section = this._sections[sectionIndex];\n\t\n\t if (!section) {\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t }\n\t\n\t return section.consumer.originalPositionFor({\n\t line: needle.generatedLine -\n\t (section.generatedOffset.generatedLine - 1),\n\t column: needle.generatedColumn -\n\t (section.generatedOffset.generatedLine === needle.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t bias: aArgs.bias\n\t });\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n\t return this._sections.every(function (s) {\n\t return s.consumer.hasContentsOfAllSources();\n\t });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tIndexedSourceMapConsumer.prototype.sourceContentFor =\n\t function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t var content = section.consumer.sourceContentFor(aSource, true);\n\t if (content) {\n\t return content;\n\t }\n\t }\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based. \n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tIndexedSourceMapConsumer.prototype.generatedPositionFor =\n\t function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t // Only consider this section if the requested source is in the list of\n\t // sources of the consumer.\n\t if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n\t continue;\n\t }\n\t var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n\t if (generatedPosition) {\n\t var ret = {\n\t line: generatedPosition.line +\n\t (section.generatedOffset.generatedLine - 1),\n\t column: generatedPosition.column +\n\t (section.generatedOffset.generatedLine === generatedPosition.line\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0)\n\t };\n\t return ret;\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null\n\t };\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tIndexedSourceMapConsumer.prototype._parseMappings =\n\t function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t this.__generatedMappings = [];\n\t this.__originalMappings = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t var sectionMappings = section.consumer._generatedMappings;\n\t for (var j = 0; j < sectionMappings.length; j++) {\n\t var mapping = sectionMappings[j];\n\t\n\t var source = section.consumer._sources.at(mapping.source);\n\t source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n\t this._sources.add(source);\n\t source = this._sources.indexOf(source);\n\t\n\t var name = null;\n\t if (mapping.name) {\n\t name = section.consumer._names.at(mapping.name);\n\t this._names.add(name);\n\t name = this._names.indexOf(name);\n\t }\n\t\n\t // The mappings coming from the consumer for the section have\n\t // generated positions relative to the start of the section, so we\n\t // need to offset them to be relative to the start of the concatenated\n\t // generated file.\n\t var adjustedMapping = {\n\t source: source,\n\t generatedLine: mapping.generatedLine +\n\t (section.generatedOffset.generatedLine - 1),\n\t generatedColumn: mapping.generatedColumn +\n\t (section.generatedOffset.generatedLine === mapping.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: name\n\t };\n\t\n\t this.__generatedMappings.push(adjustedMapping);\n\t if (typeof adjustedMapping.originalLine === 'number') {\n\t this.__originalMappings.push(adjustedMapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t quickSort(this.__originalMappings, util.compareByOriginalPositions);\n\t };\n\t\n\texports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\texports.GREATEST_LOWER_BOUND = 1;\n\texports.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Recursive implementation of binary search.\n\t *\n\t * @param aLow Indices here and lower do not contain the needle.\n\t * @param aHigh Indices here and higher do not contain the needle.\n\t * @param aNeedle The element being searched for.\n\t * @param aHaystack The non-empty array being searched.\n\t * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t */\n\tfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n\t // This function terminates when one of the following is true:\n\t //\n\t // 1. We find the exact element we are looking for.\n\t //\n\t // 2. We did not find the exact element, but we can return the index of\n\t // the next-closest element.\n\t //\n\t // 3. We did not find the exact element, and there is no next-closest\n\t // element than the one we are searching for, so we return -1.\n\t var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n\t var cmp = aCompare(aNeedle, aHaystack[mid], true);\n\t if (cmp === 0) {\n\t // Found the element we are looking for.\n\t return mid;\n\t }\n\t else if (cmp > 0) {\n\t // Our needle is greater than aHaystack[mid].\n\t if (aHigh - mid > 1) {\n\t // The element is in the upper half.\n\t return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // The exact needle element was not found in this haystack. Determine if\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return aHigh < aHaystack.length ? aHigh : -1;\n\t } else {\n\t return mid;\n\t }\n\t }\n\t else {\n\t // Our needle is less than aHaystack[mid].\n\t if (mid - aLow > 1) {\n\t // The element is in the lower half.\n\t return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return mid;\n\t } else {\n\t return aLow < 0 ? -1 : aLow;\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * This is an implementation of binary search which will always try and return\n\t * the index of the closest element if there is no exact hit. This is because\n\t * mappings between original and generated line/col pairs are single points,\n\t * and there is an implicit region between each of them, so a miss just means\n\t * that you aren't on the very start of a region.\n\t *\n\t * @param aNeedle The element you are looking for.\n\t * @param aHaystack The array that is being searched.\n\t * @param aCompare A function which takes the needle and an element in the\n\t * array and returns -1, 0, or 1 depending on whether the needle is less\n\t * than, equal to, or greater than the element, respectively.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n\t */\n\texports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n\t if (aHaystack.length === 0) {\n\t return -1;\n\t }\n\t\n\t var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n\t aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n\t if (index < 0) {\n\t return -1;\n\t }\n\t\n\t // We have found either the exact element, or the next-closest element than\n\t // the one we are searching for. However, there may be more than one such\n\t // element. Make sure we always return the smallest of these.\n\t while (index - 1 >= 0) {\n\t if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n\t break;\n\t }\n\t --index;\n\t }\n\t\n\t return index;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t// It turns out that some (most?) JavaScript engines don't self-host\n\t// `Array.prototype.sort`. This makes sense because C++ will likely remain\n\t// faster than JS when doing raw CPU-intensive sorting. However, when using a\n\t// custom comparator function, calling back and forth between the VM's C++ and\n\t// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n\t// worse generated code for the comparator function than would be optimal. In\n\t// fact, when sorting with a comparator, these costs outweigh the benefits of\n\t// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n\t// a ~3500ms mean speed-up in `bench/bench.html`.\n\t\n\t/**\n\t * Swap the elements indexed by `x` and `y` in the array `ary`.\n\t *\n\t * @param {Array} ary\n\t * The array.\n\t * @param {Number} x\n\t * The index of the first item.\n\t * @param {Number} y\n\t * The index of the second item.\n\t */\n\tfunction swap(ary, x, y) {\n\t var temp = ary[x];\n\t ary[x] = ary[y];\n\t ary[y] = temp;\n\t}\n\t\n\t/**\n\t * Returns a random integer within the range `low .. high` inclusive.\n\t *\n\t * @param {Number} low\n\t * The lower bound on the range.\n\t * @param {Number} high\n\t * The upper bound on the range.\n\t */\n\tfunction randomIntInRange(low, high) {\n\t return Math.round(low + (Math.random() * (high - low)));\n\t}\n\t\n\t/**\n\t * The Quick Sort algorithm.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t * @param {Number} p\n\t * Start index of the array\n\t * @param {Number} r\n\t * End index of the array\n\t */\n\tfunction doQuickSort(ary, comparator, p, r) {\n\t // If our lower bound is less than our upper bound, we (1) partition the\n\t // array into two pieces and (2) recurse on each half. If it is not, this is\n\t // the empty array and our base case.\n\t\n\t if (p < r) {\n\t // (1) Partitioning.\n\t //\n\t // The partitioning chooses a pivot between `p` and `r` and moves all\n\t // elements that are less than or equal to the pivot to the before it, and\n\t // all the elements that are greater than it after it. The effect is that\n\t // once partition is done, the pivot is in the exact place it will be when\n\t // the array is put in sorted order, and it will not need to be moved\n\t // again. This runs in O(n) time.\n\t\n\t // Always choose a random pivot so that an input array which is reverse\n\t // sorted does not cause O(n^2) running time.\n\t var pivotIndex = randomIntInRange(p, r);\n\t var i = p - 1;\n\t\n\t swap(ary, pivotIndex, r);\n\t var pivot = ary[r];\n\t\n\t // Immediately after `j` is incremented in this loop, the following hold\n\t // true:\n\t //\n\t // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n\t //\n\t // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n\t for (var j = p; j < r; j++) {\n\t if (comparator(ary[j], pivot) <= 0) {\n\t i += 1;\n\t swap(ary, i, j);\n\t }\n\t }\n\t\n\t swap(ary, i + 1, j);\n\t var q = i + 1;\n\t\n\t // (2) Recurse on each half.\n\t\n\t doQuickSort(ary, comparator, p, q - 1);\n\t doQuickSort(ary, comparator, q + 1, r);\n\t }\n\t}\n\t\n\t/**\n\t * Sort the given array in-place with the given comparator function.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t */\n\texports.quickSort = function (ary, comparator) {\n\t doQuickSort(ary, comparator, 0, ary.length - 1);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;\n\tvar util = __webpack_require__(4);\n\t\n\t// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n\t// operating systems these days (capturing the result).\n\tvar REGEX_NEWLINE = /(\\r?\\n)/;\n\t\n\t// Newline character code for charCodeAt() comparisons\n\tvar NEWLINE_CODE = 10;\n\t\n\t// Private symbol for identifying `SourceNode`s when multiple versions of\n\t// the source-map library are loaded. This MUST NOT CHANGE across\n\t// versions!\n\tvar isSourceNode = \"$$$isSourceNode$$$\";\n\t\n\t/**\n\t * SourceNodes provide a way to abstract over interpolating/concatenating\n\t * snippets of generated JavaScript source code while maintaining the line and\n\t * column information associated with the original source code.\n\t *\n\t * @param aLine The original line number.\n\t * @param aColumn The original column number.\n\t * @param aSource The original source's filename.\n\t * @param aChunks Optional. An array of strings which are snippets of\n\t * generated JS, or other SourceNodes.\n\t * @param aName The original identifier.\n\t */\n\tfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n\t this.children = [];\n\t this.sourceContents = {};\n\t this.line = aLine == null ? null : aLine;\n\t this.column = aColumn == null ? null : aColumn;\n\t this.source = aSource == null ? null : aSource;\n\t this.name = aName == null ? null : aName;\n\t this[isSourceNode] = true;\n\t if (aChunks != null) this.add(aChunks);\n\t}\n\t\n\t/**\n\t * Creates a SourceNode from generated code and a SourceMapConsumer.\n\t *\n\t * @param aGeneratedCode The generated code\n\t * @param aSourceMapConsumer The SourceMap for the generated code\n\t * @param aRelativePath Optional. The path that relative sources in the\n\t * SourceMapConsumer should be relative to.\n\t */\n\tSourceNode.fromStringWithSourceMap =\n\t function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n\t // The SourceNode we want to fill with the generated code\n\t // and the SourceMap\n\t var node = new SourceNode();\n\t\n\t // All even indices of this array are one line of the generated code,\n\t // while all odd indices are the newlines between two adjacent lines\n\t // (since `REGEX_NEWLINE` captures its match).\n\t // Processed fragments are accessed by calling `shiftNextLine`.\n\t var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n\t var remainingLinesIndex = 0;\n\t var shiftNextLine = function() {\n\t var lineContents = getNextLine();\n\t // The last line of a file might not have a newline.\n\t var newLine = getNextLine() || \"\";\n\t return lineContents + newLine;\n\t\n\t function getNextLine() {\n\t return remainingLinesIndex < remainingLines.length ?\n\t remainingLines[remainingLinesIndex++] : undefined;\n\t }\n\t };\n\t\n\t // We need to remember the position of \"remainingLines\"\n\t var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\t\n\t // The generate SourceNodes we need a code range.\n\t // To extract it current and last mapping is used.\n\t // Here we store the last mapping.\n\t var lastMapping = null;\n\t\n\t aSourceMapConsumer.eachMapping(function (mapping) {\n\t if (lastMapping !== null) {\n\t // We add the code from \"lastMapping\" to \"mapping\":\n\t // First check if there is a new line in between.\n\t if (lastGeneratedLine < mapping.generatedLine) {\n\t // Associate first line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t lastGeneratedLine++;\n\t lastGeneratedColumn = 0;\n\t // The remaining code is added without mapping\n\t } else {\n\t // There is no new line in between.\n\t // Associate the code between \"lastGeneratedColumn\" and\n\t // \"mapping.generatedColumn\" with \"lastMapping\"\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t var code = nextLine.substr(0, mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t addMappingWithCode(lastMapping, code);\n\t // No more remaining code, continue\n\t lastMapping = mapping;\n\t return;\n\t }\n\t }\n\t // We add the generated code until the first mapping\n\t // to the SourceNode without any mapping.\n\t // Each line is added as separate string.\n\t while (lastGeneratedLine < mapping.generatedLine) {\n\t node.add(shiftNextLine());\n\t lastGeneratedLine++;\n\t }\n\t if (lastGeneratedColumn < mapping.generatedColumn) {\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t node.add(nextLine.substr(0, mapping.generatedColumn));\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t }\n\t lastMapping = mapping;\n\t }, this);\n\t // We have processed all mappings.\n\t if (remainingLinesIndex < remainingLines.length) {\n\t if (lastMapping) {\n\t // Associate the remaining code in the current line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t }\n\t // and add the remaining lines without any mapping\n\t node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n\t }\n\t\n\t // Copy sourcesContent into SourceNode\n\t aSourceMapConsumer.sources.forEach(function (sourceFile) {\n\t var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\t if (content != null) {\n\t if (aRelativePath != null) {\n\t sourceFile = util.join(aRelativePath, sourceFile);\n\t }\n\t node.setSourceContent(sourceFile, content);\n\t }\n\t });\n\t\n\t return node;\n\t\n\t function addMappingWithCode(mapping, code) {\n\t if (mapping === null || mapping.source === undefined) {\n\t node.add(code);\n\t } else {\n\t var source = aRelativePath\n\t ? util.join(aRelativePath, mapping.source)\n\t : mapping.source;\n\t node.add(new SourceNode(mapping.originalLine,\n\t mapping.originalColumn,\n\t source,\n\t code,\n\t mapping.name));\n\t }\n\t }\n\t };\n\t\n\t/**\n\t * Add a chunk of generated JS to this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.add = function SourceNode_add(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t aChunk.forEach(function (chunk) {\n\t this.add(chunk);\n\t }, this);\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t if (aChunk) {\n\t this.children.push(aChunk);\n\t }\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a chunk of generated JS to the beginning of this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t for (var i = aChunk.length-1; i >= 0; i--) {\n\t this.prepend(aChunk[i]);\n\t }\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t this.children.unshift(aChunk);\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Walk over the tree of JS snippets in this node and its children. The\n\t * walking function is called once for each snippet of JS and is passed that\n\t * snippet and the its original associated source's line/column location.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n\t var chunk;\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t chunk = this.children[i];\n\t if (chunk[isSourceNode]) {\n\t chunk.walk(aFn);\n\t }\n\t else {\n\t if (chunk !== '') {\n\t aFn(chunk, { source: this.source,\n\t line: this.line,\n\t column: this.column,\n\t name: this.name });\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n\t * each of `this.children`.\n\t *\n\t * @param aSep The separator.\n\t */\n\tSourceNode.prototype.join = function SourceNode_join(aSep) {\n\t var newChildren;\n\t var i;\n\t var len = this.children.length;\n\t if (len > 0) {\n\t newChildren = [];\n\t for (i = 0; i < len-1; i++) {\n\t newChildren.push(this.children[i]);\n\t newChildren.push(aSep);\n\t }\n\t newChildren.push(this.children[i]);\n\t this.children = newChildren;\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Call String.prototype.replace on the very right-most source snippet. Useful\n\t * for trimming whitespace from the end of a source node, etc.\n\t *\n\t * @param aPattern The pattern to replace.\n\t * @param aReplacement The thing to replace the pattern with.\n\t */\n\tSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n\t var lastChild = this.children[this.children.length - 1];\n\t if (lastChild[isSourceNode]) {\n\t lastChild.replaceRight(aPattern, aReplacement);\n\t }\n\t else if (typeof lastChild === 'string') {\n\t this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n\t }\n\t else {\n\t this.children.push(''.replace(aPattern, aReplacement));\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Set the source content for a source file. This will be added to the SourceMapGenerator\n\t * in the sourcesContent field.\n\t *\n\t * @param aSourceFile The filename of the source file\n\t * @param aSourceContent The content of the source file\n\t */\n\tSourceNode.prototype.setSourceContent =\n\t function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n\t this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n\t };\n\t\n\t/**\n\t * Walk over the tree of SourceNodes. The walking function is called for each\n\t * source file content and is passed the filename and source content.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walkSourceContents =\n\t function SourceNode_walkSourceContents(aFn) {\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t if (this.children[i][isSourceNode]) {\n\t this.children[i].walkSourceContents(aFn);\n\t }\n\t }\n\t\n\t var sources = Object.keys(this.sourceContents);\n\t for (var i = 0, len = sources.length; i < len; i++) {\n\t aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n\t }\n\t };\n\t\n\t/**\n\t * Return the string representation of this source node. Walks over the tree\n\t * and concatenates all the various snippets together to one string.\n\t */\n\tSourceNode.prototype.toString = function SourceNode_toString() {\n\t var str = \"\";\n\t this.walk(function (chunk) {\n\t str += chunk;\n\t });\n\t return str;\n\t};\n\t\n\t/**\n\t * Returns the string representation of this source node along with a source\n\t * map.\n\t */\n\tSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n\t var generated = {\n\t code: \"\",\n\t line: 1,\n\t column: 0\n\t };\n\t var map = new SourceMapGenerator(aArgs);\n\t var sourceMappingActive = false;\n\t var lastOriginalSource = null;\n\t var lastOriginalLine = null;\n\t var lastOriginalColumn = null;\n\t var lastOriginalName = null;\n\t this.walk(function (chunk, original) {\n\t generated.code += chunk;\n\t if (original.source !== null\n\t && original.line !== null\n\t && original.column !== null) {\n\t if(lastOriginalSource !== original.source\n\t || lastOriginalLine !== original.line\n\t || lastOriginalColumn !== original.column\n\t || lastOriginalName !== original.name) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t lastOriginalSource = original.source;\n\t lastOriginalLine = original.line;\n\t lastOriginalColumn = original.column;\n\t lastOriginalName = original.name;\n\t sourceMappingActive = true;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t }\n\t });\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t }\n\t for (var idx = 0, length = chunk.length; idx < length; idx++) {\n\t if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n\t generated.line++;\n\t generated.column = 0;\n\t // Mappings end at eol\n\t if (idx + 1 === length) {\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t } else {\n\t generated.column++;\n\t }\n\t }\n\t });\n\t this.walkSourceContents(function (sourceFile, sourceContent) {\n\t map.setSourceContent(sourceFile, sourceContent);\n\t });\n\t\n\t return { code: generated.code, map: map };\n\t};\n\t\n\texports.SourceNode = SourceNode;\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// source-map.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0fd5815da764db5fb9fe","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./source-map.js\n// module id = 0\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-generator.js\n// module id = 1\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64-vlq.js\n// module id = 2\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64.js\n// module id = 3\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/util.js\n// module id = 4\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/array-set.js\n// module id = 5\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/mapping-list.js\n// module id = 6\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-consumer.js\n// module id = 7\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/binary-search.js\n// module id = 8\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/quick-sort.js\n// module id = 9\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-node.js\n// module id = 10\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/source-map/lib/array-set.js b/node_modules/source-map/lib/array-set.js deleted file mode 100644 index fbd5c81..0000000 --- a/node_modules/source-map/lib/array-set.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var has = Object.prototype.hasOwnProperty; -var hasNativeMap = typeof Map !== "undefined"; - -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); -} - -/** - * Static method for creating ArraySet instances from an existing array. - */ -ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; -}; - -/** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ -ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; -}; - -/** - * Add the given string to this set. - * - * @param String aStr - */ -ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } -}; - -/** - * Is the given string a member of this set? - * - * @param String aStr - */ -ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } -}; - -/** - * What is the index of the given string in the array? - * - * @param String aStr - */ -ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); -}; - -/** - * What is the element at the given index? - * - * @param Number aIdx - */ -ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); -}; - -/** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ -ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); -}; - -exports.ArraySet = ArraySet; diff --git a/node_modules/source-map/lib/base64-vlq.js b/node_modules/source-map/lib/base64-vlq.js deleted file mode 100644 index 612b404..0000000 --- a/node_modules/source-map/lib/base64-vlq.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var base64 = require('./base64'); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -var VLQ_BASE_SHIFT = 5; - -// binary: 100000 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -var VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -var VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} - -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - -/** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; -}; diff --git a/node_modules/source-map/lib/base64.js b/node_modules/source-map/lib/base64.js deleted file mode 100644 index 8aa86b3..0000000 --- a/node_modules/source-map/lib/base64.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - -/** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ -exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; -}; diff --git a/node_modules/source-map/lib/binary-search.js b/node_modules/source-map/lib/binary-search.js deleted file mode 100644 index 010ac94..0000000 --- a/node_modules/source-map/lib/binary-search.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; diff --git a/node_modules/source-map/lib/mapping-list.js b/node_modules/source-map/lib/mapping-list.js deleted file mode 100644 index 06d1274..0000000 --- a/node_modules/source-map/lib/mapping-list.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ -function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; -} - -/** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ -MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - -/** - * Add the given source mapping. - * - * @param Object aMapping - */ -MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } -}; - -/** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ -MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; -}; - -exports.MappingList = MappingList; diff --git a/node_modules/source-map/lib/quick-sort.js b/node_modules/source-map/lib/quick-sort.js deleted file mode 100644 index 6a7caad..0000000 --- a/node_modules/source-map/lib/quick-sort.js +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -// It turns out that some (most?) JavaScript engines don't self-host -// `Array.prototype.sort`. This makes sense because C++ will likely remain -// faster than JS when doing raw CPU-intensive sorting. However, when using a -// custom comparator function, calling back and forth between the VM's C++ and -// JIT'd JS is rather slow *and* loses JIT type information, resulting in -// worse generated code for the comparator function than would be optimal. In -// fact, when sorting with a comparator, these costs outweigh the benefits of -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get -// a ~3500ms mean speed-up in `bench/bench.html`. - -/** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ -function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; -} - -/** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ -function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); -} - -/** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ -function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } -} - -/** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ -exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); -}; diff --git a/node_modules/source-map/lib/source-map-consumer.js b/node_modules/source-map/lib/source-map-consumer.js deleted file mode 100644 index 7b99d1d..0000000 --- a/node_modules/source-map/lib/source-map-consumer.js +++ /dev/null @@ -1,1145 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var binarySearch = require('./binary-search'); -var ArraySet = require('./array-set').ArraySet; -var base64VLQ = require('./base64-vlq'); -var quickSort = require('./quick-sort').quickSort; - -function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); -} - -SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; - -// `__generatedMappings` and `__originalMappings` are arrays that hold the -// parsed mapping coordinates from the source map's "mappings" attribute. They -// are lazily instantiated, accessed via the `_generatedMappings` and -// `_originalMappings` getters respectively, and we only parse the mappings -// and create these arrays once queried for a source location. We jump through -// these hoops because there can be many thousands of mappings, and parsing -// them is expensive, so we only want to do it if we must. -// -// Each object in the arrays is of the form: -// -// { -// generatedLine: The line number in the generated code, -// generatedColumn: The column number in the generated code, -// source: The path to the original source file that generated this -// chunk of code, -// originalLine: The line number in the original source that -// corresponds to this chunk of generated code, -// originalColumn: The column number in the original source that -// corresponds to this chunk of generated code, -// name: The name of the original symbol which generated this chunk of -// code. -// } -// -// All properties except for `generatedLine` and `generatedColumn` can be -// `null`. -// -// `_generatedMappings` is ordered by the generated positions. -// -// `_originalMappings` is ordered by the original positions. - -SourceMapConsumer.prototype.__generatedMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } -}); - -SourceMapConsumer.prototype.__originalMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } -}); - -SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -/** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ -SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - -/** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; -} - -BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - -/** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ -BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; -}; - -/** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ -BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - -/** - * The version of the source mapping spec that we are consuming. - */ -BasicSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } -}); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - -/** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ -BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - -/** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ -BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); -} - -IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - -/** - * The version of the source mapping spec that we are consuming. - */ -IndexedSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } -}); - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/node_modules/source-map/lib/source-map-generator.js b/node_modules/source-map/lib/source-map-generator.js deleted file mode 100644 index 508bcfb..0000000 --- a/node_modules/source-map/lib/source-map-generator.js +++ /dev/null @@ -1,425 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var base64VLQ = require('./base64-vlq'); -var util = require('./util'); -var ArraySet = require('./array-set').ArraySet; -var MappingList = require('./mapping-list').MappingList; - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; -} - -SourceMapGenerator.prototype._version = 3; - -/** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ -SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - -/** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ -SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - -/** - * Set the source content for a source file. - */ -SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - -/** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ -SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - -/** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ -SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - -/** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ -SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - -SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - -/** - * Externalize the source map. - */ -SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - -/** - * Render the source map being generated to a string. - */ -SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - -exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/source-map/lib/source-node.js b/node_modules/source-map/lib/source-node.js deleted file mode 100644 index 8bcdbe3..0000000 --- a/node_modules/source-map/lib/source-node.js +++ /dev/null @@ -1,413 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; -var util = require('./util'); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -var REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -var NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -var isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); -} - -/** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ -SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - -/** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } -}; - -/** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ -SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; -}; - -/** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ -SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; -}; - -/** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ -SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - -/** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - -/** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ -SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; -}; - -/** - * Returns the string representation of this source node along with a source - * map. - */ -SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; -}; - -exports.SourceNode = SourceNode; diff --git a/node_modules/source-map/lib/util.js b/node_modules/source-map/lib/util.js deleted file mode 100644 index 3ca92e5..0000000 --- a/node_modules/source-map/lib/util.js +++ /dev/null @@ -1,488 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } -} -exports.getArg = getArg; - -var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -var dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -} -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); -}()); - -function identity (s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); -} -exports.parseSourceMapInput = parseSourceMapInput; - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); -} -exports.computeSourceURL = computeSourceURL; diff --git a/node_modules/source-map/package.json b/node_modules/source-map/package.json deleted file mode 100644 index 67bbe0a..0000000 --- a/node_modules/source-map/package.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "_from": "source-map@^0.6.0", - "_id": "source-map@0.6.1", - "_inBundle": false, - "_integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "_location": "/source-map", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "source-map@^0.6.0", - "name": "source-map", - "escapedName": "source-map", - "rawSpec": "^0.6.0", - "saveSpec": null, - "fetchSpec": "^0.6.0" - }, - "_requiredBy": [ - "/source-map-support" - ], - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "_shasum": "74722af32e9614e9c287a8d0bbde48b5e2f1a263", - "_spec": "source-map@^0.6.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/source-map-support", - "author": { - "name": "Nick Fitzgerald", - "email": "nfitzgerald@mozilla.com" - }, - "bugs": { - "url": "https://github.com/mozilla/source-map/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Tobias Koppers", - "email": "tobias.koppers@googlemail.com" - }, - { - "name": "Duncan Beevers", - "email": "duncan@dweebd.com" - }, - { - "name": "Stephen Crane", - "email": "scrane@mozilla.com" - }, - { - "name": "Ryan Seddon", - "email": "seddon.ryan@gmail.com" - }, - { - "name": "Miles Elam", - "email": "miles.elam@deem.com" - }, - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com" - }, - { - "name": "Michael Ficarra", - "email": "github.public.email@michael.ficarra.me" - }, - { - "name": "Todd Wolfson", - "email": "todd@twolfson.com" - }, - { - "name": "Alexander Solovyov", - "email": "alexander@solovyov.net" - }, - { - "name": "Felix Gnass", - "email": "fgnass@gmail.com" - }, - { - "name": "Conrad Irwin", - "email": "conrad.irwin@gmail.com" - }, - { - "name": "usrbincc", - "email": "usrbincc@yahoo.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Chase Douglas", - "email": "chase@newrelic.com" - }, - { - "name": "Evan Wallace", - "email": "evan.exe@gmail.com" - }, - { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Simon Lydell", - "email": "simon.lydell@gmail.com" - }, - { - "name": "Jmeas Smith", - "email": "jellyes2@gmail.com" - }, - { - "name": "Michael Z Goddard", - "email": "mzgoddard@gmail.com" - }, - { - "name": "azu", - "email": "azu@users.noreply.github.com" - }, - { - "name": "John Gozde", - "email": "john@gozde.ca" - }, - { - "name": "Adam Kirkton", - "email": "akirkton@truefitinnovation.com" - }, - { - "name": "Chris Montgomery", - "email": "christopher.montgomery@dowjones.com" - }, - { - "name": "J. Ryan Stinnett", - "email": "jryans@gmail.com" - }, - { - "name": "Jack Herrington", - "email": "jherrington@walmartlabs.com" - }, - { - "name": "Chris Truter", - "email": "jeffpalentine@gmail.com" - }, - { - "name": "Daniel Espeset", - "email": "daniel@danielespeset.com" - }, - { - "name": "Jamie Wong", - "email": "jamie.lf.wong@gmail.com" - }, - { - "name": "Eddy Bruël", - "email": "ejpbruel@mozilla.com" - }, - { - "name": "Hawken Rives", - "email": "hawkrives@gmail.com" - }, - { - "name": "Gilad Peleg", - "email": "giladp007@gmail.com" - }, - { - "name": "djchie", - "email": "djchie.dev@gmail.com" - }, - { - "name": "Gary Ye", - "email": "garysye@gmail.com" - }, - { - "name": "Nicolas Lalevée", - "email": "nicolas.lalevee@hibnet.org" - } - ], - "deprecated": false, - "description": "Generates and consumes source maps", - "devDependencies": { - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "source-map.js", - "source-map.d.ts", - "lib/", - "dist/source-map.debug.js", - "dist/source-map.js", - "dist/source-map.min.js", - "dist/source-map.min.js.map" - ], - "homepage": "https://github.com/mozilla/source-map", - "license": "BSD-3-Clause", - "main": "./source-map.js", - "name": "source-map", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/mozilla/source-map.git" - }, - "scripts": { - "build": "webpack --color", - "test": "npm run build && node test/run-tests.js", - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" - }, - "typings": "source-map", - "version": "0.6.1" -} diff --git a/node_modules/source-map/source-map.d.ts b/node_modules/source-map/source-map.d.ts deleted file mode 100644 index 8f972b0..0000000 --- a/node_modules/source-map/source-map.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -export interface StartOfSourceMap { - file?: string; - sourceRoot?: string; -} - -export interface RawSourceMap extends StartOfSourceMap { - version: string; - sources: string[]; - names: string[]; - sourcesContent?: string[]; - mappings: string; -} - -export interface Position { - line: number; - column: number; -} - -export interface LineRange extends Position { - lastColumn: number; -} - -export interface FindPosition extends Position { - // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND - bias?: number; -} - -export interface SourceFindPosition extends FindPosition { - source: string; -} - -export interface MappedPosition extends Position { - source: string; - name?: string; -} - -export interface MappingItem { - source: string; - generatedLine: number; - generatedColumn: number; - originalLine: number; - originalColumn: number; - name: string; -} - -export class SourceMapConsumer { - static GENERATED_ORDER: number; - static ORIGINAL_ORDER: number; - - static GREATEST_LOWER_BOUND: number; - static LEAST_UPPER_BOUND: number; - - constructor(rawSourceMap: RawSourceMap); - computeColumnSpans(): void; - originalPositionFor(generatedPosition: FindPosition): MappedPosition; - generatedPositionFor(originalPosition: SourceFindPosition): LineRange; - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; - hasContentsOfAllSources(): boolean; - sourceContentFor(source: string, returnNullOnMissing?: boolean): string; - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; -} - -export interface Mapping { - generated: Position; - original: Position; - source: string; - name?: string; -} - -export class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; - addMapping(mapping: Mapping): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - toString(): string; -} - -export interface CodeWithSourceMap { - code: string; - map: SourceMapGenerator; -} - -export class SourceNode { - constructor(); - constructor(line: number, column: number, source: string); - constructor(line: number, column: number, source: string, chunk?: string, name?: string); - static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; - add(chunk: string): void; - prepend(chunk: string): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - walk(fn: (chunk: string, mapping: MappedPosition) => void): void; - walkSourceContents(fn: (file: string, content: string) => void): void; - join(sep: string): SourceNode; - replaceRight(pattern: string, replacement: string): SourceNode; - toString(): string; - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; -} diff --git a/node_modules/source-map/source-map.js b/node_modules/source-map/source-map.js deleted file mode 100644 index bc88fe8..0000000 --- a/node_modules/source-map/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/spdx-correct/package.json b/node_modules/spdx-correct/package.json index 7a81ce0..91fdc87 100644 --- a/node_modules/spdx-correct/package.json +++ b/node_modules/spdx-correct/package.json @@ -1,27 +1,33 @@ { - "_from": "spdx-correct@^3.0.0", + "_args": [ + [ + "spdx-correct@3.1.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "spdx-correct@3.1.0", "_id": "spdx-correct@3.1.0", "_inBundle": false, "_integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "_location": "/spdx-correct", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "spdx-correct@^3.0.0", + "raw": "spdx-correct@3.1.0", "name": "spdx-correct", "escapedName": "spdx-correct", - "rawSpec": "^3.0.0", + "rawSpec": "3.1.0", "saveSpec": null, - "fetchSpec": "^3.0.0" + "fetchSpec": "3.1.0" }, "_requiredBy": [ "/validate-npm-package-license" ], "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "_shasum": "fb83e504445268f154b074e218c87c003cd31df4", - "_spec": "spdx-correct@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/validate-npm-package-license", + "_spec": "3.1.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Kyle E. Mitchell", "email": "kyle@kemitchell.com", @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/jslicense/spdx-correct.js/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Kyle E. Mitchell", @@ -54,7 +59,6 @@ "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" }, - "deprecated": false, "description": "correct invalid SPDX expressions", "devDependencies": { "defence-cli": "^2.0.1", diff --git a/node_modules/spdx-exceptions/package.json b/node_modules/spdx-exceptions/package.json index bb07fc2..39eadad 100644 --- a/node_modules/spdx-exceptions/package.json +++ b/node_modules/spdx-exceptions/package.json @@ -1,34 +1,39 @@ { - "_from": "spdx-exceptions@^2.1.0", + "_args": [ + [ + "spdx-exceptions@2.2.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "spdx-exceptions@2.2.0", "_id": "spdx-exceptions@2.2.0", "_inBundle": false, "_integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "_location": "/spdx-exceptions", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "spdx-exceptions@^2.1.0", + "raw": "spdx-exceptions@2.2.0", "name": "spdx-exceptions", "escapedName": "spdx-exceptions", - "rawSpec": "^2.1.0", + "rawSpec": "2.2.0", "saveSpec": null, - "fetchSpec": "^2.1.0" + "fetchSpec": "2.2.0" }, "_requiredBy": [ "/spdx-expression-parse" ], "_resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "_shasum": "2ea450aee74f2a89bfb94519c07fcd6f41322977", - "_spec": "spdx-exceptions@^2.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/spdx-expression-parse", + "_spec": "2.2.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "The Linux Foundation" }, "bugs": { "url": "https://github.com/kemitchell/spdx-exceptions.json/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Kyle E. Mitchell", @@ -36,7 +41,6 @@ "url": "https://kemitchell.com/" } ], - "deprecated": false, "description": "list of SPDX standard license exceptions", "homepage": "https://github.com/kemitchell/spdx-exceptions.json#readme", "license": "CC-BY-3.0", diff --git a/node_modules/spdx-expression-parse/package.json b/node_modules/spdx-expression-parse/package.json index 2c4a86b..0db7ed9 100644 --- a/node_modules/spdx-expression-parse/package.json +++ b/node_modules/spdx-expression-parse/package.json @@ -1,28 +1,34 @@ { - "_from": "spdx-expression-parse@^3.0.0", + "_args": [ + [ + "spdx-expression-parse@3.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "spdx-expression-parse@3.0.0", "_id": "spdx-expression-parse@3.0.0", "_inBundle": false, "_integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "_location": "/spdx-expression-parse", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "spdx-expression-parse@^3.0.0", + "raw": "spdx-expression-parse@3.0.0", "name": "spdx-expression-parse", "escapedName": "spdx-expression-parse", - "rawSpec": "^3.0.0", + "rawSpec": "3.0.0", "saveSpec": null, - "fetchSpec": "^3.0.0" + "fetchSpec": "3.0.0" }, "_requiredBy": [ "/spdx-correct", "/validate-npm-package-license" ], "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "_shasum": "99e119b7a5da00e05491c9fa338b7904823b41d0", - "_spec": "spdx-expression-parse@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/validate-npm-package-license", + "_spec": "3.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Kyle E. Mitchell", "email": "kyle@kemitchell.com", @@ -31,7 +37,6 @@ "bugs": { "url": "https://github.com/jslicense/spdx-expression-parse.js/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "C. Scott Ananian", @@ -56,7 +61,6 @@ "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" }, - "deprecated": false, "description": "parse SPDX license expressions", "devDependencies": { "defence-cli": "^2.0.1", diff --git a/node_modules/spdx-license-ids/package.json b/node_modules/spdx-license-ids/package.json index af2ae77..39f2723 100644 --- a/node_modules/spdx-license-ids/package.json +++ b/node_modules/spdx-license-ids/package.json @@ -1,28 +1,34 @@ { - "_from": "spdx-license-ids@^3.0.0", + "_args": [ + [ + "spdx-license-ids@3.0.3", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "spdx-license-ids@3.0.3", "_id": "spdx-license-ids@3.0.3", "_inBundle": false, "_integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", "_location": "/spdx-license-ids", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "spdx-license-ids@^3.0.0", + "raw": "spdx-license-ids@3.0.3", "name": "spdx-license-ids", "escapedName": "spdx-license-ids", - "rawSpec": "^3.0.0", + "rawSpec": "3.0.3", "saveSpec": null, - "fetchSpec": "^3.0.0" + "fetchSpec": "3.0.3" }, "_requiredBy": [ "/spdx-correct", "/spdx-expression-parse" ], "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "_shasum": "81c0ce8f21474756148bbb5f3bfc0f36bf15d76e", - "_spec": "spdx-license-ids@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/spdx-correct", + "_spec": "3.0.3", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Shinnosuke Watanabe", "url": "https://github.com/shinnn" @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/shinnn/spdx-license-ids/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "A list of SPDX license identifiers", "devDependencies": { "@shinnn/eslint-config": "^6.8.7", diff --git a/node_modules/speedometer/package.json b/node_modules/speedometer/package.json index 3d36340..6a901e2 100644 --- a/node_modules/speedometer/package.json +++ b/node_modules/speedometer/package.json @@ -1,27 +1,33 @@ { - "_from": "speedometer@~0.1.2", + "_args": [ + [ + "speedometer@0.1.4", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "speedometer@0.1.4", "_id": "speedometer@0.1.4", "_inBundle": false, "_integrity": "sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0=", "_location": "/speedometer", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "speedometer@~0.1.2", + "raw": "speedometer@0.1.4", "name": "speedometer", "escapedName": "speedometer", - "rawSpec": "~0.1.2", + "rawSpec": "0.1.4", "saveSpec": null, - "fetchSpec": "~0.1.2" + "fetchSpec": "0.1.4" }, "_requiredBy": [ "/progress-stream" ], "_resolved": "https://registry.npmjs.org/speedometer/-/speedometer-0.1.4.tgz", - "_shasum": "9876dbd2a169d3115402d48e6ea6329c8816a50d", - "_spec": "speedometer@~0.1.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/progress-stream", + "_spec": "0.1.4", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mathias Buus Madsen", "email": "mathiasbuus@gmail.com" @@ -29,8 +35,6 @@ "bugs": { "url": "https://github.com/mafintosh/speedometer/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "simple speed measurement in javascript", "homepage": "https://github.com/mafintosh/speedometer#readme", "keywords": [ diff --git a/node_modules/sprintf-js/.npmignore b/node_modules/sprintf-js/.npmignore deleted file mode 100644 index 096746c..0000000 --- a/node_modules/sprintf-js/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ \ No newline at end of file diff --git a/node_modules/sprintf-js/LICENSE b/node_modules/sprintf-js/LICENSE deleted file mode 100644 index 663ac52..0000000 --- a/node_modules/sprintf-js/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2007-2014, Alexandru Marasteanu -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of this software nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/sprintf-js/README.md b/node_modules/sprintf-js/README.md deleted file mode 100644 index 8386356..0000000 --- a/node_modules/sprintf-js/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# sprintf.js -**sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. - -Its prototype is simple: - - string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) - -The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: - -* An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. -* An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. -* An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. -* An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. -* An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. -* An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. -* A type specifier that can be any of: - * `%` — yields a literal `%` character - * `b` — yields an integer as a binary number - * `c` — yields an integer as the character with that ASCII value - * `d` or `i` — yields an integer as a signed decimal number - * `e` — yields a float using scientific notation - * `u` — yields an integer as an unsigned decimal number - * `f` — yields a float as is; see notes on precision above - * `g` — yields a float as is; see notes on precision above - * `o` — yields an integer as an octal number - * `s` — yields a string as is - * `x` — yields an integer as a hexadecimal number (lower-case) - * `X` — yields an integer as a hexadecimal number (upper-case) - * `j` — yields a JavaScript object or array as a JSON encoded string - -## JavaScript `vsprintf` -`vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: - - vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) - -## Argument swapping -You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: - - sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") -And, of course, you can repeat the placeholders without having to increase the number of arguments. - -## Named arguments -Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: - - var user = { - name: "Dolly" - } - sprintf("Hello %(name)s", user) // Hello Dolly -Keywords in replacement fields can be optionally followed by any number of keywords or indexes: - - var users = [ - {name: "Dolly"}, - {name: "Molly"}, - {name: "Polly"} - ] - sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly -Note: mixing positional and named placeholders is not (yet) supported - -## Computed values -You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. - - sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 - sprintf("Current date and time: %s", function() { return new Date().toString() }) - -# AngularJS -You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. - -# Installation - -## Via Bower - - bower install sprintf - -## Or as a node.js module - - npm install sprintf-js - -### Usage - - var sprintf = require("sprintf-js").sprintf, - vsprintf = require("sprintf-js").vsprintf - - sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") - vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) - -# License - -**sprintf.js** is licensed under the terms of the 3-clause BSD license. diff --git a/node_modules/sprintf-js/bower.json b/node_modules/sprintf-js/bower.json deleted file mode 100644 index d90a759..0000000 --- a/node_modules/sprintf-js/bower.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "sprintf", - "description": "JavaScript sprintf implementation", - "version": "1.0.3", - "main": "src/sprintf.js", - "license": "BSD-3-Clause-Clear", - "keywords": ["sprintf", "string", "formatting"], - "authors": ["Alexandru Marasteanu (http://alexei.ro/)"], - "homepage": "https://github.com/alexei/sprintf.js", - "repository": { - "type": "git", - "url": "git://github.com/alexei/sprintf.js.git" - } -} diff --git a/node_modules/sprintf-js/demo/angular.html b/node_modules/sprintf-js/demo/angular.html deleted file mode 100644 index 3559efd..0000000 --- a/node_modules/sprintf-js/demo/angular.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - -
{{ "%+010d"|sprintf:-123 }}
-
{{ "%+010d"|vsprintf:[-123] }}
-
{{ "%+010d"|fmt:-123 }}
-
{{ "%+010d"|vfmt:[-123] }}
-
{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
-
{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
- - - - diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js b/node_modules/sprintf-js/dist/angular-sprintf.min.js deleted file mode 100644 index dbaf744..0000000 --- a/node_modules/sprintf-js/dist/angular-sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); -//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/node_modules/sprintf-js/dist/angular-sprintf.min.js.map deleted file mode 100644 index 055964c..0000000 --- a/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.map b/node_modules/sprintf-js/dist/angular-sprintf.min.map deleted file mode 100644 index 055964c..0000000 --- a/node_modules/sprintf-js/dist/angular-sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js b/node_modules/sprintf-js/dist/sprintf.min.js deleted file mode 100644 index dc61e51..0000000 --- a/node_modules/sprintf-js/dist/sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); -//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js.map b/node_modules/sprintf-js/dist/sprintf.min.js.map deleted file mode 100644 index 369dbaf..0000000 --- a/node_modules/sprintf-js/dist/sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN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GM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.map b/node_modules/sprintf-js/dist/sprintf.min.map deleted file mode 100644 index ee011aa..0000000 --- a/node_modules/sprintf-js/dist/sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,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M,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/gruntfile.js b/node_modules/sprintf-js/gruntfile.js deleted file mode 100644 index 246e1c3..0000000 --- a/node_modules/sprintf-js/gruntfile.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - - uglify: { - options: { - banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", - sourceMap: true - }, - build: { - files: [ - { - src: "src/sprintf.js", - dest: "dist/sprintf.min.js" - }, - { - src: "src/angular-sprintf.js", - dest: "dist/angular-sprintf.min.js" - } - ] - } - }, - - watch: { - js: { - files: "src/*.js", - tasks: ["uglify"] - } - } - }) - - grunt.loadNpmTasks("grunt-contrib-uglify") - grunt.loadNpmTasks("grunt-contrib-watch") - - grunt.registerTask("default", ["uglify", "watch"]) -} diff --git a/node_modules/sprintf-js/package.json b/node_modules/sprintf-js/package.json deleted file mode 100644 index f43b8ec..0000000 --- a/node_modules/sprintf-js/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_from": "sprintf-js@~1.0.2", - "_id": "sprintf-js@1.0.3", - "_inBundle": false, - "_integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "_location": "/sprintf-js", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "sprintf-js@~1.0.2", - "name": "sprintf-js", - "escapedName": "sprintf-js", - "rawSpec": "~1.0.2", - "saveSpec": null, - "fetchSpec": "~1.0.2" - }, - "_requiredBy": [ - "/argparse" - ], - "_resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "_shasum": "04e6926f662895354f3dd015203633b857297e2c", - "_spec": "sprintf-js@~1.0.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/argparse", - "author": { - "name": "Alexandru Marasteanu", - "email": "hello@alexei.ro", - "url": "http://alexei.ro/" - }, - "bugs": { - "url": "https://github.com/alexei/sprintf.js/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "JavaScript sprintf implementation", - "devDependencies": { - "grunt": "*", - "grunt-contrib-uglify": "*", - "grunt-contrib-watch": "*", - "mocha": "*" - }, - "homepage": "https://github.com/alexei/sprintf.js#readme", - "license": "BSD-3-Clause", - "main": "src/sprintf.js", - "name": "sprintf-js", - "repository": { - "type": "git", - "url": "git+https://github.com/alexei/sprintf.js.git" - }, - "scripts": { - "test": "mocha test/test.js" - }, - "version": "1.0.3" -} diff --git a/node_modules/sprintf-js/src/angular-sprintf.js b/node_modules/sprintf-js/src/angular-sprintf.js deleted file mode 100644 index 9c69123..0000000 --- a/node_modules/sprintf-js/src/angular-sprintf.js +++ /dev/null @@ -1,18 +0,0 @@ -angular. - module("sprintf", []). - filter("sprintf", function() { - return function() { - return sprintf.apply(null, arguments) - } - }). - filter("fmt", ["$filter", function($filter) { - return $filter("sprintf") - }]). - filter("vsprintf", function() { - return function(format, argv) { - return vsprintf(format, argv) - } - }). - filter("vfmt", ["$filter", function($filter) { - return $filter("vsprintf") - }]) diff --git a/node_modules/sprintf-js/src/sprintf.js b/node_modules/sprintf-js/src/sprintf.js deleted file mode 100644 index c0fc7c0..0000000 --- a/node_modules/sprintf-js/src/sprintf.js +++ /dev/null @@ -1,208 +0,0 @@ -(function(window) { - var re = { - not_string: /[^s]/, - number: /[diefg]/, - json: /[j]/, - not_json: /[^j]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[\+\-]/ - } - - function sprintf() { - var key = arguments[0], cache = sprintf.cache - if (!(cache[key] && cache.hasOwnProperty(key))) { - cache[key] = sprintf.parse(key) - } - return sprintf.format.call(null, cache[key], arguments) - } - - sprintf.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]) - if (node_type === "string") { - output[output.length] = parse_tree[i] - } - else if (node_type === "array") { - match = parse_tree[i] // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor] - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) - } - arg = arg[match[2][k]] - } - } - else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]] - } - else { // positional argument (implicit) - arg = argv[cursor++] - } - - if (get_type(arg) == "function") { - arg = arg() - } - - if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { - throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) - } - - if (re.number.test(match[8])) { - is_positive = arg >= 0 - } - - switch (match[8]) { - case "b": - arg = arg.toString(2) - break - case "c": - arg = String.fromCharCode(arg) - break - case "d": - case "i": - arg = parseInt(arg, 10) - break - case "j": - arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) - break - case "e": - arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() - break - case "f": - arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) - break - case "g": - arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) - break - case "o": - arg = arg.toString(8) - break - case "s": - arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) - break - case "u": - arg = arg >>> 0 - break - case "x": - arg = arg.toString(16) - break - case "X": - arg = arg.toString(16).toUpperCase() - break - } - if (re.json.test(match[8])) { - output[output.length] = arg - } - else { - if (re.number.test(match[8]) && (!is_positive || match[3])) { - sign = is_positive ? "+" : "-" - arg = arg.toString().replace(re.sign, "") - } - else { - sign = "" - } - pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " - pad_length = match[6] - (sign + arg).length - pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" - output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) - } - } - } - return output.join("") - } - - sprintf.cache = {} - - sprintf.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 - while (_fmt) { - if ((match = re.text.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = match[0] - } - else if ((match = re.modulo.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = "%" - } - else if ((match = re.placeholder.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1 - var field_list = [], replacement_field = match[2], field_match = [] - if ((field_match = re.key.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { - if ((field_match = re.key_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else if ((field_match = re.index_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - } - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - match[2] = field_list - } - else { - arg_names |= 2 - } - if (arg_names === 3) { - throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") - } - parse_tree[parse_tree.length] = match - } - else { - throw new SyntaxError("[sprintf] unexpected placeholder") - } - _fmt = _fmt.substring(match[0].length) - } - return parse_tree - } - - var vsprintf = function(fmt, argv, _argv) { - _argv = (argv || []).slice(0) - _argv.splice(0, 0, fmt) - return sprintf.apply(null, _argv) - } - - /** - * helpers - */ - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() - } - - function str_repeat(input, multiplier) { - return Array(multiplier + 1).join(input) - } - - /** - * export to either browser or node.js - */ - if (typeof exports !== "undefined") { - exports.sprintf = sprintf - exports.vsprintf = vsprintf - } - else { - window.sprintf = sprintf - window.vsprintf = vsprintf - - if (typeof define === "function" && define.amd) { - define(function() { - return { - sprintf: sprintf, - vsprintf: vsprintf - } - }) - } - } -})(typeof window === "undefined" ? this : window); diff --git a/node_modules/sprintf-js/test/test.js b/node_modules/sprintf-js/test/test.js deleted file mode 100644 index 6f57b25..0000000 --- a/node_modules/sprintf-js/test/test.js +++ /dev/null @@ -1,82 +0,0 @@ -var assert = require("assert"), - sprintfjs = require("../src/sprintf.js"), - sprintf = sprintfjs.sprintf, - vsprintf = sprintfjs.vsprintf - -describe("sprintfjs", function() { - var pi = 3.141592653589793 - - it("should return formated strings for simple placeholders", function() { - assert.equal("%", sprintf("%%")) - assert.equal("10", sprintf("%b", 2)) - assert.equal("A", sprintf("%c", 65)) - assert.equal("2", sprintf("%d", 2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("2", sprintf("%d", "2")) - assert.equal("2", sprintf("%i", "2")) - assert.equal('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) - assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) - assert.equal("2e+0", sprintf("%e", 2)) - assert.equal("2", sprintf("%u", 2)) - assert.equal("4294967294", sprintf("%u", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("3.141592653589793", sprintf("%g", pi)) - assert.equal("10", sprintf("%o", 8)) - assert.equal("%s", sprintf("%s", "%s")) - assert.equal("ff", sprintf("%x", 255)) - assert.equal("FF", sprintf("%X", 255)) - assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) - assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) - }) - - it("should return formated strings for complex placeholders", function() { - // sign - assert.equal("2", sprintf("%d", 2)) - assert.equal("-2", sprintf("%d", -2)) - assert.equal("+2", sprintf("%+d", 2)) - assert.equal("-2", sprintf("%+d", -2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("-2", sprintf("%i", -2)) - assert.equal("+2", sprintf("%+i", 2)) - assert.equal("-2", sprintf("%+i", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("-2.2", sprintf("%f", -2.2)) - assert.equal("+2.2", sprintf("%+f", 2.2)) - assert.equal("-2.2", sprintf("%+f", -2.2)) - assert.equal("-2.3", sprintf("%+.1f", -2.34)) - assert.equal("-0.0", sprintf("%+.1f", -0.01)) - assert.equal("3.14159", sprintf("%.6g", pi)) - assert.equal("3.14", sprintf("%.3g", pi)) - assert.equal("3", sprintf("%.1g", pi)) - assert.equal("-000000123", sprintf("%+010d", -123)) - assert.equal("______-123", sprintf("%+'_10d", -123)) - assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) - - // padding - assert.equal("-0002", sprintf("%05d", -2)) - assert.equal("-0002", sprintf("%05i", -2)) - assert.equal(" <", sprintf("%5s", "<")) - assert.equal("0000<", sprintf("%05s", "<")) - assert.equal("____<", sprintf("%'_5s", "<")) - assert.equal("> ", sprintf("%-5s", ">")) - assert.equal(">0000", sprintf("%0-5s", ">")) - assert.equal(">____", sprintf("%'_-5s", ">")) - assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) - assert.equal("1234", sprintf("%02u", 1234)) - assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) - assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) - assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) - assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) - - // precision - assert.equal("2.3", sprintf("%.1f", 2.345)) - assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) - assert.equal(" x", sprintf("%5.1s", "xxxxxx")) - - }) - - it("should return formated strings for callbacks", function() { - assert.equal("foobar", sprintf("%s", function() { return "foobar" })) - assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... - }) -}) diff --git a/node_modules/sshpk/package.json b/node_modules/sshpk/package.json index 9705cf3..b0a3388 100644 --- a/node_modules/sshpk/package.json +++ b/node_modules/sshpk/package.json @@ -1,27 +1,32 @@ { - "_from": "sshpk@^1.7.0", + "_args": [ + [ + "sshpk@1.16.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "sshpk@1.16.0", "_id": "sshpk@1.16.0", "_inBundle": false, "_integrity": "sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ==", "_location": "/sshpk", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "sshpk@^1.7.0", + "raw": "sshpk@1.16.0", "name": "sshpk", "escapedName": "sshpk", - "rawSpec": "^1.7.0", + "rawSpec": "1.16.0", "saveSpec": null, - "fetchSpec": "^1.7.0" + "fetchSpec": "1.16.0" }, "_requiredBy": [ "/http-signature" ], "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.0.tgz", - "_shasum": "1d4963a2fbffe58050aa9084ca20be81741c07de", - "_spec": "sshpk@^1.7.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/http-signature", + "_spec": "1.16.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Joyent, Inc" }, @@ -33,7 +38,6 @@ "bugs": { "url": "https://github.com/arekinath/node-sshpk/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Dave Eddy", @@ -59,7 +63,6 @@ "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, - "deprecated": false, "description": "A library for finding and using SSH public keys", "devDependencies": { "benchmark": "^1.0.0", diff --git a/node_modules/stat-mode/.npmignore b/node_modules/stat-mode/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/stat-mode/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/stat-mode/.travis.yml b/node_modules/stat-mode/.travis.yml deleted file mode 100644 index 41840cb..0000000 --- a/node_modules/stat-mode/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "0.8" - - "0.10" - - "0.12" - - "1" - - "2" - - "3" - - "4" - - "5" - -install: - - PATH="`npm bin`:`npm bin -g`:$PATH" - # Node 0.8 comes with a too obsolete npm - - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi - # Install dependencies and build - - npm install - -script: - # Output useful info for debugging - - node --version - - npm --version - # Run tests - - npm test diff --git a/node_modules/stat-mode/History.md b/node_modules/stat-mode/History.md deleted file mode 100644 index 6189daa..0000000 --- a/node_modules/stat-mode/History.md +++ /dev/null @@ -1,40 +0,0 @@ -0.2.2 / 2016-09-05 -================== - -* [[`764f2420ef`](https://github.com/TooTallNate/stat-mode/commit/764f2420ef)] - Rename `define()` to `_define()` (#6) (CxRes) -* [[`ba5a88d6e4`](https://github.com/TooTallNate/stat-mode/commit/ba5a88d6e4)] - **package**: update "mocha" to v3.0.2 (Nathan Rajlich) -* [[`e8a4a487ab`](https://github.com/TooTallNate/stat-mode/commit/e8a4a487ab)] - **travis**: test lots more node versions (Nathan Rajlich) - -0.2.1 / 2015-04-06 -================== - - * fix #2 - * add regression test for #2 - * travis: test node v0.12 instead of v0.11 - * .travis: don't test node v0.9.x - * add .travis.yml file - * README: add Travis-CI badge - * test: add FIFO test - * test: more test cases - * test: more inputs for tests - * package: update "mocha" to v1.18.2 - * package: add a few more "keywords" - -0.2.0 / 2014-04-02 -================== - - * index: add `Mode#toOctal()` function - * index: add `setuid`, `setgid` and `sticky` props - * test: initial tests - -0.1.0 / 2014-03-01 -================== - - * package: remove the "test" script for now - * index: add `Mode#toString()` function - * index: add `Mode#valueOf()` function - -0.0.1 / 2014-03-01 -================== - - * initial commit diff --git a/node_modules/stat-mode/README.md b/node_modules/stat-mode/README.md deleted file mode 100644 index 37e9179..0000000 --- a/node_modules/stat-mode/README.md +++ /dev/null @@ -1,182 +0,0 @@ -stat-mode -========= -### Offers convenient getters and setters for the stat `mode` -[![Build Status](https://travis-ci.org/TooTallNate/stat-mode.svg?branch=master)](https://travis-ci.org/TooTallNate/stat-mode) - -You know that `mode` property on the `fs.Stat` object that you probably -usually just ignore? Well there's acutally a lot of information packed -into that number. - -The specific information includes: - - * What the ["file type"](http://en.wikipedia.org/wiki/Unix_file_types) of file it is - * Whether or not the [`setuid` and `setgid` bits](http://en.wikipedia.org/wiki/Setuid) are set - * Whether or not the [`sticky` bit](http://en.wikipedia.org/wiki/Sticky_bit) is set - * The [_read_, _write_, and _execute_ permissions for the _owner_, _group_ and _others_](http://en.wikipedia.org/wiki/File_system_permissions) - -This module helps you extract that information. - -All the getters are also setters, which change the `mode` property -appropriately. This is useful for when you have to build up your -own `fs.Stat` object for whatever reason (like when implementing a -FUSE filesystem. - - -Installation ------------- - -``` bash -$ npm install stat-mode -``` - - -Example -------- - -So given some arbitrary file (let's say `/bin/echo`): - -``` bash -$ ls -l /bin/echo --rwxr-xr-x 1 root wheel 14128 Aug 11 2013 /bin/echo -``` - -We can inspect it using the `fs.stat()` call and creating a `Mode` instance -on top of it. - -``` javascript -var fs = require('fs'); -var Mode = require('stat-mode'); - -fs.stat('/bin/echo', function (err, stat) { - if (err) throw err; - - // create a "Mode" instance on top of the `stat` object - var mode = new Mode(stat); - - // you can check what kind of file it is: - mode.isDirectory(); - // false - - mode.isFIFO(); - // false - - mode.isFile(); - // true - - - // and you can also check individual owner, group and others permissions - mode.owner.read; - // true - - mode.owner.write; - // true - - mode.owner.execute; - // true - - mode.group.read; - // true - - mode.group.write; - // false - - mode.group.execute; - // true - - mode.others.read; - // true - - mode.others.write; - // false - - mode.others.execute; - // true - - - // the `toString()` output resembes the `ls -l` output: - mode.toString(); - // '-rwxr-xr-x' -}); -``` - - -API ---- - -### new Mode(Object stat) → Mode - -You must pass in "stat" object to the `Mode` constructor. The "stat" -object can be a real `fs.Stat` instance, or really any Object with a -`mode` property. - -#### mode.isDirectory([Boolean set]) → Boolean - -Returns `true` if the mode's file type is "directory", `false` otherwise. -If you pass `true` to the function, then the mode will be set to "directory". - -#### mode.isFile([Boolean set]) → Boolean - -Returns `true` if the mode's file type is "file", `false` otherwise. -If you pass `true` to the function, then the mode will be set to "file". - -#### mode.isBlockDevice([Boolean set]) → Boolean - -Returns `true` if the mode's file type is "block device", `false` otherwise. -If you pass `true` to the function, then the mode will be set to "block device". - -#### mode.isCharacterDevice([Boolean set]) → Boolean - -Returns `true` if the mode's file type is "character device", `false` otherwise. -If you pass `true` to the function, then the mode will be set to "character -device". - -#### mode.isSymbolicLink([Boolean set]) → Boolean - -Returns `true` if the mode's file type is "symbolic link", `false` otherwise. -If you pass `true` to the function, then the mode will be set to "symbolic link". - -#### mode.isFIFO([Boolean set]) → Boolean - -Returns `true` if the mode's file type is "FIFO", `false` otherwise. -If you pass `true` to the function, then the mode will be set to "FIFO". - -#### mode.isSocket([Boolean set]) → Boolean - -Returns `true` if the mode's file type is "socket", `false` otherwise. -If you pass `true` to the function, then the mode will be set to "socket". - -#### mode.owner.read → Boolean [Getter/Setter] - -`true` if the mode is "owner read" rights, `false` otherwise. - -#### mode.owner.write → Boolean [Getter/Setter] - -`true` if the mode is "owner write" rights, `false` otherwise. - -#### mode.owner.execute → Boolean [Getter/Setter] - -`true` if the mode is "owner execute" rights, `false` otherwise. - -#### mode.group.read → Boolean [Getter/Setter] - -`true` if the mode is "group read" rights, `false` otherwise. - -#### mode.group.write → Boolean [Getter/Setter] - -`true` if the mode is "group write" rights, `false` otherwise. - -#### mode.group.execute → Boolean [Getter/Setter] - -`true` if the mode is "group execute" rights, `false` otherwise. - -#### mode.others.read → Boolean [Getter/Setter] - -`true` if the mode is "others read" rights, `false` otherwise. - -#### mode.others.write → Boolean [Getter/Setter] - -`true` if the mode is "others write" rights, `false` otherwise. - -#### mode.others.execute → Boolean [Getter/Setter] - -`true` if the mode is "others execute" rights, `false` otherwise. diff --git a/node_modules/stat-mode/index.js b/node_modules/stat-mode/index.js deleted file mode 100644 index fd014f1..0000000 --- a/node_modules/stat-mode/index.js +++ /dev/null @@ -1,337 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = Mode; - -/** - * Constants (defined in `stat.h`). - */ - -var S_IFMT = 61440; /* 0170000 type of file */ -var S_IFIFO = 4096; /* 0010000 named pipe (fifo) */ -var S_IFCHR = 8192; /* 0020000 character special */ -var S_IFDIR = 16384; /* 0040000 directory */ -var S_IFBLK = 24576; /* 0060000 block special */ -var S_IFREG = 32768; /* 0100000 regular */ -var S_IFLNK = 40960; /* 0120000 symbolic link */ -var S_IFSOCK = 49152; /* 0140000 socket */ -var S_IFWHT = 57344; /* 0160000 whiteout */ -var S_ISUID = 2048; /* 0004000 set user id on execution */ -var S_ISGID = 1024; /* 0002000 set group id on execution */ -var S_ISVTX = 512; /* 0001000 save swapped text even after use */ -var S_IRUSR = 256; /* 0000400 read permission, owner */ -var S_IWUSR = 128; /* 0000200 write permission, owner */ -var S_IXUSR = 64; /* 0000100 execute/search permission, owner */ -var S_IRGRP = 32; /* 0000040 read permission, group */ -var S_IWGRP = 16; /* 0000020 write permission, group */ -var S_IXGRP = 8; /* 0000010 execute/search permission, group */ -var S_IROTH = 4; /* 0000004 read permission, others */ -var S_IWOTH = 2; /* 0000002 write permission, others */ -var S_IXOTH = 1; /* 0000001 execute/search permission, others */ - -/** - * `Mode` class. - * - * @param {fs.Stat} stat a "stat" object (anything with a `mode` Number property) - * @api public - */ - -function Mode (stat) { - if (!(this instanceof Mode)) return new Mode(stat); - if (!stat) throw new TypeError('must pass in a "stat" object'); - if ('number' != typeof stat.mode) stat.mode = 0; - this.stat = stat; - this.owner = new Owner(stat); - this.group = new Group(stat); - this.others = new Others(stat); -} - -/** - * Returns the Number value of the `mode`. - * - * @return {Number} - * @api public - */ - -Mode.prototype.valueOf = function () { - return this.stat.mode; -}; - -/** - * Returns a String representation of the `mode`. - * The output resembles something similiar to what `ls -l` would output. - * - * http://en.wikipedia.org/wiki/Unix_file_types - * - * @return {String} - * @api public - */ - -Mode.prototype.toString = function () { - var str = []; - - // file type - if (this.isDirectory()) { - str.push('d'); - } else if (this.isFile()) { - str.push('-'); - } else if (this.isBlockDevice()) { - str.push('b'); - } else if (this.isCharacterDevice()) { - str.push('c'); - } else if (this.isSymbolicLink()) { - str.push('l'); - } else if (this.isFIFO()) { - str.push('p'); - } else if (this.isSocket()) { - str.push('s'); - } else { - throw new TypeError('unexpected "file type"'); - } - - // owner read, write, execute - str.push(this.owner.read ? 'r' : '-'); - str.push(this.owner.write ? 'w' : '-'); - if (this.setuid) { - str.push(this.owner.execute ? 's' : 'S'); - } else { - str.push(this.owner.execute ? 'x' : '-'); - } - - // group read, write, execute - str.push(this.group.read ? 'r' : '-'); - str.push(this.group.write ? 'w' : '-'); - if (this.setgid) { - str.push(this.group.execute ? 's' : 'S'); - } else { - str.push(this.group.execute ? 'x' : '-'); - } - - // others read, write, execute - str.push(this.others.read ? 'r' : '-'); - str.push(this.others.write ? 'w' : '-'); - if (this.sticky) { - str.push(this.others.execute ? 't' : 'T'); - } else { - str.push(this.others.execute ? 'x' : '-'); - } - - return str.join(''); -}; - -/** - * Returns an octal representation of the `mode`, eg. "0754". - * - * http://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation - * - * @return {String} - * @api public - */ - -Mode.prototype.toOctal = function () { - var octal = this.stat.mode & 4095 /* 07777 */; - return ('0000' + octal.toString(8)).slice(-4); -}; - -Mode.prototype._checkModeProperty = function (property, set) { - var mode = this.stat.mode; - if (set) { - this.stat.mode = (mode | S_IFMT) & property | mode & ~S_IFMT; - } - return (mode & S_IFMT) === property; -}; - -Mode.prototype.isDirectory = function (v) { - return this._checkModeProperty(S_IFDIR, v); -}; - -Mode.prototype.isFile = function (v) { - return this._checkModeProperty(S_IFREG, v); -}; - -Mode.prototype.isBlockDevice = function (v) { - return this._checkModeProperty(S_IFBLK, v); -}; - -Mode.prototype.isCharacterDevice = function (v) { - return this._checkModeProperty(S_IFCHR, v); -}; - -Mode.prototype.isSymbolicLink = function (v) { - return this._checkModeProperty(S_IFLNK, v); -}; - -Mode.prototype.isFIFO = function (v) { - return this._checkModeProperty(S_IFIFO, v); -}; - -Mode.prototype.isSocket = function (v) { - return this._checkModeProperty(S_IFSOCK, v); -}; - -_define(Mode.prototype, 'setuid', - function () { - return Boolean(this.stat.mode & S_ISUID); - }, - function (v) { - if (v) { - this.stat.mode |= S_ISUID; - } else { - this.stat.mode &= ~S_ISUID; - } - } -); - -_define(Mode.prototype, 'setgid', - function () { - return Boolean(this.stat.mode & S_ISGID); - }, - function (v) { - if (v) { - this.stat.mode |= S_ISGID; - } else { - this.stat.mode &= ~S_ISGID; - } - } -); - -_define(Mode.prototype, 'sticky', - function () { - return Boolean(this.stat.mode & S_ISVTX); - }, - function (v) { - if (v) { - this.stat.mode |= S_ISVTX; - } else { - this.stat.mode &= ~S_ISVTX; - } - } -); - -function Owner (stat) { - _define(this, 'read', - function () { - return Boolean(stat.mode & S_IRUSR); - }, - function (v) { - if (v) { - stat.mode |= S_IRUSR; - } else { - stat.mode &= ~S_IRUSR; - } - } - ); - _define(this, 'write', - function () { - return Boolean(stat.mode & S_IWUSR); - }, - function (v) { - if (v) { - stat.mode |= S_IWUSR; - } else { - stat.mode &= ~S_IWUSR; - } - } - ); - _define(this, 'execute', - function () { - return Boolean(stat.mode & S_IXUSR); - }, - function (v) { - if (v) { - stat.mode |= S_IXUSR; - } else { - stat.mode &= ~S_IXUSR; - } - } - ); -} - -function Group (stat) { - _define(this, 'read', - function () { - return Boolean(stat.mode & S_IRGRP); - }, - function (v) { - if (v) { - stat.mode |= S_IRGRP; - } else { - stat.mode &= ~S_IRGRP; - } - } - ); - _define(this, 'write', - function () { - return Boolean(stat.mode & S_IWGRP); - }, - function (v) { - if (v) { - stat.mode |= S_IWGRP; - } else { - stat.mode &= ~S_IWGRP; - } - } - ); - _define(this, 'execute', - function () { - return Boolean(stat.mode & S_IXGRP); - }, - function (v) { - if (v) { - stat.mode |= S_IXGRP; - } else { - stat.mode &= ~S_IXGRP; - } - } - ); -} - -function Others (stat) { - _define(this, 'read', - function () { - return Boolean(stat.mode & S_IROTH); - }, - function (v) { - if (v) { - stat.mode |= S_IROTH; - } else { - stat.mode &= ~S_IROTH; - } - } - ); - _define(this, 'write', - function () { - return Boolean(stat.mode & S_IWOTH); - }, - function (v) { - if (v) { - stat.mode |= S_IWOTH; - } else { - stat.mode &= ~S_IWOTH; - } - } - ); - _define(this, 'execute', - function () { - return Boolean(stat.mode & S_IXOTH); - }, - function (v) { - if (v) { - stat.mode |= S_IXOTH; - } else { - stat.mode &= ~S_IXOTH; - } - } - ); -} - -function _define (obj, name, get, set) { - Object.defineProperty(obj, name, { - enumerable: true, - configurable: true, - get: get, - set: set - }); -} diff --git a/node_modules/stat-mode/package.json b/node_modules/stat-mode/package.json deleted file mode 100644 index 5bce34c..0000000 --- a/node_modules/stat-mode/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "stat-mode@^0.2.2", - "_id": "stat-mode@0.2.2", - "_inBundle": false, - "_integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", - "_location": "/stat-mode", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stat-mode@^0.2.2", - "name": "stat-mode", - "escapedName": "stat-mode", - "rawSpec": "^0.2.2", - "saveSpec": null, - "fetchSpec": "^0.2.2" - }, - "_requiredBy": [ - "/builder-util" - ], - "_resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", - "_shasum": "e6c80b623123d7d80cf132ce538f346289072502", - "_spec": "stat-mode@^0.2.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/builder-util", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "bugs": { - "url": "https://github.com/TooTallNate/stat-mode/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Offers convenient getters and setters for the stat `mode`", - "devDependencies": { - "mocha": "^3.0.2" - }, - "homepage": "https://github.com/TooTallNate/stat-mode", - "keywords": [ - "stat", - "mode", - "owner", - "group", - "others", - "chmod", - "octal", - "symbolic", - "permissions" - ], - "license": "MIT", - "main": "index.js", - "name": "stat-mode", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/stat-mode.git" - }, - "scripts": { - "test": "mocha --reporter spec" - }, - "version": "0.2.2" -} diff --git a/node_modules/stat-mode/test/test.js b/node_modules/stat-mode/test/test.js deleted file mode 100644 index 6678a08..0000000 --- a/node_modules/stat-mode/test/test.js +++ /dev/null @@ -1,115 +0,0 @@ - -var Mode = require('../'); -var assert = require('assert'); - -describe('stat-mode', function () { - - it('should export the `Mode` constructor', function () { - assert.equal('function', typeof Mode); - assert.equal('Mode', Mode.name); - }); - - describe('Mode', function () { - - it('should return a `Mode` instance with `new`', function () { - var m = new Mode({}); - assert(m instanceof Mode); - }); - - it('should return a `Mode` instance without `new`', function () { - var m = Mode({}); - assert(m instanceof Mode); - }); - - it('should throw an Error if no `stat` object is passed in', function () { - try { - new Mode(); - assert(false, 'unreachable'); - } catch (e) { - assert.equal('must pass in a "stat" object', e.message); - } - }); - - [ - { - mode: 33188 /* 0100644 */, - octal: '0644', - string: '-rw-r--r--', - type: 'file' - }, - { - mode: 16877 /* 040755 */, - octal: '0755', - string: 'drwxr-xr-x', - type: 'directory' - }, - { - mode: 16832 /* 040700 */, - octal: '0700', - string: 'drwx------', - type: 'directory' - }, - { - mode: 41325 /* 0120555 */, - octal: '0555', - string: 'lr-xr-xr-x', - type: 'symbolicLink' - }, - { - mode: 8592 /* 020620 */, - octal: '0620', - string: 'crw--w----', - type: 'characterDevice' - }, - { - mode: 24960 /* 060600 */, - octal: '0600', - string: 'brw-------', - type: 'blockDevice' - }, - { - mode: 4516 /* 010644 */, - octal: '0644', - string: 'prw-r--r--', - type: 'FIFO' - } - ].forEach(function (test) { - var m = new Mode(test); - var isFn = 'is' + test.type[0].toUpperCase() + test.type.substring(1); - var strMode = m.toString(); - var opposite = test.type == 'file' ? 'isDirectory' : 'isFile'; - var first = test.type == 'file' ? 'd' : '-'; - describe('input: 0' + test.mode.toString(8), function () { - describe('#toString()', function () { - it('should equal "' + test.string + '"', function () { - assert.equal(m.toString(), test.string); - }); - }); - describe('#toOctal()', function () { - it('should equal "' + test.octal + '"', function () { - assert.equal(m.toOctal(), test.octal); - }); - }); - describe('#' + isFn + '()', function () { - it('should return `true` for #' + isFn + '()', function () { - assert.ok(m[isFn]()); - }); - it('should remain "' + strMode + '" after #' + isFn + '(true) (gh-2)', function () { - assert.equal(true, m[isFn](true)); - assert.equal(strMode, m.toString()); - }); - }); - describe('#' + opposite + '(true)', function () { - it('should return `false` for `#' + opposite + '(true)`', function () { - assert.equal(false, m[opposite](true)); - }); - it('should be "' + first + m.toString().substring(1) + '" after #' + opposite + '(true) (gh-2)', function () { - assert.equal(first + m.toString().substring(1), m.toString()); - }); - }); - }); - }); - - }); - -}); diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json index e5f53c4..7efee1a 100644 --- a/node_modules/string-width/package.json +++ b/node_modules/string-width/package.json @@ -1,27 +1,34 @@ { - "_from": "string-width@^1.0.1", + "_args": [ + [ + "string-width@1.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "string-width@1.0.2", "_id": "string-width@1.0.2", "_inBundle": false, "_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "_location": "/string-width", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "string-width@^1.0.1", + "raw": "string-width@1.0.2", "name": "string-width", "escapedName": "string-width", - "rawSpec": "^1.0.1", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "1.0.2" }, "_requiredBy": [ - "/single-line-log" + "/gauge", + "/single-line-log", + "/wide-align" ], "_resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", - "_spec": "string-width@^1.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/single-line-log", + "_spec": "1.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,13 +37,11 @@ "bugs": { "url": "https://github.com/sindresorhus/string-width/issues" }, - "bundleDependencies": false, "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" }, - "deprecated": false, "description": "Get the visual width of a string - the number of columns required to display it", "devDependencies": { "ava": "*", diff --git a/node_modules/string_decoder/package.json b/node_modules/string_decoder/package.json index aefb37a..f543070 100644 --- a/node_modules/string_decoder/package.json +++ b/node_modules/string_decoder/package.json @@ -1,33 +1,37 @@ { - "_from": "string_decoder@~0.10.x", + "_args": [ + [ + "string_decoder@0.10.31", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "string_decoder@0.10.31", "_id": "string_decoder@0.10.31", "_inBundle": false, "_integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "_location": "/string_decoder", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "string_decoder@~0.10.x", + "raw": "string_decoder@0.10.31", "name": "string_decoder", "escapedName": "string_decoder", - "rawSpec": "~0.10.x", + "rawSpec": "0.10.31", "saveSpec": null, - "fetchSpec": "~0.10.x" + "fetchSpec": "0.10.31" }, "_requiredBy": [ + "/data-table/readable-stream", "/readable-stream" ], "_resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_spec": "string_decoder@~0.10.x", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/readable-stream", + "_spec": "0.10.31", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/rvagg/string_decoder/issues" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, "description": "The string_decoder module from Node core", "devDependencies": { "tap": "~0.4.8" diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json index 893c012..f0fa47c 100644 --- a/node_modules/strip-ansi/package.json +++ b/node_modules/strip-ansi/package.json @@ -1,27 +1,33 @@ { - "_from": "strip-ansi@^3.0.0", + "_args": [ + [ + "strip-ansi@3.0.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "strip-ansi@3.0.1", "_id": "strip-ansi@3.0.1", "_inBundle": false, "_integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "_location": "/strip-ansi", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "strip-ansi@^3.0.0", + "raw": "strip-ansi@3.0.1", "name": "strip-ansi", "escapedName": "strip-ansi", - "rawSpec": "^3.0.0", + "rawSpec": "3.0.1", "saveSpec": null, - "fetchSpec": "^3.0.0" + "fetchSpec": "3.0.1" }, "_requiredBy": [ + "/gauge", "/string-width" ], "_resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", - "_spec": "strip-ansi@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/string-width", + "_spec": "3.0.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,11 +36,9 @@ "bugs": { "url": "https://github.com/chalk/strip-ansi/issues" }, - "bundleDependencies": false, "dependencies": { "ansi-regex": "^2.0.0" }, - "deprecated": false, "description": "Strip ANSI escape codes", "devDependencies": { "ava": "*", diff --git a/node_modules/strip-bom/package.json b/node_modules/strip-bom/package.json index aeeecf1..2256f96 100644 --- a/node_modules/strip-bom/package.json +++ b/node_modules/strip-bom/package.json @@ -1,27 +1,33 @@ { - "_from": "strip-bom@^2.0.0", + "_args": [ + [ + "strip-bom@2.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "strip-bom@2.0.0", "_id": "strip-bom@2.0.0", "_inBundle": false, "_integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "_location": "/strip-bom", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "strip-bom@^2.0.0", + "raw": "strip-bom@2.0.0", "name": "strip-bom", "escapedName": "strip-bom", - "rawSpec": "^2.0.0", + "rawSpec": "2.0.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "2.0.0" }, "_requiredBy": [ "/load-json-file" ], "_resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "_shasum": "6219a85616520491f35788bdbf1447a99c7e6b0e", - "_spec": "strip-bom@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/load-json-file", + "_spec": "2.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,11 +36,9 @@ "bugs": { "url": "https://github.com/sindresorhus/strip-bom/issues" }, - "bundleDependencies": false, "dependencies": { "is-utf8": "^0.2.0" }, - "deprecated": false, "description": "Strip UTF-8 byte order mark (BOM) from a string/buffer", "devDependencies": { "mocha": "*" diff --git a/node_modules/strip-eof/index.js b/node_modules/strip-eof/index.js deleted file mode 100644 index a17d0af..0000000 --- a/node_modules/strip-eof/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -module.exports = function (x) { - var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); - var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); - - if (x[x.length - 1] === lf) { - x = x.slice(0, x.length - 1); - } - - if (x[x.length - 1] === cr) { - x = x.slice(0, x.length - 1); - } - - return x; -}; diff --git a/node_modules/strip-eof/license b/node_modules/strip-eof/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/strip-eof/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/strip-eof/package.json b/node_modules/strip-eof/package.json deleted file mode 100644 index 5add8d8..0000000 --- a/node_modules/strip-eof/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "strip-eof@^1.0.0", - "_id": "strip-eof@1.0.0", - "_inBundle": false, - "_integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "_location": "/strip-eof", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-eof@^1.0.0", - "name": "strip-eof", - "escapedName": "strip-eof", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/execa", - "/os-locale/execa" - ], - "_resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "_shasum": "bb43ff5598a6eb05d89b59fcd129c983313606bf", - "_spec": "strip-eof@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/strip-eof/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Strip the End-Of-File (EOF) character from a string/buffer", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/strip-eof#readme", - "keywords": [ - "strip", - "trim", - "remove", - "delete", - "eof", - "end", - "file", - "newline", - "linebreak", - "character", - "string", - "buffer" - ], - "license": "MIT", - "name": "strip-eof", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-eof.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0" -} diff --git a/node_modules/strip-eof/readme.md b/node_modules/strip-eof/readme.md deleted file mode 100644 index 45ffe04..0000000 --- a/node_modules/strip-eof/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# strip-eof [![Build Status](https://travis-ci.org/sindresorhus/strip-eof.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-eof) - -> Strip the [End-Of-File](https://en.wikipedia.org/wiki/End-of-file) (EOF) character from a string/buffer - - -## Install - -``` -$ npm install --save strip-eof -``` - - -## Usage - -```js -const stripEof = require('strip-eof'); - -stripEof('foo\nbar\n\n'); -//=> 'foo\nbar\n' - -stripEof(new Buffer('foo\nbar\n\n')).toString(); -//=> 'foo\nbar\n' -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/strip-indent/package.json b/node_modules/strip-indent/package.json index 5db61e8..a9286a1 100644 --- a/node_modules/strip-indent/package.json +++ b/node_modules/strip-indent/package.json @@ -1,27 +1,33 @@ { - "_from": "strip-indent@^1.0.1", + "_args": [ + [ + "strip-indent@1.0.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "strip-indent@1.0.1", "_id": "strip-indent@1.0.1", "_inBundle": false, "_integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "_location": "/strip-indent", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "strip-indent@^1.0.1", + "raw": "strip-indent@1.0.1", "name": "strip-indent", "escapedName": "strip-indent", - "rawSpec": "^1.0.1", + "rawSpec": "1.0.1", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "1.0.1" }, "_requiredBy": [ "/redent" ], "_resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "_shasum": "0c7962a6adefa7bbd4ac366460a638552ae1a0a2", - "_spec": "strip-indent@^1.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/redent", + "_spec": "1.0.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -33,11 +39,9 @@ "bugs": { "url": "https://github.com/sindresorhus/strip-indent/issues" }, - "bundleDependencies": false, "dependencies": { "get-stdin": "^4.0.1" }, - "deprecated": false, "description": "Strip leading whitespace from every line in a string", "devDependencies": { "mocha": "*" diff --git a/node_modules/strip-json-comments/package.json b/node_modules/strip-json-comments/package.json index d0c56be..5eddf47 100644 --- a/node_modules/strip-json-comments/package.json +++ b/node_modules/strip-json-comments/package.json @@ -1,27 +1,32 @@ { - "_from": "strip-json-comments@~2.0.1", + "_args": [ + [ + "strip-json-comments@2.0.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "strip-json-comments@2.0.1", "_id": "strip-json-comments@2.0.1", "_inBundle": false, "_integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "_location": "/strip-json-comments", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "strip-json-comments@~2.0.1", + "raw": "strip-json-comments@2.0.1", "name": "strip-json-comments", "escapedName": "strip-json-comments", - "rawSpec": "~2.0.1", + "rawSpec": "2.0.1", "saveSpec": null, - "fetchSpec": "~2.0.1" + "fetchSpec": "2.0.1" }, "_requiredBy": [ "/rc" ], "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "_shasum": "3c531942e908c2697c0ec344858c286c7ca0a60a", - "_spec": "strip-json-comments@~2.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/rc", + "_spec": "2.0.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +35,6 @@ "bugs": { "url": "https://github.com/sindresorhus/strip-json-comments/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Strip comments from JSON. Lets you use comments in your JSON files!", "devDependencies": { "ava": "*", diff --git a/node_modules/sumchecker/node_modules/debug/package.json b/node_modules/sumchecker/node_modules/debug/package.json index 9275fa9..7357a21 100644 --- a/node_modules/sumchecker/node_modules/debug/package.json +++ b/node_modules/sumchecker/node_modules/debug/package.json @@ -1,27 +1,33 @@ { - "_from": "debug@^2.2.0", + "_args": [ + [ + "debug@2.6.9", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "debug@2.6.9", "_id": "debug@2.6.9", "_inBundle": false, "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "_location": "/sumchecker/debug", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "debug@^2.2.0", + "raw": "debug@2.6.9", "name": "debug", "escapedName": "debug", - "rawSpec": "^2.2.0", + "rawSpec": "2.6.9", "saveSpec": null, - "fetchSpec": "^2.2.0" + "fetchSpec": "2.6.9" }, "_requiredBy": [ "/sumchecker" ], "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f", - "_spec": "debug@^2.2.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sumchecker", + "_spec": "2.6.9", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/visionmedia/debug/issues" }, - "bundleDependencies": false, "component": { "scripts": { "debug/index.js": "browser.js", @@ -51,7 +56,6 @@ "dependencies": { "ms": "2.0.0" }, - "deprecated": false, "description": "small debugging utility", "devDependencies": { "browserify": "9.0.3", diff --git a/node_modules/sumchecker/node_modules/ms/package.json b/node_modules/sumchecker/node_modules/ms/package.json index 35fdd01..bf06a44 100644 --- a/node_modules/sumchecker/node_modules/ms/package.json +++ b/node_modules/sumchecker/node_modules/ms/package.json @@ -1,4 +1,11 @@ { + "_args": [ + [ + "ms@2.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, "_from": "ms@2.0.0", "_id": "ms@2.0.0", "_inBundle": false, @@ -19,14 +26,11 @@ "/sumchecker/debug" ], "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8", - "_spec": "ms@2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sumchecker/node_modules/debug", + "_spec": "2.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/zeit/ms/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Tiny milisecond conversion utility", "devDependencies": { "eslint": "3.19.0", diff --git a/node_modules/sumchecker/package.json b/node_modules/sumchecker/package.json index 85ce420..708ea1d 100644 --- a/node_modules/sumchecker/package.json +++ b/node_modules/sumchecker/package.json @@ -1,38 +1,42 @@ { - "_from": "sumchecker@^2.0.2", + "_args": [ + [ + "sumchecker@2.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "sumchecker@2.0.2", "_id": "sumchecker@2.0.2", "_inBundle": false, "_integrity": "sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4=", "_location": "/sumchecker", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "sumchecker@^2.0.2", + "raw": "sumchecker@2.0.2", "name": "sumchecker", "escapedName": "sumchecker", - "rawSpec": "^2.0.2", + "rawSpec": "2.0.2", "saveSpec": null, - "fetchSpec": "^2.0.2" + "fetchSpec": "2.0.2" }, "_requiredBy": [ "/electron-download" ], "_resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-2.0.2.tgz", - "_shasum": "0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e", - "_spec": "sumchecker@^2.0.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-download", + "_spec": "2.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mark Lee" }, "bugs": { "url": "https://github.com/malept/sumchecker/issues" }, - "bundleDependencies": false, "dependencies": { "debug": "^2.2.0" }, - "deprecated": false, "description": "Checksum validator", "devDependencies": { "codeclimate-test-reporter": "^0.4.0", diff --git a/node_modules/temp-file/out/main.d.ts b/node_modules/temp-file/out/main.d.ts deleted file mode 100644 index 3147afb..0000000 --- a/node_modules/temp-file/out/main.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export declare function getTempName(prefix?: string | null | undefined): string; -export interface GetTempFileOptions { - prefix?: string | null; - suffix?: string | null; - disposer?: ((file: string) => Promise) | null; -} -export declare class TmpDir { - private readonly debugName; - private tempFiles; - private registered; - constructor(debugName?: string); - readonly rootTempDir: Promise; - getTempDir(options?: GetTempFileOptions): Promise; - createTempDir(options?: GetTempFileOptions): Promise; - getTempFile(options?: GetTempFileOptions, isDir?: boolean): Promise; - cleanupSync(): void; - cleanup(): Promise; - toString(): string; -} diff --git a/node_modules/temp-file/out/main.js b/node_modules/temp-file/out/main.js deleted file mode 100644 index 92a670c..0000000 --- a/node_modules/temp-file/out/main.js +++ /dev/null @@ -1,235 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getTempName = getTempName; -exports.TmpDir = void 0; - -function _bluebirdLst() { - const data = _interopRequireDefault(require("bluebird-lst")); - - _bluebirdLst = function () { - return data; - }; - - return data; -} - -function _fsExtraP() { - const data = require("fs-extra-p"); - - _fsExtraP = function () { - return data; - }; - - return data; -} - -function _os() { - const data = require("os"); - - _os = function () { - return data; - }; - - return data; -} - -var path = _interopRequireWildcard(require("path")); - -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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -let tmpFileCounter = 0; -const tmpDirManagers = new Set(); // add date to avoid use stale temp dir - -const tempDirPrefix = `${process.pid.toString(36)}-${Date.now().toString(36)}`; - -function getTempName(prefix) { - return `${prefix == null ? "" : `${prefix}-`}${tempDirPrefix}-${(tmpFileCounter++).toString(36)}`; -} - -let tempDirPromise; -let tempBaseDir; - -function getBaseTempDir() { - if (tempDirPromise != null) { - return tempDirPromise; - } - - if (tempBaseDir != null) { - return Promise.resolve(tempBaseDir); - } - - const systemTmpDir = process.env.APP_BUILDER_TMP_DIR || (0, _os().tmpdir)(); - const isEnsureRemovedOnExit = process.env.TMP_DIR_MANAGER_ENSURE_REMOVED_ON_EXIT !== "false"; - tempDirPromise = (0, _fsExtraP().mkdtemp)(path.join(systemTmpDir, "t-")).then(it => (0, _fsExtraP().realpath)(it)).then(dir => { - if (isEnsureRemovedOnExit) { - addExitHook(dir); - } - - tempBaseDir = dir; - return dir; - }); - return tempDirPromise; -} - -function addExitHook(dir) { - require("async-exit-hook")(callback => { - const managers = Array.from(tmpDirManagers); - tmpDirManagers.clear(); - - if (callback == null) { - for (const manager of managers) { - manager.cleanupSync(); - } - - try { - (0, _fsExtraP().removeSync)(dir); - } catch (e) { - handleError(e, dir); - } - - return; - } // each instead of map to avoid fs overload - - - _bluebirdLst().default.each(managers, it => it.cleanup()).then(() => (0, _fsExtraP().remove)(dir)).then(() => callback()).catch(e => { - try { - handleError(e, dir); - } finally { - callback(); - } - }); - }); -} - -function handleError(e, file) { - if (e.code !== "EPERM" && e.code !== "ENOENT") { - // use only console.* instead of our warn on exit (otherwise nodeEmoji can be required on request) - console.warn(`Cannot delete temporary "${file}": ${(e.stack || e).toString()}`); - } -} - -class TmpDir { - constructor(debugName = "") { - this.debugName = debugName; - this.tempFiles = []; - this.registered = false; - } // noinspection JSMethodCanBeStatic,JSUnusedGlobalSymbols - - - get rootTempDir() { - return getBaseTempDir(); - } - - getTempDir(options) { - return this.getTempFile(options, true); - } - - createTempDir(options) { - return this.getTempFile(options, true).then(it => (0, _fsExtraP().ensureDir)(it).then(() => it)); - } - - getTempFile(options, isDir = false) { - return getBaseTempDir().then(baseTempDir => { - if (!this.registered) { - this.registered = true; - tmpDirManagers.add(this); - } - - const prefix = nullize(options == null ? null : options.prefix); - const suffix = nullize(options == null ? null : options.suffix); - const namePrefix = prefix == null ? "" : `${prefix}-`; - const nameSuffix = suffix == null ? "" : suffix.startsWith(".") ? suffix : `-${suffix}`; - const result = `${baseTempDir}${path.sep}${namePrefix}${(tmpFileCounter++).toString(36)}${nameSuffix}`; - this.tempFiles.push({ - path: result, - isDir, - disposer: options == null ? null : options.disposer - }); - return result; - }); - } - - cleanupSync() { - const tempFiles = this.tempFiles; - tmpDirManagers.delete(this); - this.registered = false; - - if (tempFiles.length === 0) { - return; - } - - this.tempFiles = []; - - for (const file of tempFiles) { - if (file.disposer != null) { - // noinspection JSIgnoredPromiseFromCall - file.disposer(file.path); - continue; - } - - try { - if (file.isDir) { - (0, _fsExtraP().removeSync)(file.path); - } else { - (0, _fsExtraP().unlinkSync)(file.path); - } - } catch (e) { - handleError(e, file.path); - } - } - } - - cleanup() { - const tempFiles = this.tempFiles; - tmpDirManagers.delete(this); - this.registered = false; - - if (tempFiles.length === 0) { - return Promise.resolve(); - } - - this.tempFiles = []; - - if (tmpDirManagers.size === 0) { - const dir = tempBaseDir; - - if (dir == null) { - return Promise.resolve(); - } - - tempBaseDir = null; - tempDirPromise = null; - return (0, _fsExtraP().remove)(dir); - } - - return _bluebirdLst().default.map(tempFiles, it => { - if (it.disposer != null) { - return it.disposer(it.path); - } - - return (it.isDir ? (0, _fsExtraP().remove)(it.path) : (0, _fsExtraP().unlink)(it.path)).catch(e => { - handleError(e, it.path); - }); - }, { - concurrency: 4 - }); - } - - toString() { - return this.debugName; - } - -} - -exports.TmpDir = TmpDir; - -function nullize(s) { - return s == null || s.length === 0 ? null : s; -} -// __ts-babel@6.0.4 -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/node_modules/temp-file/out/main.js.map b/node_modules/temp-file/out/main.js.map deleted file mode 100644 index 513db14..0000000 --- a/node_modules/temp-file/out/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;;;AAEA,IAAI,cAAc,GAAG,CAArB;AACA,MAAM,cAAc,GAAG,IAAI,GAAJ,EAAvB,C,CAEA;;AACA,M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IAAf,CAAP;AACD;;AAED,aAAO,CAAC,EAAE,CAAC,KAAH,GAAW,wBAAO,EAAE,CAAC,IAAV,CAAX,GAA6B,wBAAO,EAAE,CAAC,IAAV,CAA9B,EACJ,KADI,CACE,CAAC,IAAG;AACT,QAAA,WAAW,CAAC,CAAD,EAAI,EAAE,CAAC,IAAP,CAAX;AACD,OAHI,CAAP;AAID,KATM,EASJ;AAAC,MAAA,WAAW,EAAE;AAAd,KATI,CAAP;AAUD;;AAED,EAAA,QAAQ,GAAA;AACN,WAAO,KAAK,SAAZ;AACD;;AA7GgB;;;;AAgHnB,SAAS,OAAT,CAAiB,CAAjB,EAAkC;AAChC,SAAO,CAAC,IAAI,IAAL,IAAa,CAAC,CAAC,MAAF,KAAa,CAA1B,GAA8B,IAA9B,GAAqC,CAA5C;AACD,C","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { ensureDir, mkdtemp, realpath, remove, removeSync, unlink, unlinkSync } from \"fs-extra-p\"\nimport { tmpdir } from \"os\"\nimport * as path from \"path\"\n\nlet tmpFileCounter = 0\nconst tmpDirManagers = new Set()\n\n// add date to avoid use stale temp dir\nconst tempDirPrefix = `${process.pid.toString(36)}-${Date.now().toString(36)}`\n\nexport function getTempName(prefix?: string | null | undefined): string {\n return `${prefix == null ? \"\" : `${prefix}-`}${tempDirPrefix}-${(tmpFileCounter++).toString(36)}`\n}\n\nlet tempDirPromise: Promise | null\nlet tempBaseDir: string | null\n\nfunction getBaseTempDir(): Promise {\n if (tempDirPromise != null) {\n return tempDirPromise\n }\n\n if (tempBaseDir != null) {\n return Promise.resolve(tempBaseDir)\n }\n\n const systemTmpDir = process.env.APP_BUILDER_TMP_DIR || tmpdir()\n const isEnsureRemovedOnExit = process.env.TMP_DIR_MANAGER_ENSURE_REMOVED_ON_EXIT !== \"false\"\n tempDirPromise = mkdtemp(path.join(systemTmpDir, \"t-\"))\n .then(it => realpath(it))\n .then(dir => {\n if (isEnsureRemovedOnExit) {\n addExitHook(dir)\n }\n tempBaseDir = dir\n return dir\n })\n return tempDirPromise\n}\n\nfunction addExitHook(dir: string) {\n require(\"async-exit-hook\")((callback: (() => void) | null) => {\n const managers = Array.from(tmpDirManagers)\n tmpDirManagers.clear()\n\n if (callback == null) {\n for (const manager of managers) {\n manager.cleanupSync()\n }\n\n try {\n removeSync(dir)\n }\n catch (e) {\n handleError(e, dir)\n }\n return\n }\n\n // each instead of map to avoid fs overload\n BluebirdPromise.each(managers, it => it.cleanup())\n .then(() => remove(dir))\n .then(() => callback())\n .catch(e => {\n try {\n handleError(e, dir)\n }\n finally {\n callback()\n }\n })\n })\n}\n\nfunction handleError(e: any, file: string) {\n if (e.code !== \"EPERM\" && e.code !== \"ENOENT\") {\n // use only console.* instead of our warn on exit (otherwise nodeEmoji can be required on request)\n console.warn(`Cannot delete temporary \"${file}\": ${(e.stack || e).toString()}`)\n }\n}\n\ninterface TempFileInfo {\n isDir: boolean\n path: string\n disposer?: ((file: string) => Promise) | null\n}\n\nexport interface GetTempFileOptions {\n prefix?: string | null\n suffix?: string | null\n\n disposer?: ((file: string) => Promise) | null\n}\n\nexport class TmpDir {\n private tempFiles: Array = []\n private registered = false\n\n constructor(private readonly debugName: string = \"\") {\n }\n\n // noinspection JSMethodCanBeStatic,JSUnusedGlobalSymbols\n get rootTempDir(): Promise {\n return getBaseTempDir()\n }\n\n getTempDir(options?: GetTempFileOptions): Promise {\n return this.getTempFile(options, true)\n }\n\n createTempDir(options?: GetTempFileOptions): Promise {\n return this.getTempFile(options, true)\n .then(it => ensureDir(it).then(() => it))\n }\n\n getTempFile(options?: GetTempFileOptions, isDir = false): Promise {\n return getBaseTempDir()\n .then(baseTempDir => {\n if (!this.registered) {\n this.registered = true\n tmpDirManagers.add(this)\n }\n\n const prefix = nullize(options == null ? null : options.prefix)\n const suffix = nullize(options == null ? null : options.suffix)\n const namePrefix = prefix == null ? \"\" : `${prefix}-`\n const nameSuffix = suffix == null ? \"\" : (suffix.startsWith(\".\") ? suffix : `-${suffix}`)\n const result = `${baseTempDir}${path.sep}${namePrefix}${(tmpFileCounter++).toString(36)}${nameSuffix}`\n this.tempFiles.push({\n path: result,\n isDir,\n disposer: options == null ? null : options.disposer,\n })\n return result\n })\n }\n\n cleanupSync() {\n const tempFiles = this.tempFiles\n tmpDirManagers.delete(this)\n this.registered = false\n if (tempFiles.length === 0) {\n return\n }\n\n this.tempFiles = []\n\n for (const file of tempFiles) {\n if (file.disposer != null) {\n // noinspection JSIgnoredPromiseFromCall\n file.disposer(file.path)\n continue\n }\n\n try {\n if (file.isDir) {\n removeSync(file.path)\n }\n else {\n unlinkSync(file.path)\n }\n }\n catch (e) {\n handleError(e, file.path)\n }\n }\n }\n\n cleanup(): Promise {\n const tempFiles = this.tempFiles\n tmpDirManagers.delete(this)\n\n this.registered = false\n if (tempFiles.length === 0) {\n return Promise.resolve()\n }\n this.tempFiles = []\n\n if (tmpDirManagers.size === 0) {\n const dir = tempBaseDir\n if (dir == null) {\n return Promise.resolve()\n }\n\n tempBaseDir = null\n tempDirPromise = null\n return remove(dir)\n }\n\n return BluebirdPromise.map(tempFiles, it => {\n if (it.disposer != null) {\n return it.disposer(it.path)\n }\n\n return (it.isDir ? remove(it.path) : unlink(it.path))\n .catch(e => {\n handleError(e, it.path)\n })\n }, {concurrency: 4})\n }\n\n toString() {\n return this.debugName\n }\n}\n\nfunction nullize(s?: string | null) {\n return s == null || s.length === 0 ? null : s\n}"],"sourceRoot":""} diff --git a/node_modules/temp-file/package.json b/node_modules/temp-file/package.json deleted file mode 100644 index ad3d013..0000000 --- a/node_modules/temp-file/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "temp-file@^3.3.2", - "_id": "temp-file@3.3.2", - "_inBundle": false, - "_integrity": "sha512-FGKccAW0Mux9hC/2bdUIe4bJRv4OyVo4RpVcuplFird1V/YoplIFbnPZjfzbJSf/qNvRZIRB9/4n/RkI0GziuQ==", - "_location": "/temp-file", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "temp-file@^3.3.2", - "name": "temp-file", - "escapedName": "temp-file", - "rawSpec": "^3.3.2", - "saveSpec": null, - "fetchSpec": "^3.3.2" - }, - "_requiredBy": [ - "/app-builder-lib", - "/builder-util" - ], - "_resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.3.2.tgz", - "_shasum": "69b6daf1bbe23231d0a5d03844e3d96f3f531aaa", - "_spec": "temp-file@^3.3.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/app-builder-lib", - "author": { - "name": "Vladimir Krivosheev" - }, - "babel": { - "presets": [ - "babel-preset-ts-node6-bluebird" - ] - }, - "bugs": { - "url": "https://github.com/develar/temp-file/issues" - }, - "bundleDependencies": false, - "dependencies": { - "async-exit-hook": "^2.0.1", - "bluebird-lst": "^1.0.6", - "fs-extra-p": "^7.0.0" - }, - "deprecated": false, - "description": "```typescript export function getTempName(prefix?: string | null | undefined): string;", - "devDependencies": { - "@types/js-yaml": "^3.11.2", - "@types/node": "^10.12.9", - "babel-preset-ts-node6-bluebird": "^3.0.1", - "ts-babel": "^6.1.2", - "typescript": "^3.1.6" - }, - "files": [ - "out" - ], - "homepage": "https://github.com/develar/temp-file", - "license": "MIT", - "main": "out/main.js", - "name": "temp-file", - "repository": { - "type": "git", - "url": "git+https://github.com/develar/temp-file.git" - }, - "scripts": { - "compile": "ts-babel", - "release": "BABEL_ENV=production yarn compile && npm publish" - }, - "typings": "./out/main.d.ts", - "version": "3.3.2" -} diff --git a/node_modules/temp-file/readme.md b/node_modules/temp-file/readme.md deleted file mode 100644 index 79b3252..0000000 --- a/node_modules/temp-file/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -## temp-file - -```typescript -export function getTempName(prefix?: string | null | undefined): string; - -export class TmpDir { - getTempDir(suffix?: string): Promise; - - createTempDir(suffix?: string): Promise; - - getTempFile(suffix: string, isDir?: boolean, disposer?: ((file: string) => Promise) | null): Promise; - - cleanupSync(): void; - - cleanup(): Promise; -} -``` \ No newline at end of file diff --git a/node_modules/term-size/index.js b/node_modules/term-size/index.js deleted file mode 100644 index 95e410d..0000000 --- a/node_modules/term-size/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; -const path = require('path'); -const execa = require('execa'); - -const create = (columns, rows) => ({ - columns: parseInt(columns, 10), - rows: parseInt(rows, 10) -}); - -module.exports = () => { - const env = process.env; - const stdout = process.stdout; - const stderr = process.stderr; - - if (stdout && stdout.columns && stdout.rows) { - return create(stdout.columns, stdout.rows); - } - - if (stderr && stderr.columns && stderr.rows) { - return create(stderr.columns, stderr.rows); - } - - // These values are static, so not the first choice - if (env.COLUMNS && env.LINES) { - return create(env.COLUMNS, env.LINES); - } - - if (process.platform === 'win32') { - try { - // Binary: https://github.com/sindresorhus/win-term-size - const size = execa.sync(path.join(__dirname, 'vendor/windows/term-size.exe')).stdout.split(/\r?\n/); - - if (size.length === 2) { - return create(size[0], size[1]); - } - } catch (err) {} - } else { - if (process.platform === 'darwin') { - try { - // Binary: https://github.com/sindresorhus/macos-term-size - const size = execa.shellSync(path.join(__dirname, 'vendor/macos/term-size')).stdout.split(/\r?\n/); - - if (size.length === 2) { - return create(size[0], size[1]); - } - } catch (err) {} - } - - // `resize` is preferred as it works even when all file descriptors are redirected - // https://linux.die.net/man/1/resize - try { - const size = execa.sync('resize', ['-u']).stdout.match(/\d+/g); - - if (size.length === 2) { - return create(size[0], size[1]); - } - } catch (err) {} - - try { - const columns = execa.sync('tput', ['cols']).stdout; - const rows = execa.sync('tput', ['lines']).stdout; - - if (columns && rows) { - return create(columns, rows); - } - } catch (err) {} - } - - return create(80, 24); -}; diff --git a/node_modules/term-size/license b/node_modules/term-size/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/term-size/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/term-size/package.json b/node_modules/term-size/package.json deleted file mode 100644 index 5190f6c..0000000 --- a/node_modules/term-size/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "term-size@^1.2.0", - "_id": "term-size@1.2.0", - "_inBundle": false, - "_integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "_location": "/term-size", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "term-size@^1.2.0", - "name": "term-size", - "escapedName": "term-size", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "_shasum": "458b83887f288fc56d6fffbfad262e26638efa69", - "_spec": "term-size@^1.2.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/term-size/issues" - }, - "bundleDependencies": false, - "dependencies": { - "execa": "^0.7.0" - }, - "deprecated": false, - "description": "Reliably get the terminal window size (columns & rows)", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "vendor" - ], - "homepage": "https://github.com/sindresorhus/term-size#readme", - "keywords": [ - "term", - "terminal", - "size", - "console", - "window", - "width", - "height", - "columns", - "rows", - "lines", - "tty", - "redirected" - ], - "license": "MIT", - "name": "term-size", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/term-size.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.2.0" -} diff --git a/node_modules/term-size/readme.md b/node_modules/term-size/readme.md deleted file mode 100644 index dd642ca..0000000 --- a/node_modules/term-size/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -# term-size [![Build Status: Linux & macOS](https://travis-ci.org/sindresorhus/term-size.svg?branch=master)](https://travis-ci.org/sindresorhus/term-size) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/c3tydg6uedsk0bob/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/term-size/branch/master) - -> Reliably get the terminal window size - -Because [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) doesn't exist when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped. This module even works when all the TTY file descriptors are redirected! - -Confirmed working on macOS, Linux, and Windows. - - -## Install - -``` -$ npm install --save term-size -``` - - -## Usage - -```js -const termSize = require('term-size'); - -termSize(); -//=> {columns: 143, rows: 24} -``` - - -## API - -### termSize() - -Returns an `Object` with `columns` and `rows` properties. - - -## Related - -- [term-size-cli](https://github.com/sindresorhus/term-size-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/term-size/vendor/macos/term-size b/node_modules/term-size/vendor/macos/term-size deleted file mode 100755 index e383cc7..0000000 Binary files a/node_modules/term-size/vendor/macos/term-size and /dev/null differ diff --git a/node_modules/term-size/vendor/windows/term-size.exe b/node_modules/term-size/vendor/windows/term-size.exe deleted file mode 100644 index c7a170c..0000000 Binary files a/node_modules/term-size/vendor/windows/term-size.exe and /dev/null differ diff --git a/node_modules/throttleit/package.json b/node_modules/throttleit/package.json index a9ae98c..a3d249b 100644 --- a/node_modules/throttleit/package.json +++ b/node_modules/throttleit/package.json @@ -1,4 +1,11 @@ { + "_args": [ + [ + "throttleit@0.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, "_from": "throttleit@0.0.2", "_id": "throttleit@0.0.2", "_inBundle": false, @@ -19,20 +26,17 @@ "/nugget" ], "_resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz", - "_shasum": "cfedf88e60c00dd9697b61fdd2a8343a9b680eaf", - "_spec": "throttleit@0.0.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/nugget", + "_spec": "0.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/component/throttle/issues" }, - "bundleDependencies": false, "component": { "scripts": { "throttle/index.js": "index.js" } }, "dependencies": {}, - "deprecated": false, "description": "Throttle a function", "development": {}, "homepage": "https://github.com/component/throttle#readme", diff --git a/node_modules/through2/package.json b/node_modules/through2/package.json index 170e2ef..adf76ce 100644 --- a/node_modules/through2/package.json +++ b/node_modules/through2/package.json @@ -1,27 +1,33 @@ { - "_from": "through2@~0.2.3", + "_args": [ + [ + "through2@0.2.3", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "through2@0.2.3", "_id": "through2@0.2.3", "_inBundle": false, "_integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", "_location": "/through2", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "through2@~0.2.3", + "raw": "through2@0.2.3", "name": "through2", "escapedName": "through2", - "rawSpec": "~0.2.3", + "rawSpec": "0.2.3", "saveSpec": null, - "fetchSpec": "~0.2.3" + "fetchSpec": "0.2.3" }, "_requiredBy": [ "/progress-stream" ], "_resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", - "_shasum": "eb3284da4ea311b6cc8ace3653748a52abf25a3f", - "_spec": "through2@~0.2.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/progress-stream", + "_spec": "0.2.3", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Rod Vagg", "email": "r@va.gg", @@ -30,12 +36,10 @@ "bugs": { "url": "https://github.com/rvagg/through2/issues" }, - "bundleDependencies": false, "dependencies": { "readable-stream": "~1.1.9", "xtend": "~2.1.1" }, - "deprecated": false, "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", "devDependencies": { "bl": "~0.4.1", diff --git a/node_modules/timed-out/index.js b/node_modules/timed-out/index.js deleted file mode 100644 index 94007a4..0000000 --- a/node_modules/timed-out/index.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -module.exports = function (req, time) { - if (req.timeoutTimer) { - return req; - } - - var delays = isNaN(time) ? time : {socket: time, connect: time}; - var host = req._headers ? (' to ' + req._headers.host) : ''; - - if (delays.connect !== undefined) { - req.timeoutTimer = setTimeout(function timeoutHandler() { - req.abort(); - var e = new Error('Connection timed out on request' + host); - e.code = 'ETIMEDOUT'; - req.emit('error', e); - }, delays.connect); - } - - // Clear the connection timeout timer once a socket is assigned to the - // request and is connected. - req.on('socket', function assign(socket) { - // Socket may come from Agent pool and may be already connected. - if (!(socket.connecting || socket._connecting)) { - connect(); - return; - } - - socket.once('connect', connect); - }); - - function clear() { - if (req.timeoutTimer) { - clearTimeout(req.timeoutTimer); - req.timeoutTimer = null; - } - } - - function connect() { - clear(); - - if (delays.socket !== undefined) { - // Abort the request if there is no activity on the socket for more - // than `delays.socket` milliseconds. - req.setTimeout(delays.socket, function socketTimeoutHandler() { - req.abort(); - var e = new Error('Socket timed out on request' + host); - e.code = 'ESOCKETTIMEDOUT'; - req.emit('error', e); - }); - } - } - - return req.on('error', clear); -}; diff --git a/node_modules/timed-out/license b/node_modules/timed-out/license deleted file mode 100644 index faadd52..0000000 --- a/node_modules/timed-out/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky - -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/timed-out/package.json b/node_modules/timed-out/package.json deleted file mode 100644 index 6546665..0000000 --- a/node_modules/timed-out/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "timed-out@^4.0.0", - "_id": "timed-out@4.0.1", - "_inBundle": false, - "_integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "_location": "/timed-out", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "timed-out@^4.0.0", - "name": "timed-out", - "escapedName": "timed-out", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "_shasum": "f32eacac5a175bea25d7fab565ab3ed8741ef56f", - "_spec": "timed-out@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/got", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com" - }, - "bugs": { - "url": "https://github.com/floatdrop/timed-out/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Emit `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged", - "devDependencies": { - "mocha": "*", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/timed-out#readme", - "keywords": [ - "http", - "https", - "get", - "got", - "url", - "uri", - "request", - "util", - "utility", - "simple" - ], - "license": "MIT", - "name": "timed-out", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/timed-out.git" - }, - "scripts": { - "test": "xo && mocha" - }, - "version": "4.0.1" -} diff --git a/node_modules/timed-out/readme.md b/node_modules/timed-out/readme.md deleted file mode 100644 index fa0a035..0000000 --- a/node_modules/timed-out/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# timed-out [![Build Status](https://travis-ci.org/floatdrop/timed-out.svg?branch=master)](https://travis-ci.org/floatdrop/timed-out) - -> Timeout HTTP/HTTPS requests - -Emit Error object with `code` property equal `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged. - -## Usage - -```js -var get = require('http').get; -var timeout = require('timed-out'); - -var req = get('http://www.google.ru'); -timeout(req, 2000); // Set 2 seconds limit -``` - -### API - -#### timedout(request, time) - -##### request - -*Required* -Type: [`ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) - -The request to watch on. - -##### time - -*Required* -Type: `number` or `object` - -Time in milliseconds to wait for `connect` event on socket and also time to wait on inactive socket. - -Or you can pass Object with following fields: - -- `connect` - time to wait for connection -- `socket` - time to wait for activity on socket - -## License - -MIT © [Vsevolod Strukchinsky](floatdrop@gmail.com) diff --git a/node_modules/tough-cookie/node_modules/punycode/package.json b/node_modules/tough-cookie/node_modules/punycode/package.json index 2ff4048..ddf9188 100644 --- a/node_modules/tough-cookie/node_modules/punycode/package.json +++ b/node_modules/tough-cookie/node_modules/punycode/package.json @@ -1,27 +1,32 @@ { - "_from": "punycode@^1.4.1", + "_args": [ + [ + "punycode@1.4.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "punycode@1.4.1", "_id": "punycode@1.4.1", "_inBundle": false, "_integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "_location": "/tough-cookie/punycode", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "punycode@^1.4.1", + "raw": "punycode@1.4.1", "name": "punycode", "escapedName": "punycode", - "rawSpec": "^1.4.1", + "rawSpec": "1.4.1", "saveSpec": null, - "fetchSpec": "^1.4.1" + "fetchSpec": "1.4.1" }, "_requiredBy": [ "/tough-cookie" ], "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "_shasum": "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e", - "_spec": "punycode@^1.4.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/tough-cookie", + "_spec": "1.4.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" @@ -29,7 +34,6 @@ "bugs": { "url": "https://github.com/bestiejs/punycode.js/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Mathias Bynens", @@ -40,7 +44,6 @@ "url": "http://allyoucanleet.com/" } ], - "deprecated": false, "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", "devDependencies": { "coveralls": "^2.11.4", diff --git a/node_modules/tough-cookie/package.json b/node_modules/tough-cookie/package.json index 2a85a25..0467030 100644 --- a/node_modules/tough-cookie/package.json +++ b/node_modules/tough-cookie/package.json @@ -1,27 +1,32 @@ { - "_from": "tough-cookie@~2.4.3", + "_args": [ + [ + "tough-cookie@2.4.3", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "tough-cookie@2.4.3", "_id": "tough-cookie@2.4.3", "_inBundle": false, "_integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "_location": "/tough-cookie", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "tough-cookie@~2.4.3", + "raw": "tough-cookie@2.4.3", "name": "tough-cookie", "escapedName": "tough-cookie", - "rawSpec": "~2.4.3", + "rawSpec": "2.4.3", "saveSpec": null, - "fetchSpec": "~2.4.3" + "fetchSpec": "2.4.3" }, "_requiredBy": [ "/request" ], "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "_shasum": "53f36da3f47783b0925afa06ff9f3b165280f781", - "_spec": "tough-cookie@~2.4.3", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "2.4.3", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Jeremy Stashewsky", "email": "jstash@gmail.com" @@ -29,7 +34,6 @@ "bugs": { "url": "https://github.com/salesforce/tough-cookie/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Alexander Savin" @@ -54,7 +58,6 @@ "psl": "^1.1.24", "punycode": "^1.4.1" }, - "deprecated": false, "description": "RFC6265 Cookies and Cookie Jar for node.js", "devDependencies": { "async": "^1.4.2", diff --git a/node_modules/trim-newlines/package.json b/node_modules/trim-newlines/package.json index c905826..8bc5af7 100644 --- a/node_modules/trim-newlines/package.json +++ b/node_modules/trim-newlines/package.json @@ -1,27 +1,33 @@ { - "_from": "trim-newlines@^1.0.0", + "_args": [ + [ + "trim-newlines@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "trim-newlines@1.0.0", "_id": "trim-newlines@1.0.0", "_inBundle": false, "_integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", "_location": "/trim-newlines", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "trim-newlines@^1.0.0", + "raw": "trim-newlines@1.0.0", "name": "trim-newlines", "escapedName": "trim-newlines", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/meow" ], "_resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "_shasum": "5887966bb582a4503a41eb524f7d35011815a613", - "_spec": "trim-newlines@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/meow", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/trim-newlines/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Trim newlines from the start and/or end of a string", "devDependencies": { "ava": "*", diff --git a/node_modules/truncate-utf8-bytes/package.json b/node_modules/truncate-utf8-bytes/package.json index 621531f..cfcd076 100644 --- a/node_modules/truncate-utf8-bytes/package.json +++ b/node_modules/truncate-utf8-bytes/package.json @@ -1,27 +1,33 @@ { - "_from": "truncate-utf8-bytes@^1.0.0", + "_args": [ + [ + "truncate-utf8-bytes@1.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "truncate-utf8-bytes@1.0.2", "_id": "truncate-utf8-bytes@1.0.2", "_inBundle": false, "_integrity": "sha1-QFkjkJWS1W94pYGENLC3hInKXys=", "_location": "/truncate-utf8-bytes", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "truncate-utf8-bytes@^1.0.0", + "raw": "truncate-utf8-bytes@1.0.2", "name": "truncate-utf8-bytes", "escapedName": "truncate-utf8-bytes", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.2" }, "_requiredBy": [ "/sanitize-filename" ], "_resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", - "_shasum": "405923909592d56f78a5818434b0b78489ca5f2b", - "_spec": "truncate-utf8-bytes@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sanitize-filename", + "_spec": "1.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Carl Xiong", "email": "xiongc05@gmail.com" @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/parshap/truncate-utf8-bytes/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Carl Xiong", @@ -44,7 +49,6 @@ "dependencies": { "utf8-byte-length": "^1.0.1" }, - "deprecated": false, "description": "Truncate string to given length in bytes", "devDependencies": { "tape": "^4.2.2" diff --git a/node_modules/tunnel-agent/package.json b/node_modules/tunnel-agent/package.json index 58f4a33..609acac 100644 --- a/node_modules/tunnel-agent/package.json +++ b/node_modules/tunnel-agent/package.json @@ -1,27 +1,33 @@ { - "_from": "tunnel-agent@^0.6.0", + "_args": [ + [ + "tunnel-agent@0.6.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "tunnel-agent@0.6.0", "_id": "tunnel-agent@0.6.0", "_inBundle": false, "_integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "_location": "/tunnel-agent", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "tunnel-agent@^0.6.0", + "raw": "tunnel-agent@0.6.0", "name": "tunnel-agent", "escapedName": "tunnel-agent", - "rawSpec": "^0.6.0", + "rawSpec": "0.6.0", "saveSpec": null, - "fetchSpec": "^0.6.0" + "fetchSpec": "0.6.0" }, "_requiredBy": [ + "/prebuild-install", "/request" ], "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "_shasum": "27a5dea06b36b04a0a9966774b290868f0fc40fd", - "_spec": "tunnel-agent@^0.6.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "0.6.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", @@ -30,11 +36,9 @@ "bugs": { "url": "https://github.com/mikeal/tunnel-agent/issues" }, - "bundleDependencies": false, "dependencies": { "safe-buffer": "^5.0.1" }, - "deprecated": false, "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, "engines": { diff --git a/node_modules/tweetnacl/package.json b/node_modules/tweetnacl/package.json index 8e2ed56..f8b7738 100644 --- a/node_modules/tweetnacl/package.json +++ b/node_modules/tweetnacl/package.json @@ -1,28 +1,33 @@ { - "_from": "tweetnacl@~0.14.0", + "_args": [ + [ + "tweetnacl@0.14.5", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "tweetnacl@0.14.5", "_id": "tweetnacl@0.14.5", "_inBundle": false, "_integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "_location": "/tweetnacl", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "tweetnacl@~0.14.0", + "raw": "tweetnacl@0.14.5", "name": "tweetnacl", "escapedName": "tweetnacl", - "rawSpec": "~0.14.0", + "rawSpec": "0.14.5", "saveSpec": null, - "fetchSpec": "~0.14.0" + "fetchSpec": "0.14.5" }, "_requiredBy": [ "/bcrypt-pbkdf", "/sshpk" ], "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "_shasum": "5ae68177f192d4456269d108afa93ff8743f4f64", - "_spec": "tweetnacl@~0.14.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/sshpk", + "_spec": "0.14.5", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "TweetNaCl-js contributors" }, @@ -33,8 +38,6 @@ "bugs": { "url": "https://github.com/dchest/tweetnacl-js/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Port of TweetNaCl cryptographic library to JavaScript", "devDependencies": { "browserify": "^13.0.0", diff --git a/node_modules/typedarray/package.json b/node_modules/typedarray/package.json index 6e62fb6..a62ea1d 100644 --- a/node_modules/typedarray/package.json +++ b/node_modules/typedarray/package.json @@ -1,27 +1,33 @@ { - "_from": "typedarray@^0.0.6", + "_args": [ + [ + "typedarray@0.0.6", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "typedarray@0.0.6", "_id": "typedarray@0.0.6", "_inBundle": false, "_integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "_location": "/typedarray", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "typedarray@^0.0.6", + "raw": "typedarray@0.0.6", "name": "typedarray", "escapedName": "typedarray", - "rawSpec": "^0.0.6", + "rawSpec": "0.0.6", "saveSpec": null, - "fetchSpec": "^0.0.6" + "fetchSpec": "0.0.6" }, "_requiredBy": [ "/concat-stream" ], "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", - "_spec": "typedarray@^0.0.6", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/concat-stream", + "_spec": "0.0.6", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "James Halliday", "email": "mail@substack.net", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/substack/typedarray/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "TypedArray polyfill for old browsers", "devDependencies": { "tape": "~2.3.2" diff --git a/node_modules/unique-string/index.js b/node_modules/unique-string/index.js deleted file mode 100644 index 5bc7787..0000000 --- a/node_modules/unique-string/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const cryptoRandomString = require('crypto-random-string'); - -module.exports = () => cryptoRandomString(32); diff --git a/node_modules/unique-string/license b/node_modules/unique-string/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/unique-string/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/unique-string/package.json b/node_modules/unique-string/package.json deleted file mode 100644 index e69d785..0000000 --- a/node_modules/unique-string/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "unique-string@^1.0.0", - "_id": "unique-string@1.0.0", - "_inBundle": false, - "_integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "_location": "/unique-string", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "unique-string@^1.0.0", - "name": "unique-string", - "escapedName": "unique-string", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/configstore" - ], - "_resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "_shasum": "9e1057cca851abb93398f8b33ae187b99caec11a", - "_spec": "unique-string@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/configstore", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/unique-string/issues" - }, - "bundleDependencies": false, - "dependencies": { - "crypto-random-string": "^1.0.0" - }, - "deprecated": false, - "description": "Generate a unique random string", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/unique-string#readme", - "keywords": [ - "unique", - "string", - "random", - "uniq", - "str", - "rand", - "text", - "id", - "identifier", - "slug", - "hex" - ], - "license": "MIT", - "name": "unique-string", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/unique-string.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/unique-string/readme.md b/node_modules/unique-string/readme.md deleted file mode 100644 index 5d5ac97..0000000 --- a/node_modules/unique-string/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# unique-string [![Build Status](https://travis-ci.org/sindresorhus/unique-string.svg?branch=master)](https://travis-ci.org/sindresorhus/unique-string) - -> Generate a unique random string - - -## Install - -``` -$ npm install --save unique-string -``` - - -## Usage - -```js -const uniqueString = require('unique-string'); - -uniqueString(); -//=> 'b4de2a49c8ffa3fbee04446f045483b2' -``` - - -## API - -### uniqueString() - -Returns a 32 character unique string. Matches the length of MD5, which is [unique enough](http://stackoverflow.com/a/2444336/64949) for non-crypto purposes. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/universalify/package.json b/node_modules/universalify/package.json index 6383b90..da5c28d 100644 --- a/node_modules/universalify/package.json +++ b/node_modules/universalify/package.json @@ -1,27 +1,35 @@ { - "_from": "universalify@^0.1.0", + "_args": [ + [ + "universalify@0.1.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "universalify@0.1.2", "_id": "universalify@0.1.2", "_inBundle": false, "_integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "_location": "/universalify", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "universalify@^0.1.0", + "raw": "universalify@0.1.2", "name": "universalify", "escapedName": "universalify", - "rawSpec": "^0.1.0", + "rawSpec": "0.1.2", "saveSpec": null, - "fetchSpec": "^0.1.0" + "fetchSpec": "0.1.2" }, "_requiredBy": [ + "/electron-notarize/fs-extra", + "/electron-packager/fs-extra", "/fs-extra" ], "_resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "_shasum": "b646f69be3942dabcecc9d6639c80dc105efaa66", - "_spec": "universalify@^0.1.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/fs-extra", + "_spec": "0.1.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Ryan Zimmerman", "email": "opensrc@ryanzim.com" @@ -29,8 +37,6 @@ "bugs": { "url": "https://github.com/RyanZim/universalify/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Make a callback- or promise-based function support both promises and callbacks.", "devDependencies": { "colortape": "^0.1.2", diff --git a/node_modules/unused-filename/package.json b/node_modules/unused-filename/package.json index 418e996..e5fd743 100644 --- a/node_modules/unused-filename/package.json +++ b/node_modules/unused-filename/package.json @@ -1,27 +1,32 @@ { - "_from": "unused-filename@^1.0.0", + "_args": [ + [ + "unused-filename@1.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "unused-filename@1.0.0", "_id": "unused-filename@1.0.0", "_inBundle": false, "_integrity": "sha1-00CID3GuIRXrqhMlvvBcxmhEacY=", "_location": "/unused-filename", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "unused-filename@^1.0.0", + "raw": "unused-filename@1.0.0", "name": "unused-filename", "escapedName": "unused-filename", - "rawSpec": "^1.0.0", + "rawSpec": "1.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "1.0.0" }, "_requiredBy": [ "/electron-dl" ], "_resolved": "https://registry.npmjs.org/unused-filename/-/unused-filename-1.0.0.tgz", - "_shasum": "d340880f71ae2115ebaa1325bef05cc6684469c6", - "_spec": "unused-filename@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-dl", + "_spec": "1.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,12 +35,10 @@ "bugs": { "url": "https://github.com/sindresorhus/unused-filename/issues" }, - "bundleDependencies": false, "dependencies": { "modify-filename": "^1.1.0", "path-exists": "^3.0.0" }, - "deprecated": false, "description": "Get an unused filename by appending a number if it exists: `file.txt` → `file (1).txt`", "devDependencies": { "ava": "*", diff --git a/node_modules/unzip-response/index.js b/node_modules/unzip-response/index.js deleted file mode 100644 index e97b993..0000000 --- a/node_modules/unzip-response/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; -const PassThrough = require('stream').PassThrough; -const zlib = require('zlib'); - -module.exports = res => { - // TODO: use Array#includes when targeting Node.js 6 - if (['gzip', 'deflate'].indexOf(res.headers['content-encoding']) === -1) { - return res; - } - - const unzip = zlib.createUnzip(); - const stream = new PassThrough(); - - stream.httpVersion = res.httpVersion; - stream.headers = res.headers; - stream.rawHeaders = res.rawHeaders; - stream.trailers = res.trailers; - stream.rawTrailers = res.rawTrailers; - stream.setTimeout = res.setTimeout.bind(res); - stream.statusCode = res.statusCode; - stream.statusMessage = res.statusMessage; - stream.socket = res.socket; - - unzip.on('error', err => { - if (err.code === 'Z_BUF_ERROR') { - stream.end(); - return; - } - - stream.emit('error', err); - }); - - res.pipe(unzip).pipe(stream); - - return stream; -}; diff --git a/node_modules/unzip-response/license b/node_modules/unzip-response/license deleted file mode 100644 index 32a16ce..0000000 --- a/node_modules/unzip-response/license +++ /dev/null @@ -1,21 +0,0 @@ -`The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/unzip-response/package.json b/node_modules/unzip-response/package.json deleted file mode 100644 index 3ee74a1..0000000 --- a/node_modules/unzip-response/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "unzip-response@^2.0.1", - "_id": "unzip-response@2.0.1", - "_inBundle": false, - "_integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", - "_location": "/unzip-response", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "unzip-response@^2.0.1", - "name": "unzip-response", - "escapedName": "unzip-response", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "_shasum": "d2f0f737d16b0615e72a6935ed04214572d56f97", - "_spec": "unzip-response@^2.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/got", - "bugs": { - "url": "https://github.com/sindresorhus/unzip-response/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Unzip a HTTP response if needed", - "devDependencies": { - "ava": "*", - "get-stream": "^2.3.0", - "pify": "^2.3.0", - "rfpify": "^1.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/unzip-response#readme", - "keywords": [ - "http", - "unzip", - "zlib", - "gzip", - "deflate", - "incoming", - "message", - "response", - "stream" - ], - "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - } - ], - "name": "unzip-response", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/unzip-response.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.1", - "xo": { - "esnext": true - } -} diff --git a/node_modules/unzip-response/readme.md b/node_modules/unzip-response/readme.md deleted file mode 100644 index 87a62c4..0000000 --- a/node_modules/unzip-response/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# unzip-response [![Build Status](https://travis-ci.org/sindresorhus/unzip-response.svg?branch=master)](https://travis-ci.org/sindresorhus/unzip-response) - -> Unzip a HTTP response if needed - -Unzips the response from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped/deflated, otherwise just passes it through. - - -## Install - -``` -$ npm install --save unzip-response -``` - - -## Usage - -```js -const http = require('http'); -const unzipResponse = require('unzip-response'); - -http.get('http://sindresorhus.com', res => { - res = unzipResponse(res); -}); -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/update-notifier/check.js b/node_modules/update-notifier/check.js deleted file mode 100644 index 521f84a..0000000 --- a/node_modules/update-notifier/check.js +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable unicorn/no-process-exit */ -'use strict'; -let updateNotifier = require('.'); - -const options = JSON.parse(process.argv[2]); - -updateNotifier = new updateNotifier.UpdateNotifier(options); - -updateNotifier.checkNpm().then(update => { - // Only update the last update check time on success - updateNotifier.config.set('lastUpdateCheck', Date.now()); - - if (update.type && update.type !== 'latest') { - updateNotifier.config.set('update', update); - } - - // Call process exit explicitly to terminate the child process - // Otherwise the child process will run forever, according to the Node.js docs - process.exit(); -}).catch(() => { - process.exit(1); -}); diff --git a/node_modules/update-notifier/index.js b/node_modules/update-notifier/index.js deleted file mode 100644 index 38ff01e..0000000 --- a/node_modules/update-notifier/index.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; -const spawn = require('child_process').spawn; -const path = require('path'); -const format = require('util').format; -const importLazy = require('import-lazy')(require); - -const configstore = importLazy('configstore'); -const chalk = importLazy('chalk'); -const semverDiff = importLazy('semver-diff'); -const latestVersion = importLazy('latest-version'); -const isNpm = importLazy('is-npm'); -const isInstalledGlobally = importLazy('is-installed-globally'); -const boxen = importLazy('boxen'); -const xdgBasedir = importLazy('xdg-basedir'); -const isCi = importLazy('is-ci'); -const ONE_DAY = 1000 * 60 * 60 * 24; - -class UpdateNotifier { - constructor(options) { - options = options || {}; - this.options = options; - options.pkg = options.pkg || {}; - - // Reduce pkg to the essential keys. with fallback to deprecated options - // TODO: Remove deprecated options at some point far into the future - options.pkg = { - name: options.pkg.name || options.packageName, - version: options.pkg.version || options.packageVersion - }; - - if (!options.pkg.name || !options.pkg.version) { - throw new Error('pkg.name and pkg.version required'); - } - - this.packageName = options.pkg.name; - this.packageVersion = options.pkg.version; - this.updateCheckInterval = typeof options.updateCheckInterval === 'number' ? options.updateCheckInterval : ONE_DAY; - this.hasCallback = typeof options.callback === 'function'; - this.callback = options.callback || (() => {}); - this.disabled = 'NO_UPDATE_NOTIFIER' in process.env || - process.argv.indexOf('--no-update-notifier') !== -1 || - isCi(); - this.shouldNotifyInNpmScript = options.shouldNotifyInNpmScript; - - if (!this.disabled && !this.hasCallback) { - try { - const ConfigStore = configstore(); - this.config = new ConfigStore(`update-notifier-${this.packageName}`, { - optOut: false, - // Init with the current time so the first check is only - // after the set interval, so not to bother users right away - lastUpdateCheck: Date.now() - }); - } catch (err) { - // Expecting error code EACCES or EPERM - const msg = - chalk().yellow(format(' %s update check failed ', options.pkg.name)) + - format('\n Try running with %s or get access ', chalk().cyan('sudo')) + - '\n to the local update config store via \n' + - chalk().cyan(format(' sudo chown -R $USER:$(id -gn $USER) %s ', xdgBasedir().config)); - - process.on('exit', () => { - console.error('\n' + boxen()(msg, {align: 'center'})); - }); - } - } - } - check() { - if (this.hasCallback) { - this.checkNpm() - .then(update => this.callback(null, update)) - .catch(err => this.callback(err)); - return; - } - - if ( - !this.config || - this.config.get('optOut') || - this.disabled - ) { - return; - } - - this.update = this.config.get('update'); - - if (this.update) { - this.config.delete('update'); - } - - // Only check for updates on a set interval - if (Date.now() - this.config.get('lastUpdateCheck') < this.updateCheckInterval) { - return; - } - - // Spawn a detached process, passing the options as an environment property - spawn(process.execPath, [path.join(__dirname, 'check.js'), JSON.stringify(this.options)], { - detached: true, - stdio: 'ignore' - }).unref(); - } - checkNpm() { - return latestVersion()(this.packageName).then(latestVersion => { - return { - latest: latestVersion, - current: this.packageVersion, - type: semverDiff()(this.packageVersion, latestVersion) || 'latest', - name: this.packageName - }; - }); - } - notify(opts) { - const suppressForNpm = !this.shouldNotifyInNpmScript && isNpm(); - if (!process.stdout.isTTY || suppressForNpm || !this.update) { - return this; - } - - opts = Object.assign({isGlobal: isInstalledGlobally()}, opts); - - opts.message = opts.message || 'Update available ' + chalk().dim(this.update.current) + chalk().reset(' → ') + - chalk().green(this.update.latest) + ' \nRun ' + chalk().cyan('npm i ' + (opts.isGlobal ? '-g ' : '') + this.packageName) + ' to update'; - - opts.boxenOpts = opts.boxenOpts || { - padding: 1, - margin: 1, - align: 'center', - borderColor: 'yellow', - borderStyle: 'round' - }; - - const message = '\n' + boxen()(opts.message, opts.boxenOpts); - - if (opts.defer === false) { - console.error(message); - } else { - process.on('exit', () => { - console.error(message); - }); - - process.on('SIGINT', () => { - console.error(''); - process.exit(); - }); - } - - return this; - } -} - -module.exports = options => { - const updateNotifier = new UpdateNotifier(options); - updateNotifier.check(); - return updateNotifier; -}; - -module.exports.UpdateNotifier = UpdateNotifier; diff --git a/node_modules/update-notifier/license b/node_modules/update-notifier/license deleted file mode 100644 index cea5a35..0000000 --- a/node_modules/update-notifier/license +++ /dev/null @@ -1,9 +0,0 @@ -Copyright Google - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/update-notifier/node_modules/.bin/is-ci b/node_modules/update-notifier/node_modules/.bin/is-ci deleted file mode 120000 index fe6aca6..0000000 --- a/node_modules/update-notifier/node_modules/.bin/is-ci +++ /dev/null @@ -1 +0,0 @@ -../is-ci/bin.js \ No newline at end of file diff --git a/node_modules/update-notifier/node_modules/ci-info/CHANGELOG.md b/node_modules/update-notifier/node_modules/ci-info/CHANGELOG.md deleted file mode 100644 index 859a0ad..0000000 --- a/node_modules/update-notifier/node_modules/ci-info/CHANGELOG.md +++ /dev/null @@ -1,62 +0,0 @@ -# Changelog - -## v1.6.0 - -* feat: add Sail CI support -* feat: add Buddy support -* feat: add Bitrise support -* feat: detect Jenkins PRs -* feat: detect Drone PRs - -## v1.5.1 - -* fix: use full path to vendors.json - -## v1.5.0 - -* feat: add dsari detection ([#15](https://github.com/watson/ci-info/pull/15)) -* feat: add ci.isPR ([#16](https://github.com/watson/ci-info/pull/16)) - -## v1.4.0 - -* feat: add Cirrus CI detection ([#13](https://github.com/watson/ci-info/pull/13)) -* feat: add Shippable CI detection ([#14](https://github.com/watson/ci-info/pull/14)) - -## v1.3.1 - -* chore: reduce npm package size by not including `.github` folder content ([#11](https://github.com/watson/ci-info/pull/11)) - -## v1.3.0 - -* feat: add support for Strider CD -* chore: deprecate vendor constant `TDDIUM` in favor of `SOLANO` -* docs: add missing vendor constant to docs - -## v1.2.0 - -* feat: detect solano-ci ([#9](https://github.com/watson/ci-info/pull/9)) - -## v1.1.3 - -* fix: fix spelling of Hunson in `ci.name` - -## v1.1.2 - -* fix: no more false positive matches for Jenkins - -## v1.1.1 - -* docs: sort lists of CI servers in README.md -* docs: add missing AWS CodeBuild to the docs - -## v1.1.0 - -* feat: add AWS CodeBuild to CI detection ([#2](https://github.com/watson/ci-info/pull/2)) - -## v1.0.1 - -* chore: reduce npm package size by using an `.npmignore` file ([#3](https://github.com/watson/ci-info/pull/3)) - -## v1.0.0 - -* Initial release diff --git a/node_modules/update-notifier/node_modules/ci-info/LICENSE b/node_modules/update-notifier/node_modules/ci-info/LICENSE deleted file mode 100644 index 6784683..0000000 --- a/node_modules/update-notifier/node_modules/ci-info/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018 Thomas Watson Steen - -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/update-notifier/node_modules/ci-info/README.md b/node_modules/update-notifier/node_modules/ci-info/README.md deleted file mode 100644 index c88be8f..0000000 --- a/node_modules/update-notifier/node_modules/ci-info/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# ci-info - -Get details about the current Continuous Integration environment. - -Please [open an -issue](https://github.com/watson/ci-info/issues/new?template=ci-server-not-detected.md) -if your CI server isn't properly detected :) - -[![npm](https://img.shields.io/npm/v/ci-info.svg)](https://www.npmjs.com/package/ci-info) -[![Build status](https://travis-ci.org/watson/ci-info.svg?branch=master)](https://travis-ci.org/watson/ci-info) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) - -## Installation - -```bash -npm install ci-info --save -``` - -## Usage - -```js -var ci = require('ci-info') - -if (ci.isCI) { - console.log('The name of the CI server is:', ci.name) -} else { - console.log('This program is not running on a CI server') -} -``` - -## Supported CI tools - -Officially supported CI servers: - -| Name | Constant | -|------|----------| -| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | -| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | -| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | -| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | -| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | -| [Buddy](https://buddy.works/) | `ci.BUDDY` | -| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | -| [CircleCI](http://circleci.com) | `ci.CIRCLE` | -| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | -| [Codeship](https://codeship.com) | `ci.CODESHIP` | -| [Drone](https://drone.io) | `ci.DRONE` | -| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | -| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | -| [GoCD](https://www.go.cd/) | `ci.GOCD` | -| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | -| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | -| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | -| [Sail CI](https://sail.ci/) | `ci.SAIL` | -| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | -| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | -| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | -| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | -| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | -| [Team Foundation Server](https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx) by Microsoft | `ci.TFS` | -| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | -| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | - -## API - -### `ci.name` - -A string. Will contain the name of the CI server the code is running on. -If not CI server is detected, it will be `null`. - -Don't depend on the value of this string not to change for a specific -vendor. If you find your self writing `ci.name === 'Travis CI'`, you -most likely want to use `ci.TRAVIS` instead. - -### `ci.isCI` - -A boolean. Will be `true` if the code is running on a CI server. -Otherwise `false`. - -Some CI servers not listed here might still trigger the `ci.isCI` -boolean to be set to `true` if they use certain vendor neutral -environment variables. In those cases `ci.name` will be `null` and no -vendor specific boolean will be set to `true`. - -### `ci.isPR` - -A boolean if PR detection is supported for the current CI server. Will -be `true` if a PR is being tested. Otherwise `false`. If PR detection is -not supported for the current CI server, the value will be `null`. - -### `ci.` - -A vendor specific boolean constants is exposed for each support CI -vendor. A constant will be `true` if the code is determined to run on -the given CI server. Otherwise `false`. - -Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a -complete list, see the support table above. - -Deprecated vendor constants that will be removed in the next major -release: - -- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO` - -## License - -[MIT](LICENSE) diff --git a/node_modules/update-notifier/node_modules/ci-info/index.js b/node_modules/update-notifier/node_modules/ci-info/index.js deleted file mode 100644 index 27794d4..0000000 --- a/node_modules/update-notifier/node_modules/ci-info/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict' - -var vendors = require('./vendors.json') - -var env = process.env - -// Used for testinging only -Object.defineProperty(exports, '_vendors', { - value: vendors.map(function (v) { return v.constant }) -}) - -exports.name = null -exports.isPR = null - -vendors.forEach(function (vendor) { - var envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env] - var isCI = envs.every(function (obj) { - return checkEnv(obj) - }) - - exports[vendor.constant] = isCI - - if (isCI) { - exports.name = vendor.name - - switch (typeof vendor.pr) { - case 'string': - // "pr": "CIRRUS_PR" - exports.isPR = !!env[vendor.pr] - break - case 'object': - if ('env' in vendor.pr) { - // "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } - exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne - } else if ('any' in vendor.pr) { - // "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } - exports.isPR = vendor.pr.any.some(function (key) { - return !!env[key] - }) - } else { - // "pr": { "DRONE_BUILD_EVENT": "pull_request" } - exports.isPR = checkEnv(vendor.pr) - } - break - default: - // PR detection not supported for this vendor - exports.isPR = null - } - } -}) - -exports.isCI = !!( - env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari - env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI - env.BUILD_NUMBER || // Jenkins, TeamCity - env.RUN_ID || // TaskCluster, dsari - exports.name || - false -) - -function checkEnv (obj) { - if (typeof obj === 'string') return !!env[obj] - return Object.keys(obj).every(function (k) { - return env[k] === obj[k] - }) -} diff --git a/node_modules/update-notifier/node_modules/ci-info/package.json b/node_modules/update-notifier/node_modules/ci-info/package.json deleted file mode 100644 index e94f12d..0000000 --- a/node_modules/update-notifier/node_modules/ci-info/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "ci-info@^1.5.0", - "_id": "ci-info@1.6.0", - "_inBundle": false, - "_integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", - "_location": "/update-notifier/ci-info", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ci-info@^1.5.0", - "name": "ci-info", - "escapedName": "ci-info", - "rawSpec": "^1.5.0", - "saveSpec": null, - "fetchSpec": "^1.5.0" - }, - "_requiredBy": [ - "/update-notifier/is-ci" - ], - "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "_shasum": "2ca20dbb9ceb32d4524a683303313f0304b1e497", - "_spec": "ci-info@^1.5.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/update-notifier/node_modules/is-ci", - "author": { - "name": "Thomas Watson Steen", - "email": "w@tson.dk", - "url": "https://twitter.com/wa7son" - }, - "bugs": { - "url": "https://github.com/watson/ci-info/issues" - }, - "bundleDependencies": false, - "coordinates": [ - 55.778271, - 12.593091 - ], - "dependencies": {}, - "deprecated": false, - "description": "Get details about the current Continuous Integration environment", - "devDependencies": { - "clear-require": "^1.0.1", - "standard": "^12.0.1", - "tape": "^4.9.1" - }, - "homepage": "https://github.com/watson/ci-info", - "keywords": [ - "ci", - "continuous", - "integration", - "test", - "detect" - ], - "license": "MIT", - "main": "index.js", - "name": "ci-info", - "repository": { - "type": "git", - "url": "git+https://github.com/watson/ci-info.git" - }, - "scripts": { - "test": "standard && node test.js" - }, - "version": "1.6.0" -} diff --git a/node_modules/update-notifier/node_modules/ci-info/vendors.json b/node_modules/update-notifier/node_modules/ci-info/vendors.json deleted file mode 100644 index a157b78..0000000 --- a/node_modules/update-notifier/node_modules/ci-info/vendors.json +++ /dev/null @@ -1,152 +0,0 @@ -[ - { - "name": "AppVeyor", - "constant": "APPVEYOR", - "env": "APPVEYOR", - "pr": "APPVEYOR_PULL_REQUEST_NUMBER" - }, - { - "name": "Bamboo", - "constant": "BAMBOO", - "env": "bamboo_planKey" - }, - { - "name": "Bitbucket Pipelines", - "constant": "BITBUCKET", - "env": "BITBUCKET_COMMIT" - }, - { - "name": "Bitrise", - "constant": "BITRISE", - "env": "BITRISE_IO", - "pr": "BITRISE_PULL_REQUEST" - }, - { - "name": "Buddy", - "constant": "BUDDY", - "env": "BUDDY_WORKSPACE_ID", - "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID" - }, - { - "name": "Buildkite", - "constant": "BUILDKITE", - "env": "BUILDKITE", - "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } - }, - { - "name": "CircleCI", - "constant": "CIRCLE", - "env": "CIRCLECI", - "pr": "CIRCLE_PULL_REQUEST" - }, - { - "name": "Cirrus CI", - "constant": "CIRRUS", - "env": "CIRRUS_CI", - "pr": "CIRRUS_PR" - }, - { - "name": "AWS CodeBuild", - "constant": "CODEBUILD", - "env": "CODEBUILD_BUILD_ARN" - }, - { - "name": "Codeship", - "constant": "CODESHIP", - "env": { "CI_NAME": "codeship" } - }, - { - "name": "Drone", - "constant": "DRONE", - "env": "DRONE", - "pr": { "DRONE_BUILD_EVENT": "pull_request" } - }, - { - "name": "dsari", - "constant": "DSARI", - "env": "DSARI" - }, - { - "name": "GitLab CI", - "constant": "GITLAB", - "env": "GITLAB_CI" - }, - { - "name": "GoCD", - "constant": "GOCD", - "env": "GO_PIPELINE_LABEL" - }, - { - "name": "Hudson", - "constant": "HUDSON", - "env": "HUDSON_URL" - }, - { - "name": "Jenkins", - "constant": "JENKINS", - "env": ["JENKINS_URL", "BUILD_ID"], - "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } - }, - { - "name": "Magnum CI", - "constant": "MAGNUM", - "env": "MAGNUM" - }, - { - "name": "Sail CI", - "constant": "SAIL", - "env": "SAILCI", - "pr": "SAIL_PULL_REQUEST_NUMBER" - }, - { - "name": "Semaphore", - "constant": "SEMAPHORE", - "env": "SEMAPHORE", - "pr": "PULL_REQUEST_NUMBER" - }, - { - "name": "Shippable", - "constant": "SHIPPABLE", - "env": "SHIPPABLE", - "pr": { "IS_PULL_REQUEST": "true" } - }, - { - "name": "Solano CI", - "constant": "SOLANO", - "env": "TDDIUM", - "pr": "TDDIUM_PR_ID" - }, - { - "name": "Strider CD", - "constant": "STRIDER", - "env": "STRIDER" - }, - { - "name": "TaskCluster", - "constant": "TASKCLUSTER", - "env": ["TASK_ID", "RUN_ID"] - }, - { - "name": "Solano CI", - "constant": "TDDIUM", - "env": "TDDIUM", - "pr": "TDDIUM_PR_ID", - "deprecated": true - }, - { - "name": "TeamCity", - "constant": "TEAMCITY", - "env": "TEAMCITY_VERSION" - }, - { - "name": "Team Foundation Server", - "constant": "TFS", - "env": "TF_BUILD" - }, - { - "name": "Travis CI", - "constant": "TRAVIS", - "env": "TRAVIS", - "pr": { "env": "TRAVIS_PULL_REQUEST", "ne": "false" } - } -] diff --git a/node_modules/update-notifier/node_modules/is-ci/LICENSE b/node_modules/update-notifier/node_modules/is-ci/LICENSE deleted file mode 100644 index 6784683..0000000 --- a/node_modules/update-notifier/node_modules/is-ci/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018 Thomas Watson Steen - -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/update-notifier/node_modules/is-ci/README.md b/node_modules/update-notifier/node_modules/is-ci/README.md deleted file mode 100644 index bc3840a..0000000 --- a/node_modules/update-notifier/node_modules/is-ci/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# is-ci - -Returns `true` if the current environment is a Continuous Integration -server. - -Please [open an issue](https://github.com/watson/is-ci/issues) if your -CI server isn't properly detected :) - -[![npm](https://img.shields.io/npm/v/is-ci.svg)](https://www.npmjs.com/package/is-ci) -[![Build status](https://travis-ci.org/watson/is-ci.svg?branch=master)](https://travis-ci.org/watson/is-ci) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) - -## Installation - -```bash -npm install is-ci --save -``` - -## Programmatic Usage - -```js -const isCI = require('is-ci') - -if (isCI) { - console.log('The code is running on a CI server') -} -``` - -## CLI Usage - -For CLI usage you need to have the `is-ci` executable in your `PATH`. -There's a few ways to do that: - -- Either install the module globally using `npm install is-ci -g` -- Or add the module as a dependency to your app in which case it can be - used inside your package.json scripts as is -- Or provide the full path to the executable, e.g. - `./node_modules/.bin/is-ci` - -```bash -is-ci && echo "This is a CI server" -``` - -## Supported CI tools - -Refer to [ci-info](https://github.com/watson/ci-info#supported-ci-tools) docs for all supported CI's - -## License - -[MIT](LICENSE) diff --git a/node_modules/update-notifier/node_modules/is-ci/bin.js b/node_modules/update-notifier/node_modules/is-ci/bin.js deleted file mode 100755 index 0c56c01..0000000 --- a/node_modules/update-notifier/node_modules/is-ci/bin.js +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node -'use strict' - -process.exit(require('./') ? 0 : 1) diff --git a/node_modules/update-notifier/node_modules/is-ci/index.js b/node_modules/update-notifier/node_modules/is-ci/index.js deleted file mode 100644 index d4cb67a..0000000 --- a/node_modules/update-notifier/node_modules/is-ci/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('ci-info').isCI diff --git a/node_modules/update-notifier/node_modules/is-ci/package.json b/node_modules/update-notifier/node_modules/is-ci/package.json deleted file mode 100644 index ec229cd..0000000 --- a/node_modules/update-notifier/node_modules/is-ci/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "is-ci@^1.0.10", - "_id": "is-ci@1.2.1", - "_inBundle": false, - "_integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", - "_location": "/update-notifier/is-ci", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-ci@^1.0.10", - "name": "is-ci", - "escapedName": "is-ci", - "rawSpec": "^1.0.10", - "saveSpec": null, - "fetchSpec": "^1.0.10" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "_shasum": "e3779c8ee17fccf428488f6e281187f2e632841c", - "_spec": "is-ci@^1.0.10", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/update-notifier", - "author": { - "name": "Thomas Watson Steen", - "email": "w@tson.dk", - "url": "https://twitter.com/wa7son" - }, - "bin": { - "is-ci": "bin.js" - }, - "bugs": { - "url": "https://github.com/watson/is-ci/issues" - }, - "bundleDependencies": false, - "coordinates": [ - 55.778255, - 12.593033 - ], - "dependencies": { - "ci-info": "^1.5.0" - }, - "deprecated": false, - "description": "Detect if the current environment is a CI server", - "devDependencies": { - "clear-require": "^1.0.1", - "standard": "^11.0.1" - }, - "homepage": "https://github.com/watson/is-ci", - "keywords": [ - "ci", - "continuous", - "integration", - "test", - "detect" - ], - "license": "MIT", - "main": "index.js", - "name": "is-ci", - "repository": { - "type": "git", - "url": "git+https://github.com/watson/is-ci.git" - }, - "scripts": { - "test": "standard && node test.js" - }, - "version": "1.2.1" -} diff --git a/node_modules/update-notifier/package.json b/node_modules/update-notifier/package.json deleted file mode 100644 index 8dc869d..0000000 --- a/node_modules/update-notifier/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "update-notifier@^2.5.0", - "_id": "update-notifier@2.5.0", - "_inBundle": false, - "_integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", - "_location": "/update-notifier", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "update-notifier@^2.5.0", - "name": "update-notifier", - "escapedName": "update-notifier", - "rawSpec": "^2.5.0", - "saveSpec": null, - "fetchSpec": "^2.5.0" - }, - "_requiredBy": [ - "/electron-builder" - ], - "_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", - "_shasum": "d0744593e13f161e406acb1d9408b72cad08aff6", - "_spec": "update-notifier@^2.5.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/electron-builder", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/yeoman/update-notifier/issues" - }, - "bundleDependencies": false, - "dependencies": { - "boxen": "^1.2.1", - "chalk": "^2.0.1", - "configstore": "^3.0.0", - "import-lazy": "^2.1.0", - "is-ci": "^1.0.10", - "is-installed-globally": "^0.1.0", - "is-npm": "^1.0.0", - "latest-version": "^3.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - }, - "deprecated": false, - "description": "Update notifications for your CLI app", - "devDependencies": { - "ava": "*", - "clear-module": "^2.1.0", - "fixture-stdout": "^0.2.1", - "mock-require": "^2.0.2", - "strip-ansi": "^4.0.0", - "xo": "^0.18.2" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "check.js" - ], - "homepage": "https://github.com/yeoman/update-notifier#readme", - "keywords": [ - "npm", - "update", - "updater", - "notify", - "notifier", - "check", - "checker", - "cli", - "module", - "package", - "version" - ], - "license": "BSD-2-Clause", - "name": "update-notifier", - "repository": { - "type": "git", - "url": "git+https://github.com/yeoman/update-notifier.git" - }, - "scripts": { - "test": "xo && ava --timeout=20s" - }, - "version": "2.5.0" -} diff --git a/node_modules/update-notifier/readme.md b/node_modules/update-notifier/readme.md deleted file mode 100644 index ef6a1a8..0000000 --- a/node_modules/update-notifier/readme.md +++ /dev/null @@ -1,193 +0,0 @@ -# update-notifier [![Build Status](https://travis-ci.org/yeoman/update-notifier.svg?branch=master)](https://travis-ci.org/yeoman/update-notifier) - -> Update notifications for your CLI app - -![](screenshot.png) - -Inform users of your package of updates in a non-intrusive way. - -#### Contents - -- [Install](#install) -- [Usage](#usage) -- [How](#how) -- [API](#api) -- [About](#about) -- [Users](#users) - - -## Install - -``` -$ npm install update-notifier -``` - - -## Usage - -### Simple - -```js -const updateNotifier = require('update-notifier'); -const pkg = require('./package.json'); - -updateNotifier({pkg}).notify(); -``` - -### Comprehensive - -```js -const updateNotifier = require('update-notifier'); -const pkg = require('./package.json'); - -// Checks for available update and returns an instance -const notifier = updateNotifier({pkg}); - -// Notify using the built-in convenience method -notifier.notify(); - -// `notifier.update` contains some useful info about the update -console.log(notifier.update); -/* -{ - latest: '1.0.1', - current: '1.0.0', - type: 'patch', // Possible values: latest, major, minor, patch, prerelease, build - name: 'pageres' -} -*/ -``` - -### Options and custom message - -```js -const notifier = updateNotifier({ - pkg, - updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week -}); - -if (notifier.update) { - console.log(`Update available: ${notifier.update.latest}`); -} -``` - - -## How - -Whenever you initiate the update notifier and it's not within the interval threshold, it will asynchronously check with npm in the background for available updates, then persist the result. The next time the notifier is initiated, the result will be loaded into the `.update` property. This prevents any impact on your package startup performance. -The update check is done in a unref'ed [child process](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). This means that if you call `process.exit`, the check will still be performed in its own process. - -The first time the user runs your app, it will check for an update, and even if an update is available, it will wait the specified `updateCheckInterval` before notifying the user. This is done to not be annoying to the user, but might surprise you as an implementer if you're testing whether it works. Check out [`example.js`](example.js) to quickly test out `update-notifier` and see how you can test that it works in your app. - - -## API - -### notifier = updateNotifier(options) - -Checks if there is an available update. Accepts options defined below. Returns an instance with an `.update` property there is an available update, otherwise `undefined`. - -### options - -#### pkg - -Type: `Object` - -##### name - -*Required*
-Type: `string` - -##### version - -*Required*
-Type: `string` - -#### updateCheckInterval - -Type: `number`
-Default: `1000 * 60 * 60 * 24` *(1 day)* - -How often to check for updates. - -#### callback(error, update) - -Type: `Function` - -Passing a callback here will make it check for an update directly and report right away. Not recommended as you won't get the benefits explained in [`How`](#how). `update` is equal to `notifier.update`. - -### notifier.notify([options]) - -Convenience method to display a notification message. *(See screenshot)* - -Only notifies if there is an update and the process is [TTY](https://nodejs.org/api/process.html#process_tty_terminals_and_process_stdout). - -#### options - -Type: `Object` - -##### defer - -Type: `boolean`
-Default: `true` - -Defer showing the notification to after the process has exited. - -##### message - -Type: `string`
-Default: [See above screenshot](https://github.com/yeoman/update-notifier#update-notifier-) - -Message that will be shown when an update is available. - -##### isGlobal - -Type: `boolean`
-Default: `true` - -Include the `-g` argument in the default message's `npm i` recommendation. You may want to change this if your CLI package can be installed as a dependency of another project, and don't want to recommend a global installation. This option is ignored if you supply your own `message` (see above). - -##### boxenOpts - -Type: `Object`
-Default: `{padding: 1, margin: 1, align: 'center', borderColor: 'yellow', borderStyle: 'round'}` *(See screenshot)* - -Options object that will be passed to [`boxen`](https://github.com/sindresorhus/boxen). - -##### shouldNotifyInNpmScript - -Type: `boolean`
-Default: `false` - -Allows notification to be shown when running as an npm script. - -### User settings - -Users of your module have the ability to opt-out of the update notifier by changing the `optOut` property to `true` in `~/.config/configstore/update-notifier-[your-module-name].json`. The path is available in `notifier.config.path`. - -Users can also opt-out by [setting the environment variable](https://github.com/sindresorhus/guides/blob/master/set-environment-variables.md) `NO_UPDATE_NOTIFIER` with any value or by using the `--no-update-notifier` flag on a per run basis. - -The check is also skipped on CI automatically. - - -## About - -The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications. - - -## Users - -There are a bunch projects using it: - -- [npm](https://github.com/npm/npm) - Package manager for JavaScript -- [Yeoman](http://yeoman.io) - Modern workflows for modern webapps -- [AVA](https://ava.li) - Simple concurrent test runner -- [XO](https://github.com/xojs/xo) - JavaScript happiness style linter -- [Pageres](https://github.com/sindresorhus/pageres) - Capture website screenshots -- [Node GH](http://nodegh.io) - GitHub command line tool - -[And 1600+ more…](https://www.npmjs.org/browse/depended/update-notifier) - - -## License - -BSD-2-Clause © Google diff --git a/node_modules/uri-js/package.json b/node_modules/uri-js/package.json index 272b511..bd83a8e 100644 --- a/node_modules/uri-js/package.json +++ b/node_modules/uri-js/package.json @@ -1,27 +1,32 @@ { - "_from": "uri-js@^4.2.2", + "_args": [ + [ + "uri-js@4.2.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "uri-js@4.2.2", "_id": "uri-js@4.2.2", "_inBundle": false, "_integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "_location": "/uri-js", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "uri-js@^4.2.2", + "raw": "uri-js@4.2.2", "name": "uri-js", "escapedName": "uri-js", - "rawSpec": "^4.2.2", + "rawSpec": "4.2.2", "saveSpec": null, - "fetchSpec": "^4.2.2" + "fetchSpec": "4.2.2" }, "_requiredBy": [ "/ajv" ], "_resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "_shasum": "94c540e1ff772956e2299507c010aea6c8838eb0", - "_spec": "uri-js@^4.2.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/ajv", + "_spec": "4.2.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Gary Court", "email": "gary.court@gmail.com" @@ -29,11 +34,9 @@ "bugs": { "url": "https://github.com/garycourt/uri-js/issues" }, - "bundleDependencies": false, "dependencies": { "punycode": "^2.1.0" }, - "deprecated": false, "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", "devDependencies": { "babel-cli": "^6.26.0", diff --git a/node_modules/url-parse-lax/index.js b/node_modules/url-parse-lax/index.js deleted file mode 100644 index f9c0c65..0000000 --- a/node_modules/url-parse-lax/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var url = require('url'); -var prependHttp = require('prepend-http'); - -module.exports = function (x) { - var withProtocol = prependHttp(x); - var parsed = url.parse(withProtocol); - - if (withProtocol !== x) { - parsed.protocol = null; - } - - return parsed; -}; diff --git a/node_modules/url-parse-lax/license b/node_modules/url-parse-lax/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/url-parse-lax/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/url-parse-lax/package.json b/node_modules/url-parse-lax/package.json deleted file mode 100644 index 5cabc6e..0000000 --- a/node_modules/url-parse-lax/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "url-parse-lax@^1.0.0", - "_id": "url-parse-lax@1.0.0", - "_inBundle": false, - "_integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "_location": "/url-parse-lax", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "url-parse-lax@^1.0.0", - "name": "url-parse-lax", - "escapedName": "url-parse-lax", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "_shasum": "7af8f303645e9bd79a272e7a14ac68bc0609da73", - "_spec": "url-parse-lax@^1.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/got", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/url-parse-lax/issues" - }, - "bundleDependencies": false, - "dependencies": { - "prepend-http": "^1.0.1" - }, - "deprecated": false, - "description": "url.parse() with support for protocol-less URLs & IPs", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/url-parse-lax#readme", - "keywords": [ - "url", - "uri", - "parse", - "parser", - "loose", - "lax", - "protocol", - "less", - "protocol-less", - "ip", - "ipv4", - "ipv6" - ], - "license": "MIT", - "name": "url-parse-lax", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/url-parse-lax.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/url-parse-lax/readme.md b/node_modules/url-parse-lax/readme.md deleted file mode 100644 index f263944..0000000 --- a/node_modules/url-parse-lax/readme.md +++ /dev/null @@ -1,100 +0,0 @@ -# url-parse-lax [![Build Status](https://travis-ci.org/sindresorhus/url-parse-lax.svg?branch=master)](https://travis-ci.org/sindresorhus/url-parse-lax) - -> [`url.parse()`](https://nodejs.org/docs/latest/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost) with support for protocol-less URLs & IPs - - -## Install - -``` -$ npm install --save url-parse-lax -``` - - -## Usage - -```js -var urlParseLax = require('url-parse-lax'); - -urlParseLax('sindresorhus.com'); -/* -{ - protocol: null, - slashes: true, - auth: null, - host: 'sindresorhus.com', - port: null, - hostname: 'sindresorhus.com', - hash: null, - search: null, - query: null, - pathname: '/', - path: '/', - href: 'http://sindresorhus.com/' -} -*/ - -urlParseLax('[2001:db8::]:8000'); -/* -{ - protocol: null, - slashes: true, - auth: null, - host: '[2001:db8::]:8000', - port: '8000', - hostname: '2001:db8::', - hash: null, - search: null, - query: null, - pathname: '/', - path: '/', - href: 'http://[2001:db8::]:8000/' -} -*/ -``` - -And with the built-in `url.parse()`: - -```js -var url = require('url'); - -url.parse('sindresorhus.com'); -/* -{ - protocol: null, - slashes: null, - auth: null, - host: null, - port: null, - hostname: null, - hash: null, - search: null, - query: null, - pathname: 'sindresorhus', - path: 'sindresorhus', - href: 'sindresorhus' -} -*/ - -url.parse('[2001:db8::]:8000'); -/* -{ - protocol: null, - slashes: null, - auth: null, - host: null, - port: null, - hostname: null, - hash: null, - search: null, - query: null, - pathname: '[2001:db8::]:8000', - path: '[2001:db8::]:8000', - href: '[2001:db8::]:8000' -} -*/ -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/utf8-byte-length/package.json b/node_modules/utf8-byte-length/package.json index 35f9253..e2372d5 100644 --- a/node_modules/utf8-byte-length/package.json +++ b/node_modules/utf8-byte-length/package.json @@ -1,27 +1,33 @@ { - "_from": "utf8-byte-length@^1.0.1", + "_args": [ + [ + "utf8-byte-length@1.0.4", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "utf8-byte-length@1.0.4", "_id": "utf8-byte-length@1.0.4", "_inBundle": false, "_integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=", "_location": "/utf8-byte-length", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "utf8-byte-length@^1.0.1", + "raw": "utf8-byte-length@1.0.4", "name": "utf8-byte-length", "escapedName": "utf8-byte-length", - "rawSpec": "^1.0.1", + "rawSpec": "1.0.4", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "1.0.4" }, "_requiredBy": [ "/truncate-utf8-bytes" ], "_resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", - "_shasum": "f45f150c4c66eee968186505ab93fcbb8ad6bf61", - "_spec": "utf8-byte-length@^1.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/truncate-utf8-bytes", + "_spec": "1.0.4", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Carl Xiong", "email": "xiongc05@gmail.com" @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/parshap/utf8-byte-length/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Carl Xiong", @@ -41,7 +46,6 @@ "email": "parshap@gmail.com" } ], - "deprecated": false, "description": "Get utf8 byte length of string", "devDependencies": { "tape": "^4.2.2" diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json index d6a0049..c985d6f 100644 --- a/node_modules/util-deprecate/package.json +++ b/node_modules/util-deprecate/package.json @@ -1,27 +1,35 @@ { - "_from": "util-deprecate@~1.0.1", + "_args": [ + [ + "util-deprecate@1.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "util-deprecate@1.0.2", "_id": "util-deprecate@1.0.2", "_inBundle": false, "_integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "_location": "/util-deprecate", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "util-deprecate@~1.0.1", + "raw": "util-deprecate@1.0.2", "name": "util-deprecate", "escapedName": "util-deprecate", - "rawSpec": "~1.0.1", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "~1.0.1" + "fetchSpec": "1.0.2" }, "_requiredBy": [ - "/concat-stream/readable-stream" + "/are-we-there-yet/readable-stream", + "/bl/readable-stream", + "/concat-stream/readable-stream", + "/tar-stream/readable-stream" ], "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "_spec": "util-deprecate@~1.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/concat-stream/node_modules/readable-stream", + "_spec": "1.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", @@ -31,8 +39,6 @@ "bugs": { "url": "https://github.com/TooTallNate/util-deprecate/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "The Node.js `util.deprecate()` function with browser support", "homepage": "https://github.com/TooTallNate/util-deprecate", "keywords": [ diff --git a/node_modules/uuid/package.json b/node_modules/uuid/package.json index 480adf5..3367777 100644 --- a/node_modules/uuid/package.json +++ b/node_modules/uuid/package.json @@ -1,27 +1,32 @@ { - "_from": "uuid@^3.3.2", + "_args": [ + [ + "uuid@3.3.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "uuid@3.3.2", "_id": "uuid@3.3.2", "_inBundle": false, "_integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "_location": "/uuid", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "uuid@^3.3.2", + "raw": "uuid@3.3.2", "name": "uuid", "escapedName": "uuid", - "rawSpec": "^3.3.2", + "rawSpec": "3.3.2", "saveSpec": null, - "fetchSpec": "^3.3.2" + "fetchSpec": "3.3.2" }, "_requiredBy": [ "/request" ], "_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "_shasum": "1b4af4955eb3077c501c23872fc6513811587131", - "_spec": "uuid@^3.3.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/request", + "_spec": "3.3.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bin": { "uuid": "./bin/uuid" }, @@ -33,7 +38,6 @@ "bugs": { "url": "https://github.com/kelektiv/node-uuid/issues" }, - "bundleDependencies": false, "commitlint": { "extends": [ "@commitlint/config-conventional" @@ -61,7 +65,6 @@ "email": "shtylman@gmail.com" } ], - "deprecated": false, "description": "RFC4122 (v1, v4, and v5) UUIDs", "devDependencies": { "@commitlint/cli": "7.0.0", diff --git a/node_modules/validate-npm-package-license/package.json b/node_modules/validate-npm-package-license/package.json index 02f367c..cb36050 100644 --- a/node_modules/validate-npm-package-license/package.json +++ b/node_modules/validate-npm-package-license/package.json @@ -1,27 +1,33 @@ { - "_from": "validate-npm-package-license@^3.0.1", + "_args": [ + [ + "validate-npm-package-license@3.0.4", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "validate-npm-package-license@3.0.4", "_id": "validate-npm-package-license@3.0.4", "_inBundle": false, "_integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "_location": "/validate-npm-package-license", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "validate-npm-package-license@^3.0.1", + "raw": "validate-npm-package-license@3.0.4", "name": "validate-npm-package-license", "escapedName": "validate-npm-package-license", - "rawSpec": "^3.0.1", + "rawSpec": "3.0.4", "saveSpec": null, - "fetchSpec": "^3.0.1" + "fetchSpec": "3.0.4" }, "_requiredBy": [ "/normalize-package-data" ], "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "_shasum": "fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a", - "_spec": "validate-npm-package-license@^3.0.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/normalize-package-data", + "_spec": "3.0.4", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Kyle E. Mitchell", "email": "kyle@kemitchell.com", @@ -30,7 +36,6 @@ "bugs": { "url": "https://github.com/kemitchell/validate-npm-package-license.js/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Mark Stacey", @@ -41,7 +46,6 @@ "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" }, - "deprecated": false, "description": "Give me a string and I'll tell you if it's a valid npm package license string", "devDependencies": { "defence-cli": "^2.0.1", diff --git a/node_modules/verror/package.json b/node_modules/verror/package.json index faa3f51..1d0d2f5 100644 --- a/node_modules/verror/package.json +++ b/node_modules/verror/package.json @@ -1,4 +1,10 @@ { + "_args": [ + [ + "verror@1.10.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], "_from": "verror@1.10.0", "_id": "verror@1.10.0", "_inBundle": false, @@ -19,19 +25,16 @@ "/jsprim" ], "_resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "_shasum": "3a105ca17053af55d6e270c1f8288682e18da400", - "_spec": "verror@1.10.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/jsprim", + "_spec": "1.10.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "bugs": { "url": "https://github.com/davepacheco/node-verror/issues" }, - "bundleDependencies": false, "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", "extsprintf": "^1.2.0" }, - "deprecated": false, "description": "richer JavaScript errors", "engines": [ "node >=0.6.0" diff --git a/node_modules/which-module/CHANGELOG.md b/node_modules/which-module/CHANGELOG.md index 863d469..6c8f5f2 100644 --- a/node_modules/which-module/CHANGELOG.md +++ b/node_modules/which-module/CHANGELOG.md @@ -2,21 +2,6 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -# [2.0.0](https://github.com/nexdrew/which-module/compare/v1.0.0...v2.0.0) (2017-05-01) - - -### Features - -* remove Node < 4 from official testing/support ([#22](https://github.com/nexdrew/which-module/issues/22)) ([ee7aff4](https://github.com/nexdrew/which-module/commit/ee7aff4)) - - -### BREAKING CHANGES - -* Node 0.10 or 0.12 no longer supported, please update to Node 4+ or use which-module@1.0.0 - - - # 1.0.0 (2016-06-06) diff --git a/node_modules/which-module/package.json b/node_modules/which-module/package.json index 25086e0..0d96826 100644 --- a/node_modules/which-module/package.json +++ b/node_modules/which-module/package.json @@ -1,26 +1,26 @@ { - "_from": "which-module@^2.0.0", - "_id": "which-module@2.0.0", + "_from": "which-module@^1.0.0", + "_id": "which-module@1.0.0", "_inBundle": false, - "_integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "_integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", "_location": "/which-module", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "which-module@^2.0.0", + "raw": "which-module@^1.0.0", "name": "which-module", "escapedName": "which-module", - "rawSpec": "^2.0.0", + "rawSpec": "^1.0.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "^1.0.0" }, "_requiredBy": [ "/yargs" ], - "_resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "_shasum": "d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a", - "_spec": "which-module@^2.0.0", + "_resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "_shasum": "bba63ca861948994ff307736089e3b96026c2a4f", + "_spec": "which-module@^1.0.0", "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/yargs", "author": { "name": "nexdrew" @@ -32,11 +32,11 @@ "deprecated": false, "description": "Find the module object for something that was require()d", "devDependencies": { - "ava": "^0.19.1", - "coveralls": "^2.13.1", - "nyc": "^10.3.0", - "standard": "^10.0.2", - "standard-version": "^4.0.0" + "ava": "^0.15.2", + "coveralls": "^2.11.9", + "nyc": "^6.4.4", + "standard": "^7.1.2", + "standard-version": "^2.3.0" }, "files": [ "index.js" @@ -64,5 +64,5 @@ "release": "standard-version", "test": "nyc ava" }, - "version": "2.0.0" + "version": "1.0.0" } diff --git a/node_modules/which/package.json b/node_modules/which/package.json index bef6952..eae75bf 100644 --- a/node_modules/which/package.json +++ b/node_modules/which/package.json @@ -1,5 +1,5 @@ { - "_from": "which@^1.2.9", + "_from": "which@1", "_id": "which@1.3.1", "_inBundle": false, "_integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", @@ -8,21 +8,20 @@ "_requested": { "type": "range", "registry": true, - "raw": "which@^1.2.9", + "raw": "which@1", "name": "which", "escapedName": "which", - "rawSpec": "^1.2.9", + "rawSpec": "1", "saveSpec": null, - "fetchSpec": "^1.2.9" + "fetchSpec": "1" }, "_requiredBy": [ - "/cross-spawn", - "/os-locale/cross-spawn" + "/node-gyp" ], "_resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "_shasum": "a45043d54f5805316da8d62f9f50918d3da70b0a", - "_spec": "which@^1.2.9", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/cross-spawn", + "_spec": "which@1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/node-gyp", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", diff --git a/node_modules/widest-line/index.js b/node_modules/widest-line/index.js deleted file mode 100644 index a9865d0..0000000 --- a/node_modules/widest-line/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -const stringWidth = require('string-width'); - -module.exports = input => { - let max = 0; - for (const s of input.split('\n')) max = Math.max(max, stringWidth(s)); - return max; -}; diff --git a/node_modules/widest-line/license b/node_modules/widest-line/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/widest-line/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/widest-line/node_modules/ansi-regex/index.js b/node_modules/widest-line/node_modules/ansi-regex/index.js deleted file mode 100644 index c4aaecf..0000000 --- a/node_modules/widest-line/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = () => { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, 'g'); -}; diff --git a/node_modules/widest-line/node_modules/ansi-regex/license b/node_modules/widest-line/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/widest-line/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/widest-line/node_modules/ansi-regex/package.json b/node_modules/widest-line/node_modules/ansi-regex/package.json deleted file mode 100644 index d277f8c..0000000 --- a/node_modules/widest-line/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "ansi-regex@^3.0.0", - "_id": "ansi-regex@3.0.0", - "_inBundle": false, - "_integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "_location": "/widest-line/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-regex@^3.0.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/widest-line/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "_shasum": "ed0317c322064f79466c02966bddb605ab37d998", - "_spec": "ansi-regex@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/widest-line/node_modules/strip-ansi", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/ansi-regex#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "3.0.0" -} diff --git a/node_modules/widest-line/node_modules/ansi-regex/readme.md b/node_modules/widest-line/node_modules/ansi-regex/readme.md deleted file mode 100644 index 22db1c3..0000000 --- a/node_modules/widest-line/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] -``` - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/widest-line/node_modules/is-fullwidth-code-point/index.js b/node_modules/widest-line/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index d506327..0000000 --- a/node_modules/widest-line/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -/* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { - return false; - } - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || - // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || - // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || - // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || - // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || - // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || - // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || - // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || - // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || - // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) - ) - ) { - return true; - } - - return false; -}; diff --git a/node_modules/widest-line/node_modules/is-fullwidth-code-point/license b/node_modules/widest-line/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/widest-line/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/widest-line/node_modules/is-fullwidth-code-point/package.json b/node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index 573ef41..0000000 --- a/node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-fullwidth-code-point@^2.0.0", - "_id": "is-fullwidth-code-point@2.0.0", - "_inBundle": false, - "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "_location": "/widest-line/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-fullwidth-code-point@^2.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/widest-line/string-width" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", - "_spec": "is-fullwidth-code-point@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/widest-line/node_modules/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "license": "MIT", - "name": "is-fullwidth-code-point", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/widest-line/node_modules/is-fullwidth-code-point/readme.md b/node_modules/widest-line/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 093b028..0000000 --- a/node_modules/widest-line/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/widest-line/node_modules/string-width/index.js b/node_modules/widest-line/node_modules/string-width/index.js deleted file mode 100644 index bbc49d2..0000000 --- a/node_modules/widest-line/node_modules/string-width/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -module.exports = str => { - if (typeof str !== 'string' || str.length === 0) { - return 0; - } - - str = stripAnsi(str); - - let width = 0; - - for (let i = 0; i < str.length; i++) { - const code = str.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; diff --git a/node_modules/widest-line/node_modules/string-width/license b/node_modules/widest-line/node_modules/string-width/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/widest-line/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/widest-line/node_modules/string-width/package.json b/node_modules/widest-line/node_modules/string-width/package.json deleted file mode 100644 index 023c195..0000000 --- a/node_modules/widest-line/node_modules/string-width/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "string-width@^2.1.1", - "_id": "string-width@2.1.1", - "_inBundle": false, - "_integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "_location": "/widest-line/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^2.1.1", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^2.1.1", - "saveSpec": null, - "fetchSpec": "^2.1.1" - }, - "_requiredBy": [ - "/widest-line" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "_shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e", - "_spec": "string-width@^2.1.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/widest-line", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "license": "MIT", - "name": "string-width", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/string-width.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.1.1" -} diff --git a/node_modules/widest-line/node_modules/string-width/readme.md b/node_modules/widest-line/node_modules/string-width/readme.md deleted file mode 100644 index df5b719..0000000 --- a/node_modules/widest-line/node_modules/string-width/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/widest-line/node_modules/strip-ansi/index.js b/node_modules/widest-line/node_modules/strip-ansi/index.js deleted file mode 100644 index 96e0292..0000000 --- a/node_modules/widest-line/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; diff --git a/node_modules/widest-line/node_modules/strip-ansi/license b/node_modules/widest-line/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/widest-line/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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/widest-line/node_modules/strip-ansi/package.json b/node_modules/widest-line/node_modules/strip-ansi/package.json deleted file mode 100644 index c2c441b..0000000 --- a/node_modules/widest-line/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "strip-ansi@^4.0.0", - "_id": "strip-ansi@4.0.0", - "_inBundle": false, - "_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "_location": "/widest-line/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^4.0.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/widest-line/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "_shasum": "a8479022eb1ac368a871389b635262c505ee368f", - "_spec": "strip-ansi@^4.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/widest-line/node_modules/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/strip-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/strip-ansi#readme", - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} diff --git a/node_modules/widest-line/node_modules/strip-ansi/readme.md b/node_modules/widest-line/node_modules/strip-ansi/readme.md deleted file mode 100644 index dc76f0c..0000000 --- a/node_modules/widest-line/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/widest-line/package.json b/node_modules/widest-line/package.json deleted file mode 100644 index 33b39a1..0000000 --- a/node_modules/widest-line/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "widest-line@^2.0.0", - "_id": "widest-line@2.0.1", - "_inBundle": false, - "_integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", - "_location": "/widest-line", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "widest-line@^2.0.0", - "name": "widest-line", - "escapedName": "widest-line", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "_shasum": "7438764730ec7ef4381ce4df82fb98a53142a3fc", - "_spec": "widest-line@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/widest-line/issues" - }, - "bundleDependencies": false, - "dependencies": { - "string-width": "^2.1.1" - }, - "deprecated": false, - "description": "Get the visual width of the widest line in a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/widest-line#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "license": "MIT", - "name": "widest-line", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/widest-line.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.1" -} diff --git a/node_modules/widest-line/readme.md b/node_modules/widest-line/readme.md deleted file mode 100644 index 20e02d5..0000000 --- a/node_modules/widest-line/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# widest-line [![Build Status](https://travis-ci.org/sindresorhus/widest-line.svg?branch=master)](https://travis-ci.org/sindresorhus/widest-line) - -> Get the visual width of the widest line in a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to know the maximum width a string will take up in the terminal. - - -## Install - -``` -$ npm install widest-line -``` - - -## Usage - -```js -const widestLine = require('widest-line'); - -widestLine('古\n\u001B[1m@\u001B[22m'); -//=> 2 -``` - - -## Related - -- [string-width](https://github.com/sindresorhus/string-width) - Get the visual width of a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json index c230142..226bb13 100644 --- a/node_modules/wrappy/package.json +++ b/node_modules/wrappy/package.json @@ -1,27 +1,33 @@ { - "_from": "wrappy@1", + "_args": [ + [ + "wrappy@1.0.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "wrappy@1.0.2", "_id": "wrappy@1.0.2", "_inBundle": false, "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "_location": "/wrappy", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "wrappy@1", + "raw": "wrappy@1.0.2", "name": "wrappy", "escapedName": "wrappy", - "rawSpec": "1", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "1" + "fetchSpec": "1.0.2" }, "_requiredBy": [ + "/inflight", "/once" ], "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", - "_spec": "wrappy@1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/once", + "_spec": "1.0.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -30,9 +36,7 @@ "bugs": { "url": "https://github.com/npm/wrappy/issues" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, "description": "Callback wrapping utility", "devDependencies": { "tap": "^2.3.1" diff --git a/node_modules/write-file-atomic/LICENSE b/node_modules/write-file-atomic/LICENSE deleted file mode 100644 index 95e65a7..0000000 --- a/node_modules/write-file-atomic/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, Rebecca Turner - -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/write-file-atomic/README.md b/node_modules/write-file-atomic/README.md deleted file mode 100644 index af385f3..0000000 --- a/node_modules/write-file-atomic/README.md +++ /dev/null @@ -1,49 +0,0 @@ -write-file-atomic ------------------ - -This is an extension for node's `fs.writeFile` that makes its operation -atomic and allows you set ownership (uid/gid of the file). - -### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) - -* filename **String** -* data **String** | **Buffer** -* options **Object** - * chown **Object** - * uid **Number** - * gid **Number** - * encoding **String** | **Null** default = 'utf8' - * fsync **Boolean** default = true - * mode **Number** default = 438 (aka 0666 in Octal) - * Promise **Object** default = native Promise object -callback **Function** - -Atomically and asynchronously writes data to a file, replacing the file if it already -exists. data can be a string or a buffer. - -The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. -If writeFile completes successfully then, if passed the **chown** option it will change -the ownership of the file. Finally it renames the file back to the filename you specified. If -it encounters errors at any of these steps it will attempt to unlink the temporary file and then -pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. - -If provided, the **chown** option requires both **uid** and **gid** properties or else -you'll get an error. - -The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. - -If the **fsync** option is **false**, writeFile will skip the final fsync call. - -Example: - -```javascript -writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { - if (err) throw err; - console.log('It\'s saved!'); -}); -``` - -### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) - -The synchronous version of **writeFileAtomic**. diff --git a/node_modules/write-file-atomic/index.js b/node_modules/write-file-atomic/index.js deleted file mode 100644 index 3b5607d..0000000 --- a/node_modules/write-file-atomic/index.js +++ /dev/null @@ -1,199 +0,0 @@ -'use strict' -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing -module.exports._cleanupOnExit = cleanupOnExit - -var fs = require('graceful-fs') -var MurmurHash3 = require('imurmurhash') -var onExit = require('signal-exit') -var path = require('path') -var activeFiles = {} - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(++invocations)) - .result() -} - -function cleanupOnExit (tmpfile) { - return function () { - try { - fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} - } -} - -function writeFile (filename, data, options, callback) { - if (options instanceof Function) { - callback = options - options = null - } - if (!options) options = {} - - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - var removeOnExit = cleanupOnExit(() => tmpfile) - var absoluteName = path.resolve(filename) - - new Promise(function serializeSameFile (resolve) { - // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] - - activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) - - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - if (options.fsync !== false) { - return new Promise(function (resolve, reject) { - fs.fsync(fd, function (err) { - if (err) reject(err) - else fs.close(fd, resolve) - }) - }) - } - }).then(function chown () { - if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function chmod () { - if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { - removeOnExit() - callback() - }).catch(function fail (err) { - removeOnExit() - fs.unlink(tmpfile, function () { - callback(err) - }) - }).then(function checkQueue () { - activeFiles[absoluteName].shift() // remove the element added by serializeSameFile - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0]() // start next job if one is pending - } else delete activeFiles[absoluteName] - }) -} - -function writeFileSync (filename, data, options) { - if (!options) options = {} - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - var tmpfile = getTmpname(filename) - - try { - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - var stats = fs.statSync(filename) - options = Object.assign({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } - - var removeOnExit = onExit(cleanupOnExit(tmpfile)) - var fd = fs.openSync(tmpfile, 'w', options.mode) - if (Buffer.isBuffer(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - if (options.fsync !== false) { - fs.fsyncSync(fd) - } - fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) - fs.renameSync(tmpfile, filename) - removeOnExit() - } catch (err) { - removeOnExit() - try { fs.unlinkSync(tmpfile) } catch (e) {} - throw err - } -} diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json deleted file mode 100644 index b2316ae..0000000 --- a/node_modules/write-file-atomic/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "write-file-atomic@^2.0.0", - "_id": "write-file-atomic@2.3.0", - "_inBundle": false, - "_integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "_location": "/write-file-atomic", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "write-file-atomic@^2.0.0", - "name": "write-file-atomic", - "escapedName": "write-file-atomic", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/configstore" - ], - "_resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "_shasum": "1ff61575c2e2a4e8e510d6fa4e243cce183999ab", - "_spec": "write-file-atomic@^2.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/configstore", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org" - }, - "bugs": { - "url": "https://github.com/iarna/write-file-atomic/issues" - }, - "bundleDependencies": false, - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - }, - "deprecated": false, - "description": "Write files in an atomic fashion w/configurable ownership", - "devDependencies": { - "mkdirp": "^0.5.1", - "require-inject": "^1.4.0", - "rimraf": "^2.5.4", - "standard": "^10.0.2", - "tap": "^10.3.2" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/iarna/write-file-atomic", - "keywords": [ - "writeFile", - "atomic" - ], - "license": "ISC", - "main": "index.js", - "name": "write-file-atomic", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/iarna/write-file-atomic.git" - }, - "scripts": { - "test": "standard && tap --100 test/*.js" - }, - "version": "2.3.0" -} diff --git a/node_modules/xdg-basedir/index.js b/node_modules/xdg-basedir/index.js deleted file mode 100644 index f5aa176..0000000 --- a/node_modules/xdg-basedir/index.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -const os = require('os'); -const path = require('path'); - -const home = os.homedir(); -const env = process.env; - -exports.data = env.XDG_DATA_HOME || - (home ? path.join(home, '.local', 'share') : null); - -exports.config = env.XDG_CONFIG_HOME || - (home ? path.join(home, '.config') : null); - -exports.cache = env.XDG_CACHE_HOME || (home ? path.join(home, '.cache') : null); - -exports.runtime = env.XDG_RUNTIME_DIR || null; - -exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':'); - -if (exports.data) { - exports.dataDirs.unshift(exports.data); -} - -exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':'); - -if (exports.config) { - exports.configDirs.unshift(exports.config); -} diff --git a/node_modules/xdg-basedir/license b/node_modules/xdg-basedir/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/xdg-basedir/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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/xdg-basedir/package.json b/node_modules/xdg-basedir/package.json deleted file mode 100644 index 58f69db..0000000 --- a/node_modules/xdg-basedir/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "xdg-basedir@^3.0.0", - "_id": "xdg-basedir@3.0.0", - "_inBundle": false, - "_integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", - "_location": "/xdg-basedir", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xdg-basedir@^3.0.0", - "name": "xdg-basedir", - "escapedName": "xdg-basedir", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/configstore", - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "_shasum": "496b2cc109eca8dbacfe2dc72b603c17c5870ad4", - "_spec": "xdg-basedir@^3.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/xdg-basedir/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get XDG Base Directory paths", - "devDependencies": { - "ava": "*", - "require-uncached": "^1.0.2", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/xdg-basedir#readme", - "keywords": [ - "xdg", - "base", - "directory", - "dir", - "basedir", - "path", - "data", - "config", - "cache", - "linux", - "unix", - "spec" - ], - "license": "MIT", - "name": "xdg-basedir", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/xdg-basedir.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/node_modules/xdg-basedir/readme.md b/node_modules/xdg-basedir/readme.md deleted file mode 100644 index 61f8c16..0000000 --- a/node_modules/xdg-basedir/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# xdg-basedir [![Build Status](https://travis-ci.org/sindresorhus/xdg-basedir.svg?branch=master)](https://travis-ci.org/sindresorhus/xdg-basedir) - -> Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths - - -## Install - -``` -$ npm install --save xdg-basedir -``` - - -## Usage - -```js -const xdgBasedir = require('xdg-basedir'); - -xdgBasedir.data; -//=> '/home/sindresorhus/.local/share' - -xdgBasedir.config; -//=> '/home/sindresorhus/.config' - -xdgBasedir.dataDirs -//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/'] -``` - - -## API - -The properties `.data`, `.config`, `.cache`, `.runtime` will return `null` in the uncommon case that both the XDG environment variable is not set and the users home directory can't be found. You need to handle this case. A common solution is to [fall back to a temp directory](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15). - -### .data - -Directory for user specific data files. - -### .config - -Directory for user specific configuration files. - -### .cache - -Directory for user specific non-essential data files. - -### .runtime - -Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc). - -### .dataDirs - -Preference-ordered array of base directories to search for data files in addition to `.data`. - -### .configDirs - -Preference-ordered array of base directories to search for configuration files in addition to `.config`. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/xmlbuilder/package.json b/node_modules/xmlbuilder/package.json index abfa214..f05c495 100644 --- a/node_modules/xmlbuilder/package.json +++ b/node_modules/xmlbuilder/package.json @@ -1,27 +1,33 @@ { - "_from": "xmlbuilder@^9.0.7", + "_args": [ + [ + "xmlbuilder@9.0.7", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "xmlbuilder@9.0.7", "_id": "xmlbuilder@9.0.7", "_inBundle": false, "_integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", "_location": "/xmlbuilder", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "xmlbuilder@^9.0.7", + "raw": "xmlbuilder@9.0.7", "name": "xmlbuilder", "escapedName": "xmlbuilder", - "rawSpec": "^9.0.7", + "rawSpec": "9.0.7", "saveSpec": null, - "fetchSpec": "^9.0.7" + "fetchSpec": "9.0.7" }, "_requiredBy": [ "/plist" ], "_resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "_shasum": "132ee63d2ec5565c557e20f4c22df9aca686b10d", - "_spec": "xmlbuilder@^9.0.7", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/plist", + "_spec": "9.0.7", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Ozgur Ozcitak", "email": "oozcitak@gmail.com" @@ -29,10 +35,8 @@ "bugs": { "url": "http://github.com/oozcitak/xmlbuilder-js/issues" }, - "bundleDependencies": false, "contributors": [], "dependencies": {}, - "deprecated": false, "description": "An XML builder for node.js", "devDependencies": { "coffee-coverage": "2.*", diff --git a/node_modules/xmldom/package.json b/node_modules/xmldom/package.json index 5e35d5f..9f860b0 100644 --- a/node_modules/xmldom/package.json +++ b/node_modules/xmldom/package.json @@ -1,27 +1,33 @@ { - "_from": "xmldom@0.1.x", + "_args": [ + [ + "xmldom@0.1.27", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "xmldom@0.1.27", "_id": "xmldom@0.1.27", "_inBundle": false, "_integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=", "_location": "/xmldom", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "xmldom@0.1.x", + "raw": "xmldom@0.1.27", "name": "xmldom", "escapedName": "xmldom", - "rawSpec": "0.1.x", + "rawSpec": "0.1.27", "saveSpec": null, - "fetchSpec": "0.1.x" + "fetchSpec": "0.1.27" }, "_requiredBy": [ "/plist" ], "_resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "_shasum": "d501f97b3bdb403af8ef9ecc20573187aadac0e9", - "_spec": "xmldom@0.1.x", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/plist", + "_spec": "0.1.27", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "jindw", "email": "jindw@xidea.org", @@ -31,7 +37,6 @@ "url": "http://github.com/jindw/xmldom/issues", "email": "jindw@xidea.org" }, - "bundleDependencies": false, "contributors": [ { "name": "Yaron Naveh", @@ -50,7 +55,6 @@ } ], "dependencies": {}, - "deprecated": false, "description": "A W3C Standard XML DOM(Level2 CORE) implementation and parser(DOMParser/XMLSerializer).", "devDependencies": { "proof": "0.0.28" diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json index ad5e657..716d639 100644 --- a/node_modules/xtend/package.json +++ b/node_modules/xtend/package.json @@ -1,27 +1,33 @@ { - "_from": "xtend@~2.1.1", + "_args": [ + [ + "xtend@2.1.2", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_from": "xtend@2.1.2", "_id": "xtend@2.1.2", "_inBundle": false, "_integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "_location": "/xtend", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "xtend@~2.1.1", + "raw": "xtend@2.1.2", "name": "xtend", "escapedName": "xtend", - "rawSpec": "~2.1.1", + "rawSpec": "2.1.2", "saveSpec": null, - "fetchSpec": "~2.1.1" + "fetchSpec": "2.1.2" }, "_requiredBy": [ + "/data-table/through2", "/through2" ], "_resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "_shasum": "6efecc2a4dad8e6962c4901b337ce7ba87b5d28b", - "_spec": "xtend@~2.1.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/through2", + "_spec": "2.1.2", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Raynos", "email": "raynos2@gmail.com" @@ -30,7 +36,6 @@ "url": "https://github.com/Raynos/xtend/issues", "email": "raynos2@gmail.com" }, - "bundleDependencies": false, "contributors": [ { "name": "Jake Verbaten" @@ -42,7 +47,6 @@ "dependencies": { "object-keys": "~0.4.0" }, - "deprecated": false, "description": "extend like a boss", "devDependencies": { "tape": "~1.1.0" diff --git a/node_modules/y18n/CHANGELOG.md b/node_modules/y18n/CHANGELOG.md deleted file mode 100644 index c259076..0000000 --- a/node_modules/y18n/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -# [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10) - - -### Bug Fixes - -* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123)) - - -### Features - -* **__:** added tagged template literal support ([#44](https://github.com/yargs/y18n/issues/44)) ([0598daf](https://github.com/yargs/y18n/commit/0598daf)) - - -### BREAKING CHANGES - -* **__:** dropping Node 0.10/Node 0.12 support diff --git a/node_modules/y18n/README.md b/node_modules/y18n/README.md index 826474f..9859458 100644 --- a/node_modules/y18n/README.md +++ b/node_modules/y18n/README.md @@ -4,7 +4,6 @@ [![Coverage Status][coveralls-image]][coveralls-url] [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] -[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) The bare-bones internationalization library used by yargs. @@ -24,19 +23,6 @@ output: `my awesome string foo` -_using tagged template literals_ - -```js -var __ = require('y18n').__ -var str = 'foo' - -console.log(__`my awesome string ${str}`) -``` - -output: - -`my awesome string foo` - _pluralization support:_ ```js @@ -74,10 +60,6 @@ Create an instance of y18n with the config provided, options include: Print a localized string, `%s` will be replaced with `arg`s. -This function can also be used as a tag for a template literal. You can use it -like this: __`hello ${'world'}`. This will be equivalent to -`__('hello %s', 'world')`. - ### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) Print a localized string with appropriate pluralization. If `%d` is provided diff --git a/node_modules/y18n/index.js b/node_modules/y18n/index.js index d720681..91b159e 100644 --- a/node_modules/y18n/index.js +++ b/node_modules/y18n/index.js @@ -16,9 +16,6 @@ function Y18N (opts) { } Y18N.prototype.__ = function () { - if (typeof arguments[0] !== 'string') { - return this._taggedLiteral.apply(this, arguments) - } var args = Array.prototype.slice.call(arguments) var str = args.shift() var cb = function () {} // start with noop. @@ -43,19 +40,6 @@ Y18N.prototype.__ = function () { return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args)) } -Y18N.prototype._taggedLiteral = function (parts) { - var args = arguments - var str = '' - parts.forEach(function (part, i) { - var arg = args[i + 1] - str += part - if (typeof arg !== 'undefined') { - str += '%s' - } - }) - return this.__.apply(null, [str].concat([].slice.call(arguments, 1))) -} - Y18N.prototype._enqueueWrite = function (work) { this.writeQueue.push(work) if (this.writeQueue.length === 1) this._processWriteQueue() diff --git a/node_modules/y18n/package.json b/node_modules/y18n/package.json index e0b2cac..ae4458b 100644 --- a/node_modules/y18n/package.json +++ b/node_modules/y18n/package.json @@ -1,26 +1,26 @@ { - "_from": "y18n@^3.2.1 || ^4.0.0", - "_id": "y18n@4.0.0", + "_from": "y18n@^3.2.1", + "_id": "y18n@3.2.1", "_inBundle": false, - "_integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "_integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "_location": "/y18n", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "y18n@^3.2.1 || ^4.0.0", + "raw": "y18n@^3.2.1", "name": "y18n", "escapedName": "y18n", - "rawSpec": "^3.2.1 || ^4.0.0", + "rawSpec": "^3.2.1", "saveSpec": null, - "fetchSpec": "^3.2.1 || ^4.0.0" + "fetchSpec": "^3.2.1" }, "_requiredBy": [ "/yargs" ], - "_resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "_shasum": "95ef94f85ecc81d007c264e190a120f0a3c8566b", - "_spec": "y18n@^3.2.1 || ^4.0.0", + "_resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "_shasum": "6d15fba884c08679c0d77e88e7759e811e07fa41", + "_spec": "y18n@^3.2.1", "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/yargs", "author": { "name": "Ben Coe", @@ -33,13 +33,12 @@ "deprecated": false, "description": "the bare-bones internationalization library used by yargs", "devDependencies": { - "chai": "^4.0.1", - "coveralls": "^3.0.0", - "mocha": "^4.0.1", - "nyc": "^11.0.1", + "chai": "^3.4.1", + "coveralls": "^2.11.6", + "mocha": "^2.3.4", + "nyc": "^6.1.1", "rimraf": "^2.5.0", - "standard": "^10.0.0-beta.0", - "standard-version": "^4.2.0" + "standard": "^5.4.1" }, "files": [ "index.js" @@ -60,8 +59,7 @@ "scripts": { "coverage": "nyc report --reporter=text-lcov | coveralls", "pretest": "standard", - "release": "standard-version", "test": "nyc mocha" }, - "version": "4.0.0" + "version": "3.2.1" } diff --git a/node_modules/yallist/LICENSE b/node_modules/yallist/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/yallist/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -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/yallist/README.md b/node_modules/yallist/README.md deleted file mode 100644 index f586101..0000000 --- a/node_modules/yallist/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# yallist - -Yet Another Linked List - -There are many doubly-linked list implementations like it, but this -one is mine. - -For when an array would be too big, and a Map can't be iterated in -reverse order. - - -[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) - -## basic usage - -```javascript -var yallist = require('yallist') -var myList = yallist.create([1, 2, 3]) -myList.push('foo') -myList.unshift('bar') -// of course pop() and shift() are there, too -console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] -myList.forEach(function (k) { - // walk the list head to tail -}) -myList.forEachReverse(function (k, index, list) { - // walk the list tail to head -}) -var myDoubledList = myList.map(function (k) { - return k + k -}) -// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] -// mapReverse is also a thing -var myDoubledListReverse = myList.mapReverse(function (k) { - return k + k -}) // ['foofoo', 6, 4, 2, 'barbar'] - -var reduced = myList.reduce(function (set, entry) { - set += entry - return set -}, 'start') -console.log(reduced) // 'startfoo123bar' -``` - -## api - -The whole API is considered "public". - -Functions with the same name as an Array method work more or less the -same way. - -There's reverse versions of most things because that's the point. - -### Yallist - -Default export, the class that holds and manages a list. - -Call it with either a forEach-able (like an array) or a set of -arguments, to initialize the list. - -The Array-ish methods all act like you'd expect. No magic length, -though, so if you change that it won't automatically prune or add -empty spots. - -### Yallist.create(..) - -Alias for Yallist function. Some people like factories. - -#### yallist.head - -The first node in the list - -#### yallist.tail - -The last node in the list - -#### yallist.length - -The number of nodes in the list. (Change this at your peril. It is -not magic like Array length.) - -#### yallist.toArray() - -Convert the list to an array. - -#### yallist.forEach(fn, [thisp]) - -Call a function on each item in the list. - -#### yallist.forEachReverse(fn, [thisp]) - -Call a function on each item in the list, in reverse order. - -#### yallist.get(n) - -Get the data at position `n` in the list. If you use this a lot, -probably better off just using an Array. - -#### yallist.getReverse(n) - -Get the data at position `n`, counting from the tail. - -#### yallist.map(fn, thisp) - -Create a new Yallist with the result of calling the function on each -item. - -#### yallist.mapReverse(fn, thisp) - -Same as `map`, but in reverse. - -#### yallist.pop() - -Get the data from the list tail, and remove the tail from the list. - -#### yallist.push(item, ...) - -Insert one or more items to the tail of the list. - -#### yallist.reduce(fn, initialValue) - -Like Array.reduce. - -#### yallist.reduceReverse - -Like Array.reduce, but in reverse. - -#### yallist.reverse - -Reverse the list in place. - -#### yallist.shift() - -Get the data from the list head, and remove the head from the list. - -#### yallist.slice([from], [to]) - -Just like Array.slice, but returns a new Yallist. - -#### yallist.sliceReverse([from], [to]) - -Just like yallist.slice, but the result is returned in reverse. - -#### yallist.toArray() - -Create an array representation of the list. - -#### yallist.toArrayReverse() - -Create a reversed array representation of the list. - -#### yallist.unshift(item, ...) - -Insert one or more items to the head of the list. - -#### yallist.unshiftNode(node) - -Move a Node object to the front of the list. (That is, pull it out of -wherever it lives, and make it the new head.) - -If the node belongs to a different list, then that list will remove it -first. - -#### yallist.pushNode(node) - -Move a Node object to the end of the list. (That is, pull it out of -wherever it lives, and make it the new tail.) - -If the node belongs to a list already, then that list will remove it -first. - -#### yallist.removeNode(node) - -Remove a node from the list, preserving referential integrity of head -and tail and other nodes. - -Will throw an error if you try to have a list remove a node that -doesn't belong to it. - -### Yallist.Node - -The class that holds the data and is actually the list. - -Call with `var n = new Node(value, previousNode, nextNode)` - -Note that if you do direct operations on Nodes themselves, it's very -easy to get into weird states where the list is broken. Be careful :) - -#### node.next - -The next node in the list. - -#### node.prev - -The previous node in the list. - -#### node.value - -The data the node contains. - -#### node.list - -The list to which this node belongs. (Null if it does not belong to -any list.) diff --git a/node_modules/yallist/iterator.js b/node_modules/yallist/iterator.js deleted file mode 100644 index 4a15bf2..0000000 --- a/node_modules/yallist/iterator.js +++ /dev/null @@ -1,7 +0,0 @@ -var Yallist = require('./yallist.js') - -Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value - } -} diff --git a/node_modules/yallist/package.json b/node_modules/yallist/package.json deleted file mode 100644 index c7b9659..0000000 --- a/node_modules/yallist/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "yallist@^2.1.2", - "_id": "yallist@2.1.2", - "_inBundle": false, - "_integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "_location": "/yallist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "yallist@^2.1.2", - "name": "yallist", - "escapedName": "yallist", - "rawSpec": "^2.1.2", - "saveSpec": null, - "fetchSpec": "^2.1.2" - }, - "_requiredBy": [ - "/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "_shasum": "1c11f9218f076089a47dd512f93c6699a6a81d52", - "_spec": "yallist@^2.1.2", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/lru-cache", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/yallist/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Yet Another Linked List", - "devDependencies": { - "tap": "^10.3.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "yallist.js", - "iterator.js" - ], - "homepage": "https://github.com/isaacs/yallist#readme", - "license": "ISC", - "main": "yallist.js", - "name": "yallist", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100" - }, - "version": "2.1.2" -} diff --git a/node_modules/yallist/yallist.js b/node_modules/yallist/yallist.js deleted file mode 100644 index 518d233..0000000 --- a/node_modules/yallist/yallist.js +++ /dev/null @@ -1,370 +0,0 @@ -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length-- - node.next = null - node.prev = null - node.list = null -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined - } - - var res = this.tail.value - this.tail = this.tail.prev - if (this.tail) { - this.tail.next = null - } else { - this.head = null - } - this.length-- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined - } - - var res = this.head.value - this.head = this.head.next - if (this.head) { - this.head.prev = null - } else { - this.tail = null - } - this.length-- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} diff --git a/node_modules/yargs-parser/node_modules/camelcase/package.json b/node_modules/yargs-parser/node_modules/camelcase/package.json index ddfadb0..b3ab3d1 100644 --- a/node_modules/yargs-parser/node_modules/camelcase/package.json +++ b/node_modules/yargs-parser/node_modules/camelcase/package.json @@ -1,27 +1,33 @@ { - "_from": "camelcase@^5.0.0", + "_args": [ + [ + "camelcase@5.0.0", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "camelcase@5.0.0", "_id": "camelcase@5.0.0", "_inBundle": false, "_integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", "_location": "/yargs-parser/camelcase", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "camelcase@^5.0.0", + "raw": "camelcase@5.0.0", "name": "camelcase", "escapedName": "camelcase", - "rawSpec": "^5.0.0", + "rawSpec": "5.0.0", "saveSpec": null, - "fetchSpec": "^5.0.0" + "fetchSpec": "5.0.0" }, "_requiredBy": [ "/yargs-parser" ], "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "_shasum": "03295527d58bd3cd4aa75363f35b2e8d97be2f42", - "_spec": "camelcase@^5.0.0", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/yargs-parser", + "_spec": "5.0.0", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -30,8 +36,6 @@ "bugs": { "url": "https://github.com/sindresorhus/camelcase/issues" }, - "bundleDependencies": false, - "deprecated": false, "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", "devDependencies": { "ava": "*", diff --git a/node_modules/yargs-parser/package.json b/node_modules/yargs-parser/package.json index a4c595d..5bd869a 100644 --- a/node_modules/yargs-parser/package.json +++ b/node_modules/yargs-parser/package.json @@ -1,27 +1,33 @@ { - "_from": "yargs-parser@^11.1.1", + "_args": [ + [ + "yargs-parser@11.1.1", + "/Users/josh/Documents/Arduino/SpeedyLoader" + ] + ], + "_development": true, + "_from": "yargs-parser@11.1.1", "_id": "yargs-parser@11.1.1", "_inBundle": false, "_integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", "_location": "/yargs-parser", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "yargs-parser@^11.1.1", + "raw": "yargs-parser@11.1.1", "name": "yargs-parser", "escapedName": "yargs-parser", - "rawSpec": "^11.1.1", + "rawSpec": "11.1.1", "saveSpec": null, - "fetchSpec": "^11.1.1" + "fetchSpec": "11.1.1" }, "_requiredBy": [ - "/yargs" + "/electron-packager" ], "_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "_shasum": "879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4", - "_spec": "yargs-parser@^11.1.1", - "_where": "/Users/josh/Documents/Arduino/SpeedyLoader/node_modules/yargs", + "_spec": "11.1.1", + "_where": "/Users/josh/Documents/Arduino/SpeedyLoader", "author": { "name": "Ben Coe", "email": "ben@npmjs.com" @@ -29,12 +35,10 @@ "bugs": { "url": "https://github.com/yargs/yargs-parser/issues" }, - "bundleDependencies": false, "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" }, - "deprecated": false, "description": "the mighty option parser used by yargs", "devDependencies": { "chai": "^4.2.0", diff --git a/node_modules/yargs/CHANGELOG.md b/node_modules/yargs/CHANGELOG.md index 506764c..eadcd6a 100644 --- a/node_modules/yargs/CHANGELOG.md +++ b/node_modules/yargs/CHANGELOG.md @@ -2,316 +2,6 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -## [12.0.5](https://github.com/yargs/yargs/compare/v12.0.4...v12.0.5) (2018-11-19) - - -### Bug Fixes - -* allows camel-case, variadic arguments, and strict mode to be combined ([#1247](https://github.com/yargs/yargs/issues/1247)) ([eacc035](https://github.com/yargs/yargs/commit/eacc035)) - - - - -## [12.0.4](https://github.com/yargs/yargs/compare/v12.0.3...v12.0.4) (2018-11-10) - - -### Bug Fixes - -* don't load config when processing positionals ([5d0dc92](https://github.com/yargs/yargs/commit/5d0dc92)) - - - - -## [12.0.3](https://github.com/yargs/yargs/compare/v12.0.2...v12.0.3) (2018-10-06) - - -### Bug Fixes - -* $0 contains first arg in bundled electron apps ([#1206](https://github.com/yargs/yargs/issues/1206)) ([567820b](https://github.com/yargs/yargs/commit/567820b)) -* accept single function for middleware ([66fd6f7](https://github.com/yargs/yargs/commit/66fd6f7)), closes [#1214](https://github.com/yargs/yargs/issues/1214) [#1214](https://github.com/yargs/yargs/issues/1214) -* hide `hidden` options from help output even if they are in a group ([#1221](https://github.com/yargs/yargs/issues/1221)) ([da54028](https://github.com/yargs/yargs/commit/da54028)) -* improve Norwegian Bokmål translations ([#1208](https://github.com/yargs/yargs/issues/1208)) ([a458fa4](https://github.com/yargs/yargs/commit/a458fa4)) -* improve Norwegian Nynorsk translations ([#1207](https://github.com/yargs/yargs/issues/1207)) ([d422eb5](https://github.com/yargs/yargs/commit/d422eb5)) - - - - -## [12.0.2](https://github.com/yargs/yargs/compare/v12.0.1...v12.0.2) (2018-09-04) - - -### Bug Fixes - -* middleware should work regardless of when method is called ([664b265](https://github.com/yargs/yargs/commit/664b265)), closes [#1178](https://github.com/yargs/yargs/issues/1178) -* translation not working when using __ with a single parameter ([#1183](https://github.com/yargs/yargs/issues/1183)) ([f449aea](https://github.com/yargs/yargs/commit/f449aea)) -* upgrade os-locale to version that addresses license issue ([#1195](https://github.com/yargs/yargs/issues/1195)) ([efc0970](https://github.com/yargs/yargs/commit/efc0970)) - - - - -## [12.0.1](https://github.com/yargs/yargs/compare/v12.0.0...v12.0.1) (2018-06-29) - - - - -# [12.0.0](https://github.com/yargs/yargs/compare/v11.1.0...v12.0.0) (2018-06-26) - - -### Bug Fixes - -* .argv and .parse() now invoke identical code path ([#1126](https://github.com/yargs/yargs/issues/1126)) ([f13ebf4](https://github.com/yargs/yargs/commit/f13ebf4)) -* remove the trailing white spaces from the help output ([#1090](https://github.com/yargs/yargs/issues/1090)) ([3f0746c](https://github.com/yargs/yargs/commit/3f0746c)) -* **completion:** Avoid default command and recommendations during completion ([#1123](https://github.com/yargs/yargs/issues/1123)) ([036e7c5](https://github.com/yargs/yargs/commit/036e7c5)) - - -### Chores - -* test Node.js 6, 8 and 10 ([#1160](https://github.com/yargs/yargs/issues/1160)) ([84f9d2b](https://github.com/yargs/yargs/commit/84f9d2b)) -* upgrade to version of yargs-parser that does not populate value for unset boolean ([#1104](https://github.com/yargs/yargs/issues/1104)) ([d4705f4](https://github.com/yargs/yargs/commit/d4705f4)) - - -### Features - -* add support for global middleware, useful for shared tasks like metrics ([#1119](https://github.com/yargs/yargs/issues/1119)) ([9d71ac7](https://github.com/yargs/yargs/commit/9d71ac7)) -* allow setting scriptName $0 ([#1143](https://github.com/yargs/yargs/issues/1143)) ([a2f2eae](https://github.com/yargs/yargs/commit/a2f2eae)) -* remove `setPlaceholderKeys` ([#1105](https://github.com/yargs/yargs/issues/1105)) ([6ee2c82](https://github.com/yargs/yargs/commit/6ee2c82)) - - -### BREAKING CHANGES - -* Options absent from `argv` (not set via CLI argument) are now absent from the parsed result object rather than being set with `undefined` -* drop Node 4 from testing matrix, such that we'll gradually start drifting away from supporting Node 4. -* yargs-parser does not populate 'false' when boolean flag is not passed -* tests that assert against help output will need to be updated - - - - -# [11.1.0](https://github.com/yargs/yargs/compare/v11.0.0...v11.1.0) (2018-03-04) - - -### Bug Fixes - -* choose correct config directory when require.main does not exist ([#1056](https://github.com/yargs/yargs/issues/1056)) ([a04678c](https://github.com/yargs/yargs/commit/a04678c)) - - -### Features - -* allow hidden options to be displayed with --show-hidden ([#1061](https://github.com/yargs/yargs/issues/1061)) ([ea862ae](https://github.com/yargs/yargs/commit/ea862ae)) -* extend *.rc files in addition to json ([#1080](https://github.com/yargs/yargs/issues/1080)) ([11691a6](https://github.com/yargs/yargs/commit/11691a6)) - - - - -# [11.0.0](https://github.com/yargs/yargs/compare/v10.1.2...v11.0.0) (2018-01-22) - - -### Bug Fixes - -* Set implicit nargs=1 when type=number requiresArg=true ([#1050](https://github.com/yargs/yargs/issues/1050)) ([2b56812](https://github.com/yargs/yargs/commit/2b56812)) - - -### Features - -* requiresArg is now simply an alias for nargs(1) ([#1054](https://github.com/yargs/yargs/issues/1054)) ([a3ddacc](https://github.com/yargs/yargs/commit/a3ddacc)) - - -### BREAKING CHANGES - -* requiresArg now has significantly different error output, matching nargs. - - - - -## [10.1.2](https://github.com/yargs/yargs/compare/v10.1.1...v10.1.2) (2018-01-17) - - -### Bug Fixes - -* requiresArg should only be enforced if argument exists ([#1043](https://github.com/yargs/yargs/issues/1043)) ([fbf41ae](https://github.com/yargs/yargs/commit/fbf41ae)) - - - - -## [10.1.1](https://github.com/yargs/yargs/compare/v10.1.0...v10.1.1) (2018-01-09) - - -### Bug Fixes - -* Add `dirname` sanity check on `findUp` ([#1036](https://github.com/yargs/yargs/issues/1036)) ([331d103](https://github.com/yargs/yargs/commit/331d103)) - - - - -# [10.1.0](https://github.com/yargs/yargs/compare/v10.0.3...v10.1.0) (2018-01-01) - - -### Bug Fixes - -* 'undefined' should be taken to mean no argument was provided ([#1015](https://github.com/yargs/yargs/issues/1015)) ([c679e90](https://github.com/yargs/yargs/commit/c679e90)) - - -### Features - -* add missing simple chinese locale strings ([#1004](https://github.com/yargs/yargs/issues/1004)) ([3cc24ec](https://github.com/yargs/yargs/commit/3cc24ec)) -* add Norwegian Nynorsk translations ([#1028](https://github.com/yargs/yargs/issues/1028)) ([a5ac213](https://github.com/yargs/yargs/commit/a5ac213)) -* async command handlers ([#1001](https://github.com/yargs/yargs/issues/1001)) ([241124b](https://github.com/yargs/yargs/commit/241124b)) -* middleware ([#881](https://github.com/yargs/yargs/issues/881)) ([77b8dbc](https://github.com/yargs/yargs/commit/77b8dbc)) - - - - -## [10.0.3](https://github.com/yargs/yargs/compare/v10.0.2...v10.0.3) (2017-10-21) - - -### Bug Fixes - -* parse array rather than string, so that quotes are safe ([#993](https://github.com/yargs/yargs/issues/993)) ([c351685](https://github.com/yargs/yargs/commit/c351685)) - - - - -## [10.0.2](https://github.com/yargs/yargs/compare/v10.0.1...v10.0.2) (2017-10-21) - - -### Bug Fixes - -* fix tiny spacing issue with usage ([#992](https://github.com/yargs/yargs/issues/992)) ([7871327](https://github.com/yargs/yargs/commit/7871327)) - - - - -## [10.0.1](https://github.com/yargs/yargs/compare/v10.0.0...v10.0.1) (2017-10-19) - - -### Bug Fixes - -* help strings for nested commands were missing parent commands ([#990](https://github.com/yargs/yargs/issues/990)) ([cd1ca15](https://github.com/yargs/yargs/commit/cd1ca15)) -* use correct completion command in generated completion script ([#988](https://github.com/yargs/yargs/issues/988)) ([3c8ac1d](https://github.com/yargs/yargs/commit/3c8ac1d)) - - - - -# [10.0.0](https://github.com/yargs/yargs/compare/v9.1.0...v10.0.0) (2017-10-18) - - -### Bug Fixes - -* config and normalize can be disabled with false ([#952](https://github.com/yargs/yargs/issues/952)) ([3bb8771](https://github.com/yargs/yargs/commit/3bb8771)) -* less eager help command execution ([#972](https://github.com/yargs/yargs/issues/972)) ([8c1d7bf](https://github.com/yargs/yargs/commit/8c1d7bf)) -* the positional argument parse was clobbering global flag arguments ([#984](https://github.com/yargs/yargs/issues/984)) ([7e58453](https://github.com/yargs/yargs/commit/7e58453)) - - -### Features - -* .usage() can now be used to configure a default command ([#975](https://github.com/yargs/yargs/issues/975)) ([7269531](https://github.com/yargs/yargs/commit/7269531)) -* hidden options are now explicitly indicated using "hidden" flag ([#962](https://github.com/yargs/yargs/issues/962)) ([280d0d6](https://github.com/yargs/yargs/commit/280d0d6)) -* introduce .positional() for configuring positional arguments ([#967](https://github.com/yargs/yargs/issues/967)) ([cb16460](https://github.com/yargs/yargs/commit/cb16460)) -* replace $0 with file basename ([#983](https://github.com/yargs/yargs/issues/983)) ([20bb99b](https://github.com/yargs/yargs/commit/20bb99b)) - - -### BREAKING CHANGES - -* .usage() no longer accepts an options object as the second argument. It can instead be used as an alias for configuring a default command. -* previously hidden options were simply implied using a falsy description -* help command now only executes if it's the last positional in argv._ - - - - -# [9.1.0](https://github.com/yargs/yargs/compare/v9.0.1...v9.1.0) (2017-09-25) - - -### Bug Fixes - -* **command:** Run default cmd even if the only cmd ([#950](https://github.com/yargs/yargs/issues/950)) ([7b22203](https://github.com/yargs/yargs/commit/7b22203)) - - -### Features - -* multiple usage calls are now collected, not replaced ([#958](https://github.com/yargs/yargs/issues/958)) ([74a38b2](https://github.com/yargs/yargs/commit/74a38b2)) - - - - -## [9.0.1](https://github.com/yargs/yargs/compare/v9.0.0...v9.0.1) (2017-09-17) - - -### Bug Fixes - -* implications fails only displayed once ([#954](https://github.com/yargs/yargs/issues/954)) ([ac8088b](https://github.com/yargs/yargs/commit/ac8088b)) - - - - -# [9.0.0](https://github.com/yargs/yargs/compare/v8.0.2...v9.0.0) (2017-09-03) - - -### Bug Fixes - -* 'undefined' default value for choices resulted in validation failing ([782b896](https://github.com/yargs/yargs/commit/782b896)) -* address bug with handling of arrays of implications ([c240661](https://github.com/yargs/yargs/commit/c240661)) -* defaulting keys to 'undefined' interfered with conflicting key logic ([a8e0cff](https://github.com/yargs/yargs/commit/a8e0cff)) -* don't bother calling JSON.stringify() on string default values ([#891](https://github.com/yargs/yargs/issues/891)) ([628be21](https://github.com/yargs/yargs/commit/628be21)) -* exclude positional arguments from completion output ([#927](https://github.com/yargs/yargs/issues/927)) ([71c7ec7](https://github.com/yargs/yargs/commit/71c7ec7)) -* strict mode should not fail for hidden options ([#949](https://github.com/yargs/yargs/issues/949)) ([0e0c58d](https://github.com/yargs/yargs/commit/0e0c58d)) - - -### Features - -* allow implies and conflicts to accept array values ([#922](https://github.com/yargs/yargs/issues/922)) ([abdc7da](https://github.com/yargs/yargs/commit/abdc7da)) -* allow parse with no arguments as alias for yargs.argv ([#944](https://github.com/yargs/yargs/issues/944)) ([a9f03e7](https://github.com/yargs/yargs/commit/a9f03e7)) -* enable .help() and .version() by default ([#912](https://github.com/yargs/yargs/issues/912)) ([1ef44e0](https://github.com/yargs/yargs/commit/1ef44e0)) -* to allow both undefined and nulls, for benefit of TypeScript ([#945](https://github.com/yargs/yargs/issues/945)) ([792564d](https://github.com/yargs/yargs/commit/792564d)) - - -### BREAKING CHANGES - -* version() and help() are now enabled by default, and show up in help output; the implicit help command can no longer be enabled/disabled independently from the help command itself (which can now be disabled). -* parse() now behaves as an alias for .argv, unless a parseCallback is provided. - - - - -## [8.0.2](https://github.com/yargs/yargs/compare/v8.0.1...v8.0.2) (2017-06-12) - - - - -## [8.0.1](https://github.com/yargs/yargs/compare/v8.0.0...v8.0.1) (2017-05-02) - - - - -# [8.0.0](https://github.com/yargs/yargs/compare/v7.1.0...v8.0.0) (2017-05-01) - - -### Bug Fixes - -* commands are now applied in order, from left to right ([#857](https://github.com/yargs/yargs/issues/857)) ([baba863](https://github.com/yargs/yargs/commit/baba863)) -* help now takes precedence over command recommendation ([#866](https://github.com/yargs/yargs/issues/866)) ([17e3567](https://github.com/yargs/yargs/commit/17e3567)) -* positional arguments now work if no handler is provided to inner command ([#864](https://github.com/yargs/yargs/issues/864)) ([e28ded3](https://github.com/yargs/yargs/commit/e28ded3)) - - -### Chores - -* upgrade yargs-parser ([#867](https://github.com/yargs/yargs/issues/867)) ([8f9c6c6](https://github.com/yargs/yargs/commit/8f9c6c6)) - - -### Features - -* allow extends to inherit from a module ([#865](https://github.com/yargs/yargs/issues/865)) ([89456d9](https://github.com/yargs/yargs/commit/89456d9)) -* allow strict mode to be disabled ([#840](https://github.com/yargs/yargs/issues/840)) ([6f78c05](https://github.com/yargs/yargs/commit/6f78c05)) - - -### BREAKING CHANGES - -* extends functionality now always loads the JSON provided, rather than reading from a specific key -* Node 4+ is now required; this will allow us to start updating our dependencies. -* the first argument to strict() is now used to enable/disable its functionality, rather than controlling whether or not it is global. - - - # [7.1.0](https://github.com/yargs/yargs/compare/v7.0.2...v7.1.0) (2017-04-13) @@ -737,7 +427,7 @@ All notable changes to this project will be documented in this file. See [standa - [#308](https://github.com/bcoe/yargs/pull/308) Yargs now handles environment variables (@nexdrew) - [#302](https://github.com/bcoe/yargs/pull/302) Add Indonesian translation (@rilut) - [#300](https://github.com/bcoe/yargs/pull/300) Add Turkish translation (@feyzo) -- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus) +- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus) - [#297](https://github.com/bcoe/yargs/pull/297) Fix for layout of cjk characters (@disjukr) - [#296](https://github.com/bcoe/yargs/pull/296) Add Korean translation (@disjukr) diff --git a/node_modules/yargs/README.md b/node_modules/yargs/README.md index b821f12..4887915 100644 --- a/node_modules/yargs/README.md +++ b/node_modules/yargs/README.md @@ -1,112 +1,2005 @@ -

- -

-

Yargs

-

- Yargs be a node.js library fer hearties tryin' ter parse optstrings -

-
+ yargs +======== + +Yargs be a node.js library fer hearties tryin' ter parse optstrings. + +With yargs, ye be havin' a map that leads straight to yer treasure! Treasure of course, being a simple option hash. [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![NPM version][npm-image]][npm-url] +[![Windows Tests][windows-image]][windows-url] [![js-standard-style][standard-image]][standard-url] [![Conventional Commits][conventional-commits-image]][conventional-commits-url] -[![Slack][slack-image]][slack-url] +[![Gitter][gitter-image]][gitter-url] -## Description : -Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. +> Yargs is the official successor to optimist. Please feel free to submit issues and pull requests. If you'd like to contribute and don't know where to start, have a look at [the issue list](https://github.com/yargs/yargs/issues) :) -It gives you: +examples +======== -* commands and (grouped) options (`my-program.js serve --port=5000`). -* a dynamically generated help menu based on your arguments. +With yargs, the options be just a hash! +------------------------------------------------------------------- -> - -* bash-completion shortcuts for commands and options. -* and [tons more](/docs/api.md). - -## Installation - -Stable version: -```bash -npm i yargs --save -``` - -Bleeding edge version with the most recent features: -```bash -npm i yargs@next --save -``` - -## Usage : - -### Simple Example +plunder.js: ````javascript #!/usr/bin/env node -const argv = require('yargs').argv +var argv = require('yargs').argv; if (argv.ships > 3 && argv.distance < 53.5) { - console.log('Plunder more riffiwobbles!') + console.log('Plunder more riffiwobbles!'); } else { - console.log('Retreat from the xupptumblers!') + console.log('Retreat from the xupptumblers!'); } ```` -```bash -$ ./plunder.js --ships=4 --distance=22 -Plunder more riffiwobbles! +*** -$ ./plunder.js --ships 12 --distance 98.7 -Retreat from the xupptumblers! + $ ./plunder.js --ships=4 --distance=22 + Plunder more riffiwobbles! + + $ ./plunder.js --ships 12 --distance 98.7 + Retreat from the xupptumblers! + +![Joe was one optimistic pirate.](https://i.imgur.com/4WFGVJ9.png) + +But don't walk the plank just yet! There be more! You can do short options: +------------------------------------------------- + +short.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs').argv; +console.log('(%d,%d)', argv.x, argv.y); +```` + +*** + + $ ./short.js -x 10 -y 21 + (10,21) + +And booleans, both long, short, and even grouped: +---------------------------------- + +bool.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs').argv; + +if (argv.s) { + process.stdout.write(argv.fr ? 'Le perroquet dit: ' : 'The parrot says: '); +} +console.log( + (argv.fr ? 'couac' : 'squawk') + (argv.p ? '!' : '') +); +```` + +*** + + $ ./bool.js -s + The parrot says: squawk + + $ ./bool.js -sp + The parrot says: squawk! + + $ ./bool.js -sp --fr + Le perroquet dit: couac! + +And non-hyphenated options too! Just use `argv._`! +------------------------------------------------- + +nonopt.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); +```` + +*** + + $ ./nonopt.js -x 6.82 -y 3.35 rum + (6.82,3.35) + [ 'rum' ] + + $ ./nonopt.js "me hearties" -x 0.54 yo -y 1.12 ho + (0.54,1.12) + [ 'me hearties', 'yo', 'ho' ] + +Yargs even counts your booleans! +---------------------------------------------------------------------- + +count.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .count('verbose') + .alias('v', 'verbose') + .argv; + +VERBOSE_LEVEL = argv.verbose; + +function WARN() { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); } +function INFO() { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); } +function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); } + +WARN("Showing only important stuff"); +INFO("Showing semi-important stuff too"); +DEBUG("Extra chatty mode"); +```` + +*** + $ node count.js + Showing only important stuff + + $ node count.js -v + Showing only important stuff + Showing semi-important stuff too + + $ node count.js -vv + Showing only important stuff + Showing semi-important stuff too + Extra chatty mode + + $ node count.js -v --verbose + Showing only important stuff + Showing semi-important stuff too + Extra chatty mode + +Tell users how to use yer options and make demands. +------------------------------------------------- + +area.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .usage('Usage: $0 -w [num] -h [num]') + .demandOption(['w','h']) + .argv; + +console.log("The area is:", argv.w * argv.h); +```` + +*** + + $ ./area.js -w 55 -h 11 + The area is: 605 + + $ node ./area.js -w 4.91 -w 2.51 + Usage: area.js -w [num] -h [num] + + Options: + -w [required] + -h [required] + + Missing required arguments: h + +After yer demands have been met, demand more! Ask for non-hyphenated arguments! +----------------------------------------- + +demand_count.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .demandCommand(2) + .argv; +console.dir(argv); +```` + +*** + + $ ./demand_count.js a + + Not enough non-option arguments: got 1, need at least 2 + + $ ./demand_count.js a b + { _: [ 'a', 'b' ], '$0': 'demand_count.js' } + + $ ./demand_count.js a b c + { _: [ 'a', 'b', 'c' ], '$0': 'demand_count.js' } + +EVEN MORE SHIVER ME TIMBERS! +------------------ + +default_singles.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_singles.js -x 5 + 15 + +default_hash.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .default({ x : 10, y : 10 }) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_hash.js -y 7 + 17 + +And if you really want to get all descriptive about it... +--------------------------------------------------------- + +boolean_single.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .boolean('v') + .argv +; +console.dir(argv.v); +console.dir(argv._); +```` + +*** + + $ ./boolean_single.js -v "me hearties" yo ho + true + [ 'me hearties', 'yo', 'ho' ] + + +boolean_double.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); +```` + +*** + + $ ./boolean_double.js -x -z one two three + [ true, false, true ] + [ 'one', 'two', 'three' ] + +Yargs is here to help you... +--------------------------- + +Ye can describe parameters fer help messages and set aliases. Yargs figures +out how ter format a handy help string automatically. + +line_count.js: + +````javascript +#!/usr/bin/env node +var argv = require('yargs') + .usage('Usage: $0 [options]') + .command('count', 'Count the lines in a file') + .example('$0 count -f foo.js', 'count the lines in the given file') + .alias('f', 'file') + .nargs('f', 1) + .describe('f', 'Load a file') + .demandOption(['f']) + .help('h') + .alias('h', 'help') + .epilog('copyright 2015') + .argv; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); +```` + +*** + $ node line_count.js count + Usage: line_count.js [options] + + Commands: + count Count the lines in a file + + Options: + -f, --file Load a file [required] + -h, --help Show help [boolean] + + Examples: + line_count.js count -f foo.js count the lines in the given file + + copyright 2015 + + Missing required arguments: f + + $ node line_count.js count --file line_count.js + 26 + + $ node line_count.js count -f line_count.js + 26 + +methods +======= + +By itself, + +````javascript +require('yargs').argv +```` + +will use the `process.argv` array to construct the `argv` object. + +You can pass in the `process.argv` yourself: + +````javascript +require('yargs')([ '-x', '1', '-y', '2' ]).argv +```` + +or use `.parse()` to do the same thing: + +````javascript +require('yargs').parse([ '-x', '1', '-y', '2' ]) +```` + +The rest of these methods below come in just before the terminating `.argv`. + +.alias(key, alias) +------------------ + +Set key names as equivalent such that updates to a key will propagate to aliases +and vice-versa. + +Optionally `.alias()` can take an object that maps keys to aliases. +Each key of this object should be the canonical version of the option, and each +value should be a string or an array of strings. + +.argv +----- + +Get the arguments as a plain old object. + +Arguments without a corresponding flag show up in the `argv._` array. + +The script name or node command is available at `argv.$0` similarly to how `$0` +works in bash or perl. + +If `yargs` is executed in an environment that embeds node and there's no script name (e.g. +[Electron](http://electron.atom.io/) or [nw.js](http://nwjs.io/)), it will ignore the first parameter since it +expects it to be the script name. In order to override this behavior, use `.parse(process.argv.slice(1))` +instead of `.argv` and the first parameter won't be ignored. + +.array(key) +---------- + +Tell the parser to interpret `key` as an array. If `.array('foo')` is set, +`--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`. + +.boolean(key) +------------- + +Interpret `key` as a boolean. If a non-flag option follows `key` in +`process.argv`, that string won't get set as the value of `key`. + +`key` will default to `false`, unless a `default(key, undefined)` is +explicitly set. + +If `key` is an array, interpret all the elements as booleans. + +.check(fn, [global=true]) +---------- + +Check that certain conditions are met in the provided arguments. + +`fn` is called with two arguments, the parsed `argv` hash and an array of options and their aliases. + +If `fn` throws or returns a non-truthy value, show the thrown error, usage information, and +exit. + +`global` indicates whether `check()` should be enabled both +at the top-level and for each sub-command. + +.choices(key, choices) +---------------------- + +Limit valid values for `key` to a predefined set of `choices`, given as an array +or as an individual value. + +```js +var argv = require('yargs') + .alias('i', 'ingredient') + .describe('i', 'choose your sandwich ingredients') + .choices('i', ['peanut-butter', 'jelly', 'banana', 'pickles']) + .help('help') + .argv ``` -### Complex Example +If this method is called multiple times, all enumerated values will be merged +together. Choices are generally strings or numbers, and value matching is +case-sensitive. -```javascript -#!/usr/bin/env node -require('yargs') // eslint-disable-line - .command('serve [port]', 'start the server', (yargs) => { - yargs - .positional('port', { - describe: 'port to bind on', - default: 5000 - }) - }, (argv) => { - if (argv.verbose) console.info(`start server on :${argv.port}`) - serve(argv.port) - }) - .option('verbose', { - alias: 'v', - default: false +Optionally `.choices()` can take an object that maps multiple keys to their +choices. + +Choices can also be specified as `choices` in the object given to `option()`. + +```js +var argv = require('yargs') + .option('size', { + alias: 's', + describe: 'choose a size', + choices: ['xs', 's', 'm', 'l', 'xl'] }) .argv ``` -Run the example above with `--help` to see the help for the application. +.coerce(key, fn) +---------------- -## Community : +Provide a synchronous function to coerce or transform the value(s) given on the +command line for `key`. -Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). +The coercion function should accept one argument, representing the parsed value +from the command line, and should return a new value or throw an error. The +returned value will be used as the value for `key` (or one of its aliases) in +`argv`. -## Documentation : +If the function throws, the error will be treated as a validation +failure, delegating to either a custom [`.fail()`](#fail) handler or printing +the error message in the console. -### Table of Contents +Coercion will be applied to a value after +all other modifications, such as [`.normalize()`](#normalize). -* [Yargs' API](/docs/api.md) -* [Examples](/docs/examples.md) -* [Parsing Tricks](/docs/tricks.md) - * [Stop the Parser](/docs/tricks.md#stop) - * [Negating Boolean Arguments](/docs/tricks.md#negate) - * [Numbers](/docs/tricks.md#numbers) - * [Arrays](/docs/tricks.md#arrays) - * [Objects](/docs/tricks.md#objects) -* [Advanced Topics](/docs/advanced.md) - * [Composing Your App Using Commands](/docs/advanced.md#commands) - * [Building Configurable CLI Apps](/docs/advanced.md#configuration) - * [Customizing Yargs' Parser](/docs/advanced.md#customizing) -* [Contributing](/contributing.md) +_Examples:_ + +```js +var argv = require('yargs') + .coerce('file', function (arg) { + return require('fs').readFileSync(arg, 'utf8') + }) + .argv +``` + +Optionally `.coerce()` can take an object that maps several keys to their +respective coercion function. + +```js +var argv = require('yargs') + .coerce({ + date: Date.parse, + json: JSON.parse + }) + .argv +``` + +You can also map the same function to several keys at one time. Just pass an +array of keys as the first argument to `.coerce()`: + +```js +var path = require('path') +var argv = require('yargs') + .coerce(['src', 'dest'], path.resolve) + .argv +``` + +If you are using dot-notion or arrays, .e.g., `user.email` and `user.password`, +coercion will be applied to the final object that has been parsed: + +```js +// --user.name Batman --user.password 123 +// gives us: {name: 'batman', password: '[SECRET]'} +var argv = require('yargs') + .option('user') + .coerce('user', opt => { + opt.name = opt.name.toLowerCase() + opt.password = '[SECRET]' + return opt + }) + .argv +``` + +.command(cmd, desc, [builder], [handler]) +----------------------------------------- +.command(cmd, desc, [module]) +----------------------------- +.command(module) +---------------- + +Define the commands exposed by your application. + +`cmd` should be a string representing the command or an array of strings +representing the command and its aliases. Read more about command aliases in the +subsection below. + +Use `desc` to provide a description for each command your application accepts (the +values stored in `argv._`). Set `desc` to `false` to create a hidden command. +Hidden commands don't show up in the help output and aren't available for +completion. + +Optionally, you can provide a `builder` object to give hints about the +options that your command accepts: + +```js +yargs + .command('get', 'make a get HTTP request', { + url: { + alias: 'u', + default: 'http://yargs.js.org/' + } + }) + .help() + .argv +``` + +`builder` can also be a function. This function is executed +with a `yargs` instance, and can be used to provide _advanced_ command specific help: + +```js +yargs + .command('get', 'make a get HTTP request', function (yargs) { + return yargs.option('url', { + alias: 'u', + default: 'http://yargs.js.org/' + }) + }) + .help() + .argv +``` + +You can also provide a handler function, which will be executed with the +parsed `argv` object: + +```js +yargs + .command( + 'get', + 'make a get HTTP request', + function (yargs) { + return yargs.option('u', { + alias: 'url', + describe: 'the URL to make an HTTP request to' + }) + }, + function (argv) { + console.log(argv.url) + } + ) + .help() + .argv +``` + +### Default Commands + +To specify a default command use the character `*`. A default command +will be run if the positional arguments provided match no known +commands: + +```js +const argv = require('yargs') + .command('*', 'the default command', () => {}, (argv) => { + console.log('this command will be run by default') + }) +``` + +The command defined above will be executed if the program +is run with `./my-cli.js --x=22`. + +Default commands can also be used as a command alias, like so: + +```js +const argv = require('yargs') + .command(['serve', '*'], 'the serve command', () => {}, (argv) => { + console.log('this command will be run by default') + }) +``` + +The command defined above will be executed if the program +is run with `./my-cli.js --x=22`, or with `./my-cli.js serve --x=22`. + +### Positional Arguments + +Commands can accept _optional_ and _required_ positional arguments. Required +positional arguments take the form ``, and optional arguments +take the form `[bar]`. The parsed positional arguments will be populated in +`argv`: + +```js +yargs.command('get [proxy]', 'make a get HTTP request') + .help() + .argv +``` + +#### Positional Argument Aliases + +Aliases can be provided for positional arguments using the `|` character. +As an example, suppose our application allows either a username _or_ +an email as the first argument: + +```js +yargs.command('get [password]', 'fetch a user by username or email.') + .help() + .argv +``` + +In this way, both `argv.username` and `argv.email` would be populated with the +same value when the command is executed. + +#### Variadic Positional Arguments + +The last positional argument can optionally accept an array of +values, by using the `..` operator: + +```js +yargs.command('download [files..]', 'download several files') + .help() + .argv +``` + +### Command Execution + +When a command is given on the command line, yargs will execute the following: + +1. push the command into the current context +2. reset non-global configuration +3. apply command configuration via the `builder`, if given +4. parse and validate args from the command line, including positional args +5. if validation succeeds, run the `handler` function, if given +6. pop the command from the current context + +### Command Aliases + +You can define aliases for a command by putting the command and all of its +aliases into an array. + +Alternatively, a command module may specify an `aliases` property, which may be +a string or an array of strings. All aliases defined via the `command` property +and the `aliases` property will be concatenated together. + +The first element in the array is considered the canonical command, which may +define positional arguments, and the remaining elements in the array are +considered aliases. Aliases inherit positional args from the canonical command, +and thus any positional args defined in the aliases themselves are ignored. + +If either the canonical command or any of its aliases are given on the command +line, the command will be executed. + +```js +#!/usr/bin/env node +require('yargs') + .command(['start [app]', 'run', 'up'], 'Start up an app', {}, (argv) => { + console.log('starting up the', argv.app || 'default', 'app') + }) + .command({ + command: 'configure [value]', + aliases: ['config', 'cfg'], + desc: 'Set a config variable', + builder: (yargs) => yargs.default('value', 'true'), + handler: (argv) => { + console.log(`setting ${argv.key} to ${argv.value}`) + } + }) + .demandCommand() + .help() + .wrap(72) + .argv +``` + +``` +$ ./svc.js help +Commands: + start [app] Start up an app [aliases: run, up] + configure [value] Set a config variable [aliases: config, cfg] + +Options: + --help Show help [boolean] + +$ ./svc.js cfg concurrency 4 +setting concurrency to 4 + +$ ./svc.js run web +starting up the web app +``` + +### Providing a Command Module + +For complicated commands you can pull the logic into a module. A module +simply needs to export: + +* `exports.command`: string (or array of strings) that executes this command when given on the command line, first string may contain positional args +* `exports.aliases`: array of strings (or a single string) representing aliases of `exports.command`, positional args defined in an alias are ignored +* `exports.describe`: string used as the description for the command in help text, use `false` for a hidden command +* `exports.builder`: object declaring the options the command accepts, or a function accepting and returning a yargs instance +* `exports.handler`: a function which will be passed the parsed argv. + +```js +// my-module.js +exports.command = 'get [proxy]' + +exports.describe = 'make a get HTTP request' + +exports.builder = { + banana: { + default: 'cool' + }, + batman: { + default: 'sad' + } +} + +exports.handler = function (argv) { + // do something with argv. +} +``` + +You then register the module like so: + +```js +yargs.command(require('my-module')) + .help() + .argv +``` + +Or if the module does not export `command` and `describe` (or if you just want to override them): + +```js +yargs.command('get [proxy]', 'make a get HTTP request', require('my-module')) + .help() + .argv +``` + +.commandDir(directory, [opts]) +------------------------------ + +Apply command modules from a directory relative to the module calling this method. + +This allows you to organize multiple commands into their own modules under a +single directory and apply all of them at once instead of calling +`.command(require('./dir/module'))` multiple times. + +By default, it ignores subdirectories. This is so you can use a directory +structure to represent your command hierarchy, where each command applies its +subcommands using this method in its builder function. See the example below. + +Note that yargs assumes all modules in the given directory are command modules +and will error if non-command modules are encountered. In this scenario, you +can either move your module to a different directory or use the `exclude` or +`visit` option to manually filter it out. More on that below. + +`directory` is a relative directory path as a string (required). + +`opts` is an options object (optional). The following options are valid: + +- `recurse`: boolean, default `false` + + Look for command modules in all subdirectories and apply them as a flattened + (non-hierarchical) list. + +- `extensions`: array of strings, default `['js']` + + The types of files to look for when requiring command modules. + +- `visit`: function + + A synchronous function called for each command module encountered. Accepts + `commandObject`, `pathToFile`, and `filename` as arguments. Returns + `commandObject` to include the command; any falsy value to exclude/skip it. + +- `include`: RegExp or function + + Whitelist certain modules. See [`require-directory` whitelisting](https://www.npmjs.com/package/require-directory#whitelisting) for details. + +- `exclude`: RegExp or function + + Blacklist certain modules. See [`require-directory` blacklisting](https://www.npmjs.com/package/require-directory#blacklisting) for details. + +### Example command hierarchy using `.commandDir()` + +Desired CLI: + +```sh +$ myapp --help +$ myapp init +$ myapp remote --help +$ myapp remote add base http://yargs.js.org +$ myapp remote prune base +$ myapp remote prune base fork whatever +``` + +Directory structure: + +``` +myapp/ +├─ cli.js +└─ cmds/ + ├─ init.js + ├─ remote.js + └─ remote_cmds/ + ├─ add.js + └─ prune.js +``` + +cli.js: + +```js +#!/usr/bin/env node +require('yargs') + .commandDir('cmds') + .demandCommand() + .help() + .argv +``` + +cmds/init.js: + +```js +exports.command = 'init [dir]' +exports.desc = 'Create an empty repo' +exports.builder = { + dir: { + default: '.' + } +} +exports.handler = function (argv) { + console.log('init called for dir', argv.dir) +} +``` + +cmds/remote.js: + +```js +exports.command = 'remote ' +exports.desc = 'Manage set of tracked repos' +exports.builder = function (yargs) { + return yargs.commandDir('remote_cmds') +} +exports.handler = function (argv) {} +``` + +cmds/remote_cmds/add.js: + +```js +exports.command = 'add ' +exports.desc = 'Add remote named for repo at url ' +exports.builder = {} +exports.handler = function (argv) { + console.log('adding remote %s at url %s', argv.name, argv.url) +} +``` + +cmds/remote_cmds/prune.js: + +```js +exports.command = 'prune [names..]' +exports.desc = 'Delete tracked branches gone stale for remotes' +exports.builder = {} +exports.handler = function (argv) { + console.log('pruning remotes %s', [].concat(argv.name).concat(argv.names).join(', ')) +} +``` + +.completion([cmd], [description], [fn]) +--------------------------------------- + +Enable bash-completion shortcuts for commands and options. + +`cmd`: When present in `argv._`, will result in the `.bashrc` completion script +being outputted. To enable bash completions, concat the generated script to your +`.bashrc` or `.bash_profile`. + +`description`: Provide a description in your usage instructions for the command +that generates bash completion scripts. + +`fn`: Rather than relying on yargs' default completion functionality, which +shiver me timbers is pretty awesome, you can provide your own completion +method. + +If invoked without parameters, `.completion()` will make `completion` the command to output +the completion script. + +```js +var argv = require('yargs') + .completion('completion', function(current, argv) { + // 'current' is the current command being completed. + // 'argv' is the parsed arguments so far. + // simply return an array of completions. + return [ + 'foo', + 'bar' + ]; + }) + .argv; +``` + +You can also provide asynchronous completions. + +```js +var argv = require('yargs') + .completion('completion', function(current, argv, done) { + setTimeout(function() { + done([ + 'apple', + 'banana' + ]); + }, 500); + }) + .argv; +``` + +But wait, there's more! You can return an asynchronous promise. + +```js +var argv = require('yargs') + .completion('completion', function(current, argv, done) { + return new Promise(function (resolve, reject) { + setTimeout(function () { + resolve(['apple', 'banana']) + }, 10) + }) + }) + .argv; +``` + +.config([key], [description], [parseFn]) +------------------------------------------------------------- +.config(object) +--------------- + +Tells the parser that if the option specified by `key` is passed in, it +should be interpreted as a path to a JSON config file. The file is loaded +and parsed, and its properties are set as arguments. Because the file is +loaded using Node's require(), the filename MUST end in `.json` to be +interpreted correctly. + +If invoked without parameters, `.config()` will make `--config` the option to pass the JSON config file. + +An optional `description` can be provided to customize the config (`key`) option +in the usage string. + +An optional `parseFn` can be used to provide a custom parser. The parsing +function must be synchronous, and should return an object containing +key value pairs or an error. + +```js +var argv = require('yargs') + .config('settings', function (configPath) { + return JSON.parse(fs.readFileSync(configPath, 'utf-8')) + }) + .argv +``` + +You can also pass an explicit configuration `object`, it will be parsed +and its properties will be set as arguments. + +```js +var argv = require('yargs') + .config({foo: 1, bar: 2}) + .argv +console.log(argv) +``` + +``` +$ node test.js +{ _: [], + foo: 1, + bar: 2, + '$0': 'test.js' } +``` + +Note that a configuration object may extend from a JSON file using the `"extends"` property. When doing so, the `"extends"` value should be a path (relative or absolute) to the extended JSON file. + +.conflicts(x, y) +---------------------------------------------- + +Given the key `x` is set, the key `y` must not be set. + +Optionally `.conflicts()` can accept an object specifying multiple conflicting keys. + +.count(key) +------------ + +Interpret `key` as a boolean flag, but set its parsed value to the number of +flag occurrences rather than `true` or `false`. Default value is thus `0`. + +.default(key, value, [description]) +--------------------------------------------------------- +.defaults(key, value, [description]) +------------------------------------ + +**Note:** The `.defaults()` alias is deprecated. It will be +removed in the next major version. + +Set `argv[key]` to `value` if no option was specified in `process.argv`. + +Optionally `.default()` can take an object that maps keys to default values. + +But wait, there's more! The default value can be a `function` which returns +a value. The name of the function will be used in the usage string: + +```js +var argv = require('yargs') + .default('random', function randomValue() { + return Math.random() * 256; + }).argv; +``` + +Optionally, `description` can also be provided and will take precedence over +displaying the value in the usage instructions: + +```js +.default('timeout', 60000, '(one-minute)') +``` + +.demand(count, [max], [msg]) [DEPRECATED] +-------------------- + +`demand()` has been deprecated, please instead see [`demandOption()`](#demandOption) and +[`demandCommand()`](#demandCommand). + +.demandOption(key, [msg | boolean]) +------------------------------ +.demandOption(key, msg) +------------------------------ + +If `key` is a string, show the usage information and exit if `key` wasn't +specified in `process.argv`. + +If `key` is an array, demand each element. + +If a `msg` string is given, it will be printed when the argument is missing, instead of the standard error message. + +```javascript +// demand an array of keys to be provided +require('yargs') + .option('run', { + alias: 'r', + describe: 'run your program' + }) + .option('path', { + alias: 'p', + describe: 'provide a path to file' + }) + .option('spec', { + alias: 's', + describe: 'program specifications' + }) + .demandOption(['run', 'path'], 'Please provide both run and path arguments to work with this tool') + .help() + .argv +``` +which will provide the following output: +```bash +Options: + --run, -r run your program [required] + --path, -p provide a path to file [required] + --spec, -s program specifications + --help Show help [boolean] + + Missing required arguments: run, path + Please provide both run and path arguments to work with this tool +``` + +If a `boolean` value is given, it controls whether the option is demanded; +this is useful when using `.options()` to specify command line parameters. + +```javascript +// demand individual options within the option constructor +require('yargs') + .options({ + 'run': { + alias: 'r', + describe: 'run your program', + demandOption: true + }, + 'path': { + alias: 'p', + describe: 'provide a path to file', + demandOption: true + }, + 'spec': { + alias: 's', + describe: 'program specifications' + } + }) + .help() + .argv +``` +which will provide the following output: +```bash +Options: + --run, -r run your program [required] + --path, -p provide a path to file [required] + --spec, -s program specifications + --help Show help [boolean] + +Missing required arguments: run, path +``` + +.demandCommand([min=1], [minMsg]) +------------------------------ +.demandCommand([min=1], [max], [minMsg], [maxMsg]) +------------------------------ + +Demand in context of commands. You can demand a minimum and a maximum number a user can have within your program, as well as provide corresponding error messages if either of the demands is not met. +```javascript +require('yargs') + .command({ + command: 'configure [value]', + aliases: ['config', 'cfg'], + desc: 'Set a config variable', + builder: (yargs) => yargs.default('value', 'true'), + handler: (argv) => { + console.log(`setting ${argv.key} to ${argv.value}`) + } + }) + // provide a minimum demand and a minimum demand message + .demandCommand(1, 'You need at least one command before moving on') + .help() + .argv +``` + +which will provide the following output: + +```bash +Commands: + configure [value] Set a config variable [aliases: config, cfg] + +Options: + --help Show help [boolean] + +You need at least one command before moving on +``` + +_Note: in `minMsg` and `maxMsg`, every occurrence of `$0` will be replaced +with the observed value, and every instance of `$1` will be replaced with the +expected value._ + +.describe(key, desc) +-------------------- + +Describe a `key` for the generated usage information. + +Optionally `.describe()` can take an object that maps keys to descriptions. + +.detectLocale(boolean) +----------- + +Should yargs attempt to detect the os' locale? Defaults to `true`. + +.env([prefix]) +-------------- + +Tell yargs to parse environment variables matching the given prefix and apply +them to argv as though they were command line arguments. + +Use the "__" separator in the environment variable to indicate nested options. +(e.g. prefix_nested__foo => nested.foo) + +If this method is called with no argument or with an empty string or with `true`, +then all env vars will be applied to argv. + +Program arguments are defined in this order of precedence: + +1. Command line args +2. Env vars +3. Config file/objects +4. Configured defaults + +```js +var argv = require('yargs') + .env('MY_PROGRAM') + .option('f', { + alias: 'fruit-thing', + default: 'apple' + }) + .argv +console.log(argv) +``` + +``` +$ node fruity.js +{ _: [], + f: 'apple', + 'fruit-thing': 'apple', + fruitThing: 'apple', + '$0': 'fruity.js' } +``` + +``` +$ MY_PROGRAM_FRUIT_THING=banana node fruity.js +{ _: [], + fruitThing: 'banana', + f: 'banana', + 'fruit-thing': 'banana', + '$0': 'fruity.js' } +``` + +``` +$ MY_PROGRAM_FRUIT_THING=banana node fruity.js -f cat +{ _: [], + f: 'cat', + 'fruit-thing': 'cat', + fruitThing: 'cat', + '$0': 'fruity.js' } +``` + +Env var parsing is disabled by default, but you can also explicitly disable it +by calling `.env(false)`, e.g. if you need to undo previous configuration. + +.epilog(str) +------------ +.epilogue(str) +-------------- + +A message to print at the end of the usage instructions, e.g. + +```js +var argv = require('yargs') + .epilogue('for more information, find our manual at http://example.com'); +``` + +.example(cmd, desc) +------------------- + +Give some example invocations of your program. Inside `cmd`, the string +`$0` will get interpolated to the current script name or node command for the +present script similar to how `$0` works in bash or perl. +Examples will be printed out as part of the help message. + +.exitProcess(enable) +---------------------------------- + +By default, yargs exits the process when the user passes a help flag, uses the +`.version` functionality, or when validation fails. Calling +`.exitProcess(false)` disables this behavior, enabling further actions after +yargs have been validated. + +.fail(fn) +--------- + +Method to execute when a failure occurs, rather than printing the failure message. + +`fn` is called with the failure message that would have been printed, the +`Error` instance originally thrown and yargs state when the failure +occured. + +```js +var argv = require('yargs') + .fail(function (msg, err, yargs) { + if (err) throw err // preserve stack + console.error('You broke it!') + console.error(msg) + console.error('You should be doing', yargs.help()) + process.exit(1) + }) + .argv +``` + +.getCompletion(args, done); +--------------------------- + +Allows to programmatically get completion choices for any line. + +`args`: An array of the words in the command line to complete. + +`done`: The callback to be called with the resulting completions. + +For example: + +```js +require('yargs') + .option('foobar') + .option('foobaz') + .completion() + .getCompletion(['./test.js', '--foo'], function (completions) { + console.log(completions) + }) +``` + +Outputs the same completion choices as `./test.js --foo`TAB: `--foobar` and `--foobaz` + +.global(globals, [global=true]) +------------ + +Indicate that an option (or group of options) should not be reset when a command +is executed, as an example: + +```js +var argv = require('yargs') + .option('a', { + alias: 'all', + default: true, + global: false + }) + .option('n', { + alias: 'none', + default: true, + global: false + }) + .command('foo', 'foo command', function (yargs) { + return yargs.option('b', { + alias: 'bar' + }) + }) + .help('help') + .global('a') + .argv +``` + +If the `foo` command is executed the `all` option will remain, but the `none` +option will have been eliminated. + +Options default to being global. + +.group(key(s), groupName) +-------------------- + +Given a key, or an array of keys, places options under an alternative heading +when displaying usage instructions, e.g., + +```js +var yargs = require('yargs')(['--help']) + .help() + .group('batman', 'Heroes:') + .describe('batman', "world's greatest detective") + .wrap(null) + .argv +``` +*** + Heroes: + --batman world's greatest detective + + Options: + --help Show help [boolean] + +.help() +----------------------------------------- +.help([option | boolean]) +----------------------------------------- +.help([option, [description | boolean]]) +----------------------------------------- +.help([option, [description, [boolean]]]) +----------------------------------------- + +Add an option (e.g. `--help`) and implicit command that displays the usage +string and exits the process. + +If present, the `description` parameter customizes the description of +the help option in the usage string. + +If a boolean argument is provided, it will enable or disable the use of an +implicit command. The implicit command is enabled by default, but it can be +disabled by passing `false`. + +Note that any multi-char aliases (e.g. `help`) used for the help option will +also be used for the implicit command. If there are no multi-char aliases (e.g. +`h`), then all single-char aliases will be used for the command. + +If invoked without parameters, `.help()` will use `--help` as the option and +`help` as the implicit command to trigger help output. + +Example: + +```js +var yargs = require("yargs")(['--help']) + .usage("$0 -operand1 number -operand2 number -operation [add|subtract]") + .help() + .argv +``` + +Later on, `argv` can be retrieved with `yargs.argv`. + +.implies(x, y) +-------------- + +Given the key `x` is set, it is required that the key `y` is set. + +Optionally `.implies()` can accept an object specifying multiple implications. + +.locale() +--------- + +Return the locale that yargs is currently using. + +By default, yargs will auto-detect the operating system's locale so that +yargs-generated help content will display in the user's language. + +To override this behavior with a static locale, pass the desired locale as a +string to this method (see below). + +.locale(locale) +--------------- + +Override the auto-detected locale from the user's operating system with a static +locale. Note that the OS locale can be modified by setting/exporting the `LC_ALL` +environment variable. + +```js +var argv = require('yargs') + .usage('./$0 - follow ye instructions true') + .option('option', { + alias: 'o', + describe: "'tis a mighty fine option", + demandOption: true + }) + .command('run', "Arrr, ya best be knowin' what yer doin'") + .example('$0 run foo', "shiver me timbers, here's an example for ye") + .help('help') + .wrap(70) + .locale('pirate') + .argv +``` + +*** + +```shell +./test.js - follow ye instructions true + +Choose yer command: + run Arrr, ya best be knowin' what yer doin' + +Options for me hearties! + --option, -o 'tis a mighty fine option [requi-yar-ed] + --help Parlay this here code of conduct [boolean] + +Ex. marks the spot: + test.js run foo shiver me timbers, here's an example for ye + +Ye be havin' to set the followin' argument land lubber: option +``` + +Locales currently supported: + +* **de:** German. +* **en:** American English. +* **es:** Spanish. +* **fr:** French. +* **hi:** Hindi. +* **hu:** Hungarian. +* **id:** Indonesian. +* **it:** Italian. +* **ja:** Japanese. +* **ko:** Korean. +* **nb:** Norwegian Bokmål. +* **pirate:** American Pirate. +* **pl:** Polish. +* **pt:** Portuguese. +* **pt_BR:** Brazilian Portuguese. +* **ru:** Russian. +* **th:** Thai. +* **tr:** Turkish. +* **zh_CN:** Chinese. + +To submit a new translation for yargs: + +1. use `./locales/en.json` as a starting point. +2. submit a pull request with the new locale file. + +*The [Microsoft Terminology Search](http://www.microsoft.com/Language/en-US/Search.aspx) can be useful for finding the correct terminology in your locale.* + +.nargs(key, count) +----------- + +The number of arguments that should be consumed after a key. This can be a +useful hint to prevent parsing ambiguity. For example: + +```js +var argv = require('yargs') + .nargs('token', 1) + .parse(['--token', '-my-token']); +``` + +parses as: + +`{ _: [], token: '-my-token', '$0': 'node test' }` + +Optionally `.nargs()` can take an object of `key`/`narg` pairs. + +.normalize(key) +--------------- + +The key provided represents a path and should have `path.normalize()` applied. + +.number(key) +------------ + +Tell the parser to always interpret `key` as a number. + +If `key` is an array, all elements will be parsed as numbers. + +If the option is given on the command line without a value, `argv` will be +populated with `undefined`. + +If the value given on the command line cannot be parsed as a number, `argv` will +be populated with `NaN`. + +Note that decimals, hexadecimals, and scientific notation are all accepted. + +```js +var argv = require('yargs') + .number('n') + .number(['width', 'height']) + .argv +``` + +.option(key, [opt]) +----------------- +.options(key, [opt]) +------------------ + +This method can be used to make yargs aware of options that _could_ +exist. You can also pass an `opt` object which can hold further +customization, like `.alias()`, `.demandOption()` etc. for that option. + +For example: + +````javascript +var argv = require('yargs') + .option('f', { + alias: 'file', + demandOption: true, + default: '/etc/passwd', + describe: 'x marks the spot', + type: 'string' + }) + .argv +; +```` + +is the same as + +````javascript +var argv = require('yargs') + .alias('f', 'file') + .demandOption('f') + .default('f', '/etc/passwd') + .describe('f', 'x marks the spot') + .string('f') + .argv +; +```` + +Optionally `.options()` can take an object that maps keys to `opt` parameters. + +````javascript +var argv = require('yargs') + .options({ + 'f': { + alias: 'file', + demandOption: true, + default: '/etc/passwd', + describe: 'x marks the spot', + type: 'string' + } + }) + .argv +; +```` + +Valid `opt` keys include: + +- `alias`: string or array of strings, alias(es) for the canonical option key, see [`alias()`](#alias) +- `array`: boolean, interpret option as an array, see [`array()`](#array) +- `boolean`: boolean, interpret option as a boolean flag, see [`boolean()`](#boolean) +- `choices`: value or array of values, limit valid option arguments to a predefined set, see [`choices()`](#choices) +- `coerce`: function, coerce or transform parsed command line values into another value, see [`coerce()`](#coerce) +- `config`: boolean, interpret option as a path to a JSON config file, see [`config()`](#config) +- `configParser`: function, provide a custom config parsing function, see [`config()`](#config) +- `conflicts`: string or object, require certain keys not to be set, see [`conflicts()`](#conflicts) +- `count`: boolean, interpret option as a count of boolean flags, see [`count()`](#count) +- `default`: value, set a default value for the option, see [`default()`](#default) +- `defaultDescription`: string, use this description for the default value in help content, see [`default()`](#default) +- `demandOption`: boolean or string, demand the option be given, with optional error message, see [`demandOption()`](#demandOption) +- `desc`/`describe`/`description`: string, the option description for help content, see [`describe()`](#describe) +- `global`: boolean, indicate that this key should not be [reset](#reset) when a command is invoked, see [`global()`](#global) +- `group`: string, when displaying usage instructions place the option under an alternative group heading, see [`group()`](#group) +- `implies`: string or object, require certain keys to be set, see [`implies()`](#implies) +- `nargs`: number, specify how many arguments should be consumed for the option, see [`nargs()`](#nargs) +- `normalize`: boolean, apply `path.normalize()` to the option, see [`normalize()`](#normalize) +- `number`: boolean, interpret option as a number, [`number()`](#number) +- `requiresArg`: boolean, require the option be specified with a value, see [`requiresArg()`](#requiresArg) +- `skipValidation`: boolean, skips validation if the option is present, see [`skipValidation()`](#skipValidation) +- `string`: boolean, interpret option as a string, see [`string()`](#string) +- `type`: one of the following strings + - `'array'`: synonymous for `array: true`, see [`array()`](#array) + - `'boolean'`: synonymous for `boolean: true`, see [`boolean()`](#boolean) + - `'count'`: synonymous for `count: true`, see [`count()`](#count) + - `'number'`: synonymous for `number: true`, see [`number()`](#number) + - `'string'`: synonymous for `string: true`, see [`string()`](#string) + +.parse(args, [context], [parseCallback]) +------------ + +Parse `args` instead of `process.argv`. Returns the `argv` object. +`args` may either be a pre-processed argv array, or a raw argument string. + +A `context` object can optionally be given as the second argument to `parse()`, providing a +useful mechanism for passing state information to commands: + +```js +const parser = yargs + .command('lunch-train ', 'start lunch train', function () {}, function (argv) { + console.log(argv.restaurant, argv.time) + }) + .parse("lunch-train rudy's", {time: '12:15'}) +``` + +A `parseCallback` can also be provided to `.parse()`. If a callback is given, it will be invoked with three arguments: + +1. `err`: populated if any validation errors raised while parsing. +2. `argv`: the parsed argv object. +3. `output`: any text that would have been output to the terminal, had a + callback not been provided. + +```js +// providing the `fn` argument to `parse()` runs yargs in headless mode, this +// makes it easy to use yargs in contexts other than the CLI, e.g., writing +// a chat-bot. +const parser = yargs + .command('lunch-train